unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Xinglu Chen <public@yoctocell.xyz>
To: Daniel Trujillo Viedma <dtviedma@gmail.com>, 50052@debbugs.gnu.org
Subject: [bug#50052] [PATCH] Add prusa-slicer
Date: Sun, 15 Aug 2021 13:02:39 +0200	[thread overview]
Message-ID: <878s139dio.fsf@yoctocell.xyz> (raw)
In-Reply-To: <e2620c20-2558-6770-266f-a039eed4cf91@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 7131 bytes --]

On Sat, Aug 14 2021, Daniel Trujillo Viedma wrote:

> 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.

That’s probably a good idea, in case upstream changes the default value
in the future.

> * 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
>
>
> From 522c1904cf62afac25a9d974091211adac760c25 Mon Sep 17 00:00:00 2001
> From: Daniel Trujillo Viedma <danihacker.viedma@gmail.com>
> Date: Sat, 14 Aug 2021 00:00:55 +0200
> Subject: [PATCH] Add prusa-slicer
>
> ---

The commit message should be in the GNU ChangeLog format, see the commit
log for examples, or check the manual.

  <https://www.gnu.org/prep/standards/standards.html#Change-Logs>
  
>  gnu/packages/engineering.scm                       | 58 ++++++++++++++++++++++
>  .../patches/prusa-slicer-backport-fix-5542.patch   | 31 ++++++++++++

This patch should also be added to the gnu/local.mk file.

>  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))))

The ‘file-name’ field should be set to

  (file-name (git-file-name name version))

to give the git checkout, in the Guix store, a more descriptive name,
otherwise its name is

  /gnu/store/hc1slayzjz8xrw24q8wzgcs6xrzfk74q-git-checkout

which doesn’t really say much.  This usually only applies if some kind
of VCS repository is used, and not if ‘url-fetch’ is used.

> +       (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)
> +         ("glibc" ,glibc)

These packages are already included in the ‘cmake-build-system’ by
default, no need to add them explicitly.

> +         ("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

Nit: “perfect” sounds a bit too much like marketing speak; instead of
“to export the perfect print files”, I suggest “to export to print
files”.

WDYT?

> +for your Original Prusa 3D printer.")
> +    (license license:agpl3)))

According the the LICENSE file, this should be agpl3+ (grep for “any
later version”).

  <https://github.com/prusa3d/PrusaSlicer/blob/master/LICENSE>


I didn’t manage to build the package because my machine ran out of
memory, but I assume that it built fine for you.  :-)

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 861 bytes --]

  reply	other threads:[~2021-08-15 11:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <0654f9e7-8c1d-aa4c-3240-54faf3defb2f@gmail.com>
2021-08-13 22:58 ` [bug#50052] [PATCH] Add prusa-slicer Daniel Trujillo Viedma
2021-08-15 11:02   ` Xinglu Chen [this message]
2021-08-16  7:49   ` Ivan Gankevich
2021-08-16 20:09     ` Daniel Trujillo Viedma
2021-08-17  7:18       ` Ivan Gankevich
2021-08-17 21:59     ` bug#50052: " Daniel Trujillo Viedma

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878s139dio.fsf@yoctocell.xyz \
    --to=public@yoctocell.xyz \
    --cc=50052@debbugs.gnu.org \
    --cc=dtviedma@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).