guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#55999] [PATCH v3 3/3] guix: Modernize dub-build-system somewhat.


From: (
Subject: [bug#55999] [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 via email to

[Prev in Thread] Current Thread [Next in Thread]