From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 8ERMGkb7tWLYNAAAbAwnHQ (envelope-from ) for ; Fri, 24 Jun 2022 19:58:30 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id 8JkpGkb7tWLm2gAAauVa8A (envelope-from ) for ; Fri, 24 Jun 2022 19:58:30 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id DE0AD2580F for ; Fri, 24 Jun 2022 19:58:29 +0200 (CEST) Received: from localhost ([::1]:59432 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o4nZc-00062f-J1 for larch@yhetil.org; Fri, 24 Jun 2022 13:58:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43784) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o4nYE-0005F2-QT for guix-patches@gnu.org; Fri, 24 Jun 2022 13:57:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:49566) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o4nYE-0005fY-HO for guix-patches@gnu.org; Fri, 24 Jun 2022 13:57:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o4nYE-0005MT-H6 for guix-patches@gnu.org; Fri, 24 Jun 2022 13:57:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#55999] [PATCH v3 3/3] guix: Modernize dub-build-system somewhat. Resent-From: "(" Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 24 Jun 2022 17:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55999 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 55999@debbugs.gnu.org Cc: "\(" Received: via spool by 55999-submit@debbugs.gnu.org id=B55999.165609340820572 (code B ref 55999); Fri, 24 Jun 2022 17:57:02 +0000 Received: (at 55999) by debbugs.gnu.org; 24 Jun 2022 17:56:48 +0000 Received: from localhost ([127.0.0.1]:43461 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o4nY0-0005Lk-6R for submit@debbugs.gnu.org; Fri, 24 Jun 2022 13:56:48 -0400 Received: from knopi.disroot.org ([178.21.23.139]:54728) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o4nXw-0005LN-4s for 55999@debbugs.gnu.org; Fri, 24 Jun 2022 13:56:44 -0400 Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 67EB145941; Fri, 24 Jun 2022 19:56:43 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Received: from knopi.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZZJL5_bEnfrI; Fri, 24 Jun 2022 19:56:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1656093402; bh=DGTSUPSRruKnNTVsnd59TIVzP7NZmgWnhy3zbTSWMIQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Jw0vLWhygNwAqNZrherRLu2W1mIMpYWNa0NO//iZuNgcsGtuxxib7U+qVoOmfnqQ6 LSQWeQCzEAuCG5P0ODQUneadHoTHSqs/2kHEyL0VH+rsHUKoKFeqZ770G/vDmb8ZH5 rNn1q4PdzLugk/kKFLizzlUciaIHX8/NDQ7A95iYzHFinbyLja1u52Sa0aaj/m0+jG zTxrZzaVyXEobRZb2lXjkONIm/O3RdN2by5iQfxbipDAOFlKBpet00Emw5gK8XLMip xLCGE32/HuKmpiDhesTu195372I3aWZY/V0G9XkT7LPJeGU46J3x6xYJGplGgwFE0m dF0Zr/O9HE54Q== Date: Fri, 24 Jun 2022 18:56:28 +0100 Message-Id: <20220624175628.7877-3-paren@disroot.org> In-Reply-To: <20220624175628.7877-1-paren@disroot.org> References: <20220624175628.7877-1-paren@disroot.org> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" Reply-to: "\(" X-ACL-Warn: , "\( via Guix-patches" From: "\( via Guix-patches" via X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1656093510; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=ehLg/YjE4R80LLjvElnK5/xlsDNuaWsKgNjrGLMgX28=; b=r8A8aXkAOuQuzpqKxzDOoeLvjaYkmezIE9NUKRMERl/UcEsPX7h0WiX7kqhjcsf1+cC3Uh rz0WaFs7pSqoISIN9kHfTvhkbM7R4BA4/EMEo6AcFERC/ejeGElud0+x/CSxuJcxvwK1dc flSV7EmARUofPldXUzwo6c46q+fLpWsa4GBCud7Wk24GpzQU7pnVEIaa+RPLXceb9dfnh0 O9VClctbDw+m3WyNhna9PlRFTGyrigTrbIugSCRp+HiqpgghBKXXhkb54FiyjRjHch5BFg tmmtienjrA/2Rvhgx2GKI6XDQMUd1vW2k0+lr/12Ccy/hLj6XKqW5EW3fWzccw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1656093510; a=rsa-sha256; cv=none; b=ECXQ2wCkuy4fyZWLr8bnzjzVbdpiwoKUQRC13yCsZS5E4J0ONNb+d/ApPTDuAc7DItKVDg 38gI0fkO7olxdz9qArZkI4UMT+IKpdliOkIlbJ4Ic43f1Ww+V6SzgY6SYF4wPDPLBWxY8P Nuwtu0TrQUGgZ5VhADQHsgVeMdnq3ipF1+4Ah7BcpikeYMlgibYY9Te9vthGjxwJczN/WX ipXE9YhcsWzy8bKPqTZyIlOXZPgVZmjH8UrsSFnDc4jTevvOJ35u3zYpB8rzwBkck21QoH lKrwzCPN7A4mp4jAmETPMj1g8IpvxoFudG9gJNhNdjQD0BX8RKMOPRpYkOakmA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=disroot.org header.s=mail header.b=Jw0vLWhy; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -2.46 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=disroot.org header.s=mail header.b=Jw0vLWhy; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: DE0AD2580F X-Spam-Score: -2.46 X-Migadu-Scanner: scn0.migadu.com X-TUID: V6HJQrztXr7p * guix/build-system/dub.scm (default-ld-gold-wrapper): New variable. (lower): Add keyed argument ld-gold-wrapper. [bag]: 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