Package: guix-patches;
Reported by: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Date: Wed, 17 Jan 2024 22:42:02 UTC
Severity: normal
Tags: patch
Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 68554 in the body.
You can then email your comments to 68554 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
View this report as an mbox folder, status mbox, maintainer mbox
guix-patches <at> gnu.org
:bug#68554
; Package guix-patches
.
(Wed, 17 Jan 2024 22:42:02 GMT) Full text and rfc822 format available.Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
:guix-patches <at> gnu.org
.
(Wed, 17 Jan 2024 22:42:02 GMT) Full text and rfc822 format available.Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com> To: guix-patches <at> gnu.org Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com> Subject: [PATCH 0/3] Add DMD, the D language reference compiler. Date: Wed, 17 Jan 2024 17:41:26 -0500
This series adds DMD, bootstrapped via GDC. Maxim Cournoyer (3): gnu: Add gdc alias. gnu: gdmd: Replace gdc-11 with gdc alias. gnu: Add dmd. gnu/packages/dlang.scm | 167 ++++++++++++++++++++++++++++++++++++++++- gnu/packages/gcc.scm | 6 ++ 2 files changed, 171 insertions(+), 2 deletions(-) base-commit: 8ca490e6600c55b2dab5db12cf1aefa2b1b27f9a -- 2.41.0
maxim.cournoyer <at> gmail.com, ludo <at> gnu.org, guix-patches <at> gnu.org
:bug#68554
; Package guix-patches
.
(Thu, 18 Jan 2024 00:25:01 GMT) Full text and rfc822 format available.Message #8 received at 68554 <at> debbugs.gnu.org (full text, mbox):
From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com> To: 68554 <at> debbugs.gnu.org Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com> Subject: [PATCH 1/3] gnu: Add gdc alias. Date: Wed, 17 Jan 2024 19:24:31 -0500
* gnu/packages/gcc.scm (gdc): New variable. Change-Id: I38447e46ffba44d3a9d3757d34fe9ff081803457 --- gnu/packages/gcc.scm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm index 5590cd3d7e..3ee7afb97f 100644 --- a/gnu/packages/gcc.scm +++ b/gnu/packages/gcc.scm @@ -1118,6 +1118,12 @@ (define-public gdc-11 (custom-gcc gcc-11 "gdc" '("d") %generic-search-paths))) +;;; Alias tracking the latest GDC version. +(define-public gdc + (hidden-package + (custom-gcc gcc "gdc" '("d") + %generic-search-paths))) + (define-public (make-libgccjit gcc) (package (inherit gcc) -- 2.41.0
maxim.cournoyer <at> gmail.com, guix-patches <at> gnu.org
:bug#68554
; Package guix-patches
.
(Thu, 18 Jan 2024 00:26:01 GMT) Full text and rfc822 format available.Message #11 received at 68554 <at> debbugs.gnu.org (full text, mbox):
From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com> To: 68554 <at> debbugs.gnu.org Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com> Subject: [PATCH 2/3] gnu: gdmd: Replace gdc-11 with gdc alias. Date: Wed, 17 Jan 2024 19:24:32 -0500
* gnu/packages/dlang.scm (gdmd) [inputs]: Replace gdc-11 with gdc. Change-Id: Ie035bb79c128c266cee85cf11bf79216f4f8b454 --- gnu/packages/dlang.scm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gnu/packages/dlang.scm b/gnu/packages/dlang.scm index 61823714f6..5c9766110d 100644 --- a/gnu/packages/dlang.scm +++ b/gnu/packages/dlang.scm @@ -136,8 +136,7 @@ (define-public gdmd (string-append "my $gdc_dir = \"" (dirname (search-input-file inputs "/bin/gdc")) "\";\n")))))))) - (inputs - (list gdc-11 perl)) + (inputs (list gdc perl)) (home-page "https://github.com/D-Programming-GDC/gdmd") (synopsis "DMD-like wrapper for GDC") (description "This package provides a DMD-like wrapper for the -- 2.41.0
maxim.cournoyer <at> gmail.com, guix-patches <at> gnu.org
:bug#68554
; Package guix-patches
.
(Thu, 18 Jan 2024 00:26:02 GMT) Full text and rfc822 format available.Message #14 received at 68554 <at> debbugs.gnu.org (full text, mbox):
From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com> To: 68554 <at> debbugs.gnu.org Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com> Subject: [PATCH 3/3] gnu: Add dmd. Date: Wed, 17 Jan 2024 19:24:33 -0500
* gnu/packages/dlang.scm (dmd-bootstrap, dmd): New variables. Change-Id: I53e00a429e2084a392341ef1bc7ea63f0fcaaab4 --- gnu/packages/dlang.scm | 164 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 164 insertions(+) diff --git a/gnu/packages/dlang.scm b/gnu/packages/dlang.scm index 5c9766110d..dd7951e01d 100644 --- a/gnu/packages/dlang.scm +++ b/gnu/packages/dlang.scm @@ -358,6 +358,170 @@ (define-public ldc `(("clang" ,clang-14) ;propagates llvm and clang-runtime ("python-lit" ,python-lit)))))) +;;; Bootstrap version of phobos that is built with GDC, using GDC's standard +;;; library. +(define dmd-bootstrap + (package + ;; This package is purposefully named just "dmd" and not "dmd-bootstrap", + ;; as the final dmd package rewrites references from this one to itself, + ;; and their names must have the same length to avoid corrupting the + ;; binary. + (name "dmd") + (version "2.106.1") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/dlang/dmd") + (commit (string-append "v" version)))) + (file-name (git-file-name "dmd" version)) + (sha256 + (base32 + "1bq4jws1vns2jjzfz7biyngrx9y5pvvgklymhrvb5kvbzky1ldmy")))) + (build-system gnu-build-system) + (arguments + (list + #:disallowed-references (list (gexp-input (canonical-package gcc) + "lib")) + ;; Disable tests, as gdmd cannot cope with some arguments used such as + ;; '-conf'. + #:tests? #f + #:test-target "test" + #:make-flags + #~(list (string-append "CC=" #$(cc-for-target)) + ;; XXX: Proceed despite conflicts from symbols provided by both + ;; the source built and GDC. + "DFLAGS=-L--allow-multiple-definition" + "ENABLE_RELEASE=1" + (string-append "HOST_CXX=" #$(cxx-for-target)) + "HOST_DMD=gdmd" + (string-append "INSTALL_DIR=" #$output) + ;; Do not build the shared libphobos2.so library, to avoid + ;; retaining a reference to gcc:lib. + "SHARED=0" + (string-append "SYSCONFDIR=" #$output "/etc") + "VERBOSE=1" + "-f" "posix.mak") + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'copy-phobos-source-and-chdir + ;; Start with building phobos, which in turns will automatically + ;; build druntime and dmd. A minimal dmd command is still + ;; required to do so, which is why we need dmd-bootstrap-0. + (lambda _ + (symlink "." "dmd") ;to please the build system expected layout + (copy-recursively + #$(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/dlang/phobos") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1yw7nb5d78cx9m7sfibv7rfc7wj3w0dw9mfk3d269qpfpnwzs4n9"))) + "phobos") + (chdir "phobos"))) + (add-after 'copy-phobos-source-and-chdir 'adjust-phobos-install-dirs + (lambda _ + (substitute* "posix.mak" + ;; Install to lib directory, not to e.g. 'linux/lib64'. + (("\\$\\(INSTALL_DIR)/\\$\\(OS)/\\$\\(lib_dir)") + (string-append #$output "/lib")) + ;; Do not install license file, already done by the gnu build + ;; system. + ((".*\\$\\(INSTALL_DIR)/phobos-LICENSE.txt.*") "")))) + (delete 'configure) + (add-after 'install 'install-druntime + (lambda args + (chdir "../druntime") + (apply (assoc-ref %standard-phases 'install) args) + (chdir ".."))) + (add-after 'install-druntime 'install-includes + (lambda _ + ;; Normalize the include files prefix to include/dmd. + (let ((include-dir (string-append #$output "/include/dmd"))) + (mkdir-p include-dir) + (rename-file (string-append #$output "/src/phobos") + (string-append include-dir)) + (copy-recursively "druntime/import" include-dir)) + (delete-file-recursively (string-append #$output "/src")))) + (add-after 'install-druntime 'install-dmd + (assoc-ref %standard-phases 'install)) + (add-after 'install-license-files 'refine-install-layout + (lambda _ + (let* ((docdir (string-append #$output "/share/doc/" + (strip-store-file-name #$output))) + ;; The dmd binary gets installed to + ;; e.g. /linux/bin64/dmd. + (dmd (car (find-files #$output "^dmd$"))) + (dmd.conf (car (find-files #$output "^dmd.conf$"))) + (os-dir (dirname (dirname dmd)))) + ;; Move samples from root to the doc directory. + (rename-file (string-append #$output "/samples") + (string-append docdir "/samples")) + ;; Remove duplicate license file. + (delete-file (string-append #$output + "/dmd-boostlicense.txt")) + ;; Move dmd binary and dmd.conf. + (install-file dmd (string-append #$output "/bin")) + (install-file dmd.conf (string-append #$output "/etc")) + (delete-file-recursively os-dir)))) + (add-after 'refine-install-layout 'patch-dmd.conf + (lambda* (#:key outputs #:allow-other-keys) + (substitute* (search-input-file outputs "etc/dmd.conf") + (("lib(32|64)") + "lib") + (("\\.\\./src/(phobos|druntime/import)") + "include/dmd"))))))) + (native-inputs (list gdmd which)) + (home-page "https://github.com/dlang/dmd") + (synopsis "Reference D Programming Language compiler") + (description "@acronym{DMD, Digital Mars D compiler} is the reference +compiler for the D programming language.") + (license license:boost1.0))) + +;;; Second bootstrap of DMD, built using dmd-bootstrap, with its shared +;;; libraries preserved. +(define-public dmd + (package + (inherit dmd-bootstrap) + (arguments + (substitute-keyword-arguments + (strip-keyword-arguments + '(#:tests?) ;reinstate tests + (package-arguments dmd-bootstrap)) + ((#:disallowed-references _ ''()) + (list dmd-bootstrap)) + ((#:make-flags _ ''()) + #~(list (string-append "CC=" #$(cc-for-target)) + "ENABLE_RELEASE=1" + (string-append "HOST_CXX=" #$(cxx-for-target)) + (string-append "INSTALL_DIR=" #$output) + "VERBOSE=1" + "-f" "posix.mak")) + ((#:phases phases '%standard-phases) + #~(modify-phases #$phases + (add-after 'patch-dmd.conf 'rewrite-references-to-bootstrap + ;; DMD keeps references to include files used to build a + ;; binary. Rewrite those of dmd-bootstrap to itself, to reduce + ;; its closure size. + (lambda* (#:key native-inputs inputs outputs + #:allow-other-keys) + (let ((dmd (search-input-file outputs "bin/dmd")) + (dmd-bootstrap (dirname + (dirname + (search-input-file + (or native-inputs inputs) + "bin/dmd"))))) + ;; XXX: Use sed, as replace-store-references wouldn't + ;; replace the references, while substitute* throws an + ;; error. + (invoke "sed" "-i" + (format #f "s,~a,~a,g" dmd-bootstrap #$output) + dmd)))))))) + (native-inputs (modify-inputs (package-native-inputs dmd-bootstrap) + (replace "gdmd" dmd-bootstrap))))) + (define-public dub (package (name "dub") -- 2.41.0
guix-patches <at> gnu.org
:bug#68554
; Package guix-patches
.
(Thu, 18 Jan 2024 03:30:02 GMT) Full text and rfc822 format available.Message #17 received at 68554 <at> debbugs.gnu.org (full text, mbox):
From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com> To: 68554 <at> debbugs.gnu.org Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com> Subject: [PATCH v2 0/3] Add DMD, the D language reference compiler. Date: Wed, 17 Jan 2024 22:28:22 -0500
This series adds DMD, bootstrapped via GDC. Changes in v2: - Build dmd make flags via inheritance... - ... fixing the missing SYSCONFDIR make flag Maxim Cournoyer (3): gnu: Add gdc alias. gnu: gdmd: Replace gdc-11 with gdc alias. gnu: Add dmd. gnu/packages/dlang.scm | 168 ++++++++++++++++++++++++++++++++++++++++- gnu/packages/gcc.scm | 6 ++ 2 files changed, 172 insertions(+), 2 deletions(-) base-commit: 8ca490e6600c55b2dab5db12cf1aefa2b1b27f9a -- 2.41.0
ludo <at> gnu.org, guix-patches <at> gnu.org
:bug#68554
; Package guix-patches
.
(Thu, 18 Jan 2024 03:30:02 GMT) Full text and rfc822 format available.Message #20 received at 68554 <at> debbugs.gnu.org (full text, mbox):
From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com> To: 68554 <at> debbugs.gnu.org Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com> Subject: [PATCH v2 1/3] gnu: Add gdc alias. Date: Wed, 17 Jan 2024 22:28:23 -0500
* gnu/packages/gcc.scm (gdc): New variable. Change-Id: I38447e46ffba44d3a9d3757d34fe9ff081803457 --- (no changes since v1) gnu/packages/gcc.scm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm index 5590cd3d7e..3ee7afb97f 100644 --- a/gnu/packages/gcc.scm +++ b/gnu/packages/gcc.scm @@ -1118,6 +1118,12 @@ (define-public gdc-11 (custom-gcc gcc-11 "gdc" '("d") %generic-search-paths))) +;;; Alias tracking the latest GDC version. +(define-public gdc + (hidden-package + (custom-gcc gcc "gdc" '("d") + %generic-search-paths))) + (define-public (make-libgccjit gcc) (package (inherit gcc) -- 2.41.0
guix-patches <at> gnu.org
:bug#68554
; Package guix-patches
.
(Thu, 18 Jan 2024 03:30:03 GMT) Full text and rfc822 format available.Message #23 received at 68554 <at> debbugs.gnu.org (full text, mbox):
From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com> To: 68554 <at> debbugs.gnu.org Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com> Subject: [PATCH v2 2/3] gnu: gdmd: Replace gdc-11 with gdc alias. Date: Wed, 17 Jan 2024 22:28:24 -0500
* gnu/packages/dlang.scm (gdmd) [inputs]: Replace gdc-11 with gdc. Change-Id: Ie035bb79c128c266cee85cf11bf79216f4f8b454 --- (no changes since v1) gnu/packages/dlang.scm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gnu/packages/dlang.scm b/gnu/packages/dlang.scm index 61823714f6..5c9766110d 100644 --- a/gnu/packages/dlang.scm +++ b/gnu/packages/dlang.scm @@ -136,8 +136,7 @@ (define-public gdmd (string-append "my $gdc_dir = \"" (dirname (search-input-file inputs "/bin/gdc")) "\";\n")))))))) - (inputs - (list gdc-11 perl)) + (inputs (list gdc perl)) (home-page "https://github.com/D-Programming-GDC/gdmd") (synopsis "DMD-like wrapper for GDC") (description "This package provides a DMD-like wrapper for the -- 2.41.0
guix-patches <at> gnu.org
:bug#68554
; Package guix-patches
.
(Thu, 18 Jan 2024 03:30:03 GMT) Full text and rfc822 format available.Message #26 received at 68554 <at> debbugs.gnu.org (full text, mbox):
From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com> To: 68554 <at> debbugs.gnu.org Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com> Subject: [PATCH v2 3/3] gnu: Add dmd. Date: Wed, 17 Jan 2024 22:28:25 -0500
* gnu/packages/dlang.scm (dmd-bootstrap, dmd): New variables. Change-Id: I53e00a429e2084a392341ef1bc7ea63f0fcaaab4 --- Changes in v2: - Build make flags via inheritance... - Fixing the missing SYSCONFDIR make flag gnu/packages/dlang.scm | 165 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 165 insertions(+) diff --git a/gnu/packages/dlang.scm b/gnu/packages/dlang.scm index 5c9766110d..f8060fa0c3 100644 --- a/gnu/packages/dlang.scm +++ b/gnu/packages/dlang.scm @@ -358,6 +358,171 @@ (define-public ldc `(("clang" ,clang-14) ;propagates llvm and clang-runtime ("python-lit" ,python-lit)))))) +;;; Bootstrap version of phobos that is built with GDC, using GDC's standard +;;; library. +(define dmd-bootstrap + (package + ;; This package is purposefully named just "dmd" and not "dmd-bootstrap", + ;; as the final dmd package rewrites references from this one to itself, + ;; and their names must have the same length to avoid corrupting the + ;; binary. + (name "dmd") + (version "2.106.1") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/dlang/dmd") + (commit (string-append "v" version)))) + (file-name (git-file-name "dmd" version)) + (sha256 + (base32 + "1bq4jws1vns2jjzfz7biyngrx9y5pvvgklymhrvb5kvbzky1ldmy")))) + (build-system gnu-build-system) + (arguments + (list + #:disallowed-references (list (gexp-input (canonical-package gcc) + "lib")) + ;; Disable tests, as gdmd cannot cope with some arguments used such as + ;; '-conf'. + #:tests? #f + #:test-target "test" + #:make-flags + #~(list (string-append "CC=" #$(cc-for-target)) + ;; XXX: Proceed despite conflicts from symbols provided by both + ;; the source built and GDC. + "DFLAGS=-L--allow-multiple-definition" + "ENABLE_RELEASE=1" + (string-append "HOST_CXX=" #$(cxx-for-target)) + "HOST_DMD=gdmd" + (string-append "INSTALL_DIR=" #$output) + ;; Do not build the shared libphobos2.so library, to avoid + ;; retaining a reference to gcc:lib. + "SHARED=0" + (string-append "SYSCONFDIR=" #$output "/etc") + "VERBOSE=1" + "-f" "posix.mak") + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'copy-phobos-source-and-chdir + ;; Start with building phobos, which in turns will automatically + ;; build druntime and dmd. A minimal dmd command is still + ;; required to do so, which is why we need dmd-bootstrap-0. + (lambda _ + (symlink "." "dmd") ;to please the build system expected layout + (copy-recursively + #$(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/dlang/phobos") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1yw7nb5d78cx9m7sfibv7rfc7wj3w0dw9mfk3d269qpfpnwzs4n9"))) + "phobos") + (chdir "phobos"))) + (add-after 'copy-phobos-source-and-chdir 'adjust-phobos-install-dirs + (lambda _ + (substitute* "posix.mak" + ;; Install to lib directory, not to e.g. 'linux/lib64'. + (("\\$\\(INSTALL_DIR)/\\$\\(OS)/\\$\\(lib_dir)") + (string-append #$output "/lib")) + ;; Do not install license file, already done by the gnu build + ;; system. + ((".*\\$\\(INSTALL_DIR)/phobos-LICENSE.txt.*") "")))) + (delete 'configure) + (add-after 'install 'install-druntime + (lambda args + (chdir "../druntime") + (apply (assoc-ref %standard-phases 'install) args) + (chdir ".."))) + (add-after 'install-druntime 'install-includes + (lambda _ + ;; Normalize the include files prefix to include/dmd. + (let ((include-dir (string-append #$output "/include/dmd"))) + (mkdir-p include-dir) + (rename-file (string-append #$output "/src/phobos") + (string-append include-dir)) + (copy-recursively "druntime/import" include-dir)) + (delete-file-recursively (string-append #$output "/src")))) + (add-after 'install-druntime 'install-dmd + (assoc-ref %standard-phases 'install)) + (add-after 'install-license-files 'refine-install-layout + (lambda _ + (let* ((docdir (string-append #$output "/share/doc/" + (strip-store-file-name #$output))) + ;; The dmd binary gets installed to + ;; e.g. /linux/bin64/dmd. + (dmd (car (find-files #$output "^dmd$"))) + (dmd.conf (car (find-files #$output "^dmd.conf$"))) + (os-dir (dirname (dirname dmd)))) + ;; Move samples from root to the doc directory. + (rename-file (string-append #$output "/samples") + (string-append docdir "/samples")) + ;; Remove duplicate license file. + (delete-file (string-append #$output + "/dmd-boostlicense.txt")) + ;; Move dmd binary and dmd.conf. + (install-file dmd (string-append #$output "/bin")) + (install-file dmd.conf (string-append #$output "/etc")) + (delete-file-recursively os-dir)))) + (add-after 'refine-install-layout 'patch-dmd.conf + (lambda* (#:key outputs #:allow-other-keys) + (substitute* (search-input-file outputs "etc/dmd.conf") + (("lib(32|64)") + "lib") + (("\\.\\./src/(phobos|druntime/import)") + "include/dmd"))))))) + (native-inputs (list gdmd which)) + (home-page "https://github.com/dlang/dmd") + (synopsis "Reference D Programming Language compiler") + (description "@acronym{DMD, Digital Mars D compiler} is the reference +compiler for the D programming language.") + (license license:boost1.0))) + +;;; Second bootstrap of DMD, built using dmd-bootstrap, with its shared +;;; libraries preserved. +(define-public dmd + (package + (inherit dmd-bootstrap) + (arguments + (substitute-keyword-arguments + (strip-keyword-arguments + '(#:tests?) ;reinstate tests + (package-arguments dmd-bootstrap)) + ((#:disallowed-references _ ''()) + (list dmd-bootstrap)) + ((#:modules _ ''()) + '((guix build gnu-build-system) + (guix build utils) + (srfi srfi-1))) ;for fold + ((#:make-flags flags ''()) + #~(fold delete #$flags '("DFLAGS=-L--allow-multiple-definition" + "HOST_DMD=gdmd" + "SHARED=0"))) + ((#:phases phases '%standard-phases) + #~(modify-phases #$phases + (add-after 'patch-dmd.conf 'rewrite-references-to-bootstrap + ;; DMD keeps references to include files used to build a + ;; binary. Rewrite those of dmd-bootstrap to itself, to reduce + ;; its closure size. + (lambda* (#:key native-inputs inputs outputs + #:allow-other-keys) + (let ((dmd (search-input-file outputs "bin/dmd")) + (dmd-bootstrap (dirname + (dirname + (search-input-file + (or native-inputs inputs) + "bin/dmd"))))) + ;; XXX: Use sed, as replace-store-references wouldn't + ;; replace the references, while substitute* throws an + ;; error. + (invoke "sed" "-i" + (format #f "s,~a,~a,g" dmd-bootstrap #$output) + dmd)))))))) + (native-inputs (modify-inputs (package-native-inputs dmd-bootstrap) + (replace "gdmd" dmd-bootstrap))))) + (define-public dub (package (name "dub") -- 2.41.0
andreas <at> enge.fr, maxim.cournoyer <at> gmail.com, iyzsong <at> envs.net, guix-patches <at> gnu.org
:bug#68554
; Package guix-patches
.
(Fri, 19 Jan 2024 04:42:02 GMT) Full text and rfc822 format available.Message #29 received at 68554 <at> debbugs.gnu.org (full text, mbox):
From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com> To: 68554 <at> debbugs.gnu.org Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com> Subject: [PATCH v3 0/6] Add DMD, the D language reference compiler. Date: Thu, 18 Jan 2024 23:40:38 -0500
This series adds DMD, bootstrapped via GDC. Changes in v3: - Add packages built from dmd and D demangling support to qt-creator Changes in v2: - Build make flags via inheritance... - Fixing the missing SYSCONFDIR make flag Maxim Cournoyer (6): gnu: Add gdc alias. gnu: gdmd: Replace gdc-11 with gdc alias. gnu: Add dmd. gnu: Add rust-rustc-demangle-capi-0.1. gnu: Add d-demangler. gnu: qt-creator: Add support for demangling D and Rust symbols. gnu/packages/crates-io.scm | 31 ++++++ gnu/packages/dlang.scm | 202 ++++++++++++++++++++++++++++++++++++- gnu/packages/gcc.scm | 6 ++ gnu/packages/qt.scm | 4 + 4 files changed, 240 insertions(+), 3 deletions(-) base-commit: 0eadd486484fcf9a234758842f74ba28361640db -- 2.41.0
ludo <at> gnu.org, guix-patches <at> gnu.org
:bug#68554
; Package guix-patches
.
(Fri, 19 Jan 2024 04:43:01 GMT) Full text and rfc822 format available.Message #32 received at 68554 <at> debbugs.gnu.org (full text, mbox):
From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com> To: 68554 <at> debbugs.gnu.org Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com> Subject: [PATCH v3 1/6] gnu: Add gdc alias. Date: Thu, 18 Jan 2024 23:40:39 -0500
* gnu/packages/gcc.scm (gdc): New variable. Change-Id: I38447e46ffba44d3a9d3757d34fe9ff081803457 --- (no changes since v1) gnu/packages/gcc.scm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm index 6eb01f33a6..5344278174 100644 --- a/gnu/packages/gcc.scm +++ b/gnu/packages/gcc.scm @@ -1124,6 +1124,12 @@ (define-public gdc-11 (custom-gcc gcc-11 "gdc" '("d") %generic-search-paths))) +;;; Alias tracking the latest GDC version. +(define-public gdc + (hidden-package + (custom-gcc gcc "gdc" '("d") + %generic-search-paths))) + (define-public (make-libgccjit gcc) (package (inherit gcc) -- 2.41.0
guix-patches <at> gnu.org
:bug#68554
; Package guix-patches
.
(Fri, 19 Jan 2024 04:43:02 GMT) Full text and rfc822 format available.Message #35 received at 68554 <at> debbugs.gnu.org (full text, mbox):
From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com> To: 68554 <at> debbugs.gnu.org Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com> Subject: [PATCH v3 2/6] gnu: gdmd: Replace gdc-11 with gdc alias. Date: Thu, 18 Jan 2024 23:40:40 -0500
* gnu/packages/dlang.scm (gdmd) [inputs]: Replace gdc-11 with gdc. Change-Id: Ie035bb79c128c266cee85cf11bf79216f4f8b454 --- (no changes since v1) gnu/packages/dlang.scm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gnu/packages/dlang.scm b/gnu/packages/dlang.scm index 61823714f6..5c9766110d 100644 --- a/gnu/packages/dlang.scm +++ b/gnu/packages/dlang.scm @@ -136,8 +136,7 @@ (define-public gdmd (string-append "my $gdc_dir = \"" (dirname (search-input-file inputs "/bin/gdc")) "\";\n")))))))) - (inputs - (list gdc-11 perl)) + (inputs (list gdc perl)) (home-page "https://github.com/D-Programming-GDC/gdmd") (synopsis "DMD-like wrapper for GDC") (description "This package provides a DMD-like wrapper for the -- 2.41.0
guix-patches <at> gnu.org
:bug#68554
; Package guix-patches
.
(Fri, 19 Jan 2024 04:43:02 GMT) Full text and rfc822 format available.Message #38 received at 68554 <at> debbugs.gnu.org (full text, mbox):
From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com> To: 68554 <at> debbugs.gnu.org Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com> Subject: [PATCH v3 3/6] gnu: Add dmd. Date: Thu, 18 Jan 2024 23:40:41 -0500
* gnu/packages/dlang.scm (dmd-bootstrap, dmd): New variables. Change-Id: I53e00a429e2084a392341ef1bc7ea63f0fcaaab4 --- Changes in v3: - Add packages built from dmd and D demangling support to qt-creator Changes in v2: - Build make flags via inheritance... - Fixing the missing SYSCONFDIR make flag gnu/packages/dlang.scm | 165 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 165 insertions(+) diff --git a/gnu/packages/dlang.scm b/gnu/packages/dlang.scm index 5c9766110d..f8060fa0c3 100644 --- a/gnu/packages/dlang.scm +++ b/gnu/packages/dlang.scm @@ -358,6 +358,171 @@ (define-public ldc `(("clang" ,clang-14) ;propagates llvm and clang-runtime ("python-lit" ,python-lit)))))) +;;; Bootstrap version of phobos that is built with GDC, using GDC's standard +;;; library. +(define dmd-bootstrap + (package + ;; This package is purposefully named just "dmd" and not "dmd-bootstrap", + ;; as the final dmd package rewrites references from this one to itself, + ;; and their names must have the same length to avoid corrupting the + ;; binary. + (name "dmd") + (version "2.106.1") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/dlang/dmd") + (commit (string-append "v" version)))) + (file-name (git-file-name "dmd" version)) + (sha256 + (base32 + "1bq4jws1vns2jjzfz7biyngrx9y5pvvgklymhrvb5kvbzky1ldmy")))) + (build-system gnu-build-system) + (arguments + (list + #:disallowed-references (list (gexp-input (canonical-package gcc) + "lib")) + ;; Disable tests, as gdmd cannot cope with some arguments used such as + ;; '-conf'. + #:tests? #f + #:test-target "test" + #:make-flags + #~(list (string-append "CC=" #$(cc-for-target)) + ;; XXX: Proceed despite conflicts from symbols provided by both + ;; the source built and GDC. + "DFLAGS=-L--allow-multiple-definition" + "ENABLE_RELEASE=1" + (string-append "HOST_CXX=" #$(cxx-for-target)) + "HOST_DMD=gdmd" + (string-append "INSTALL_DIR=" #$output) + ;; Do not build the shared libphobos2.so library, to avoid + ;; retaining a reference to gcc:lib. + "SHARED=0" + (string-append "SYSCONFDIR=" #$output "/etc") + "VERBOSE=1" + "-f" "posix.mak") + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'copy-phobos-source-and-chdir + ;; Start with building phobos, which in turns will automatically + ;; build druntime and dmd. A minimal dmd command is still + ;; required to do so, which is why we need dmd-bootstrap-0. + (lambda _ + (symlink "." "dmd") ;to please the build system expected layout + (copy-recursively + #$(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/dlang/phobos") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1yw7nb5d78cx9m7sfibv7rfc7wj3w0dw9mfk3d269qpfpnwzs4n9"))) + "phobos") + (chdir "phobos"))) + (add-after 'copy-phobos-source-and-chdir 'adjust-phobos-install-dirs + (lambda _ + (substitute* "posix.mak" + ;; Install to lib directory, not to e.g. 'linux/lib64'. + (("\\$\\(INSTALL_DIR)/\\$\\(OS)/\\$\\(lib_dir)") + (string-append #$output "/lib")) + ;; Do not install license file, already done by the gnu build + ;; system. + ((".*\\$\\(INSTALL_DIR)/phobos-LICENSE.txt.*") "")))) + (delete 'configure) + (add-after 'install 'install-druntime + (lambda args + (chdir "../druntime") + (apply (assoc-ref %standard-phases 'install) args) + (chdir ".."))) + (add-after 'install-druntime 'install-includes + (lambda _ + ;; Normalize the include files prefix to include/dmd. + (let ((include-dir (string-append #$output "/include/dmd"))) + (mkdir-p include-dir) + (rename-file (string-append #$output "/src/phobos") + (string-append include-dir)) + (copy-recursively "druntime/import" include-dir)) + (delete-file-recursively (string-append #$output "/src")))) + (add-after 'install-druntime 'install-dmd + (assoc-ref %standard-phases 'install)) + (add-after 'install-license-files 'refine-install-layout + (lambda _ + (let* ((docdir (string-append #$output "/share/doc/" + (strip-store-file-name #$output))) + ;; The dmd binary gets installed to + ;; e.g. /linux/bin64/dmd. + (dmd (car (find-files #$output "^dmd$"))) + (dmd.conf (car (find-files #$output "^dmd.conf$"))) + (os-dir (dirname (dirname dmd)))) + ;; Move samples from root to the doc directory. + (rename-file (string-append #$output "/samples") + (string-append docdir "/samples")) + ;; Remove duplicate license file. + (delete-file (string-append #$output + "/dmd-boostlicense.txt")) + ;; Move dmd binary and dmd.conf. + (install-file dmd (string-append #$output "/bin")) + (install-file dmd.conf (string-append #$output "/etc")) + (delete-file-recursively os-dir)))) + (add-after 'refine-install-layout 'patch-dmd.conf + (lambda* (#:key outputs #:allow-other-keys) + (substitute* (search-input-file outputs "etc/dmd.conf") + (("lib(32|64)") + "lib") + (("\\.\\./src/(phobos|druntime/import)") + "include/dmd"))))))) + (native-inputs (list gdmd which)) + (home-page "https://github.com/dlang/dmd") + (synopsis "Reference D Programming Language compiler") + (description "@acronym{DMD, Digital Mars D compiler} is the reference +compiler for the D programming language.") + (license license:boost1.0))) + +;;; Second bootstrap of DMD, built using dmd-bootstrap, with its shared +;;; libraries preserved. +(define-public dmd + (package + (inherit dmd-bootstrap) + (arguments + (substitute-keyword-arguments + (strip-keyword-arguments + '(#:tests?) ;reinstate tests + (package-arguments dmd-bootstrap)) + ((#:disallowed-references _ ''()) + (list dmd-bootstrap)) + ((#:modules _ ''()) + '((guix build gnu-build-system) + (guix build utils) + (srfi srfi-1))) ;for fold + ((#:make-flags flags ''()) + #~(fold delete #$flags '("DFLAGS=-L--allow-multiple-definition" + "HOST_DMD=gdmd" + "SHARED=0"))) + ((#:phases phases '%standard-phases) + #~(modify-phases #$phases + (add-after 'patch-dmd.conf 'rewrite-references-to-bootstrap + ;; DMD keeps references to include files used to build a + ;; binary. Rewrite those of dmd-bootstrap to itself, to reduce + ;; its closure size. + (lambda* (#:key native-inputs inputs outputs + #:allow-other-keys) + (let ((dmd (search-input-file outputs "bin/dmd")) + (dmd-bootstrap (dirname + (dirname + (search-input-file + (or native-inputs inputs) + "bin/dmd"))))) + ;; XXX: Use sed, as replace-store-references wouldn't + ;; replace the references, while substitute* throws an + ;; error. + (invoke "sed" "-i" + (format #f "s,~a,~a,g" dmd-bootstrap #$output) + dmd)))))))) + (native-inputs (modify-inputs (package-native-inputs dmd-bootstrap) + (replace "gdmd" dmd-bootstrap))))) + (define-public dub (package (name "dub") -- 2.41.0
efraim <at> flashner.co.il, guix-patches <at> gnu.org
:bug#68554
; Package guix-patches
.
(Fri, 19 Jan 2024 04:43:03 GMT) Full text and rfc822 format available.Message #41 received at 68554 <at> debbugs.gnu.org (full text, mbox):
From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com> To: 68554 <at> debbugs.gnu.org Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com> Subject: [PATCH v3 4/6] gnu: Add rust-rustc-demangle-capi-0.1. Date: Thu, 18 Jan 2024 23:40:42 -0500
* gnu/packages/crates-io.scm (rust-rustc-demangle-capi-0.1): New variable. Change-Id: I98afb19ed4bdbcb9107a1ab30af49b055802b8b0 --- (no changes since v1) gnu/packages/crates-io.scm | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm index 1bfd8fb143..43d9e3cd60 100644 --- a/gnu/packages/crates-io.scm +++ b/gnu/packages/crates-io.scm @@ -64836,6 +64836,37 @@ (define-public rust-rustc-demangle-0.1 (license (list license:asl2.0 license:expat)))) +(define-public rust-rustc-demangle-capi-0.1 + (package + (name "rust-rustc-demangle-capi") + (version "0.1.0") + (source + (origin + (method url-fetch) + (uri (crate-uri "rustc-demangle-capi" version)) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 "1s2g4z1yrh1sxl4qkmpd19ss3x2lr9115vbir7pnhgy63r1d63yv")))) + (build-system cargo-build-system) + (arguments + (list + #:cargo-inputs `(("rust-rustc-demangle" ,rust-rustc-demangle-0.1)) + #:phases + #~(modify-phases %standard-phases + (add-after 'install 'install-c-library + (lambda _ + (install-file + (car (find-files "." "^rustc_demangle\\.h$")) + (string-append #$output "/include")) + (install-file + (car (find-files "." "^librustc_demangle.so$")) + (string-append #$output "/lib"))))))) + (home-page "https://github.com/alexcrichton/rustc-demangle") + (synopsis "C API for the @code{rustc-demangle} crate") + (description "This package provides a C API library for the +@code{rustc-demangle} crate.") + (license (list license:expat license:asl2.0)))) + (define-public rust-rustc-hash-1 (package (name "rust-rustc-hash") -- 2.41.0
guix-patches <at> gnu.org
:bug#68554
; Package guix-patches
.
(Fri, 19 Jan 2024 04:43:03 GMT) Full text and rfc822 format available.Message #44 received at 68554 <at> debbugs.gnu.org (full text, mbox):
From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com> To: 68554 <at> debbugs.gnu.org Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com> Subject: [PATCH v3 5/6] gnu: Add d-demangler. Date: Thu, 18 Jan 2024 23:40:43 -0500
* gnu/packages/dlang.scm (d-demangler): New variable. Change-Id: Ic1dc8fb8adc1b4be859552e4add074a35bdfc6d0 --- (no changes since v1) gnu/packages/dlang.scm | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/gnu/packages/dlang.scm b/gnu/packages/dlang.scm index f8060fa0c3..cf9d2208d7 100644 --- a/gnu/packages/dlang.scm +++ b/gnu/packages/dlang.scm @@ -6,7 +6,7 @@ ;;; Copyright © 2017, 2019, 2022 Tobias Geerinckx-Rice <me <at> tobias.gr> ;;; Copyright © 2020 Guy Fleury Iteriteka <gfleury <at> disroot.org> ;;; Copyright © 2021-2023 Efraim Flashner <efraim <at> flashner.co.il> -;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer <at> gmail.com> +;;; Copyright © 2021, 2024 Maxim Cournoyer <maxim.cournoyer <at> gmail.com> ;;; Copyright © 2022 ( <paren <at> disroot.org> ;;; Copyright © 2022 Esther Flashner <esther <at> flashner.co.il> ;;; @@ -617,3 +617,35 @@ (define-public gtkd (synopsis "D binding and OO wrapper of GTK+") (description "This package provides bindings to GTK+ for D.") (license license:lgpl2.1))) + +(define-public d-demangler + (package + (name "d-demangler") + (version "0.0.2") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/lievenhey/d_demangler") + (commit (string-append "version-" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "13lbbxlaa1mffjs57xchl1g6kyr5lxi0z5x7snyvym0knslxwx2g")))) + (build-system gnu-build-system) + (arguments + (list + #:tests? #f ;no test suite + #:make-flags #~(list (string-append "CC=" #$(cc-for-target)) + "d_demangle") + #:phases #~(modify-phases %standard-phases + (delete 'configure) + (replace 'install + (lambda _ + (install-file "libd_demangle.so" + (string-append #$output "/lib"))))))) + (native-inputs (list dmd)) + (home-page "https://github.com/lievenhey/d_demangler") + (synopsis "Utility to demangle D symbols") + (description "@command{d_demangle} is a small utility that can be used to +demangle D symbols. A shared library is also provided.") + (license license:gpl3+))) -- 2.41.0
andreas <at> enge.fr, maxim.cournoyer <at> gmail.com, iyzsong <at> envs.net, guix-patches <at> gnu.org
:bug#68554
; Package guix-patches
.
(Fri, 19 Jan 2024 04:43:03 GMT) Full text and rfc822 format available.Message #47 received at 68554 <at> debbugs.gnu.org (full text, mbox):
From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com> To: 68554 <at> debbugs.gnu.org Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com> Subject: [PATCH v3 6/6] gnu: qt-creator: Add support for demangling D and Rust symbols. Date: Thu, 18 Jan 2024 23:40:44 -0500
* gnu/packages/qt.scm (qt-creator) [inputs]: Add d-demangler and rust-rustc-demangle-capi-0.1. Change-Id: I13122c0d148f283268d59919ade1459b5c7012a5 --- (no changes since v1) gnu/packages/qt.scm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm index a6bbc2429a..ca935ba403 100644 --- a/gnu/packages/qt.scm +++ b/gnu/packages/qt.scm @@ -71,9 +71,11 @@ (define-module (gnu packages qt) #:use-module (gnu packages cmake) #:use-module (gnu packages compression) #:use-module (gnu packages cpp) + #:use-module (gnu packages crates-io) #:use-module (gnu packages cups) #:use-module (gnu packages curl) #:use-module (gnu packages databases) + #:use-module (gnu packages dlang) #:use-module (gnu packages documentation) #:use-module (gnu packages elf) #:use-module (gnu packages enchant) @@ -5150,6 +5152,7 @@ (define-public qt-creator coreutils-minimal clang clazy + d-demangler elfutils gdb kcachegrind @@ -5159,6 +5162,7 @@ (define-public qt-creator qtdeclarative qtshadertools qtsvg + rust-rustc-demangle-capi-0.1 yaml-cpp valgrind vulkan-loader -- 2.41.0
guix-patches <at> gnu.org
:bug#68554
; Package guix-patches
.
(Fri, 19 Jan 2024 09:39:02 GMT) Full text and rfc822 format available.Message #50 received at 68554 <at> debbugs.gnu.org (full text, mbox):
From: Efraim Flashner <efraim <at> flashner.co.il> To: Maxim Cournoyer <maxim.cournoyer <at> gmail.com> Cc: 68554 <at> debbugs.gnu.org Subject: Re: [bug#68554] [PATCH v3 3/6] gnu: Add dmd. Date: Fri, 19 Jan 2024 11:38:09 +0200
[Message part 1 (text/plain, inline)]
On Thu, Jan 18, 2024 at 11:40:41PM -0500, Maxim Cournoyer wrote: > * gnu/packages/dlang.scm (dmd-bootstrap, dmd): New variables. > > Change-Id: I53e00a429e2084a392341ef1bc7ea63f0fcaaab4 > --- > > Changes in v3: > - Add packages built from dmd and D demangling support to qt-creator > > Changes in v2: > - Build make flags via inheritance... > - Fixing the missing SYSCONFDIR make flag > > gnu/packages/dlang.scm | 165 +++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 165 insertions(+) > > diff --git a/gnu/packages/dlang.scm b/gnu/packages/dlang.scm > index 5c9766110d..f8060fa0c3 100644 > --- a/gnu/packages/dlang.scm > +++ b/gnu/packages/dlang.scm > @@ -358,6 +358,171 @@ (define-public ldc > `(("clang" ,clang-14) ;propagates llvm and clang-runtime > ("python-lit" ,python-lit)))))) > > +;;; Bootstrap version of phobos that is built with GDC, using GDC's standard > +;;; library. > +(define dmd-bootstrap > + (package > + ;; This package is purposefully named just "dmd" and not "dmd-bootstrap", > + ;; as the final dmd package rewrites references from this one to itself, > + ;; and their names must have the same length to avoid corrupting the > + ;; binary. > + (name "dmd") > + (version "2.106.1") > + (source (origin > + (method git-fetch) > + (uri (git-reference > + (url "https://github.com/dlang/dmd") > + (commit (string-append "v" version)))) > + (file-name (git-file-name "dmd" version)) > + (sha256 > + (base32 > + "1bq4jws1vns2jjzfz7biyngrx9y5pvvgklymhrvb5kvbzky1ldmy")))) > + (build-system gnu-build-system) > + (arguments > + (list > + #:disallowed-references (list (gexp-input (canonical-package gcc) > + "lib")) > + ;; Disable tests, as gdmd cannot cope with some arguments used such as > + ;; '-conf'. > + #:tests? #f > + #:test-target "test" > + #:make-flags > + #~(list (string-append "CC=" #$(cc-for-target)) > + ;; XXX: Proceed despite conflicts from symbols provided by both > + ;; the source built and GDC. > + "DFLAGS=-L--allow-multiple-definition" > + "ENABLE_RELEASE=1" > + (string-append "HOST_CXX=" #$(cxx-for-target)) > + "HOST_DMD=gdmd" > + (string-append "INSTALL_DIR=" #$output) > + ;; Do not build the shared libphobos2.so library, to avoid > + ;; retaining a reference to gcc:lib. > + "SHARED=0" > + (string-append "SYSCONFDIR=" #$output "/etc") > + "VERBOSE=1" > + "-f" "posix.mak") > + #:phases > + #~(modify-phases %standard-phases > + (add-after 'unpack 'copy-phobos-source-and-chdir > + ;; Start with building phobos, which in turns will automatically > + ;; build druntime and dmd. A minimal dmd command is still > + ;; required to do so, which is why we need dmd-bootstrap-0. > + (lambda _ > + (symlink "." "dmd") ;to please the build system expected layout > + (copy-recursively > + #$(origin > + (method git-fetch) > + (uri (git-reference > + (url "https://github.com/dlang/phobos") > + (commit (string-append "v" version)))) > + (file-name (git-file-name name version)) you should probably switch name to "phobos", otherwise I assume it'll be added as dmd. Also, is this the right way to add phobos as an input? > + (sha256 > + (base32 > + "1yw7nb5d78cx9m7sfibv7rfc7wj3w0dw9mfk3d269qpfpnwzs4n9"))) > + "phobos") > + (chdir "phobos"))) > + (add-after 'copy-phobos-source-and-chdir 'adjust-phobos-install-dirs > + (lambda _ > + (substitute* "posix.mak" > + ;; Install to lib directory, not to e.g. 'linux/lib64'. > + (("\\$\\(INSTALL_DIR)/\\$\\(OS)/\\$\\(lib_dir)") > + (string-append #$output "/lib")) > + ;; Do not install license file, already done by the gnu build > + ;; system. > + ((".*\\$\\(INSTALL_DIR)/phobos-LICENSE.txt.*") "")))) > + (delete 'configure) > + (add-after 'install 'install-druntime > + (lambda args > + (chdir "../druntime") > + (apply (assoc-ref %standard-phases 'install) args) > + (chdir ".."))) Can this one be: (with-directory-excursion "../druntime" (apply (assoc-ref %standard-phases 'install) args)) > + (add-after 'install-druntime 'install-includes > + (lambda _ > + ;; Normalize the include files prefix to include/dmd. > + (let ((include-dir (string-append #$output "/include/dmd"))) > + (mkdir-p include-dir) > + (rename-file (string-append #$output "/src/phobos") > + (string-append include-dir)) > + (copy-recursively "druntime/import" include-dir)) > + (delete-file-recursively (string-append #$output "/src")))) > + (add-after 'install-druntime 'install-dmd > + (assoc-ref %standard-phases 'install)) Is this different than the regular install phase? > + (add-after 'install-license-files 'refine-install-layout > + (lambda _ > + (let* ((docdir (string-append #$output "/share/doc/" > + (strip-store-file-name #$output))) is strip-store-file-name better than #$name "-" #$version ? > + ;; The dmd binary gets installed to > + ;; e.g. /linux/bin64/dmd. > + (dmd (car (find-files #$output "^dmd$"))) > + (dmd.conf (car (find-files #$output "^dmd.conf$"))) > + (os-dir (dirname (dirname dmd)))) > + ;; Move samples from root to the doc directory. > + (rename-file (string-append #$output "/samples") > + (string-append docdir "/samples")) > + ;; Remove duplicate license file. > + (delete-file (string-append #$output > + "/dmd-boostlicense.txt")) > + ;; Move dmd binary and dmd.conf. > + (install-file dmd (string-append #$output "/bin")) > + (install-file dmd.conf (string-append #$output "/etc")) > + (delete-file-recursively os-dir)))) > + (add-after 'refine-install-layout 'patch-dmd.conf > + (lambda* (#:key outputs #:allow-other-keys) > + (substitute* (search-input-file outputs "etc/dmd.conf") I only see 1 output, so this should probably be (string-append #$output "/etc/dmd.conf") > + (("lib(32|64)") > + "lib") > + (("\\.\\./src/(phobos|druntime/import)") > + "include/dmd"))))))) > + (native-inputs (list gdmd which)) > + (home-page "https://github.com/dlang/dmd") > + (synopsis "Reference D Programming Language compiler") > + (description "@acronym{DMD, Digital Mars D compiler} is the reference > +compiler for the D programming language.") > + (license license:boost1.0))) > + > +;;; Second bootstrap of DMD, built using dmd-bootstrap, with its shared > +;;; libraries preserved. > +(define-public dmd > + (package > + (inherit dmd-bootstrap) > + (arguments > + (substitute-keyword-arguments > + (strip-keyword-arguments > + '(#:tests?) ;reinstate tests > + (package-arguments dmd-bootstrap)) > + ((#:disallowed-references _ ''()) > + (list dmd-bootstrap)) > + ((#:modules _ ''()) > + '((guix build gnu-build-system) > + (guix build utils) > + (srfi srfi-1))) ;for fold > + ((#:make-flags flags ''()) > + #~(fold delete #$flags '("DFLAGS=-L--allow-multiple-definition" > + "HOST_DMD=gdmd" > + "SHARED=0"))) > + ((#:phases phases '%standard-phases) > + #~(modify-phases #$phases > + (add-after 'patch-dmd.conf 'rewrite-references-to-bootstrap > + ;; DMD keeps references to include files used to build a > + ;; binary. Rewrite those of dmd-bootstrap to itself, to reduce > + ;; its closure size. > + (lambda* (#:key native-inputs inputs outputs > + #:allow-other-keys) > + (let ((dmd (search-input-file outputs "bin/dmd")) > + (dmd-bootstrap (dirname > + (dirname > + (search-input-file > + (or native-inputs inputs) > + "bin/dmd"))))) > + ;; XXX: Use sed, as replace-store-references wouldn't > + ;; replace the references, while substitute* throws an > + ;; error. > + (invoke "sed" "-i" > + (format #f "s,~a,~a,g" dmd-bootstrap #$output) > + dmd)))))))) > + (native-inputs (modify-inputs (package-native-inputs dmd-bootstrap) > + (replace "gdmd" dmd-bootstrap))))) > + > (define-public dub > (package > (name "dub") > -- > 2.41.0 > > > > -- Efraim Flashner <efraim <at> flashner.co.il> רנשלפ םירפא GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted
[signature.asc (application/pgp-signature, inline)]
guix-patches <at> gnu.org
:bug#68554
; Package guix-patches
.
(Fri, 19 Jan 2024 09:39:02 GMT) Full text and rfc822 format available.Message #53 received at 68554 <at> debbugs.gnu.org (full text, mbox):
From: Efraim Flashner <efraim <at> flashner.co.il> To: Maxim Cournoyer <maxim.cournoyer <at> gmail.com> Cc: Andreas Enge <andreas <at> enge.fr>, 宋文武 <iyzsong <at> envs.net>, 68554 <at> debbugs.gnu.org Subject: Re: [bug#68554] [PATCH v3 6/6] gnu: qt-creator: Add support for demangling D and Rust symbols. Date: Fri, 19 Jan 2024 11:38:43 +0200
[Message part 1 (text/plain, inline)]
I'm pretty sure dmd would be supported everywhere qtbase is, but rust-rustc-demangle-capi-0.1 should be wrapped with supported-package? On Thu, Jan 18, 2024 at 11:40:44PM -0500, Maxim Cournoyer wrote: > * gnu/packages/qt.scm (qt-creator) [inputs]: Add d-demangler and > rust-rustc-demangle-capi-0.1. > > Change-Id: I13122c0d148f283268d59919ade1459b5c7012a5 > --- > > (no changes since v1) > > gnu/packages/qt.scm | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm > index a6bbc2429a..ca935ba403 100644 > --- a/gnu/packages/qt.scm > +++ b/gnu/packages/qt.scm > @@ -71,9 +71,11 @@ (define-module (gnu packages qt) > #:use-module (gnu packages cmake) > #:use-module (gnu packages compression) > #:use-module (gnu packages cpp) > + #:use-module (gnu packages crates-io) > #:use-module (gnu packages cups) > #:use-module (gnu packages curl) > #:use-module (gnu packages databases) > + #:use-module (gnu packages dlang) > #:use-module (gnu packages documentation) > #:use-module (gnu packages elf) > #:use-module (gnu packages enchant) > @@ -5150,6 +5152,7 @@ (define-public qt-creator > coreutils-minimal > clang > clazy > + d-demangler > elfutils > gdb > kcachegrind > @@ -5159,6 +5162,7 @@ (define-public qt-creator > qtdeclarative > qtshadertools > qtsvg > + rust-rustc-demangle-capi-0.1 > yaml-cpp > valgrind > vulkan-loader > -- > 2.41.0 > > > > -- Efraim Flashner <efraim <at> flashner.co.il> רנשלפ םירפא GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted
[signature.asc (application/pgp-signature, inline)]
guix-patches <at> gnu.org
:bug#68554
; Package guix-patches
.
(Fri, 19 Jan 2024 09:40:01 GMT) Full text and rfc822 format available.Message #56 received at 68554 <at> debbugs.gnu.org (full text, mbox):
From: Efraim Flashner <efraim <at> flashner.co.il> To: Maxim Cournoyer <maxim.cournoyer <at> gmail.com> Cc: 68554 <at> debbugs.gnu.org Subject: Re: [bug#68554] [PATCH v3 4/6] gnu: Add rust-rustc-demangle-capi-0.1. Date: Fri, 19 Jan 2024 11:38:55 +0200
[Message part 1 (text/plain, inline)]
This package looks good to me On Thu, Jan 18, 2024 at 11:40:42PM -0500, Maxim Cournoyer wrote: > * gnu/packages/crates-io.scm (rust-rustc-demangle-capi-0.1): New variable. > > Change-Id: I98afb19ed4bdbcb9107a1ab30af49b055802b8b0 > --- > > (no changes since v1) > > gnu/packages/crates-io.scm | 31 +++++++++++++++++++++++++++++++ > 1 file changed, 31 insertions(+) > > diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm > index 1bfd8fb143..43d9e3cd60 100644 > --- a/gnu/packages/crates-io.scm > +++ b/gnu/packages/crates-io.scm > @@ -64836,6 +64836,37 @@ (define-public rust-rustc-demangle-0.1 > (license (list license:asl2.0 > license:expat)))) > > +(define-public rust-rustc-demangle-capi-0.1 > + (package > + (name "rust-rustc-demangle-capi") > + (version "0.1.0") > + (source > + (origin > + (method url-fetch) > + (uri (crate-uri "rustc-demangle-capi" version)) > + (file-name (string-append name "-" version ".tar.gz")) > + (sha256 > + (base32 "1s2g4z1yrh1sxl4qkmpd19ss3x2lr9115vbir7pnhgy63r1d63yv")))) > + (build-system cargo-build-system) > + (arguments > + (list > + #:cargo-inputs `(("rust-rustc-demangle" ,rust-rustc-demangle-0.1)) > + #:phases > + #~(modify-phases %standard-phases > + (add-after 'install 'install-c-library > + (lambda _ > + (install-file > + (car (find-files "." "^rustc_demangle\\.h$")) > + (string-append #$output "/include")) > + (install-file > + (car (find-files "." "^librustc_demangle.so$")) > + (string-append #$output "/lib"))))))) > + (home-page "https://github.com/alexcrichton/rustc-demangle") > + (synopsis "C API for the @code{rustc-demangle} crate") > + (description "This package provides a C API library for the > +@code{rustc-demangle} crate.") > + (license (list license:expat license:asl2.0)))) > + > (define-public rust-rustc-hash-1 > (package > (name "rust-rustc-hash") > -- > 2.41.0 > > > -- Efraim Flashner <efraim <at> flashner.co.il> רנשלפ םירפא GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted
[signature.asc (application/pgp-signature, inline)]
guix-patches <at> gnu.org
:bug#68554
; Package guix-patches
.
(Sat, 20 Jan 2024 04:04:01 GMT) Full text and rfc822 format available.Message #59 received at 68554 <at> debbugs.gnu.org (full text, mbox):
From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com> To: Efraim Flashner <efraim <at> flashner.co.il> Cc: 68554 <at> debbugs.gnu.org Subject: Re: [bug#68554] [PATCH v3 4/6] gnu: Add rust-rustc-demangle-capi-0.1. Date: Fri, 19 Jan 2024 23:03:27 -0500
Hi Efraim, Efraim Flashner <efraim <at> flashner.co.il> writes: > This package looks good to me I pushed just this one. Will send a v2 for the rest. -- Thanks, Maxim
guix-patches <at> gnu.org
:bug#68554
; Package guix-patches
.
(Sat, 20 Jan 2024 04:17:02 GMT) Full text and rfc822 format available.Message #62 received at 68554 <at> debbugs.gnu.org (full text, mbox):
From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com> To: Efraim Flashner <efraim <at> flashner.co.il> Cc: 68554 <at> debbugs.gnu.org Subject: Re: [bug#68554] [PATCH v3 3/6] gnu: Add dmd. Date: Fri, 19 Jan 2024 23:15:50 -0500
Hello! Efraim Flashner <efraim <at> flashner.co.il> writes: > On Thu, Jan 18, 2024 at 11:40:41PM -0500, Maxim Cournoyer wrote: >> * gnu/packages/dlang.scm (dmd-bootstrap, dmd): New variables. >> >> Change-Id: I53e00a429e2084a392341ef1bc7ea63f0fcaaab4 [...] >> +;;; Bootstrap version of phobos that is built with GDC, using GDC's standard >> +;;; library. >> +(define dmd-bootstrap >> + (package >> + ;; This package is purposefully named just "dmd" and not "dmd-bootstrap", >> + ;; as the final dmd package rewrites references from this one to itself, >> + ;; and their names must have the same length to avoid corrupting the >> + ;; binary. >> + (name "dmd") >> + (version "2.106.1") >> + (source (origin >> + (method git-fetch) >> + (uri (git-reference >> + (url "https://github.com/dlang/dmd") >> + (commit (string-append "v" version)))) >> + (file-name (git-file-name "dmd" version)) >> + (sha256 >> + (base32 >> + "1bq4jws1vns2jjzfz7biyngrx9y5pvvgklymhrvb5kvbzky1ldmy")))) >> + (build-system gnu-build-system) >> + (arguments >> + (list >> + #:disallowed-references (list (gexp-input (canonical-package gcc) >> + "lib")) >> + ;; Disable tests, as gdmd cannot cope with some arguments used such as >> + ;; '-conf'. >> + #:tests? #f >> + #:test-target "test" >> + #:make-flags >> + #~(list (string-append "CC=" #$(cc-for-target)) >> + ;; XXX: Proceed despite conflicts from symbols provided by both >> + ;; the source built and GDC. >> + "DFLAGS=-L--allow-multiple-definition" >> + "ENABLE_RELEASE=1" >> + (string-append "HOST_CXX=" #$(cxx-for-target)) >> + "HOST_DMD=gdmd" >> + (string-append "INSTALL_DIR=" #$output) >> + ;; Do not build the shared libphobos2.so library, to avoid >> + ;; retaining a reference to gcc:lib. >> + "SHARED=0" >> + (string-append "SYSCONFDIR=" #$output "/etc") >> + "VERBOSE=1" >> + "-f" "posix.mak") >> + #:phases >> + #~(modify-phases %standard-phases >> + (add-after 'unpack 'copy-phobos-source-and-chdir >> + ;; Start with building phobos, which in turns will automatically >> + ;; build druntime and dmd. A minimal dmd command is still >> + ;; required to do so, which is why we need dmd-bootstrap-0. >> + (lambda _ >> + (symlink "." "dmd") ;to please the build system expected layout >> + (copy-recursively >> + #$(origin >> + (method git-fetch) >> + (uri (git-reference >> + (url "https://github.com/dlang/phobos") >> + (commit (string-append "v" version)))) >> + (file-name (git-file-name name version)) > > you should probably switch name to "phobos", otherwise I assume it'll be > added as dmd. Good catch, done. > Also, is this the right way to add phobos as an input? It's the gexp way to add extra source files to a package workspace. We used to do this via labeled origins, but this is not possible in the label-less new world. I think it'd be cool to have a procedure that would take multiple source and merge them into one, possible using a copy-build-system like "plan" for the layout. Note: I tried building phobos separately at first, but that was a world of hurt, and the end result was a seg faulting dmd :-(. >> + (sha256 >> + (base32 >> + "1yw7nb5d78cx9m7sfibv7rfc7wj3w0dw9mfk3d269qpfpnwzs4n9"))) >> + "phobos") >> + (chdir "phobos"))) >> + (add-after 'copy-phobos-source-and-chdir 'adjust-phobos-install-dirs >> + (lambda _ >> + (substitute* "posix.mak" >> + ;; Install to lib directory, not to e.g. 'linux/lib64'. >> + (("\\$\\(INSTALL_DIR)/\\$\\(OS)/\\$\\(lib_dir)") >> + (string-append #$output "/lib")) >> + ;; Do not install license file, already done by the gnu build >> + ;; system. >> + ((".*\\$\\(INSTALL_DIR)/phobos-LICENSE.txt.*") "")))) >> + (delete 'configure) >> + (add-after 'install 'install-druntime >> + (lambda args >> + (chdir "../druntime") >> + (apply (assoc-ref %standard-phases 'install) args) >> + (chdir ".."))) > > Can this one be: > (with-directory-excursion "../druntime" > (apply (assoc-ref %standard-phases 'install) args)) Confusingly, no, as what I'm doing here is moving from ./phobos to ./druntime and finally to "."; i.e. the starting directory for the 'install-druntime phase is './phobos', not '.' Does that make some sense (writing it I'm doubtful, eh) ? > >> + (add-after 'install-druntime 'install-includes >> + (lambda _ >> + ;; Normalize the include files prefix to include/dmd. >> + (let ((include-dir (string-append #$output "/include/dmd"))) >> + (mkdir-p include-dir) >> + (rename-file (string-append #$output "/src/phobos") >> + (string-append include-dir)) >> + (copy-recursively "druntime/import" include-dir)) >> + (delete-file-recursively (string-append #$output "/src")))) >> + (add-after 'install-druntime 'install-dmd >> + (assoc-ref %standard-phases 'install)) > > Is this different than the regular install phase? I the install phase of druntime doesn't install its import includes, for some reason, and the install phase of phobos puts them under src/phobos instead of include/dmd. >> + (add-after 'install-license-files 'refine-install-layout >> + (lambda _ >> + (let* ((docdir (string-append #$output "/share/doc/" >> + (strip-store-file-name #$output))) > > is strip-store-file-name better than #$name "-" #$version ? I got bit by gexps being expanded in-place and not being rewritten in the inherited package, so to reuse that phase I had to use dynamic alternatives. >> + ;; The dmd binary gets installed to >> + ;; e.g. /linux/bin64/dmd. >> + (dmd (car (find-files #$output "^dmd$"))) >> + (dmd.conf (car (find-files #$output "^dmd.conf$"))) >> + (os-dir (dirname (dirname dmd)))) >> + ;; Move samples from root to the doc directory. >> + (rename-file (string-append #$output "/samples") >> + (string-append docdir "/samples")) >> + ;; Remove duplicate license file. >> + (delete-file (string-append #$output >> + "/dmd-boostlicense.txt")) >> + ;; Move dmd binary and dmd.conf. >> + (install-file dmd (string-append #$output "/bin")) >> + (install-file dmd.conf (string-append #$output "/etc")) >> + (delete-file-recursively os-dir)))) >> + (add-after 'refine-install-layout 'patch-dmd.conf >> + (lambda* (#:key outputs #:allow-other-keys) >> + (substitute* (search-input-file outputs "etc/dmd.conf") > > I only see 1 output, so this should probably be > (string-append #$output "/etc/dmd.conf") The search-input-file on outputs is a defensive trick: it fails with a clear error message when the file isn't found (I can't say that much about substitute* ^^'). So it's used here to test the file got installed there as expected. Thanks for taking a look! -- Maxim
guix-patches <at> gnu.org
:bug#68554
; Package guix-patches
.
(Sat, 20 Jan 2024 04:21:02 GMT) Full text and rfc822 format available.Message #65 received at 68554 <at> debbugs.gnu.org (full text, mbox):
From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com> To: Efraim Flashner <efraim <at> flashner.co.il> Cc: Andreas Enge <andreas <at> enge.fr>, 宋文武 <iyzsong <at> envs.net>, 68554 <at> debbugs.gnu.org Subject: Re: [bug#68554] [PATCH v3 6/6] gnu: qt-creator: Add support for demangling D and Rust symbols. Date: Fri, 19 Jan 2024 23:20:19 -0500
Hello, Efraim Flashner <efraim <at> flashner.co.il> writes: > I'm pretty sure dmd would be supported everywhere qtbase is, but > rust-rustc-demangle-capi-0.1 should be wrapped with supported-package? OK! I wasn't aware of supported-package?, thanks for suggesting. Should be in v4. -- Thanks, Maxim
andreas <at> enge.fr, maxim.cournoyer <at> gmail.com, iyzsong <at> envs.net, guix-patches <at> gnu.org
:bug#68554
; Package guix-patches
.
(Sat, 20 Jan 2024 04:42:02 GMT) Full text and rfc822 format available.Message #68 received at 68554 <at> debbugs.gnu.org (full text, mbox):
From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com> To: 68554 <at> debbugs.gnu.org Cc: efraim <at> flashner.co.il, Maxim Cournoyer <maxim.cournoyer <at> gmail.com> Subject: [PATCH v4 0/5] Add DMD, the D language reference compiler. Date: Fri, 19 Jan 2024 23:37:04 -0500
This series adds DMD, bootstrapped via GDC. Changes in v4: - Name phobos source as "phobos" (thanks to Efraim) - Only add rust-rustc-demangle-capi-0.1 input if supported Changes in v3: - Add packages built from dmd and D demangling support to qt-creator Changes in v2: - Build make flags via inheritance... - Fixing the missing SYSCONFDIR make flag Maxim Cournoyer (5): gnu: Add gdc alias. gnu: gdmd: Replace gdc-11 with gdc alias. gnu: Add dmd. gnu: Add d-demangler. gnu: qt-creator: Add support for demangling D and Rust symbols. gnu/packages/dlang.scm | 202 ++++++++++++++++++++++++++++++++++++++++- gnu/packages/gcc.scm | 6 ++ gnu/packages/qt.scm | 41 +++++---- 3 files changed, 229 insertions(+), 20 deletions(-) base-commit: 9c367ee1967b213b507a8bf041ea6c2623ceea96 -- 2.41.0
ludo <at> gnu.org, guix-patches <at> gnu.org
:bug#68554
; Package guix-patches
.
(Sat, 20 Jan 2024 04:42:02 GMT) Full text and rfc822 format available.Message #71 received at 68554 <at> debbugs.gnu.org (full text, mbox):
From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com> To: 68554 <at> debbugs.gnu.org Cc: efraim <at> flashner.co.il, Maxim Cournoyer <maxim.cournoyer <at> gmail.com> Subject: [PATCH v4 1/5] gnu: Add gdc alias. Date: Fri, 19 Jan 2024 23:37:05 -0500
* gnu/packages/gcc.scm (gdc): New variable. Change-Id: I38447e46ffba44d3a9d3757d34fe9ff081803457 --- (no changes since v1) gnu/packages/gcc.scm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm index 6eb01f33a6..5344278174 100644 --- a/gnu/packages/gcc.scm +++ b/gnu/packages/gcc.scm @@ -1124,6 +1124,12 @@ (define-public gdc-11 (custom-gcc gcc-11 "gdc" '("d") %generic-search-paths))) +;;; Alias tracking the latest GDC version. +(define-public gdc + (hidden-package + (custom-gcc gcc "gdc" '("d") + %generic-search-paths))) + (define-public (make-libgccjit gcc) (package (inherit gcc) -- 2.41.0
guix-patches <at> gnu.org
:bug#68554
; Package guix-patches
.
(Sat, 20 Jan 2024 04:42:03 GMT) Full text and rfc822 format available.Message #74 received at 68554 <at> debbugs.gnu.org (full text, mbox):
From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com> To: 68554 <at> debbugs.gnu.org Cc: efraim <at> flashner.co.il, Maxim Cournoyer <maxim.cournoyer <at> gmail.com> Subject: [PATCH v4 2/5] gnu: gdmd: Replace gdc-11 with gdc alias. Date: Fri, 19 Jan 2024 23:37:06 -0500
* gnu/packages/dlang.scm (gdmd) [inputs]: Replace gdc-11 with gdc. Change-Id: Ie035bb79c128c266cee85cf11bf79216f4f8b454 --- (no changes since v1) gnu/packages/dlang.scm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gnu/packages/dlang.scm b/gnu/packages/dlang.scm index 61823714f6..5c9766110d 100644 --- a/gnu/packages/dlang.scm +++ b/gnu/packages/dlang.scm @@ -136,8 +136,7 @@ (define-public gdmd (string-append "my $gdc_dir = \"" (dirname (search-input-file inputs "/bin/gdc")) "\";\n")))))))) - (inputs - (list gdc-11 perl)) + (inputs (list gdc perl)) (home-page "https://github.com/D-Programming-GDC/gdmd") (synopsis "DMD-like wrapper for GDC") (description "This package provides a DMD-like wrapper for the -- 2.41.0
guix-patches <at> gnu.org
:bug#68554
; Package guix-patches
.
(Sat, 20 Jan 2024 04:42:03 GMT) Full text and rfc822 format available.Message #77 received at 68554 <at> debbugs.gnu.org (full text, mbox):
From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com> To: 68554 <at> debbugs.gnu.org Cc: efraim <at> flashner.co.il, Maxim Cournoyer <maxim.cournoyer <at> gmail.com> Subject: [PATCH v4 3/5] gnu: Add dmd. Date: Fri, 19 Jan 2024 23:37:07 -0500
* gnu/packages/dlang.scm (dmd-bootstrap, dmd): New variables. Change-Id: I53e00a429e2084a392341ef1bc7ea63f0fcaaab4 --- Changes in v4: - Name phobos source as "phobos" (thanks to Efraim) Changes in v3: - Add packages built from dmd and D demangling support to qt-creator Changes in v2: - Build make flags via inheritance... - Fixing the missing SYSCONFDIR make flag gnu/packages/dlang.scm | 165 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 165 insertions(+) diff --git a/gnu/packages/dlang.scm b/gnu/packages/dlang.scm index 5c9766110d..58411166b7 100644 --- a/gnu/packages/dlang.scm +++ b/gnu/packages/dlang.scm @@ -358,6 +358,171 @@ (define-public ldc `(("clang" ,clang-14) ;propagates llvm and clang-runtime ("python-lit" ,python-lit)))))) +;;; Bootstrap version of phobos that is built with GDC, using GDC's standard +;;; library. +(define dmd-bootstrap + (package + ;; This package is purposefully named just "dmd" and not "dmd-bootstrap", + ;; as the final dmd package rewrites references from this one to itself, + ;; and their names must have the same length to avoid corrupting the + ;; binary. + (name "dmd") + (version "2.106.1") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/dlang/dmd") + (commit (string-append "v" version)))) + (file-name (git-file-name "dmd" version)) + (sha256 + (base32 + "1bq4jws1vns2jjzfz7biyngrx9y5pvvgklymhrvb5kvbzky1ldmy")))) + (build-system gnu-build-system) + (arguments + (list + #:disallowed-references (list (gexp-input (canonical-package gcc) + "lib")) + ;; Disable tests, as gdmd cannot cope with some arguments used such as + ;; '-conf'. + #:tests? #f + #:test-target "test" + #:make-flags + #~(list (string-append "CC=" #$(cc-for-target)) + ;; XXX: Proceed despite conflicts from symbols provided by both + ;; the source built and GDC. + "DFLAGS=-L--allow-multiple-definition" + "ENABLE_RELEASE=1" + (string-append "HOST_CXX=" #$(cxx-for-target)) + "HOST_DMD=gdmd" + (string-append "INSTALL_DIR=" #$output) + ;; Do not build the shared libphobos2.so library, to avoid + ;; retaining a reference to gcc:lib. + "SHARED=0" + (string-append "SYSCONFDIR=" #$output "/etc") + "VERBOSE=1" + "-f" "posix.mak") + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'copy-phobos-source-and-chdir + ;; Start with building phobos, which in turns will automatically + ;; build druntime and dmd. A minimal dmd command is still + ;; required to do so, which is why we need dmd-bootstrap-0. + (lambda _ + (symlink "." "dmd") ;to please the build system expected layout + (copy-recursively + #$(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/dlang/phobos") + (commit (string-append "v" version)))) + (file-name (git-file-name "phobos" version)) + (sha256 + (base32 + "1yw7nb5d78cx9m7sfibv7rfc7wj3w0dw9mfk3d269qpfpnwzs4n9"))) + "phobos") + (chdir "phobos"))) + (add-after 'copy-phobos-source-and-chdir 'adjust-phobos-install-dirs + (lambda _ + (substitute* "posix.mak" + ;; Install to lib directory, not to e.g. 'linux/lib64'. + (("\\$\\(INSTALL_DIR)/\\$\\(OS)/\\$\\(lib_dir)") + (string-append #$output "/lib")) + ;; Do not install license file, already done by the gnu build + ;; system. + ((".*\\$\\(INSTALL_DIR)/phobos-LICENSE.txt.*") "")))) + (delete 'configure) + (add-after 'install 'install-druntime + (lambda args + (chdir "../druntime") + (apply (assoc-ref %standard-phases 'install) args) + (chdir ".."))) + (add-after 'install-druntime 'install-includes + (lambda _ + ;; Normalize the include files prefix to include/dmd. + (let ((include-dir (string-append #$output "/include/dmd"))) + (mkdir-p include-dir) + (rename-file (string-append #$output "/src/phobos") + (string-append include-dir)) + (copy-recursively "druntime/import" include-dir)) + (delete-file-recursively (string-append #$output "/src")))) + (add-after 'install-druntime 'install-dmd + (assoc-ref %standard-phases 'install)) + (add-after 'install-license-files 'refine-install-layout + (lambda _ + (let* ((docdir (string-append #$output "/share/doc/" + (strip-store-file-name #$output))) + ;; The dmd binary gets installed to + ;; e.g. /linux/bin64/dmd. + (dmd (car (find-files #$output "^dmd$"))) + (dmd.conf (car (find-files #$output "^dmd.conf$"))) + (os-dir (dirname (dirname dmd)))) + ;; Move samples from root to the doc directory. + (rename-file (string-append #$output "/samples") + (string-append docdir "/samples")) + ;; Remove duplicate license file. + (delete-file (string-append #$output + "/dmd-boostlicense.txt")) + ;; Move dmd binary and dmd.conf. + (install-file dmd (string-append #$output "/bin")) + (install-file dmd.conf (string-append #$output "/etc")) + (delete-file-recursively os-dir)))) + (add-after 'refine-install-layout 'patch-dmd.conf + (lambda* (#:key outputs #:allow-other-keys) + (substitute* (search-input-file outputs "etc/dmd.conf") + (("lib(32|64)") + "lib") + (("\\.\\./src/(phobos|druntime/import)") + "include/dmd"))))))) + (native-inputs (list gdmd which)) + (home-page "https://github.com/dlang/dmd") + (synopsis "Reference D Programming Language compiler") + (description "@acronym{DMD, Digital Mars D compiler} is the reference +compiler for the D programming language.") + (license license:boost1.0))) + +;;; Second bootstrap of DMD, built using dmd-bootstrap, with its shared +;;; libraries preserved. +(define-public dmd + (package + (inherit dmd-bootstrap) + (arguments + (substitute-keyword-arguments + (strip-keyword-arguments + '(#:tests?) ;reinstate tests + (package-arguments dmd-bootstrap)) + ((#:disallowed-references _ ''()) + (list dmd-bootstrap)) + ((#:modules _ ''()) + '((guix build gnu-build-system) + (guix build utils) + (srfi srfi-1))) ;for fold + ((#:make-flags flags ''()) + #~(fold delete #$flags '("DFLAGS=-L--allow-multiple-definition" + "HOST_DMD=gdmd" + "SHARED=0"))) + ((#:phases phases '%standard-phases) + #~(modify-phases #$phases + (add-after 'patch-dmd.conf 'rewrite-references-to-bootstrap + ;; DMD keeps references to include files used to build a + ;; binary. Rewrite those of dmd-bootstrap to itself, to reduce + ;; its closure size. + (lambda* (#:key native-inputs inputs outputs + #:allow-other-keys) + (let ((dmd (search-input-file outputs "bin/dmd")) + (dmd-bootstrap (dirname + (dirname + (search-input-file + (or native-inputs inputs) + "bin/dmd"))))) + ;; XXX: Use sed, as replace-store-references wouldn't + ;; replace the references, while substitute* throws an + ;; error. + (invoke "sed" "-i" + (format #f "s,~a,~a,g" dmd-bootstrap #$output) + dmd)))))))) + (native-inputs (modify-inputs (package-native-inputs dmd-bootstrap) + (replace "gdmd" dmd-bootstrap))))) + (define-public dub (package (name "dub") -- 2.41.0
guix-patches <at> gnu.org
:bug#68554
; Package guix-patches
.
(Sat, 20 Jan 2024 04:42:04 GMT) Full text and rfc822 format available.Message #80 received at 68554 <at> debbugs.gnu.org (full text, mbox):
From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com> To: 68554 <at> debbugs.gnu.org Cc: efraim <at> flashner.co.il, Maxim Cournoyer <maxim.cournoyer <at> gmail.com> Subject: [PATCH v4 4/5] gnu: Add d-demangler. Date: Fri, 19 Jan 2024 23:37:08 -0500
* gnu/packages/dlang.scm (d-demangler): New variable. Change-Id: Ic1dc8fb8adc1b4be859552e4add074a35bdfc6d0 --- (no changes since v1) gnu/packages/dlang.scm | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/gnu/packages/dlang.scm b/gnu/packages/dlang.scm index 58411166b7..e3052cc032 100644 --- a/gnu/packages/dlang.scm +++ b/gnu/packages/dlang.scm @@ -6,7 +6,7 @@ ;;; Copyright © 2017, 2019, 2022 Tobias Geerinckx-Rice <me <at> tobias.gr> ;;; Copyright © 2020 Guy Fleury Iteriteka <gfleury <at> disroot.org> ;;; Copyright © 2021-2023 Efraim Flashner <efraim <at> flashner.co.il> -;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer <at> gmail.com> +;;; Copyright © 2021, 2024 Maxim Cournoyer <maxim.cournoyer <at> gmail.com> ;;; Copyright © 2022 ( <paren <at> disroot.org> ;;; Copyright © 2022 Esther Flashner <esther <at> flashner.co.il> ;;; @@ -617,3 +617,35 @@ (define-public gtkd (synopsis "D binding and OO wrapper of GTK+") (description "This package provides bindings to GTK+ for D.") (license license:lgpl2.1))) + +(define-public d-demangler + (package + (name "d-demangler") + (version "0.0.2") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/lievenhey/d_demangler") + (commit (string-append "version-" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "13lbbxlaa1mffjs57xchl1g6kyr5lxi0z5x7snyvym0knslxwx2g")))) + (build-system gnu-build-system) + (arguments + (list + #:tests? #f ;no test suite + #:make-flags #~(list (string-append "CC=" #$(cc-for-target)) + "d_demangle") + #:phases #~(modify-phases %standard-phases + (delete 'configure) + (replace 'install + (lambda _ + (install-file "libd_demangle.so" + (string-append #$output "/lib"))))))) + (native-inputs (list dmd)) + (home-page "https://github.com/lievenhey/d_demangler") + (synopsis "Utility to demangle D symbols") + (description "@command{d_demangle} is a small utility that can be used to +demangle D symbols. A shared library is also provided.") + (license license:gpl3+))) -- 2.41.0
andreas <at> enge.fr, maxim.cournoyer <at> gmail.com, iyzsong <at> envs.net, guix-patches <at> gnu.org
:bug#68554
; Package guix-patches
.
(Sat, 20 Jan 2024 04:42:04 GMT) Full text and rfc822 format available.Message #83 received at 68554 <at> debbugs.gnu.org (full text, mbox):
From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com> To: 68554 <at> debbugs.gnu.org Cc: efraim <at> flashner.co.il, Maxim Cournoyer <maxim.cournoyer <at> gmail.com> Subject: [PATCH v4 5/5] gnu: qt-creator: Add support for demangling D and Rust symbols. Date: Fri, 19 Jan 2024 23:37:09 -0500
* gnu/packages/qt.scm (qt-creator) [inputs]: Add d-demangler and rust-rustc-demangle-capi-0.1 (where supported). Change-Id: I13122c0d148f283268d59919ade1459b5c7012a5 --- Changes in v4: - Only add rust-rustc-demangle-capi-0.1 input if supported gnu/packages/qt.scm | 41 ++++++++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm index a6bbc2429a..e3c9f1accd 100644 --- a/gnu/packages/qt.scm +++ b/gnu/packages/qt.scm @@ -71,9 +71,11 @@ (define-module (gnu packages qt) #:use-module (gnu packages cmake) #:use-module (gnu packages compression) #:use-module (gnu packages cpp) + #:use-module (gnu packages crates-io) #:use-module (gnu packages cups) #:use-module (gnu packages curl) #:use-module (gnu packages databases) + #:use-module (gnu packages dlang) #:use-module (gnu packages documentation) #:use-module (gnu packages elf) #:use-module (gnu packages enchant) @@ -5146,23 +5148,28 @@ (define-public qt-creator vulkan-headers xvfb-run)) (inputs - (list bash-minimal - coreutils-minimal - clang - clazy - elfutils - gdb - kcachegrind - libxkbcommon - llvm - qt5compat - qtdeclarative - qtshadertools - qtsvg - yaml-cpp - valgrind - vulkan-loader - `(,zstd "lib"))) + (append + (list bash-minimal + coreutils-minimal + clang + clazy + d-demangler + elfutils + gdb + kcachegrind + libxkbcommon + llvm + qt5compat + qtdeclarative + qtshadertools + qtsvg + yaml-cpp + valgrind + vulkan-loader + `(,zstd "lib")) + (if (supported-package? rust-rustc-demangle-capi-0.1) + (list rust-rustc-demangle-capi-0.1) + '()))) (home-page "https://www.qt.io/") (synopsis "Integrated development environment (IDE) for Qt") (description "Qt Creator is an IDE tailored to the needs of Qt developers. -- 2.41.0
guix-patches <at> gnu.org
:bug#68554
; Package guix-patches
.
(Wed, 24 Jan 2024 17:22:02 GMT) Full text and rfc822 format available.Message #86 received at 68554 <at> debbugs.gnu.org (full text, mbox):
From: Ludovic Courtès <ludo <at> gnu.org> To: Maxim Cournoyer <maxim.cournoyer <at> gmail.com> Cc: 68554 <at> debbugs.gnu.org Subject: Re: [bug#68554] [PATCH v3 1/6] gnu: Add gdc alias. Date: Wed, 24 Jan 2024 18:20:51 +0100
Maxim Cournoyer <maxim.cournoyer <at> gmail.com> skribis: > * gnu/packages/gcc.scm (gdc): New variable. > > Change-Id: I38447e46ffba44d3a9d3757d34fe9ff081803457 LGTM!
Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
:Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
:Message #91 received at 68554-done <at> debbugs.gnu.org (full text, mbox):
From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com> To: Ludovic Courtès <ludo <at> gnu.org> Cc: 68554-done <at> debbugs.gnu.org Subject: Re: [bug#68554] [PATCH v3 1/6] gnu: Add gdc alias. Date: Fri, 26 Jan 2024 15:41:34 -0500
Hi Ludo, Ludovic Courtès <ludo <at> gnu.org> writes: > Maxim Cournoyer <maxim.cournoyer <at> gmail.com> skribis: > >> * gnu/packages/gcc.scm (gdc): New variable. >> >> Change-Id: I38447e46ffba44d3a9d3757d34fe9ff081803457 > > LGTM! Thanks, I pushed this one as well as the remaining from this series, as they had been sitting for some time in their v4 revision :-). -- Thanks, Maxim
Debbugs Internal Request <help-debbugs <at> gnu.org>
to internal_control <at> debbugs.gnu.org
.
(Sat, 24 Feb 2024 12:24:06 GMT) Full text and rfc822 format available.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.