unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: "\( via Guix-patches" via <guix-patches@gnu.org>
To: 55999@debbugs.gnu.org
Cc: "\(" <paren@disroot.org>
Subject: [bug#55999] [PATCH v3 3/3] guix: Modernize dub-build-system somewhat.
Date: Fri, 24 Jun 2022 18:56:28 +0100	[thread overview]
Message-ID: <20220624175628.7877-3-paren@disroot.org> (raw)
In-Reply-To: <20220624175628.7877-1-paren@disroot.org>

* 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





  parent reply	other threads:[~2022-06-24 17:58 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-15 18:52 [bug#55999] [PATCHSET] Various D fixes ( via Guix-patches via
2022-06-15 18:53 ` [bug#55999] [PATCH 1/2] gnu: packages: Replace rdmd with d-tools ( via Guix-patches via
2022-06-15 18:53   ` [bug#55999] [PATCH 2/2] gnu: packages: Update dub to v1.23.0 ( via Guix-patches via
2022-06-17  6:16   ` [bug#55999] [PATCH 1/2] gnu: packages: Replace rdmd with d-tools Maxime Devos
2022-06-17 15:43     ` ( via Guix-patches via
2022-06-17 17:20 ` [bug#55999] [PATCH v2 " ( via Guix-patches via
2022-06-17 17:20   ` [bug#55999] [PATCH v2 2/2] gnu: packages: Update dub to v1.23.0 ( via Guix-patches via
2022-06-24 17:56 ` [bug#55999] [PATCH v3 1/3] gnu: packages: Replace rdmd with d-tools ( via Guix-patches via
2022-06-24 17:56   ` [bug#55999] [PATCH v3 2/3] gnu: packages: Update dub to v1.23.0 ( via Guix-patches via
2022-06-24 17:56   ` ( via Guix-patches via [this message]
2022-06-25 21:37     ` bug#55999: [PATCH v3 3/3] guix: Modernize dub-build-system somewhat Tobias Geerinckx-Rice via Guix-patches via

Reply instructions:

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

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

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

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

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

  git send-email \
    --in-reply-to=20220624175628.7877-3-paren@disroot.org \
    --to=guix-patches@gnu.org \
    --cc=55999@debbugs.gnu.org \
    --cc=paren@disroot.org \
    /path/to/YOUR_REPLY

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

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

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

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