From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id eG+xDPMv+2BUkAAAgWs5BA (envelope-from ) for ; Fri, 23 Jul 2021 23:09:07 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id ICT7AfMv+2DVdgAA1q6Kng (envelope-from ) for ; Fri, 23 Jul 2021 21:09:07 +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 A475812959 for ; Fri, 23 Jul 2021 23:09:06 +0200 (CEST) Received: from localhost ([::1]:39286 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m72Pp-00057L-My for larch@yhetil.org; Fri, 23 Jul 2021 17:09:05 -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 Content-Type: text/plain; charset=UTF-8 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=1627074546; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=GT4rfzVw5joIUzAzSzxE2BUHbKaKk+i94cgm0r/Zsbg=; b=O2fKGTzrmBFz2LQa1gssqtYqb20xFoIQ5qbs+rlwpgHH6exqzAE7xaakHAEaaGVJOjXaNC ruorjTbmbqYC8llngoBsHoc5r3+qNCEuOJ9Ncqlig9OZi1R6C1EWGhshTKehXuxQQJvCOS 6Xn0xC2gIguZ9U8M92BKs3kfzFXxv/S3nQ1+0RDcKeHj4EC5WWmCajpV/TeYM2Ed7NgiEQ PUaGE6x+dcJVLSFDUi5eUgwBnw7kvYzN3jmmfB2gJtkoUEiD3eEHo2Ob4XiI2LzCW93jRE Ki4RTIYV5unmsDKkCbI2AjlVI+0ASvq5vdwW8HAfQzdrViQzz1vhmAS0+TtCIg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1627074546; a=rsa-sha256; cv=none; b=RfWG4RNqBeD9rswzO5L0IxJ6gr3CNs88Z/wuJ7K6CtilWHckZ6HjT+1NjLAdUohPiFemh/ XqbxqBjQJvkIK/O+dxrIQUExgwHH3qIkMEMpBA/qk9L/LobFTst1hrWFIBuhcWlsHQnesf qwR1wkp7sKtTz1wYWrcYVU/AOAkbebJZd+yRBRQ5WSdXpVhCeb+oGC/0GihAWFJfBvIdr4 RmfXNUr+IHkvZbRhTPPoxbh5xky4qPaG7lUMl8rVun0YATu+uP5YvoGYbcMu7KdO7vsVo1 Tz5J6XD9B0G40uFg/H2kXGVDW2tdnDFZpO64aD/VO5Hn/RArtdEzT4N+19QK5w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=spbu.ru header.s=20180812 header.b=sOTK9qzY; dmarc=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.42 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=spbu.ru header.s=20180812 header.b=sOTK9qzY; dmarc=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: A475812959 X-Spam-Score: -0.42 X-Migadu-Scanner: scn0.migadu.com X-TUID: UjX2qbPF7MH6 * 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))) -- 2.32.0