GNU bug report logs - #55999
[PATCHSET] Various D fixes

Previous Next

Package: guix-patches;

Reported by: "(" <paren <at> disroot.org>

Date: Wed, 15 Jun 2022 18:53:02 UTC

Severity: normal

Tags: patch

Done: Tobias Geerinckx-Rice <me <at> tobias.gr>

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 55999 in the body.
You can then email your comments to 55999 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


Report forwarded to guix-patches <at> gnu.org:
bug#55999; Package guix-patches. (Wed, 15 Jun 2022 18:53:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to "(" <paren <at> disroot.org>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Wed, 15 Jun 2022 18:53:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "(" <paren <at> disroot.org>
To: <guix-patches <at> gnu.org>
Subject: [PATCHSET] Various D fixes
Date: Wed, 15 Jun 2022 19:52:00 +0100
This fixes <https://issues.guix.gnu.org/55953>.




Information forwarded to guix-patches <at> gnu.org:
bug#55999; Package guix-patches. (Wed, 15 Jun 2022 18:55:02 GMT) Full text and rfc822 format available.

Message #8 received at 55999 <at> debbugs.gnu.org (full text, mbox):

From: "(" <paren <at> disroot.org>
To: 55999 <at> debbugs.gnu.org
Cc: "\(" <paren <at> disroot.org>
Subject: [PATCH 2/2] gnu: packages: Update dub to v1.23.0.
Date: Wed, 15 Jun 2022 19:53:50 +0100
* gnu/packages/dlang.scm (dub): Update to version 1.23.0.

This also fixes Dub's build, which was previously failing because of how
ancient it was.
---
 gnu/packages/dlang.scm | 40 ++++++++++++++++++++++------------------
 1 file changed, 22 insertions(+), 18 deletions(-)

diff --git a/gnu/packages/dlang.scm b/gnu/packages/dlang.scm
index e0ded5c3c8..2341f1769e 100644
--- a/gnu/packages/dlang.scm
+++ b/gnu/packages/dlang.scm
@@ -436,7 +436,7 @@ (define (gnu-triplet->clang-arch system)
 (define-public dub
   (package
     (name "dub")
-    (version "1.7.2")
+    (version "1.23.0")
     (source
      (origin
        (method git-fetch)
@@ -445,26 +445,30 @@ (define-public dub
              (commit (string-append "v" version))))
        (file-name (git-file-name name version))
        (sha256
-        (base32 "073ibvgm1gphcqs1yjrav9ryp677nh3b194nxmvicwgvdc0sb6w9"))))
+        (base32 "06a4whsl1m600k096nwif83n7za3vr7pj1xwapncy5fcad1gmady"))))
     (build-system gnu-build-system)
     (arguments
-     `(#:tests? #f ; it would have tested itself by installing some packages (vibe etc)
-       #:phases
-       (modify-phases %standard-phases
-         (delete 'configure)            ; no configure script
-         (replace 'build
-           (lambda _
-             (invoke "./build.sh")))
-         (replace 'install
-           (lambda* (#:key outputs #:allow-other-keys)
-             (let* ((out (assoc-ref outputs "out"))
-                    (bin (string-append out "/bin")))
-               (install-file "bin/dub" bin)
-               #t))))))
-    (inputs
-     (list curl))
+     (list #:tests? #f ; it would have tested itself by installing some packages (vibe etc)
+           #:phases
+           #~(modify-phases %standard-phases
+               (delete 'configure) ; no configure script
+               (replace 'build
+                 (lambda* (#:key native-inputs #:allow-other-keys)
+                   (setenv "CC" #$(cc-for-target))
+                   (setenv "LD" #$(ld-for-target))
+                   (invoke "./build.d")))
+               (replace 'install
+                 (lambda* (#:key outputs #:allow-other-keys)
+                   (let* ((out (assoc-ref outputs "out"))
+                          (bin (string-append out "/bin")))
+                     (install-file "bin/dub" bin)))))))
+    (inputs (list curl))
     (native-inputs
-     (list ldc))
+     (list ldc
+           d-tools
+           (module-ref (resolve-interface
+                        '(gnu packages commencement))
+                       'ld-gold-wrapper)))
     (home-page "https://code.dlang.org/getting_started")
     (synopsis "Package and build manager for D projects")
     (description
-- 
2.36.1





Information forwarded to guix-patches <at> gnu.org:
bug#55999; Package guix-patches. (Wed, 15 Jun 2022 18:55:02 GMT) Full text and rfc822 format available.

Message #11 received at 55999 <at> debbugs.gnu.org (full text, mbox):

From: "(" <paren <at> disroot.org>
To: 55999 <at> debbugs.gnu.org
Cc: "\(" <paren <at> disroot.org>
Subject: [PATCH 1/2] gnu: packages: Replace rdmd with d-tools.
Date: Wed, 15 Jun 2022 19:53:49 +0100
* gnu/packages/dlang.scm (rdmd): Remove variable.
* gnu/packages/dlang.scm (d-tools): New variable.

This fixes the build of rdmd and updates it to the latest version, along
with running rdmd_test.d, building dustmite along with rdmd, and
renaming the package to d-tools to reflect that change.
---
 gnu/packages/dlang.scm | 76 +++++++++++++++++++++++++-----------------
 1 file changed, 45 insertions(+), 31 deletions(-)

diff --git a/gnu/packages/dlang.scm b/gnu/packages/dlang.scm
index 403fcbbd6b..e0ded5c3c8 100644
--- a/gnu/packages/dlang.scm
+++ b/gnu/packages/dlang.scm
@@ -7,6 +7,7 @@
 ;;; Copyright © 2020 Guy Fleury Iteriteka <gfleury <at> disroot.org>
 ;;; Copyright © 2021 Efraim Flashner <efraim <at> flashner.co.il>
 ;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
+;;; Copyright © 2022 ( <paren <at> disroot.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -27,6 +28,7 @@ (define-module (gnu packages dlang)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix gexp)
   #:use-module (guix git-download)
   #:use-module (guix utils)
   #:use-module ((guix build utils) #:hide (delete which))
@@ -48,42 +50,54 @@ (define-module (gnu packages dlang)
   #:use-module (gnu packages xorg)
   #:use-module (srfi srfi-1))
 
-(define-public rdmd
+(define-public d-tools
   (package
-    (name "rdmd")
-    (version "2.077.1")
-    (source (origin
-      (method url-fetch)
-      (uri (string-append "https://github.com/dlang/tools/archive/v" version ".tar.gz"))
-      (file-name (string-append name "-" version ".tar.gz"))
-      (sha256
-       (base32
-        "0c8w373rv6iz3xfid94w40ncv2lr2ncxi662qsr4lda4aghczmq7"))))
+    (name "d-tools")
+    (version "2.100.0")
+    (source
+      (origin
+        (method git-fetch)
+        (uri (git-reference
+              (url "https://github.com/dlang/tools")
+              (commit (string-append "v" version))))
+        (file-name (git-file-name name version))
+        (sha256
+         (base32 "1jbn0hyskv4ykcckw0iganpyrm0bq2lggswspw21r4hgnxkmjbyw"))))
     (build-system gnu-build-system)
     (arguments
-     '(#:phases
-       (modify-phases %standard-phases
-         (delete 'configure)
-         (delete 'check) ; There is no Makefile, so there's no 'make check'.
-         (replace
-          'build
-          (lambda _
-            (invoke "ldc2" "rdmd.d")))
-         (replace
-          'install
-          (lambda* (#:key outputs #:allow-other-keys)
-            (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
-              (install-file "rdmd" bin)))))))
+     (list #:phases
+           #~(modify-phases %standard-phases
+               (delete 'configure)
+               (replace 'build
+                 (lambda _
+                   (mkdir-p "bin")
+                   (setenv "CC" #$(cc-for-target))
+                   (setenv "LD" #$(ld-for-target))
+                   (invoke "ldc2" "rdmd.d" "--of" "bin/rdmd")
+                   (apply invoke "ldc2" "--of=bin/dustmite"
+                          (find-files "DustMite" ".*\\.d"))))
+               (replace 'check
+                 (lambda _
+                   (invoke "bin/rdmd" "rdmd_test.d" "bin/rdmd"
+                           "--rdmd-default-compiler" "ldmd2")))
+               (replace 'install
+                 (lambda* (#:key outputs #:allow-other-keys)
+                   (let* ((out (assoc-ref outputs "out"))
+                          (bin (string-append out "/bin"))
+                          (man (string-append out "/man")))
+                     (copy-recursively "bin" bin)
+                     (copy-recursively "man" man)))))))
     (native-inputs
-     (list ldc))
-    (home-page "https://github.com/D-Programming-Language/tools/")
-    (synopsis "Specialized equivalent to 'make' for the D language")
+     (list ldc
+           (module-ref (resolve-interface
+                        '(gnu packages commencement))
+                       'ld-gold-wrapper)))
+    (home-page "https://github.com/dlang/tools")
+    (synopsis "Useful D-related tools")
     (description
-     "rdmd is a companion to the dmd compiler that simplifies the typical
-edit-compile-link-run or edit-make-run cycle to a rapid edit-run cycle.  Like
-make and other tools, rdmd uses the relative dates of the files involved to
-minimize the amount of work necessary.  Unlike make, rdmd tracks dependencies
-and freshness without requiring additional information from the user.")
+     "@code{d-tools} provides two useful tools for the D language: @code{rdmd},
+which runs D source files as scripts, and @code{dustmite}, which reduces D code
+to a minimal test case.")
     (license license:boost1.0)))
 
 ;;; The 0.17.6 version is the last release to support being bootstrapped
-- 
2.36.1





Information forwarded to guix-patches <at> gnu.org:
bug#55999; Package guix-patches. (Fri, 17 Jun 2022 06:17:01 GMT) Full text and rfc822 format available.

Message #14 received at 55999 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: "(" <paren <at> disroot.org>, 55999 <at> debbugs.gnu.org
Subject: Re: [bug#55999] [PATCH 1/2] gnu: packages: Replace rdmd with d-tools.
Date: Fri, 17 Jun 2022 08:16:41 +0200
[Message part 1 (text/plain, inline)]
( via Guix-patches via schreef op wo 15-06-2022 om 19:53 [+0100]:
> +               (replace 'check
> +                 (lambda _
> +                   (invoke "bin/rdmd" "rdmd_test.d" "bin/rdmd"
> +                           "--rdmd-default-compiler" "ldmd2")))

Run "./pre-inst guix lint d-tools", it will have a remark.

Greetings,
Maxime.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#55999; Package guix-patches. (Fri, 17 Jun 2022 15:44:01 GMT) Full text and rfc822 format available.

Message #17 received at 55999 <at> debbugs.gnu.org (full text, mbox):

From: "(" <paren <at> disroot.org>
To: "Maxime Devos" <maximedevos <at> telenet.be>, <55999 <at> debbugs.gnu.org>
Subject: Re: [bug#55999] [PATCH 1/2] gnu: packages: Replace rdmd with d-tools.
Date: Fri, 17 Jun 2022 16:43:18 +0100
On Fri Jun 17, 2022 at 7:16 AM BST, Maxime Devos wrote:
> Run "./pre-inst guix lint d-tools", it will have a remark.

thanks; sending new patch in a moment :)




Information forwarded to guix-patches <at> gnu.org:
bug#55999; Package guix-patches. (Fri, 17 Jun 2022 17:21:02 GMT) Full text and rfc822 format available.

Message #20 received at 55999 <at> debbugs.gnu.org (full text, mbox):

From: "(" <paren <at> disroot.org>
To: 55999 <at> debbugs.gnu.org
Cc: "\(" <paren <at> disroot.org>
Subject: [PATCH v2 1/2] gnu: packages: Replace rdmd with d-tools.
Date: Fri, 17 Jun 2022 18:20:22 +0100
* gnu/packages/dlang.scm (rdmd): Remove variable.
* gnu/packages/dlang.scm (d-tools): New variable.

This fixes the build of rdmd and updates it to the latest version, along
with running rdmd_test.d, building dustmite along with rdmd, and
renaming the package to d-tools to reflect that change.
---
 gnu/packages/dlang.scm | 75 +++++++++++++++++++++++++-----------------
 1 file changed, 45 insertions(+), 30 deletions(-)

diff --git a/gnu/packages/dlang.scm b/gnu/packages/dlang.scm
index 403fcbbd6b..7010994d2c 100644
--- a/gnu/packages/dlang.scm
+++ b/gnu/packages/dlang.scm
@@ -7,6 +7,7 @@
 ;;; Copyright © 2020 Guy Fleury Iteriteka <gfleury <at> disroot.org>
 ;;; Copyright © 2021 Efraim Flashner <efraim <at> flashner.co.il>
 ;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
+;;; Copyright © 2022 ( <paren <at> disroot.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -27,6 +28,7 @@ (define-module (gnu packages dlang)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix gexp)
   #:use-module (guix git-download)
   #:use-module (guix utils)
   #:use-module ((guix build utils) #:hide (delete which))
@@ -48,42 +50,55 @@ (define-module (gnu packages dlang)
   #:use-module (gnu packages xorg)
   #:use-module (srfi srfi-1))
 
-(define-public rdmd
+(define-public d-tools
   (package
-    (name "rdmd")
-    (version "2.077.1")
-    (source (origin
-      (method url-fetch)
-      (uri (string-append "https://github.com/dlang/tools/archive/v" version ".tar.gz"))
-      (file-name (string-append name "-" version ".tar.gz"))
+    (name "d-tools")
+    (version "2.100.0")
+    (source
+     (origin
+      (method git-fetch)
+      (uri (git-reference
+            (url "https://github.com/dlang/tools")
+            (commit (string-append "v" version))))
+      (file-name (git-file-name name version))
       (sha256
-       (base32
-        "0c8w373rv6iz3xfid94w40ncv2lr2ncxi662qsr4lda4aghczmq7"))))
+       (base32 "1jbn0hyskv4ykcckw0iganpyrm0bq2lggswspw21r4hgnxkmjbyw"))))
     (build-system gnu-build-system)
     (arguments
-     '(#:phases
-       (modify-phases %standard-phases
-         (delete 'configure)
-         (delete 'check) ; There is no Makefile, so there's no 'make check'.
-         (replace
-          'build
-          (lambda _
-            (invoke "ldc2" "rdmd.d")))
-         (replace
-          'install
-          (lambda* (#:key outputs #:allow-other-keys)
-            (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
-              (install-file "rdmd" bin)))))))
+     (list #:phases
+           #~(modify-phases %standard-phases
+               (delete 'configure)
+               (replace 'build
+                 (lambda _
+                   (mkdir-p "bin")
+                   (setenv "CC" #$(cc-for-target))
+                   (setenv "LD" #$(ld-for-target))
+                   (invoke "ldc2" "rdmd.d" "--of" "bin/rdmd")
+                   (apply invoke "ldc2" "--of=bin/dustmite"
+                          (find-files "DustMite" ".*\\.d"))))
+               (replace 'check
+                 (lambda* (#:key tests? #:allow-other-keys)
+                   (when tests?
+                     (invoke "bin/rdmd" "rdmd_test.d" "bin/rdmd"
+                             "--rdmd-default-compiler" "ldmd2"))))
+               (replace 'install
+                 (lambda* (#:key outputs #:allow-other-keys)
+                   (let* ((out (assoc-ref outputs "out"))
+                          (bin (string-append out "/bin"))
+                          (man (string-append out "/man")))
+                     (copy-recursively "bin" bin)
+                     (copy-recursively "man" man)))))))
     (native-inputs
-     (list ldc))
-    (home-page "https://github.com/D-Programming-Language/tools/")
-    (synopsis "Specialized equivalent to 'make' for the D language")
+     (list ldc
+           (module-ref (resolve-interface
+                        '(gnu packages commencement))
+                       'ld-gold-wrapper)))
+    (home-page "https://github.com/dlang/tools")
+    (synopsis "Useful D-related tools")
     (description
-     "rdmd is a companion to the dmd compiler that simplifies the typical
-edit-compile-link-run or edit-make-run cycle to a rapid edit-run cycle.  Like
-make and other tools, rdmd uses the relative dates of the files involved to
-minimize the amount of work necessary.  Unlike make, rdmd tracks dependencies
-and freshness without requiring additional information from the user.")
+     "@code{d-tools} provides two useful tools for the D language: @code{rdmd},
+which runs D source files as scripts, and @code{dustmite}, which reduces D code
+to a minimal test case.")
     (license license:boost1.0)))
 
 ;;; The 0.17.6 version is the last release to support being bootstrapped
-- 
2.36.1





Information forwarded to guix-patches <at> gnu.org:
bug#55999; Package guix-patches. (Fri, 17 Jun 2022 17:21:03 GMT) Full text and rfc822 format available.

Message #23 received at 55999 <at> debbugs.gnu.org (full text, mbox):

From: "(" <paren <at> disroot.org>
To: 55999 <at> debbugs.gnu.org
Cc: "\(" <paren <at> disroot.org>
Subject: [PATCH v2 2/2] gnu: packages: Update dub to v1.23.0.
Date: Fri, 17 Jun 2022 18:20:23 +0100
* gnu/packages/dlang.scm (dub): Update to version 1.23.0.

This also fixes Dub's build, which was previously failing because of how
ancient it was.
---
 gnu/packages/dlang.scm | 52 +++++++++++++++++++++++-------------------
 1 file changed, 28 insertions(+), 24 deletions(-)

diff --git a/gnu/packages/dlang.scm b/gnu/packages/dlang.scm
index 7010994d2c..34486f212c 100644
--- a/gnu/packages/dlang.scm
+++ b/gnu/packages/dlang.scm
@@ -437,35 +437,39 @@ (define (gnu-triplet->clang-arch system)
 (define-public dub
   (package
     (name "dub")
-    (version "1.7.2")
+    (version "1.23.0")
     (source
      (origin
-       (method git-fetch)
-       (uri (git-reference
-             (url "https://github.com/dlang/dub")
-             (commit (string-append "v" version))))
-       (file-name (git-file-name name version))
-       (sha256
-        (base32 "073ibvgm1gphcqs1yjrav9ryp677nh3b194nxmvicwgvdc0sb6w9"))))
+      (method git-fetch)
+      (uri (git-reference
+            (url "https://github.com/dlang/dub")
+            (commit (string-append "v" version))))
+      (file-name (git-file-name name version))
+      (sha256
+       (base32 "06a4whsl1m600k096nwif83n7za3vr7pj1xwapncy5fcad1gmady"))))
     (build-system gnu-build-system)
     (arguments
-     `(#:tests? #f ; it would have tested itself by installing some packages (vibe etc)
-       #:phases
-       (modify-phases %standard-phases
-         (delete 'configure)            ; no configure script
-         (replace 'build
-           (lambda _
-             (invoke "./build.sh")))
-         (replace 'install
-           (lambda* (#:key outputs #:allow-other-keys)
-             (let* ((out (assoc-ref outputs "out"))
-                    (bin (string-append out "/bin")))
-               (install-file "bin/dub" bin)
-               #t))))))
-    (inputs
-     (list curl))
+     (list #:tests? #f ; Tests try to install various packages.
+           #:phases
+           #~(modify-phases %standard-phases
+               (delete 'configure)
+               (replace 'build
+                 (lambda _
+                   (setenv "CC" #$(cc-for-target))
+                   (setenv "LD" #$(ld-for-target))
+                   (invoke "./build.d")))
+               (replace 'install
+                 (lambda* (#:key outputs #:allow-other-keys)
+                   (let* ((out (assoc-ref outputs "out"))
+                          (bin (string-append out "/bin")))
+                     (install-file "bin/dub" bin)))))))
+    (inputs (list curl))
     (native-inputs
-     (list ldc))
+     (list ldc
+           d-tools
+           (module-ref (resolve-interface
+                        '(gnu packages commencement))
+                       'ld-gold-wrapper)))
     (home-page "https://code.dlang.org/getting_started")
     (synopsis "Package and build manager for D projects")
     (description
-- 
2.36.1





Information forwarded to guix-patches <at> gnu.org:
bug#55999; Package guix-patches. (Fri, 24 Jun 2022 17:57:01 GMT) Full text and rfc822 format available.

Message #26 received at 55999 <at> debbugs.gnu.org (full text, mbox):

From: "(" <paren <at> disroot.org>
To: 55999 <at> debbugs.gnu.org
Cc: "\(" <paren <at> disroot.org>
Subject: [PATCH v3 1/3] gnu: packages: Replace rdmd with d-tools.
Date: Fri, 24 Jun 2022 18:56:26 +0100
* gnu/packages/dlang.scm (rdmd): Remove variable.
* gnu/packages/dlang.scm (d-tools): New variable.

This fixes the build of rdmd and updates it to the latest version, along
with running rdmd_test.d, building dustmite along with rdmd, and
renaming the package to d-tools to reflect that change.
---
 gnu/packages/dlang.scm | 75 +++++++++++++++++++++++++-----------------
 1 file changed, 45 insertions(+), 30 deletions(-)

diff --git a/gnu/packages/dlang.scm b/gnu/packages/dlang.scm
index 403fcbbd6b..7010994d2c 100644
--- a/gnu/packages/dlang.scm
+++ b/gnu/packages/dlang.scm
@@ -7,6 +7,7 @@
 ;;; Copyright © 2020 Guy Fleury Iteriteka <gfleury <at> disroot.org>
 ;;; Copyright © 2021 Efraim Flashner <efraim <at> flashner.co.il>
 ;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
+;;; Copyright © 2022 ( <paren <at> disroot.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -27,6 +28,7 @@ (define-module (gnu packages dlang)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix gexp)
   #:use-module (guix git-download)
   #:use-module (guix utils)
   #:use-module ((guix build utils) #:hide (delete which))
@@ -48,42 +50,55 @@ (define-module (gnu packages dlang)
   #:use-module (gnu packages xorg)
   #:use-module (srfi srfi-1))
 
-(define-public rdmd
+(define-public d-tools
   (package
-    (name "rdmd")
-    (version "2.077.1")
-    (source (origin
-      (method url-fetch)
-      (uri (string-append "https://github.com/dlang/tools/archive/v" version ".tar.gz"))
-      (file-name (string-append name "-" version ".tar.gz"))
+    (name "d-tools")
+    (version "2.100.0")
+    (source
+     (origin
+      (method git-fetch)
+      (uri (git-reference
+            (url "https://github.com/dlang/tools")
+            (commit (string-append "v" version))))
+      (file-name (git-file-name name version))
       (sha256
-       (base32
-        "0c8w373rv6iz3xfid94w40ncv2lr2ncxi662qsr4lda4aghczmq7"))))
+       (base32 "1jbn0hyskv4ykcckw0iganpyrm0bq2lggswspw21r4hgnxkmjbyw"))))
     (build-system gnu-build-system)
     (arguments
-     '(#:phases
-       (modify-phases %standard-phases
-         (delete 'configure)
-         (delete 'check) ; There is no Makefile, so there's no 'make check'.
-         (replace
-          'build
-          (lambda _
-            (invoke "ldc2" "rdmd.d")))
-         (replace
-          'install
-          (lambda* (#:key outputs #:allow-other-keys)
-            (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
-              (install-file "rdmd" bin)))))))
+     (list #:phases
+           #~(modify-phases %standard-phases
+               (delete 'configure)
+               (replace 'build
+                 (lambda _
+                   (mkdir-p "bin")
+                   (setenv "CC" #$(cc-for-target))
+                   (setenv "LD" #$(ld-for-target))
+                   (invoke "ldc2" "rdmd.d" "--of" "bin/rdmd")
+                   (apply invoke "ldc2" "--of=bin/dustmite"
+                          (find-files "DustMite" ".*\\.d"))))
+               (replace 'check
+                 (lambda* (#:key tests? #:allow-other-keys)
+                   (when tests?
+                     (invoke "bin/rdmd" "rdmd_test.d" "bin/rdmd"
+                             "--rdmd-default-compiler" "ldmd2"))))
+               (replace 'install
+                 (lambda* (#:key outputs #:allow-other-keys)
+                   (let* ((out (assoc-ref outputs "out"))
+                          (bin (string-append out "/bin"))
+                          (man (string-append out "/man")))
+                     (copy-recursively "bin" bin)
+                     (copy-recursively "man" man)))))))
     (native-inputs
-     (list ldc))
-    (home-page "https://github.com/D-Programming-Language/tools/")
-    (synopsis "Specialized equivalent to 'make' for the D language")
+     (list ldc
+           (module-ref (resolve-interface
+                        '(gnu packages commencement))
+                       'ld-gold-wrapper)))
+    (home-page "https://github.com/dlang/tools")
+    (synopsis "Useful D-related tools")
     (description
-     "rdmd is a companion to the dmd compiler that simplifies the typical
-edit-compile-link-run or edit-make-run cycle to a rapid edit-run cycle.  Like
-make and other tools, rdmd uses the relative dates of the files involved to
-minimize the amount of work necessary.  Unlike make, rdmd tracks dependencies
-and freshness without requiring additional information from the user.")
+     "@code{d-tools} provides two useful tools for the D language: @code{rdmd},
+which runs D source files as scripts, and @code{dustmite}, which reduces D code
+to a minimal test case.")
     (license license:boost1.0)))
 
 ;;; The 0.17.6 version is the last release to support being bootstrapped
-- 
2.36.1





Information forwarded to guix-patches <at> gnu.org:
bug#55999; Package guix-patches. (Fri, 24 Jun 2022 17:57:02 GMT) Full text and rfc822 format available.

Message #29 received at 55999 <at> debbugs.gnu.org (full text, mbox):

From: "(" <paren <at> disroot.org>
To: 55999 <at> debbugs.gnu.org
Cc: "\(" <paren <at> disroot.org>
Subject: [PATCH v3 2/3] gnu: packages: Update dub to v1.23.0.
Date: Fri, 24 Jun 2022 18:56:27 +0100
* gnu/packages/dlang.scm (dub): Update to version 1.23.0.

This also fixes Dub's build, which was previously failing because of how
ancient it was.
---
 gnu/packages/dlang.scm | 52 +++++++++++++++++++++++-------------------
 1 file changed, 28 insertions(+), 24 deletions(-)

diff --git a/gnu/packages/dlang.scm b/gnu/packages/dlang.scm
index 7010994d2c..34486f212c 100644
--- a/gnu/packages/dlang.scm
+++ b/gnu/packages/dlang.scm
@@ -437,35 +437,39 @@ (define (gnu-triplet->clang-arch system)
 (define-public dub
   (package
     (name "dub")
-    (version "1.7.2")
+    (version "1.23.0")
     (source
      (origin
-       (method git-fetch)
-       (uri (git-reference
-             (url "https://github.com/dlang/dub")
-             (commit (string-append "v" version))))
-       (file-name (git-file-name name version))
-       (sha256
-        (base32 "073ibvgm1gphcqs1yjrav9ryp677nh3b194nxmvicwgvdc0sb6w9"))))
+      (method git-fetch)
+      (uri (git-reference
+            (url "https://github.com/dlang/dub")
+            (commit (string-append "v" version))))
+      (file-name (git-file-name name version))
+      (sha256
+       (base32 "06a4whsl1m600k096nwif83n7za3vr7pj1xwapncy5fcad1gmady"))))
     (build-system gnu-build-system)
     (arguments
-     `(#:tests? #f ; it would have tested itself by installing some packages (vibe etc)
-       #:phases
-       (modify-phases %standard-phases
-         (delete 'configure)            ; no configure script
-         (replace 'build
-           (lambda _
-             (invoke "./build.sh")))
-         (replace 'install
-           (lambda* (#:key outputs #:allow-other-keys)
-             (let* ((out (assoc-ref outputs "out"))
-                    (bin (string-append out "/bin")))
-               (install-file "bin/dub" bin)
-               #t))))))
-    (inputs
-     (list curl))
+     (list #:tests? #f ; Tests try to install various packages.
+           #:phases
+           #~(modify-phases %standard-phases
+               (delete 'configure)
+               (replace 'build
+                 (lambda _
+                   (setenv "CC" #$(cc-for-target))
+                   (setenv "LD" #$(ld-for-target))
+                   (invoke "./build.d")))
+               (replace 'install
+                 (lambda* (#:key outputs #:allow-other-keys)
+                   (let* ((out (assoc-ref outputs "out"))
+                          (bin (string-append out "/bin")))
+                     (install-file "bin/dub" bin)))))))
+    (inputs (list curl))
     (native-inputs
-     (list ldc))
+     (list ldc
+           d-tools
+           (module-ref (resolve-interface
+                        '(gnu packages commencement))
+                       'ld-gold-wrapper)))
     (home-page "https://code.dlang.org/getting_started")
     (synopsis "Package and build manager for D projects")
     (description
-- 
2.36.1





Information forwarded to guix-patches <at> gnu.org:
bug#55999; Package guix-patches. (Fri, 24 Jun 2022 17:57:02 GMT) Full text and rfc822 format available.

Message #32 received at 55999 <at> debbugs.gnu.org (full text, mbox):

From: "(" <paren <at> disroot.org>
To: 55999 <at> debbugs.gnu.org
Cc: "\(" <paren <at> disroot.org>
Subject: [PATCH v3 3/3] guix: Modernize dub-build-system somewhat.
Date: Fri, 24 Jun 2022 18:56:28 +0100
* guix/build-system/dub.scm (default-ld-gold-wrapper): New variable.
(lower): Add keyed argument ld-gold-wrapper.
[bag]<build-inputs>: Add ld-gold-wrapper.
* guix/build/dub-build-system.scm (configure): Remove trailing #t, and
  fix docstring formatting.
(build): Remove trailing #t, and avoid substituting ".dub/dub.json" as
Dub no longer produces it.
(check): Same as (build).
(install): Remove trailing #t.
---
 guix/build-system/dub.scm       |  8 ++++++++
 guix/build/dub-build-system.scm | 26 ++++++++------------------
 2 files changed, 16 insertions(+), 18 deletions(-)

diff --git a/guix/build-system/dub.scm b/guix/build-system/dub.scm
index 55ad7decb8..1577f4a0c7 100644
--- a/guix/build-system/dub.scm
+++ b/guix/build-system/dub.scm
@@ -51,6 +51,12 @@ (define (default-pkg-config)
   (let ((pkg-config (resolve-interface '(gnu packages pkg-config))))
     (module-ref pkg-config 'pkg-config)))
 
+;; LDC doesn't work with the bfd linker.
+(define (default-ld-gold-wrapper)
+  "Return the default ld-gold-wrapper package."
+  (let ((commencement (resolve-interface '(gnu packages commencement))))
+    (module-ref commencement 'ld-gold-wrapper)))
+
 (define %dub-build-system-modules
   ;; Build-side modules imported by default.
   `((guix build dub-build-system)
@@ -100,6 +106,7 @@ (define* (lower name
                 (ldc (default-ldc))
                 (dub (default-dub))
                 (pkg-config (default-pkg-config))
+                (ld-gold-wrapper (default (default-ld-gold-wrapper)))
                 #:allow-other-keys
                 #:rest arguments)
   "Return a bag for NAME."
@@ -121,6 +128,7 @@ (define private-keywords
                         ,@(standard-packages)))
          (build-inputs `(("ldc" ,ldc)
                          ("dub" ,dub)
+                         ("ld-gold-wrapper" ,ld-gold-wrapper)
                          ,@native-inputs))
          (outputs outputs)
          (build dub-build)
diff --git a/guix/build/dub-build-system.scm b/guix/build/dub-build-system.scm
index 3ab50733de..9ee0433ffd 100644
--- a/guix/build/dub-build-system.scm
+++ b/guix/build/dub-build-system.scm
@@ -48,10 +48,10 @@ (define (package-name->d-package-name name)
     (_ #f)))
 
 (define* (configure #:key inputs #:allow-other-keys)
-  "Prepare one new directory with all the required dependencies.
-   It's necessary to do this (instead of just using /gnu/store as the
-   directory) because we want to hide the libraries in subdirectories
-   lib/dub/... instead of polluting the user's profile root."
+  "Prepare one new directory with all the required dependencies. It's necessary
+to do this (instead of just using /gnu/store as the directory) because we want
+to hide the libraries in subdirectories lib/dub/... instead of polluting the
+user's profile root."
   (let* ((dir (mkdtemp! "/tmp/dub.XXXXXX"))
          (vendor-dir (string-append dir "/vendor")))
     (setenv "HOME" dir)
@@ -67,8 +67,7 @@ (define* (configure #:key inputs #:allow-other-keys)
                 (symlink (string-append path "/lib/dub/" d-basename)
                          (string-append vendor-dir "/" d-basename))))))))
       inputs)
-    (invoke "dub" "add-path" vendor-dir)
-    #t))
+    (invoke "dub" "add-path" vendor-dir)))
 
 (define (grep string file-name)
   "Find the first occurrence of STRING in the file named FILE-NAME.
@@ -92,19 +91,11 @@ (define* (build #:key (dub-build-flags '())
   (unless (or (grep* "sourceLibrary" "package.json")
               (grep* "sourceLibrary" "dub.sdl") ; note: format is different!
               (grep* "sourceLibrary" "dub.json"))
-    (apply invoke `("dub" "build" ,@dub-build-flags))
-    (substitute* ".dub/dub.json"
-      (("\"lastUpgrade\": \"[^\"]*\"")
-       "\"lastUpgrade\": \"1970-01-01T00:00:00.0000000\"")))
-  #t)
+    (apply invoke `("dub" "build" ,@dub-build-flags))))
 
 (define* (check #:key tests? #:allow-other-keys)
   (when tests?
-    (invoke "dub" "test")
-    (substitute* ".dub/dub.json"
-      (("\"lastUpgrade\": \"[^\"]*\"")
-       "\"lastUpgrade\": \"1970-01-01T00:00:00.0000000\"")))
-  #t)
+    (invoke "dub" "test")))
 
 (define* (install #:key inputs outputs #:allow-other-keys)
   "Install a given DUB package."
@@ -115,8 +106,7 @@ (define* (install #:key inputs outputs #:allow-other-keys)
     ;; TODO remove "-test-application"
     (copy-recursively "bin" outbin)
     (mkdir-p outlib)
-    (copy-recursively "." (string-append outlib))
-    #t))
+    (copy-recursively "." (string-append outlib))))
 
 (define %standard-phases
   (modify-phases gnu:%standard-phases
-- 
2.36.1





Reply sent to Tobias Geerinckx-Rice <me <at> tobias.gr>:
You have taken responsibility. (Sat, 25 Jun 2022 21:42:01 GMT) Full text and rfc822 format available.

Notification sent to "(" <paren <at> disroot.org>:
bug acknowledged by developer. (Sat, 25 Jun 2022 21:42:01 GMT) Full text and rfc822 format available.

Message #37 received at 55999-done <at> debbugs.gnu.org (full text, mbox):

From: Tobias Geerinckx-Rice <me <at> tobias.gr>
To: "(" <paren <at> disroot.org>
Cc: 55999-done <at> debbugs.gnu.org, guix-patches <at> gnu.org
Subject: Re: [bug#55999] [PATCH v3 3/3] guix: Modernize dub-build-system
 somewhat.
Date: Sat, 25 Jun 2022 23:37:36 +0200
[Message part 1 (text/plain, inline)]
Hi ),

I split these patches up into more atomic parts, made a few minor 
tweaks I deemed fit, and pushed them to master in two stages as 
4c63796545ce2a1f7cd556a831bb92c7b3166358 et al and 
30edb241a9ba50fefbd08438b5ffba25b10c6e61 et al.

Thanks!

T G-R
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#55999; Package guix-patches. (Sat, 25 Jun 2022 21:43:01 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 24 Jul 2022 11:24:11 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 275 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.