From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id WPr1DLS8F2Gn7wAAgWs5BA (envelope-from ) for ; Sat, 14 Aug 2021 14:53:08 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id 1ZS1CLS8F2FEAwAAB5/wlQ (envelope-from ) for ; Sat, 14 Aug 2021 12:53:08 +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 689E98255 for ; Sat, 14 Aug 2021 14:53:07 +0200 (CEST) Received: from localhost ([::1]:33938 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mEt9u-0003QM-7E for larch@yhetil.org; Sat, 14 Aug 2021 08:53:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36342) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mEiII-0005sR-Fm for guix-patches@gnu.org; Fri, 13 Aug 2021 21:17:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:59982) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mEiII-000070-9l for guix-patches@gnu.org; Fri, 13 Aug 2021 21:17:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mEiIH-0003DD-T0 for guix-patches@gnu.org; Fri, 13 Aug 2021 21:17:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50052] [PATCH] Add prusa-slicer Resent-From: Daniel Trujillo Viedma Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 14 Aug 2021 01:17:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 50052 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50052@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.162890376212269 (code B ref -1); Sat, 14 Aug 2021 01:17:01 +0000 Received: (at submit) by debbugs.gnu.org; 14 Aug 2021 01:16:02 +0000 Received: from localhost ([127.0.0.1]:43295 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mEiHG-0003BQ-7C for submit@debbugs.gnu.org; Fri, 13 Aug 2021 21:16:02 -0400 Received: from lists.gnu.org ([209.51.188.17]:48476) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mEg8h-0008Mo-9n for submit@debbugs.gnu.org; Fri, 13 Aug 2021 18:59:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50590) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mEg8g-0008Gv-VP for guix-patches@gnu.org; Fri, 13 Aug 2021 18:58:58 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:43696) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mEg8e-0007Pb-LH for guix-patches@gnu.org; Fri, 13 Aug 2021 18:58:58 -0400 Received: by mail-wr1-x42f.google.com with SMTP id z9so15168063wrh.10 for ; Fri, 13 Aug 2021 15:58:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:references:to:from:message-id:date:user-agent:mime-version :in-reply-to:content-language; bh=jCFNWYwVRM+Ro+IXVOT9flAmqogWOiwSsT04YzScvEY=; b=N6dtU3K6hEoZ497Wx5lQmcSrNUTdABPcWcp2EaBnXJ/ECFvgNho2yIeJwSHuiJmr0L 7DsB7hyI89FX4mm8wwvieVYXhbVyyK2piGZNV6GKXP+I31RhduDvFb4tdzWcUTg9H01V K7NqaaN5zRxHBet/nt1rAIC+Hx6zgdczZvbfICeYDuJmvBwH119SMRtAyIl8zxrat8iW oHJCZuTZd2MxLvsMnfJs4CWUkqnFv5/iUoLxZloh69k2NGhj+w9ct9yfQ8fLPDAD5k2X SR2e9WoFebVon+knnJA/VlXA73wGHXhnTEE6QdCOqquQMFy6ot189W3XklHDot5texdj h5nA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:references:to:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=jCFNWYwVRM+Ro+IXVOT9flAmqogWOiwSsT04YzScvEY=; b=nLuow85IGPApkrzorivnt1Kgm5HaDfwN23tEgV71OXyBEGhr0jUrF5i3iHJKR/ue5t ildOYc2RCH8utSBZpgFGqRV0sxiGaJTNexZjOejSobMMS9MjkTfwV/xiB4tzHQiKy5Xx smPDniJ6DHWsp/mQB85lh2oKQ5WCI0V5dIrTGB8E6tksYdL0oi2CD5NTWGJa9Nkc3ZHk zc4DAVGMVQe8fTGOcr/MJws4qe57l8fYt/+BMyJkKfXSJIyAsAQ79gHlFsJyATkDek4q XMoAVpO9kARXSB+GTcE6NCKY3ITt4wPc5oNrOSNaijsirhXgjaJnsqD3tRJF+YUQB0Hy jN0w== X-Gm-Message-State: AOAM531kQbz7d8oGk6ySzOeZ0uu+CVbhIvuaTbQtpHNro3LgoCtxgOY1 Rh7espbnarqVRomMtYub3BCrPQKyUZMEZw== X-Google-Smtp-Source: ABdhPJxdtZesm4S6qDBfh+FmM4HFDFpfbgNIrmyfDxgLaj7Zu8Tcd8mu5uMn6yAUVRDWOHtPdWSPXw== X-Received: by 2002:a05:6000:128e:: with SMTP id f14mr5473328wrx.167.1628895533652; Fri, 13 Aug 2021 15:58:53 -0700 (PDT) Received: from [192.168.0.13] ([37.223.119.203]) by smtp.gmail.com with ESMTPSA id h8sm2608659wmb.35.2021.08.13.15.58.53 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 13 Aug 2021 15:58:53 -0700 (PDT) References: <0654f9e7-8c1d-aa4c-3240-54faf3defb2f@gmail.com> From: Daniel Trujillo Viedma X-Forwarded-Message-Id: <0654f9e7-8c1d-aa4c-3240-54faf3defb2f@gmail.com> Message-ID: Date: Sat, 14 Aug 2021 00:58:52 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <0654f9e7-8c1d-aa4c-3240-54faf3defb2f@gmail.com> Content-Type: multipart/mixed; boundary="------------CB336E4D379709DB6379C835" Content-Language: en-US Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=dtviedma@gmail.com; helo=mail-wr1-x42f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Fri, 13 Aug 2021 21:15:56 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Mailman-Approved-At: Sat, 14 Aug 2021 08:52:58 -0400 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=1628945587; 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: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=jCFNWYwVRM+Ro+IXVOT9flAmqogWOiwSsT04YzScvEY=; b=VfJrh5Tnmh08PHfU1X7hYd1gmYFlONXerxQwJJDAmJpn8NC6Xox+jtrhWtJ3MIH4qKn9B2 vf5gckgY6eiyZ6EW0s4GWb+RbGfustDmplm0gD1BLORZOj4+jqY+VSgdJrWtNaJHG9nP1A F0/G7q+rtOBvf78MLo3lwffNK4EPLNwTRkUrxjDSAVQYaU6/CpcoQmVHJSfCPFTPHccHm5 c2YSbut9wbWPXP33MRItfotWA6EBVyEamIqzJY0Asnxr6a2MOS09VEDzeAVE1kHtw1PADh pF07CeV/e4JlCEPxFZsfrRgFeU66AGkZFrqK7P35s8Rf32KcZESE3QgfMq0Gnw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1628945587; a=rsa-sha256; cv=none; b=SJbdXPrss6uufGDw4oVnXlVW1Bhoap8k0IXSPZS8HQW+pHvNVE5TVh5dZnrbuc5Ea4DMlT oPfxOEyA/KT+nmWb1tagTG4xTS5EeEUQMq5XwMeouposlVuNHX59DDA5N/Twh+Q1Q40t+u SMF3X4mDPXT9dz5/ob9HEhLyyiBRCOEow2K9z1CK1YHx9g4SHLiPP5ysZ+PAXuoBNFb/m5 mlKFQXJHYNoGhM9lMGCg/Kq+3vbdxeg4GlBx/MLvgTaPYc5f6FTr2QZ3dWGQqHflSLy19/ EQ2GcQYnB0jJmU016xmBDbLXIcLMlY7n7D46GV6e6Jjx3KcNAlCf/vxKgXTDdA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20161025 header.b=N6dtU3K6; 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: -1.31 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20161025 header.b=N6dtU3K6; 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: 689E98255 X-Spam-Score: -1.31 X-Migadu-Scanner: scn1.migadu.com X-TUID: UhAtQ42djdgr This is a multi-part message in MIME format. --------------CB336E4D379709DB6379C835 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Hi! I'm Daniel Trujillo, This is my first-time-ever contribution to GNU Guix, so please, don't hold any nitpick to yourself!! :) I don't know if these kind of packages are of interest, but this is PrusaSlicer [0], a software to prepare 3D printings (hence I put it in engineering.scm). The packaged version, 2.3.3 is the latest stable available at this moment. But this version has as important problem [1]: It cannot be invoked just naming the executable (through $PATH), because then, it can't locate the resources directory. I learned **the hard way** that the fix was applied *after* the release of the 2.3.3 version, so I decided to backport the fix adding a patch because it's a show-stopper to have to type the path to the executable in /gnu/store/... That's the reason why the patch attached to this email contains, not only the additions to engineering.scm, but also a patch that implements the solution in the version 2.3.3 codebase (It's quite simple, it uses a boost function to determine the path to the executable rather than relying on argv[0]). Known improvable things: * It's configured to use GTK3. After many attempts to compile it under GTK2 in a guix environment, sometimes it detected GTK right away, and some ether times I had to add more includes. It wasn't quite reliable and, according to the convention followed in gtk+ packages, probably it would be better that prusa-slicer uses GTK3, and a hypothetical future GTK2 version would be called prusa-slicer-gtk2. * In order for the above $PATH issue fix to work, it's crucial that the cmake variable SLIC3R_FHS is set to off. This is the default value according to the CMakeLists.txt, but because it's so important, probably it should have been included in the configure-flags argument? Just for clarity. * Currently, the version displayed in the title bar is "....2.3.3+UNKNOWN". This is because of another cmake option not set. It doesn't have any influence in the software, as far as I know, but it's arguably ugly. The version I currently use, doesn't display that in the title bar, but it does in the "About" window, and it says ".....2.3.3+linux-64". Maybe something like "GNU Guix" would be prettier. But if I have to include the arch, I would have to dig deeper into package definitions ^_^''' I hope everything is in order, I'm looking forward to see your comments, and hope I can start contributing more packages to Guix!! Cheers, Dani. [0] https://www.prusa3d.es/prusaslicer/ [1] https://github.com/prusa3d/PrusaSlicer/issues/5542 --------------CB336E4D379709DB6379C835 Content-Type: text/x-patch; charset=UTF-8; name="0001-Add-prusa-slicer.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-Add-prusa-slicer.patch" >From 522c1904cf62afac25a9d974091211adac760c25 Mon Sep 17 00:00:00 2001 From: Daniel Trujillo Viedma Date: Sat, 14 Aug 2021 00:00:55 +0200 Subject: [PATCH] Add prusa-slicer --- gnu/packages/engineering.scm | 58 ++++++++++++++++++++++ .../patches/prusa-slicer-backport-fix-5542.patch | 31 ++++++++++++ 2 files changed, 89 insertions(+) create mode 100644 gnu/packages/patches/prusa-slicer-backport-fix-5542.patch diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm index 33c124a2ea..047d99c0af 100644 --- a/gnu/packages/engineering.scm +++ b/gnu/packages/engineering.scm @@ -2863,3 +2863,61 @@ 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 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)))) + (sha256 + (base32 "0w0synqi3iz9aigsgv6x1c6sg123fasbx19h4w3ic1l48r8qmpwm")) + (patches (search-patches "prusa-slicer-backport-fix-5542.patch")))) + (build-system cmake-build-system) + (arguments + `(#:configure-flags `("-DSLIC3R_GTK=3"))) + (native-inputs + `(("pkg-config" ,pkg-config))) + (inputs + `(("perl" ,perl) + ("glibc-locales" ,glibc-locales) + ("adwaita-icon-theme" ,adwaita-icon-theme) + ("boost" ,boost) + ("tbb" ,tbb) + ("curl" ,curl) + ("zlib" ,zlib) + ("eigen" ,eigen) + ("expat" ,expat) + ("libpng" ,libpng) + ("mesa" ,mesa) + ("glew" ,glew) + ("cereal" ,cereal) + ("nlopt" ,nlopt) + ("openvdb" ,openvdb) + ("cgal" ,cgal) + ("gmp" ,gmp) + ("mpfr" ,mpfr) + ("qhull" ,qhull) + ("wxwidgets" ,wxwidgets-3.1) + ("coreutils" ,coreutils) + ("grep" ,grep) + ("sed" ,sed) + ("openexr" ,openexr) + ("glib" ,glib) + ("glibc" ,glibc) + ("gtk+" ,gtk+) + ("pango" ,pango) + ("dbus" ,dbus))) + (home-page "https://www.prusa3d.com/prusaslicer/") + (synopsis "G-code generator for 3D printers (RepRap, Makerbot, Ultimaker etc.)") + (description + "PrusaSlicer (formerly known as Slic3r Prusa Edition or Slic3r PE) is +our own in-house developed slicer software based on the open-source project +Slic3r. PrusaSlicer is an open-source, feature-rich, frequently updated +tool that contains everything you need to export the perfect print files +for your Original Prusa 3D printer.") + (license license:agpl3))) diff --git a/gnu/packages/patches/prusa-slicer-backport-fix-5542.patch b/gnu/packages/patches/prusa-slicer-backport-fix-5542.patch new file mode 100644 index 0000000000..63d2a45be1 --- /dev/null +++ b/gnu/packages/patches/prusa-slicer-backport-fix-5542.patch @@ -0,0 +1,31 @@ +This patch backports a solution for the issue: +https://github.com/prusa3d/PrusaSlicer/issues/5542 +that causes PrusaSlicer to crash when invoked +from the command line by means of the $PATH variable. +This fix is applied in: +https://github.com/prusa3d/PrusaSlicer/commit/293f85b6cf9b805af93b9f79f5ff878b6d673969 +quite after the release of 2.3.3, so this backport is needed. + +diff --git a/src/PrusaSlicer.cpp b/src/PrusaSlicer.cpp +index b0df2c99a..31e30af81 100644 +--- a/src/PrusaSlicer.cpp ++++ b/src/PrusaSlicer.cpp +@@ -28,6 +28,7 @@ + #include + #include + #include ++#include + + #include "unix/fhs.hpp" // Generated by CMake from ../platform/unix/fhs.hpp.in + +@@ -612,7 +613,9 @@ bool CLI::setup(int argc, char **argv) + // Detect the operating system flavor after SLIC3R_LOGLEVEL is set. + detect_platform(); + +- boost::filesystem::path path_to_binary = boost::filesystem::system_complete(argv[0]); ++ // See Invoking prusa-slicer from $PATH environment variable crashes #5542 ++ // boost::filesystem::path path_to_binary = boost::filesystem::system_complete(argv[0]); ++ boost::filesystem::path path_to_binary = boost::dll::program_location(); + + // Path from the Slic3r binary to its resources. + #ifdef __APPLE__ -- 2.11.0 --------------CB336E4D379709DB6379C835--