From unknown Wed Jun 18 00:27:10 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#78555 <78555@debbugs.gnu.org> To: bug#78555 <78555@debbugs.gnu.org> Subject: Status: [PATCH] gnu: Add pythonscad Reply-To: bug#78555 <78555@debbugs.gnu.org> Date: Wed, 18 Jun 2025 07:27:10 +0000 retitle 78555 [PATCH] gnu: Add pythonscad reassign 78555 guix-patches submitter 78555 nomike severity 78555 normal tag 78555 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Thu May 22 22:01:17 2025 Received: (at submit) by debbugs.gnu.org; 23 May 2025 02:01:17 +0000 Received: from localhost ([127.0.0.1]:41674 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uIHin-0006Pi-3X for submit@debbugs.gnu.org; Thu, 22 May 2025 22:01:17 -0400 Received: from lists.gnu.org ([2001:470:142::17]:51028) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uIHii-0006PE-Ct for submit@debbugs.gnu.org; Thu, 22 May 2025 22:01:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uIHic-0000hY-Bz for guix-patches@gnu.org; Thu, 22 May 2025 22:01:06 -0400 Received: from siberian.tulip.relay.mailchannels.net ([23.83.218.246]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uIHiX-0007Wt-Ri for guix-patches@gnu.org; Thu, 22 May 2025 22:01:05 -0400 X-Sender-Id: dreamhost|x-authsender|nomike@nomike.com Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 01E3881C52; Fri, 23 May 2025 02:00:58 +0000 (UTC) Received: from pdx1-sub0-mail-a211.dreamhost.com (trex-green-6.trex.outbound.svc.cluster.local [100.117.152.135]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 5614B817DC; Fri, 23 May 2025 02:00:57 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1747965657; a=rsa-sha256; cv=none; b=LAZ2qYdn36dOn1zEiSANuLNJ+/VUGuZ2pYg4qjooUZ/uhE6f6vBl9/sm9M+yq98xolbC8l zQgo5Ih+rh7/VTPyBXtkGdKeYJlUp9U/sol/fA1hFVgyuehL7nj53e5anLH6raO1DjMFvd JsqY+9CLm1vmv87htLMX6jUsuJYZOfqKa5koKBtuOiXloM+Mzx207jQm3K2jOLK8la1tSz /vsPXvzABhA5b2/bfCaFLPIekXBmYkukzOH/RD0hTDrHeQyRWdYoD04DRDSIIAX+Pe2C+p lhuF1HfEsvjp9pgEGiPFxwXSsW298oJsxLqCuwRW3vfBjoH3xcJZjF5JLzP+lA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1747965657; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:dkim-signature; bh=PqmptMgX7/rOsDJfgSZJmwGsT24/WYrHori5fSAwuNg=; b=hF4EuH3Bls8t06GPWBP8M0gLTRZxihDYPruCJ9J/HzSCpJmqrbEiE0H/i5DxcccnqiaK0K wNwvnIOYXvhEkg5QYjab8G3dK1AboBaX2zq6Whra8qzhoSAxAgJ9+wlYr4UEBgisKqlAYY DxM+1mIgowMyI1Mv4eBr5BD5xUmaLoAYZts9EHwDRPy6MZuGyR3h1ndT5Kx/hFwZaeLhVn do3llNh7g79MqckShMJfioS2Sw1oaVqf6eFKu58SNIDiaW/crUUKKJSjzWSf15PVCu4uD6 4nzAvmLL+Conq7urYitULd3MEXvJAQkC3lzMdqrMlq6c/LV8YjmTkrKFyq54mQ== ARC-Authentication-Results: i=1; rspamd-5b49d78d5-6c98k; auth=pass smtp.auth=dreamhost smtp.mailfrom=nomike@nomike.com X-Sender-Id: dreamhost|x-authsender|nomike@nomike.com X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|nomike@nomike.com X-MailChannels-Auth-Id: dreamhost X-Towering-Unite: 34aaa1507377fc4e_1747965657819_645249402 X-MC-Loop-Signature: 1747965657818:69336939 X-MC-Ingress-Time: 1747965657818 Received: from pdx1-sub0-mail-a211.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.117.152.135 (trex/7.0.3); Fri, 23 May 2025 02:00:57 +0000 Received: from localhost (84-112-221-106.cable.dynamic.surfer.at [84.112.221.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: nomike@nomike.com) by pdx1-sub0-mail-a211.dreamhost.com (Postfix) with ESMTPSA id 4b3T08520cz3k; Thu, 22 May 2025 19:00:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nomike.com; s=dreamhost; t=1747965657; bh=PqmptMgX7/rOsDJfgSZJmwGsT24/WYrHori5fSAwuNg=; h=From:To:Cc:Subject:Date:Content-Transfer-Encoding; b=pLAPW78hEn1343jX1rUDo4YpndcKmEImcnz8BPJ2zIG1jEFcOJObvrlReS7cY/OQs 0OlUXLYa2o8zYHyD9cD8l7sq/1RdXfTZdQ5dCTVUAk1fo4QjjfQ9zxX0D2o9lYI/l7 2hZ2cix5EdimXU9zURQSJEsb4CuYYnbnuBhCCcHMJWrKRv5chh978RIKTMDLb6zfPJ 1wfpR26HKtaTxrHpsYYToZZlJlXA3fT15wX61MfCwjCq90WMWBsGbbgTQn4gH54u3M 8oqf/OYQecOALL5VabQwkJhMzvOYWdtvO2jJbL1o7zDtF/cMy27IcQnxxDwPiJeOT0 paJfKHpCVDp6g== From: nomike To: guix-patches@gnu.org Subject: [PATCH] gnu: Add pythonscad Date: Fri, 23 May 2025 04:00:40 +0200 Message-ID: <20250523020040.1756306-1-nomike@nomike.com> X-Mailer: git-send-email 2.49.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=23.83.218.246; envelope-from=nomike@nomike.com; helo=siberian.tulip.relay.mailchannels.net 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, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) X-Debbugs-Envelope-To: submit Cc: nomike X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.1 (/) * 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))) + (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" + "-DEXPERIMENTAL=ON" + "-DSNAPSHOT=ON" + "-DENABLE_PYTHON=ON" + (string-append "-DPYTHON_VERSION=" + (string-join (reverse (list-tail (reverse (string-split #$ + (package-version + (this-package-input + "python")) + #\.)) + 1)) ".")) + "-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) + ;; + (substitute* "cmake/Modules/FindLib3MF.cmake" + (("PC_LIB3MF_INCLUDE_DIRS") + "PC_LIB3MF_INCLUDEDIR")) + (substitute* "CMakeLists.txt" + ;; + (("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)") + ;; + (("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")))))))) + (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.")))) + + (define-public emacs-scad-mode (package (name "emacs-scad-mode") @@ -3349,8 +3422,8 @@ (define-public emacs-scad-mode @item Org Babel support (@code{scad} source blocks) @end itemize") - (home-page "https://openscad.org/") - (license license:gpl3+))) + (home-page "https://openscad.org/") + (license license:gpl3+))) (define-public emacs-scad-dbus (package -- 2.49.0 From debbugs-submit-bounces@debbugs.gnu.org Mon May 26 08:22:10 2025 Received: (at 78555) by debbugs.gnu.org; 26 May 2025 12:22:10 +0000 Received: from localhost ([127.0.0.1]:55685 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) 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 ) 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 To: nomike 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi! nomike 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) > + ;; 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: )." 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" > + ;; > + (("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)") > + ;; > + (("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 From debbugs-submit-bounces@debbugs.gnu.org Mon May 26 18:24:58 2025 Received: (at 78555) by debbugs.gnu.org; 26 May 2025 22:24:59 +0000 Received: from localhost ([127.0.0.1]:33095 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uJgFd-0000iw-Nc for submit@debbugs.gnu.org; Mon, 26 May 2025 18:24:58 -0400 Received: from sienna.cherry.relay.mailchannels.net ([23.83.223.165]:37311) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uJgFa-0000ii-6x for 78555@debbugs.gnu.org; Mon, 26 May 2025 18:24:55 -0400 X-Sender-Id: dreamhost|x-authsender|nomike@nomike.com Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id A508D21DFF; Mon, 26 May 2025 22:24:52 +0000 (UTC) Received: from pdx1-sub0-mail-a225.dreamhost.com (trex-green-9.trex.outbound.svc.cluster.local [100.117.211.132]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 459AB230DF; Mon, 26 May 2025 22:24:52 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1748298292; a=rsa-sha256; cv=none; b=PtFCRXdkdqZi4dCMrcnLk6a8PHndNipWJzsHoPkqZ2zFSxqJ+uzfLMsVW+SOWRR8V1iV8i FVVKpQfFVU4+5VwuNgH55pa3r3lrjJ5f9x2lpj+NYdkyXW471bUVlPqIfjGLDsZSB9L23Z VewPkp6hQVO1xjZjcfmIIg9FbZILjFc3J971TVTMNAH1RPVOQb/1x/dmCm84rYaMglv0gb jPd5qNI9t4OW4dFT0GSZghnH53BzOCbzkKGIedUX7mZOVmgq5DF/JMG2AcXP9uA8ED5lnU Rj1xS8gOASdohCZliteKUDYdWyilzPJrRRok6UC/uxBdQiGjOCjzXU5vTDRNLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1748298292; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:dkim-signature:autocrypt:autocrypt; bh=KqYmfHFaK+Bll3yMGLv5qr65bX5u7LxwftY5LTCj56I=; b=1Bd5Mp1LZIiAp0cfPuyL3AGNdWDhqIgXRQFLSEIyeCrBiLV7I0ka7M3cz57CgfK5LiGF/u zUkn1QEccv1N5y4Aph4DZ445HqcJ5yZmDBPY9YE/R6jytEF/b3FKHKrtORF0AaJh6Wd0Cc F9+SbIrbgh6yekax20NWQxxw8aluXIgPvWPbX7M+Tf8tjCrXbnnXVPMvwid9lSIIS7rwjm 1MhcYwo1uEei2CbjQieu/XmyOW0oGZE+nTD6LdiCdjC43ow0sn2+JYkasbvF1zUucDLVJj B8oGa3GXGWtqK1o9Zqs6U2ym25zTGYbGPlIN4CBbZHqbONCxupLjyLfOPSqSzQ== ARC-Authentication-Results: i=1; rspamd-5b49d78d5-j2kvp; auth=pass smtp.auth=dreamhost smtp.mailfrom=nomike@nomike.com X-Sender-Id: dreamhost|x-authsender|nomike@nomike.com X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|nomike@nomike.com X-MailChannels-Auth-Id: dreamhost X-Daffy-Tasty: 668bbc1b20841c7a_1748298292543_2320455520 X-MC-Loop-Signature: 1748298292543:1135794218 X-MC-Ingress-Time: 1748298292543 Received: from pdx1-sub0-mail-a225.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.117.211.132 (trex/7.0.3); Mon, 26 May 2025 22:24:52 +0000 Received: from [10.31.0.156] (84-112-221-106.cable.dynamic.surfer.at [84.112.221.106]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: nomike@nomike.com) by pdx1-sub0-mail-a225.dreamhost.com (Postfix) with ESMTPSA id 4b5r0z2p15z9y; Mon, 26 May 2025 15:24:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nomike.com; s=dreamhost; t=1748298292; bh=KqYmfHFaK+Bll3yMGLv5qr65bX5u7LxwftY5LTCj56I=; h=Content-Type:Date:Subject:To:Cc:From; b=pQSc9Y4bAqI6CW55KAQPONM0hRb98qrgTSaKHA1jIemJrWiqJHCXai6PVmIkCSxN9 zGLsdD6zGeu2OvYP24mIGJ4IqsiTWUIcG2GhRfnq0/XJr/9bL7ggAwk1p/MO3SnhHS uzPy2bWc64actXVME9RduPERorr9+qsdTtNRBdPGYbhG8EStS+Lskp9HuZ8LikbPO0 N7c4MgduC2a53w8N+foxsIS65uqNmYxjfsS4pn8gDbBG93CigYRO5M1V4sMdJRc4rf P98XPXJiOqa9ZU0lhWeOqUZpV3n03ntI5jlV8H7uxbBs24XV2hhGb06mAhnkTbLK6n riale8s+5S83Q== Content-Type: multipart/alternative; boundary="------------9cr79znCrNuAlmNUOLSCKZ88" Message-ID: <903915ad-aa9a-40ce-9ac3-0272ca35a1b6@nomike.com> Date: Tue, 27 May 2025 00:24:48 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [bug#78555] [PATCH] gnu: Add pythonscad To: Maxim Cournoyer References: <20250523020040.1756306-1-nomike@nomike.com> <871psbimu5.fsf@gmail.com> Content-Language: en-US From: "nomike (they/them)" Autocrypt: addr=nomike@nomike.com; keydata= xjMEZ+8bGhYJKwYBBAHaRw8BAQdAnX/6ThbmnmGYDNklZjA0bz600QNUdP+ajuwTe4TVe4PN L25vbWlrZSBQb3N0bWFubiAodGhleS90aGVtKSA8bm9taWtlQG5vbWlrZS5jb20+wpkEExYK AEECGwMFCQWjmoACHgcCF4AWIQRDQfMGyihCx53NO0tbWPztpJIHVwUCZ+8vPgULCQgHAgIi AgYVCgkICwIEFgIDAQAKCRBbWPztpJIHV6A3APoCTSYs7uR0ZoxGMoEFdDUdgbdmPFNZSNoA 3J5js9FQwgD/UUGwD9PCILmGZTeyG1BmUUFIDshW/NlKtgzc38AeRQ3OOARn7xsaEgorBgEE AZdVAQUBAQdAQYFr4LDmq9tDyrJ1hmbnQ18nN/TEzmM+X0Dc84f+51UDAQgHwn4EGBYKACYW IQRDQfMGyihCx53NO0tbWPztpJIHVwUCZ+8bGgIbDAUJBaOagAAKCRBbWPztpJIHV549AQCo MLaLPJ8OhIRvEJkvS2nVEn+D/DKG7bxxbyvB5gwaqgEA3aVP643HUqWDp2u9q+57SCycExVI mOW3VG9jxDNJlAc= In-Reply-To: <871psbimu5.fsf@gmail.com> 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) This is a multi-part message in MIME format. --------------9cr79znCrNuAlmNUOLSCKZ88 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi! Thanks a lot for the detailed feedback. It is really valuable. On 26.05.25 14:21, Maxim Cournoyer wrote: > 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. I mainly copied this section from the openscad package definition, which I updated previously. I remember that there were some submodules which are exclusively for OpenSCAD which was the main reason for keeping them. Pythonscad is just a fork of OpenSCAD, but that means those submodules are now used by two packages, so it makes more sense to split them out into their own packages. I will work on that. >> "-DENABLE_TESTS=OFF" This was a recommendation from one of the OpenSCAD project team members. I was having some issues getting the test cases to succeed. Since then I have gained a lot more knowledge about OpenSCAD, CMake and guix, I will revisit this topic. >> + "-DEXPERIMENTAL=ON" The deal with this flag: OpenSCAD is a 3D design tool where you create your object by writing code in a DSL (pythonscad adds python support on top of that). There are commands like cube() or sphere() to create objects. There are some commands though, which the project deems experimental. For example roof(), which adds a roof over a 2D polygon. Apart from `-DEXPERIMENTAL=ON` during building, users also have to enable those experimental language features individually in the preferences of OpenSCAD. So I don't really see any harm in having this flag enabled, but the benefit for users to having new functions available. As they still need to be enabled explicitly in the application preferences, users relying on production grade fully tested features only are unlikely to bump into this. I will however, raise a ticket with the upstream project as the preferences page only labels them as "Features" and doesn't highlight their experimental nature. IMHO it should either be clear from the GUI, that those features are experimental or, if they are no longer experimental, they should be included in the build even if `-DEXPERIMENTAL=OFF`. The point for pythonscad in particular however is, that the whole program is still experimental. So while it might be possible to set EXPERIMENTAL to OFF in package openscad, this will not work for pythonscad. An issue I have with OpenSCAD is that their last release is from January 2021. Since then the project has evolved a lot, but the devs always restrained from creating new release citing that they just need a little bit more time to stabilize things. This seems to have been going on for a while and I suspect they are knees-deep into feature-creep. As to them, the next release is right around the corner, but whether this really happen, we'll see. Meanwhile the 2021.01 release is quit outdated and I've been told a number of times by project members to use the nightly builds, as they are more modern, have a bunch of really useful new features and the project team considers them to be quite stable already. I'm not really happy with that situation, having a package in guix which is based on a git commit and not on an official release, but as far as I can tell most people starting with OpenSCAD use the version supplied by their OS for a few days and then quickly switch to a nightly from snap or flatpak and I've been using a recent snapshot version for months now, without issues. So I figured this would still serve our users best. I will also stay behind updates and will try for the guix packages not to fall behind too far. As for pythonscad: There hasn't been any release yet, so there it's anyway the only thing we can do for now. >> + "-DSNAPSHOT=ON" You're right, this is not needed. As the default is set to OFF, I will just remove this. >> + "-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. Thanks, I changed the code accordingly. I have an issue with the column lengths though: I'm using emacs with aut-fill-mode to edit the source, which will take care of not to exceed the 80 column limit. I've also checked things manually to make sure. The GUIX manual about how to submit patches though, says that I should run `guix style` before submitting the patch. And if I do that, it undos my changes and the code exceeds the 80-column barrier again. First of all, I'm not sure which has more precedence in this case. I guess it's the 80-column rule, but that would then mean that `guix style` is buggy and that I should file a bug report, right? >> + "-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) >> + ;; > 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: > )." 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). I will add more verbose commentary about those upstream tickets. But here I again have an issue with the 80 columns rule: For some files there is only one patch, for some there are multiple. In case of multiple patches, I have to put the comment right above the patch of course. But this means that the start of the comment is already quite far to the right. Especially with those URLS to the upstream tickets. it's over 80 columns with the URL alone. I think I'm not supposed to put a line-break directly inside the URL, or am I (or use a "\" before the line-break)? The whole idea of keeping things below 80 columns is to increase readability, but if I break an URL in half, it would IMHO decrease readability a lot, working against the nature of the 80-column rule. Any advice about what I should to here? >> + (substitute* "cmake/Modules/FindLib3MF.cmake" >> + (("PC_LIB3MF_INCLUDE_DIRS") >> + "PC_LIB3MF_INCLUDEDIR")) >> + (substitute* "CMakeLists.txt" >> + ;; >> + (("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)") >> + ;; >> + (("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. Great suggestion. I will do that. >> + (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. Yes, makes sense. It's more likely however, that people read the start of a paragraph while skipping the end, rather than the other way around. So maybe it would be better to first have a bit of text explaining what sets pythonscad appart from OpenSCAD, and following that with parts of the the package description of OpenSCAD. What do you think? > Could you please send a v2 with the above comments taken into > consideration? > Will do, once all these things are discussed and addressed. Thanks again for the review! nomike --------------9cr79znCrNuAlmNUOLSCKZ88 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit
Hi!

Thanks a lot for the detailed feedback. It is really valuable.

On 26.05.25 14:21, Maxim Cournoyer wrote:
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.

I mainly copied this section from the openscad package definition, which I updated previously.
I remember that there were some submodules which are exclusively for OpenSCAD which was the main reason for keeping them.
Pythonscad is just a fork of OpenSCAD, but that means those submodules are now used by two packages, so it makes more sense to split them out into their own packages.

I will work on that.

 "-DENABLE_TESTS=OFF"

This was a recommendation from one of the OpenSCAD project team members. I was having some issues getting the test cases to succeed. Since then I have gained a lot more knowledge about OpenSCAD, CMake and guix, I will revisit this topic.

+                "-DEXPERIMENTAL=ON"

The deal with this flag: OpenSCAD is a 3D design tool where you create your object by writing code in a DSL (pythonscad adds python support on top of that). There are commands like cube() or sphere() to create objects.
There are some commands though, which the project deems experimental. For example roof(), which adds a roof over a 2D polygon. Apart from `-DEXPERIMENTAL=ON` during building, users also have to enable those experimental language features individually in the preferences of OpenSCAD. So I don't really see any harm in having this flag enabled, but the benefit for users to having new functions available. As they still need to be enabled explicitly in the application preferences, users relying on production grade fully tested features only are unlikely to bump into this.

I will however, raise a ticket with the upstream project as the preferences page only labels them as "Features" and doesn't highlight their experimental nature. IMHO it should either be clear from the GUI, that those features are experimental or, if they are no longer experimental, they should be included in the build even if `-DEXPERIMENTAL=OFF`.

The point for pythonscad in particular however is, that the whole program is still experimental. So while it might be possible to set EXPERIMENTAL to OFF in package openscad, this will not work for pythonscad.

An issue I have with OpenSCAD is that their last release is from January 2021. Since then the project has evolved a lot, but the devs always restrained from creating new release citing that they just need a little bit more time to stabilize things. This seems to have been going on for a while and I suspect they are knees-deep into feature-creep. As to them, the next release is right around the corner, but whether this really happen, we'll see.

Meanwhile the 2021.01 release is quit outdated and I've been told a number of times by project members to use the nightly builds, as they are more modern, have a bunch of really useful new features and the project team considers them to be quite stable already.

I'm not really happy with that situation, having a package in guix which is based on a git commit and not on an official release, but as far as I can tell most people starting with OpenSCAD use the version supplied by their OS for a few days and then quickly switch to a nightly from snap or flatpak and I've been using a recent snapshot version for months now, without issues. So I figured this would still serve our users best.

I will also stay behind updates and will try for the guix packages not to fall behind too far.

As for pythonscad: There hasn't been any release yet, so there it's anyway the only thing we can do for now.

+                "-DSNAPSHOT=ON"

You're right, this is not needed. As the default is set to OFF, I will just remove this.

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

Thanks, I changed the code accordingly.
I have an issue with the column lengths though:
I'm using emacs with aut-fill-mode to edit the source, which will take care of not to exceed the 80 column limit. I've also checked things manually to make sure.

The GUIX manual about how to submit patches though, says that I should run `guix style` before submitting the patch. And if I do that, it undos my changes and the code exceeds the 80-column barrier again.

First of all, I'm not sure which has more precedence in this case. I guess it's the 80-column rule, but that would then mean that `guix style` is buggy and that I should file a bug report, right?

+                "-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).

I will add more verbose commentary about those upstream tickets. But here I again have an issue with the 80 columns rule:

For some files there is only one patch, for some there are multiple. In case of multiple patches, I have to put the comment right above the patch of course. But this means that the start of the comment is already quite far to the right. Especially with those URLS to the upstream tickets. it's over 80 columns with the URL alone. I think I'm not supposed to put a line-break directly inside the URL, or am I (or use a "\" before the line-break)? The whole idea of keeping things below 80 columns is to increase readability, but if I break an URL in half, it would IMHO decrease readability a lot, working against the nature of the 80-column rule.

Any advice about what I should to here?

+                (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.
Great suggestion. I will do that.

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

Yes, makes sense.

It's more likely however, that people read the start of a paragraph while skipping the end, rather than the other way around. So maybe it would be better to first have a bit of text explaining what sets pythonscad appart from OpenSCAD, and following that with parts of the the package description of OpenSCAD.

What do you think?

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

Will do, once all these things are discussed and addressed.

Thanks again for the review!

nomike


--------------9cr79znCrNuAlmNUOLSCKZ88--