From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id yGpVE3chRmH7+QAAgWs5BA (envelope-from ) for ; Sat, 18 Sep 2021 19:27:19 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id MKfxDnchRmGrWgAAB5/wlQ (envelope-from ) for ; Sat, 18 Sep 2021 17:27:19 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id C3C35A667 for ; Sat, 18 Sep 2021 19:27:18 +0200 (CEST) Received: from localhost ([::1]:59882 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mRe7R-0004br-PQ for larch@yhetil.org; Sat, 18 Sep 2021 13:27:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46078) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mRe7C-0004be-Jn for guix-patches@gnu.org; Sat, 18 Sep 2021 13:27:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:53470) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mRe7C-0007v5-Bj for guix-patches@gnu.org; Sat, 18 Sep 2021 13:27:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mRe7C-00005w-5o for guix-patches@gnu.org; Sat, 18 Sep 2021 13:27:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49713] [PATCH 3/3] gnu: Add prusa-slicer. Resent-From: Liliana Marie Prikler Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 18 Sep 2021 17:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49713 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ivan Gankevich , 49713@debbugs.gnu.org Received: via spool by 49713-submit@debbugs.gnu.org id=B49713.1631986001335 (code B ref 49713); Sat, 18 Sep 2021 17:27:02 +0000 Received: (at 49713) by debbugs.gnu.org; 18 Sep 2021 17:26:41 +0000 Received: from localhost ([127.0.0.1]:36783 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mRe6q-00005K-Mm for submit@debbugs.gnu.org; Sat, 18 Sep 2021 13:26:41 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:34368) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mRe6p-000052-CT for 49713@debbugs.gnu.org; Sat, 18 Sep 2021 13:26:40 -0400 Received: by mail-wr1-f66.google.com with SMTP id t8so13619695wri.1 for <49713@debbugs.gnu.org>; Sat, 18 Sep 2021 10:26:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=bDDhBPrwXPgDt7biVH1kSSLyLXCyC8LgI3bShZmkeWc=; b=Q0PlotUBRBoBRrY42IhSTVFzVXcrKZAwBUkgsYVeM1zbhI6fHlE+hlKmrqJvbSoJme R/p0aTFG6JmMsz4cGjy/HVr3eCFNc8Vh93QveB47EMO68h4nxrsGF9EnVvgD/2nn7BNX BqRbDPVZa3y1XYpY1f6OOCyPVm/mSkBH6IhSDcYuGiajK99mabSUy4KSYi61gSMzxheU uE4qgUM71a2vAJuAV96ppV4G+6sl7eh/QOqOsY789+/pCbz9a+IAQeFNYD6EB5mVyJOo bpDGWP+jEoIxXbWkKxLZApcqjY8gEJPojWuNmWzhi4q5u3OySsBnfrMq/l58scOsOeWY qDrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=bDDhBPrwXPgDt7biVH1kSSLyLXCyC8LgI3bShZmkeWc=; b=koy2QeB80X5qIBD+3lyKlRoopXMw3MgN2HriEIb3S8szbCv5BaAUiN/0ANZTh/IAXt oaqfgVaZuIKWqPRUHnQ1Pc2FBRYhpLrVfo03vnfrWzYQ9T1Zi8ywWpfWQk7PiaUBHOew nVmzHPEbX71z6ZMX6bNK2sMLqPIfh+fE2Q6Ib/L1asgxojK8wwZSIwQ8/tIuOK5WH2c2 q7z2ji6j+5U8xveXj4aheA4/wzMC1gCjJoYnNPJ0FFzEp6U6kIfSTCPZtKJaR5CrTy22 2GmxJ1qn61U+IoTzJOfbXBreTcp9Ry3xsA9FijydvvN/adQr0K2BJm1N/7XYQojKkgwp AlUw== X-Gm-Message-State: AOAM532XkEHFcgnspapf53tAqmNO/6RP2icCHLcKHpHrMreGFNhNdsNo Ig063Fbd7gut9rXxj9W6wOw= X-Google-Smtp-Source: ABdhPJwTrmMSP2GGfWiYFreabQPdG0rjlqJmkCC+2AHbXW2hwXk/q7CT9D8na/9NNEZjjLNyjBIbfg== X-Received: by 2002:adf:e74b:: with SMTP id c11mr19189507wrn.101.1631985993391; Sat, 18 Sep 2021 10:26:33 -0700 (PDT) Received: from nijino.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id k1sm10551003wrz.61.2021.09.18.10.26.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Sep 2021 10:26:32 -0700 (PDT) Message-ID: <1e440c6a0f9e9e328eb83519e1df38f506a3d4b3.camel@gmail.com> From: Liliana Marie Prikler Date: Sat, 18 Sep 2021 19:26:31 +0200 In-Reply-To: <20210723210801.9458-1-i.gankevich@spbu.ru> References: <20210723210801.9458-1-i.gankevich@spbu.ru> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1631986039; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=bDDhBPrwXPgDt7biVH1kSSLyLXCyC8LgI3bShZmkeWc=; b=MLrreXEQysygTIxQaMWg3DzCsVhd1cTpGpHfLzyOCIiD+UXM7FEhK9RodO9Evx2Ldu8K/5 ytTdDN3Sf+DHZbMhaBF5GzCDciOLw4Y3yhS5LPr4LTF+UgAZDrAkcJ6crAqsxv3lkFd+9z LZQnUaNoLQ8SEcOqeVzYEoVmcae9ZIkcx5Xai3gLEQMMspb+cpzRCbLuslx+PL98oNctvt wILmYmdiBeEq1ABGO0Dkw9ufKBqRBI/JAbqKQtBTI7w6z4SswjLJMV+csJu/HLXWckuWcl Z9dMNQq3/NmND03Y+xoGWQhrGLEGCcVw0jGgrm4yPZ47GZGVrAxW+yWbOF4afg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1631986039; a=rsa-sha256; cv=none; b=IkmjajyykwN8tDjjYG+lOw88Aqj/T+pMe2CCmsKPJcO0D8BsH2hZpJB6jCs7t15WAkro20 uedxNL6DGYn3hZLo3J/HqkMpLrsTQSIcdy9E5/6WOupZ0i+daM+uxShbr4dEKMLTXNu59v X4qoyjX6ZSKv+qbFiPYZdeztFmjNMQhi/+TrxXU3t1EkBniygVo8n9crNdz9f7F1bsMp3V q9Z9eGhbcn69mArbu0Ux9onSDjm4JOImgbaHcsVQsjhxDg9TbHqaVxVUFDfKx21hMpr8cL P6n2VImYNvUFilFhhX8MP6H27Y9cp5x1Ssgavb84VqZyJh7YcVwEuFlJ2aNygw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=Q0PlotUB; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: 0.21 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=Q0PlotUB; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: C3C35A667 X-Spam-Score: 0.21 X-Migadu-Scanner: scn0.migadu.com X-TUID: buAX0qK3Iicf Hi, Am Samstag, den 24.07.2021, 00:08 +0300 schrieb Ivan Gankevich: > * gnu/packages/engineering.scm (prusa-slicer): New variable. > --- > gnu/packages/engineering.scm | 97 > ++++++++++++++++++++++++++++++++++++ > 1 file changed, 97 insertions(+) > > diff --git a/gnu/packages/engineering.scm > b/gnu/packages/engineering.scm > index eec12814ff..d88520a306 100644 > --- a/gnu/packages/engineering.scm > +++ b/gnu/packages/engineering.scm > @@ -24,6 +24,7 @@ > ;;; Copyright © 2021 qblade > ;;; Copyright © 2021 Gerd Heber > ;;; Copyright © 2021 Guillaume Le Vaillant > +;;; Copyright © 2021 Ivan Gankevich > ;;; > ;;; This file is part of GNU Guix. > ;;; > @@ -95,6 +96,7 @@ > #:use-module (gnu packages image-processing) > #:use-module (gnu packages imagemagick) > #:use-module (gnu packages libevent) > + #:use-module (gnu packages libusb) > #:use-module (gnu packages linux) ;FIXME: for pcb > #:use-module (gnu packages lisp) > #:use-module (gnu packages m4) > @@ -2924,3 +2926,98 @@ a process.") > (description "The library provides functionality for shape > modelling, > visualization, matrix manipulation.") > (license (list license:gpl3 license:mpl2.0)))) > + > +(define-public prusa-slicer > + (package > + (name "prusa-slicer") > + (version "2.3.3") > + (source > + (origin > + (method git-fetch) > + (uri > + (git-reference > + (url "https://github.com/prusa3d/PrusaSlicer") > + (commit (string-append "version_" version)))) > + (file-name (git-file-name name version)) > + (sha256 (base32 > "0w0synqi3iz9aigsgv6x1c6sg123fasbx19h4w3ic1l48r8qmpwm")))) > + (build-system cmake-build-system) > + (arguments > + `(#:configure-flags > + '("-DSLIC3R_FHS=1" ;; Use The Filesystem Hierarchy Standard. > + "-DSLIC3R_WX_STABLE=1") ;; Use wxWidgets 3.0.x.x to > prevent GUI crashes. > + #:phases > + (modify-phases %standard-phases > + ;; CMake is unable to find headers from glib, pango and > gtk+ > + ;; when compiling src/slic3r. Here we add them via > environment variables. > + (add-before 'configure 'add-glib-pango-gtk+ > + (lambda _ > + (use-modules > + (ice-9 popen) > + (ice-9 textual-ports)) > + (define (append-flags name flags) > + (define old-value (getenv name)) > + (setenv name (if old-value (string-append old-value > " " flags) flags))) > + (define (pkg-config args) > + (let* ((port (open-input-pipe (string-join (cons > "pkg-config" args) " "))) > + (content (string-trim-both (get-string-all > port)))) > + (close-pipe port) > + content)) > + (define deps '("glib-2.0" "pango" "gtk+-2.0" "hidapi- > hidraw")) > + (define cflags (pkg-config (cons "--cflags" deps))) > + (define ld-flags (pkg-config (cons "--libs" deps))) > + (define libigl (assoc-ref %build-inputs "libigl")) > + (append-flags "CXXFLAGS" cflags) > + (append-flags "CFLAGS" cflags) > + (append-flags "LDFLAGS" ld-flags) > + (append-flags "CFLAGS" (string-append "-I" libigl > "/include")) > + (append-flags "LDFLAGS" (string-append "-L" libigl > "/lib")))) Upstream already appears to search for GTK+3 with their CMake setup. Perhaps that's why it doesn't find GTK+2? > + (add-before 'configure 'unbundle-3d-party-libraries > + ;; Prusa slicer bundles a lot of dependencies in src/ > directory. > + ;; Most of them contain prusa-specific modifications > (e.g. avrdude), > + ;; but others do not. Here we replace the latter with > Guix packages. > + (lambda _ > + (delete-file-recursively "src/hidapi") > + (delete-file-recursively "src/eigen") > + (delete-file-recursively "src/libigl/igl") > + (substitute* "src/CMakeLists.txt" > + (("add_subdirectory\\(libigl\\)" all) > + (string-append > + all "\ninclude_directories(libigl INTERFACE > libigl::core)")) > + (("add_subdirectory\\(hidapi\\)") "") > + (("include_directories\\(hidapi/include\\)") "")) > + ;; Do not link with bundled hidapi library. > + (substitute* "src/slic3r/CMakeLists.txt" > + (("\\bhidapi\\b") ""))))))) Unbundling should be done in the snippet rather than at build time. > + (native-inputs > + `(("pkg-config" ,pkg-config))) > + (inputs > + `(("boost" ,boost) > + ("libigl" ,libigl) > + ("tbb" ,tbb) > + ("curl" ,curl) > + ("zlib" ,zlib) > + ("eigen" ,eigen) > + ("expat" ,expat) > + ("mesa" ,mesa) > + ("cereal" ,cereal) > + ("nlopt" ,nlopt) > + ("openvdb" ,openvdb) > + ("ilmbase" ,ilmbase) > + ("cgal" ,cgal) > + ("hidapi" ,hidapi) > + ;;("wxwidgets" ,wxwidgets-gtk2-3.1) ;; crashes when adding > support enforcers > + ("wxwidgets" ,wxwidgets-gtk2) > + ("glew" ,glew) > + ("udev" ,eudev) > + ("gmp" ,gmp) > + ("mpfr" ,mpfr) > + ("libpng" ,libpng) > + ("dbus" ,dbus) > + ("glib" ,glib) > + ("pango" ,pango) > + ("gtk" ,gtk+-2))) Try sorting the inputs alphabetically, also w.r.t. gtk+-2, see above. > + (home-page "https://www.prusa3d.com/prusaslicer/") > + (synopsis "G-code generator for 3D printers (RepRap, Makerbot, > Ultimaker etc.)") > + (description "PrusaSlicer takes 3D models (STL, OBJ, AMF) and > converts them into > +G-code instructions for FFF printers or PNG layers for mSLA 3D > printers.") > + (license license:agpl3))) Regards