GNU bug report logs

#78555 [PATCH] gnu: Add pythonscad

PackageSource(s)Maintainer(s)
guix-patches PTS Buildd Popcon
Full log

Message #8 received at 78555@debbugs.gnu.org (full text, mbox, reply):

Received: (at 78555) by debbugs.gnu.org; 26 May 2025 12:22:10 +0000
From debbugs-submit-bounces@debbugs.gnu.org Mon May 26 08:22:10 2025
Received: from localhost ([127.0.0.1]:55685 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
	id 1uJWqH-0002Nc-N5
	for submit@debbugs.gnu.org; Mon, 26 May 2025 08:22:10 -0400
Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]:49246)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <maxim.cournoyer@gmail.com>)
 id 1uJWqD-0002MZ-5k
 for 78555@debbugs.gnu.org; Mon, 26 May 2025 08:22:06 -0400
Received: by mail-pj1-x102b.google.com with SMTP id
 98e67ed59e1d1-3114b7e89a6so1093879a91.2
 for <78555@debbugs.gnu.org>; Mon, 26 May 2025 05:22:05 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1748262118; x=1748866918; darn=debbugs.gnu.org;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to;
 bh=fHB2Hmh14iM2yotiQ6UVQhOR7/Vg9T9RDmwSSkG95sg=;
 b=FHtx/LmMmxpVSA8hw5xQhi0Euqr5Hvpx5C0NgqUreX4J0hJDlEKlDqCYRZhMEYuGAR
 aQ/7WWiXCDjQcdR2UEtmX+G2EaJZ71GYLjouWBpauyr1eAEP9Os+jXwfEjCAw2l/BSbJ
 FVKuwCP+wgPOduZtbM+7WXl51tgWshuvcLikss8Hi652d8/B5c43WzEC1RZ36f+yR2z/
 4poSbCQUdBq9UEEipSxz6JFgYPcvlVjh8U/pJS79v8YHFPp83Ka4uRMRHw7OisGKLna4
 aVW3UqBiwystLOSOo9yKJjko9xj7LcfiPP6yv1nRg2CtNZ2xtDRYBnSPDnQKmBaLEKFA
 mgCg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1748262118; x=1748866918;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date
 :message-id:reply-to;
 bh=fHB2Hmh14iM2yotiQ6UVQhOR7/Vg9T9RDmwSSkG95sg=;
 b=mYWXuEBoYYvtZ3qN+peigNUJjT8oHgyDU/9Pg2gKJESq66GJoQEcP4a7+N5iM9d4j5
 yXH9MuHNsyQGjvh0c2//qAbDPa3EoQL9zvPZF1WcXoTmBfKPV0+/lyLGYlisKeIDOrla
 y4GUOQYg6KgpydcyKniiw3aXXN6CAWq78S8X6fmZWi4WPBuH6GLNHCEUGNVjRTPZ7ozI
 MqxQGbVpNauh7PkHAdJV3HSETVJCbqcQcaRQwS1f6JNkLAK4eUL2CSVwWff50bZJaFO6
 Tm6fuzwvhtZZnOEE5fgMHdB1U9EmvoEyZebWb1XeGUJUOUZbufdokvSLZR+m88aiJHK7
 ydqw==
X-Gm-Message-State: AOJu0YwF9qk1XkziEl8atl+rUGDiGgiVG268ZPj8qOwpyQ8UbmqeuDRY
 y5/QSRLUjpcz4vGrKXklBqRfMHweT9htKVkrOPMGUmr9pYb6yoJcgyFy356aHKRO
X-Gm-Gg: ASbGncv0WBU25MIRUKv+Z+xXi3iK+UEW+yQQc0eSLipq9zsDRYQCuU68VXahUADzj84
 BSFoDmBsTUXrIBUGgP5BzqLo7og44iOsK3jzxjrhR8D1mnW1/XxASwvCqkmSLYPy4NwiQc68afu
 3lay92mVySfn4l4dB02Nvrphs+BHFnoi969VgRPfdI0w/FZBQSG855yc/2Ma0rJLj5OOYvK/hjA
 uGULeBDcA5E/f0G4q7jA/W9BP6timnxISMlEMe5fom5U3I+ApEF6xBZEpsNgXOqKHFVa8HuDnt3
 1jJvi5+N/aLTtOeeXny1VD6qADFuB7s3IMUJ4apJ+Oeh2c20Sg==
X-Google-Smtp-Source: AGHT+IE5iLSUK1Y4T1ZjItJb1zB8Fd6HDlV8gaN5GgYCiSUSTFrWisDfz7jFo55ds5oYpihUQyjRyA==
X-Received: by 2002:a17:90b:48cc:b0:30e:37be:698d with SMTP id
 98e67ed59e1d1-3110f72e206mr11566920a91.31.1748262117913; 
 Mon, 26 May 2025 05:21:57 -0700 (PDT)
Received: from terra ([2405:6586:be0:0:83c8:d31d:2cec:f542])
 by smtp.gmail.com with ESMTPSA id
 98e67ed59e1d1-3110b9a447bsm4659901a91.3.2025.05.26.05.21.56
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 26 May 2025 05:21:57 -0700 (PDT)
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
To: nomike <nomike@nomike.com>
Subject: Re: [bug#78555] [PATCH] gnu: Add pythonscad
In-Reply-To: <20250523020040.1756306-1-nomike@nomike.com> (nomike@nomike.com's
 message of "Fri, 23 May 2025 04:00:40 +0200")
References: <20250523020040.1756306-1-nomike@nomike.com>
Date: Mon, 26 May 2025 21:21:54 +0900
Message-ID: <871psbimu5.fsf@gmail.com>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 78555
Cc: 78555@debbugs.gnu.org
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request@debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit@debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request@debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request@debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces@debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
X-Spam-Score: -1.0 (-)
Hi!

nomike <nomike@nomike.com> writes:

> * gnu/packages/engineering.scm (pythonscad): New variable
>
> Change-Id: I66737d0eaaa7546dcd407d7371166c9b5d5d9b31
> ---
>  gnu/packages/engineering.scm | 77 +++++++++++++++++++++++++++++++++++-
>  1 file changed, 75 insertions(+), 2 deletions(-)
>
> diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm
> index 8b1332e186..c81f4d5dbe 100644
> --- a/gnu/packages/engineering.scm
> +++ b/gnu/packages/engineering.scm
> @@ -3315,6 +3315,79 @@ (define-public openscad
>        (home-page "https://openscad.org/")
>        (license license:gpl2+))))
>  
> +(define-public pythonscad
> +  (let ((commit "b856456fcf26e089a616e5a9b5d685b8a8f2e2c1")
> +        (version "2025.05.21")
> +        (revision "0"))
> +    (package
> +      (inherit openscad)
> +      (name "pythonscad")
> +      (version (git-version version revision commit))
> +      (source
> +       (origin
> +         (method git-fetch)
> +         (uri (git-reference
> +               (url "https://github.com/pythonscad/pythonscad")
> +               (commit commit)
> +               (recursive? #t)))

Use of recursive? #t should be explained in a comment above; it's
typically used to bundle libraries that we'd rather package separately
and link to, if possible.

> +         (sha256
> +          (base32 "0bjpvj94m3kplpnmnlai7mjx45d5acnqw943w3p1mprg8wrp3ap6"))
> +         (file-name (git-file-name name version))))
> +      (arguments
> +       (list
> +        #:configure-flags
> +        #~(list "-DCMAKE_BUILD_TYPE=Release"
> +                "-DUSE_BUILTIN_OPENCSG=ON"
> +                "-DMANIFOLD_PYBIND=OFF"
> +                "-DMANIFOLD_TEST=OFF"
> +                "-DENABLE_TESTS=OFF"

Why is the test suite disabled?  This also needs an explanation.  We
strive to run test suites in Guix.

> +                "-DEXPERIMENTAL=ON"
> +                "-DSNAPSHOT=ON"

Are these really needed here?  In general, we stick to the default
configuration unless we have specific needs.

> +                "-DENABLE_PYTHON=ON"
> +                (string-append "-DPYTHON_VERSION="
> +                               (string-join (reverse (list-tail (reverse (string-split #$
> +                                                                          (package-version
> +                                                                           (this-package-input
> +                                                                            "python"))
> +                                                                          #\.))
> +                                                                1))
> "."))

You can use #$(version-major+minor (package-version (this-package-input
"python"))), from (guix utils) instead.  Please try to fit under 80
characters maximum width, which is in our coding style guidelines.

> +                "-DUSE_BUILTIN_CLIPPER2=OFF"
> +                (string-append "-DOPENSCAD_VERSION="
> +                               #$version)
> +                (string-append "-DOPENSCAD_COMMIT="
> +                               #$commit)
> +                "-DENABLE_EGL=ON"
> +                "-DENABLE_GLX=ON")
> +        #:phases
> +        #~(modify-phases %standard-phases
> +            (delete 'check)
> +            (add-after 'unpack 'patch-source
> +              (lambda* (#:key inputs #:allow-other-keys)
> +                ;; <https://github.com/openscad/openscad/issues/5877>

It's very nice to have the cross-references to the issues being patched
here!  It'd be even nicer if there was a short explanatory comment
introducing the issue, e.g. "The build system fails to find lib3mf; it
seems it should be using PC_LIB3MF_INCLUDEDIR instead of
PC_LIB3MF_INCLUDE_DIRS (see:
<https://github.com/openscad/openscad/issues/5880>)."  It's more
verbose, but it's nice to summarize the issue to save the reader from
having to follow the link and read the whole conversation to figure it
out (perhaps they work offline too, or the link may disappear in the
future).

> +                (substitute* "cmake/Modules/FindLib3MF.cmake"
> +                  (("PC_LIB3MF_INCLUDE_DIRS")
> +                   "PC_LIB3MF_INCLUDEDIR"))
> +                (substitute* "CMakeLists.txt"
> +                  ;; <https://github.com/openscad/openscad/issues/5880>
> +                  (("target_link_libraries\\(OpenSCAD PRIVATE OpenGL::EGL\\)")
> +                   "      find_package(ECM REQUIRED NO_MODULE)
> +      list(APPEND CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
> +      find_package(EGL REQUIRED)
> +      target_link_libraries(OpenSCAD PRIVATE EGL::EGL)")
> +                  ;; <https://github.com/openscad/openscad/issues/5897>
> +                  (("find_package\\(Nettle 3.4\\)")
> +                   "find_package(Nettle 3.4 REQUIRED)")
> +                  ;; Use the system sanitizers-cmake module.
> +                  (("\\$\\{CMAKE_SOURCE_DIR\\}/submodules/sanitizers-cmake/cmake")
> +                   (string-append (assoc-ref inputs "sanitizers-cmake")
> +                                  "/share/sanitizers-cmake/cmake"))))))))

I'd use (search-input-directory (or native-inputs inputs)
                                "share/sanitizers-cmake/cmake")

The (or native-inputs inputs) is useful when cross-compiling; in that
situation, the native-inputs are in the native inputs, when doing a
straight build (host -> host), the native-inputs are fused into the
inputs.

> +      (inputs (modify-inputs (package-inputs openscad)
> +                (append libjpeg-turbo curl python nettle)))
> +      (home-page "https://openscad.org/")
> +      (description
> +       "A fork of @code{OpenSCAD} that lets you use Python as its native language."))))

Perhaps you could reuse some of the original openscad package
description, to give more information on what this package does, and
append the above to specify how it differs from the original.

Could you please send a v2 with the above comments taken into
consideration?

-- 
Thanks,
Maxim




Send a report that this bug log contains spam.


debbugs.gnu.org maintainers <help-debbugs@gnu.org>. Last modified: Mon Sep 8 13:19:49 2025; Machine Name: wallace-server

GNU bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.