From patchwork Fri Jul 23 21:00:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Gankevich X-Patchwork-Id: 31574 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 0C64927BC78; Fri, 23 Jul 2021 22:07:22 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id B18D527BC6B for ; Fri, 23 Jul 2021 22:07:21 +0100 (BST) Received: from localhost ([::1]:37436 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m72O8-0003qc-Mv for patchwork@mira.cbaines.net; Fri, 23 Jul 2021 17:07:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54148) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m72Nq-0003pG-K0 for guix-patches@gnu.org; Fri, 23 Jul 2021 17:07:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:33199) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m72Nq-0005NM-Cp for guix-patches@gnu.org; Fri, 23 Jul 2021 17:07:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m72Nq-0002HT-4w for guix-patches@gnu.org; Fri, 23 Jul 2021 17:07:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49713] [PATCH 1/3] gnu: cereal: Use cmake to build and install the library. Resent-From: Ivan Gankevich Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 23 Jul 2021 21:07:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 49713 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49713@debbugs.gnu.org Cc: Ivan Gankevich X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16270743698699 (code B ref -1); Fri, 23 Jul 2021 21:07:01 +0000 Received: (at submit) by debbugs.gnu.org; 23 Jul 2021 21:06:09 +0000 Received: from localhost ([127.0.0.1]:44745 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m72Mz-0002GF-Ci for submit@debbugs.gnu.org; Fri, 23 Jul 2021 17:06:09 -0400 Received: from lists.gnu.org ([209.51.188.17]:51690) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m72Mu-0002G3-Hz for submit@debbugs.gnu.org; Fri, 23 Jul 2021 17:06:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54062) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m72Mu-0002qQ-D9 for guix-patches@gnu.org; Fri, 23 Jul 2021 17:06:04 -0400 Received: from mail.spbu.ru ([195.70.197.23]:53875 helo=cgp2.pu.ru) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1m72Mq-0004Ce-Hs for guix-patches@gnu.org; Fri, 23 Jul 2021 17:06:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=simple/simple; d=spbu.ru; s=20180812; bh=l7PEzWKWn7BXxNOeU4ElVYGq6UzXh8FvAxV2yU4/yK0=; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject:Cc:To:From; b=qrlZdxiXCwUDdRGCVJHvzVaJjMnsqQmRz9mPNNDtm0EQc79lqf7gT+Oy1uiCmWlGAfdnRT4zNc qOS9L4S/+/adIiPIhtuX/vtMw87q3YM1bLjD9n7ceI0wazS1fkgSykt3uQXHZ+gXBtaEoMJ73mAVT Gl5XI7Oitf+eWMeuJgdG6gPP/PAX+P2SKsyNPrPF4HlujskJW0vO/3EG/D9Ru0vOwvevv7/HaqxwC fuOKkKU0z+NoVTDvmR3RJTva4DTT1KmcZdUwYehryuy/ddbvuy8UK82Bpndd4d5mx1gk25qTmJeEs Aa61bQ+ljfeCnkzhSCBgA50kdu1/lZmD+66YA== Received: from [172.27.221.159] (account st018947@spbu.ru HELO localhost.localdomain) by spbu.ru (CommuniGate Pro SMTP 6.2.15) with ESMTPSA id 173785486; Sat, 24 Jul 2021 00:05:22 +0300 From: Ivan Gankevich Date: Sat, 24 Jul 2021 00:00:39 +0300 Message-Id: <20210723210037.28150-1-i.gankevich@spbu.ru> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Received-SPF: pass client-ip=195.70.197.23; envelope-from=i.gankevich@spbu.ru; helo=cgp2.pu.ru X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action 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+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Hello, this series of patches adds Prusa Slicer. I had to change "cereal" package definition to use cmake, otherwise "prusa-slicer" failed to find the library. Also, I added "libigl" that is a dependency of "prusa-slicer". gnu/packages/serialization.scm (cereal): Use cmake. * Replace manual build and installation with standard cmake. The main reason to do that is to get "cereal-config.cmake" file that is used to find the library in other projects. --- gnu/packages/serialization.scm | 39 ++++++++++++---------------------- 1 file changed, 13 insertions(+), 26 deletions(-) diff --git a/gnu/packages/serialization.scm b/gnu/packages/serialization.scm index 8f292ae408..9c34da62af 100644 --- a/gnu/packages/serialization.scm +++ b/gnu/packages/serialization.scm @@ -141,32 +141,19 @@ implement RPC protocols.") "0hc8wh9dwpc1w1zf5lfss4vg5hmgpblqxbrpp1rggicpx9ar831p")))) (build-system cmake-build-system) (arguments - `(;; The only included tests are portability tests requiring - ;; cross-compilation and boost. Since we are building cereal on more - ;; platforms anyway, there is no compelling reason to build the tests. - #:tests? #f - #:out-of-source? #f - #:phases - (modify-phases %standard-phases - (delete 'configure) - (replace 'build - (lambda _ - (substitute* "doc/doxygen.in" - (("@CMAKE_CURRENT_BINARY_DIR@") ".") - (("@CMAKE_CURRENT_SOURCE_DIR@") ".")) - (with-directory-excursion "doc" - (invoke "doxygen" "doxygen.in")))) - ;; There is no "install" target, so we have to provide our own - ;; "install" phase. - (replace 'install - (lambda* (#:key outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (doc (string-append out "/share/cereal/docs")) - (include (string-append out "/include/cereal"))) - (mkdir-p doc) - (mkdir-p include) - (copy-recursively "include/cereal" include) - (copy-recursively "doc/html" doc))))))) + `(#:configure-flags (list "-DSKIP_PORTABILITY_TEST=ON") + #:tests? #f + #:phases (modify-phases %standard-phases + (add-before 'configure 'skip-sandbox + (lambda _ + (substitute* "CMakeLists.txt" + (("add_subdirectory\\(sandbox\\)") "")))) + (add-after 'install 'install-doc + (lambda _ + (let ((doc (string-append %output "/share/doc/html"))) + (invoke "make" "doc") + (mkdir-p doc) + (copy-recursively "doc/html" doc))))))) (native-inputs `(("doxygen" ,doxygen))) (home-page "https://uscilab.github.io/cereal/") From patchwork Fri Jul 23 21:07:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Gankevich X-Patchwork-Id: 31575 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 9B84427BC78; Fri, 23 Jul 2021 22:08:10 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 4D68627BC6B for ; Fri, 23 Jul 2021 22:08:10 +0100 (BST) Received: from localhost ([::1]:38836 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m72Ov-0004mf-Bu for patchwork@mira.cbaines.net; Fri, 23 Jul 2021 17:08:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54334) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m72Oo-0004jc-Fm for guix-patches@gnu.org; Fri, 23 Jul 2021 17:08:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:33211) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m72Oo-00061v-6j for guix-patches@gnu.org; Fri, 23 Jul 2021 17:08:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m72Oo-0002JX-1a for guix-patches@gnu.org; Fri, 23 Jul 2021 17:08:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49713] [PATCH 2/3] gnu: Add libigl. References: <20210723210037.28150-1-i.gankevich@spbu.ru> In-Reply-To: <20210723210037.28150-1-i.gankevich@spbu.ru> Resent-From: Ivan Gankevich Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 23 Jul 2021 21:08: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: 49713@debbugs.gnu.org Cc: Ivan Gankevich Received: via spool by 49713-submit@debbugs.gnu.org id=B49713.16270744818892 (code B ref 49713); Fri, 23 Jul 2021 21:08:02 +0000 Received: (at 49713) by debbugs.gnu.org; 23 Jul 2021 21:08:01 +0000 Received: from localhost ([127.0.0.1]:44757 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m72On-0002JI-5h for submit@debbugs.gnu.org; Fri, 23 Jul 2021 17:08:01 -0400 Received: from mail.spbu.ru ([195.70.197.23]:41319 helo=cgp2.pu.ru) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m72Ok-0002J4-D0 for 49713@debbugs.gnu.org; Fri, 23 Jul 2021 17:07:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=simple/simple; d=spbu.ru; s=20180812; bh=L3j88pCBRNgBiO7q1PICge1JZCl/QvXD3TA5U/Ih6n0=; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject:Cc:To:From; b=LrVCvvQSk+DKGszQILVaOH+fE7OHSAO+urL2SnyoX/Yp+4GfAIOW+2+nuE2Rtb/KIxETnEb3Y+ Gc4OFYeIHMdDRJPTtouv3swUMJ7Gtf7dBLPoim9qQO8BVQNHf+EJa9C09Muhl0aNXPMaURnxpTylU 1ln/CYmJbK4WrXAv+ntQyuP2quyV5cSFJduMtZQKQ8QluYzZBb6LttqY1meK5uwZMzBGHcmj+cLs/ gMZPh0oMP/IHE7XuglZKe1XigTDb0GMTsNaJ+jIBmF/tWJyBoE0WX0B1mZtkwFOkR8RrSAX5GIovf bfcTLlgt+WNBUW+x/ri8MC7iTbt5ojga/9yfw== Received: from [172.27.221.159] (account st018947@spbu.ru HELO localhost.localdomain) by spbu.ru (CommuniGate Pro SMTP 6.2.15) with ESMTPSA id 173785815; Sat, 24 Jul 2021 00:07:52 +0300 From: Ivan Gankevich Date: Sat, 24 Jul 2021 00:07:32 +0300 Message-Id: <20210723210731.9246-1-i.gankevich@spbu.ru> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 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+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/engineering.scm (libigl): New variable. --- gnu/packages/engineering.scm | 62 ++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm index fc932ddb28..eec12814ff 100644 --- a/gnu/packages/engineering.scm +++ b/gnu/packages/engineering.scm @@ -2862,3 +2862,65 @@ for hooking Linux system calls in user space. This is achieved by hot-patching the machine code of the standard C library in the memory of a process.") (license license:bsd-2)))) + +(define-public libigl + (package + (name "libigl") + (version "2.3.0") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/libigl/libigl") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "004a22ifq2vibgkgvrlyihqimpsfizvq5l448204kwfg3lkycajj")))) + (build-system cmake-build-system) + (arguments + `(#:configure-flags + (list "-DLIBIGL_USE_STATIC_LIBRARY=OFF" + "-DLIBIGL_BUILD_TESTS=OFF" ;; tests need to download test data + "-DLIBIGL_BUILD_TUTORIALS=OFF" + "-DLIBIGL_EXPORT_TARGETS=ON" + "-DLIBIGL_WITH_CGAL=ON" + "-DLIBIGL_WITH_COMISO=OFF" + "-DLIBIGL_WITH_CORK=OFF" + "-DLIBIGL_WITH_EMBREE=OFF" + "-DLIBIGL_WITH_MATLAB=OFF" + "-DLIBIGL_WITH_MOSEK=OFF" + "-DLIBIGL_WITH_OPENGL=OFF" + "-DLIBIGL_WITH_OPENGL_GLFW=OFF" + "-DLIBIGL_WITH_OPENGL_GLFW_IMGUI=OFF" + "-DLIBIGL_WITH_PNG=OFF" + "-DLIBIGL_WITH_TETGEN=OFF" + "-DLIBIGL_WITH_TRIANGLE=OFF" + "-DLIBIGL_WITH_PREDICATES=OFF" + "-DLIBIGL_WITH_XML=OFF") + #:tests? #f + #:phases + (modify-phases %standard-phases + (add-before 'configure 'do-not-download-dependencies + (lambda _ + (substitute* "cmake/libigl.cmake" + (("if\\(NOT TARGET Eigen3::Eigen\\)" all) + (string-append "find_package(Eigen3 CONFIG REQUIRED)\n" all)) + (("if\\(NOT TARGET CGAL::CGAL\\)" all) + (string-append "find_package(CGAL CONFIG COMPONENTS Core)\n" all))))) + (add-after 'install 'install-all-subdirs + (lambda _ + (copy-recursively + "../source/include" + (string-append (assoc-ref %outputs "out") "/include"))))))) + (inputs + `(("eigen" ,eigen) + ("cgal" ,cgal) + ("gmp" ,gmp) + ("mpfr" ,mpfr) + ("boost" ,boost))) + (home-page "https://libigl.github.io/") + (synopsis "Simple C++ geometry processing library") + (description "The library provides functionality for shape modelling, +visualization, matrix manipulation.") + (license (list license:gpl3 license:mpl2.0)))) From patchwork Fri Jul 23 21:08:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ivan Gankevich X-Patchwork-Id: 31576 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id C0A9D27BC78; Fri, 23 Jul 2021 22:09:08 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 2B60927BC6B for ; Fri, 23 Jul 2021 22:09:08 +0100 (BST) Received: from localhost ([::1]:39286 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m72Pr-00057L-9g for patchwork@mira.cbaines.net; Fri, 23 Jul 2021 17:09:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54398) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m72Pm-00056z-2U for guix-patches@gnu.org; Fri, 23 Jul 2021 17:09:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:33218) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m72Pl-0006kU-RY for guix-patches@gnu.org; Fri, 23 Jul 2021 17:09:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m72Pl-0002LP-Nj for guix-patches@gnu.org; Fri, 23 Jul 2021 17:09:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49713] [PATCH 3/3] gnu: Add prusa-slicer. References: <20210723210037.28150-1-i.gankevich@spbu.ru> In-Reply-To: <20210723210037.28150-1-i.gankevich@spbu.ru> Resent-From: Ivan Gankevich Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 23 Jul 2021 21:09:01 +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: 49713@debbugs.gnu.org Cc: Ivan Gankevich Received: via spool by 49713-submit@debbugs.gnu.org id=B49713.16270745208980 (code B ref 49713); Fri, 23 Jul 2021 21:09:01 +0000 Received: (at 49713) by debbugs.gnu.org; 23 Jul 2021 21:08:40 +0000 Received: from localhost ([127.0.0.1]:44764 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m72PP-0002Km-Ha for submit@debbugs.gnu.org; Fri, 23 Jul 2021 17:08:39 -0400 Received: from mail.spbu.ru ([195.70.197.23]:51645 helo=cgp2.pu.ru) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m72PN-0002KT-Ly for 49713@debbugs.gnu.org; Fri, 23 Jul 2021 17:08:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=simple/simple; d=spbu.ru; s=20180812; bh=Wu//NtjuH2edyFZFUfMMwq9wmhrcSu+wMoaNGnEIsTU=; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-Id:Date:Subject :Cc:To:From; b=sOTK9qzYEuTBszHlQELTh1G2tyTaHOpby4zymEdQ05d3WADkIN5forzlsrhLZn dPH46ULe9vMzWouQFFMZn2QM5GM1BT18p6irXAHPG1MR6cbGNlJcDuTQJA7mA5I7OZtRZdvBYby+9 Tj7LQGk18HLihBMbfgc9gZkiY/yzqLyOi+ftMXOqd9JkE4Lw8nwrI7+VOxCAa5Lo1YC07BDHGNofc PaD8ON/x8RiChMOBo/YzYf5NPyAa6Y1bJioU9xS3q96R1GdyzlOQNNJ4uDNBAmGJsiJOL8baPgvJM m5d5kTKO1YgPjydrmKooh5Zp/N4GsqRrxvzHZX6ptVKniSjBg== Received: from [172.27.221.159] (account st018947@spbu.ru HELO localhost.localdomain) by spbu.ru (CommuniGate Pro SMTP 6.2.15) with ESMTPSA id 173785896; Sat, 24 Jul 2021 00:08:31 +0300 From: Ivan Gankevich Date: Sat, 24 Jul 2021 00:08:03 +0300 Message-Id: <20210723210801.9458-1-i.gankevich@spbu.ru> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 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+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * 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")))) + (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") ""))))))) + (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))) + (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)))