From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id 0IkfE2xDqmV+XgEAqHPOHw:P1 (envelope-from ) for ; Fri, 19 Jan 2024 10:39:56 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id 0IkfE2xDqmV+XgEAqHPOHw (envelope-from ) for ; Fri, 19 Jan 2024 10:39:56 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b="Lsk7n3Q/"; dmarc=none; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1705657196; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: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=VYiOM5qPyONfZUY76XTEf+0ZOTpHu5kaSSWFfgcRwuM=; b=luUbnYEg7c8tDwauymPfXxkjD1WWDISaAto5POkJkZ4VfifJvODhzctIpwzw9DK775zGdQ PQvtdR2OIIs5dM4Q/C03MlKmWDM4aAR5az2GMCUODFpgqUZmvrtu0AAp2augv2gjbx6A/B 7LvPGVSSPT9y+HIwbe4YuLYOzGvBVfvocwJSANEiyla3lEHUJFKBkE2lqhax0P0zih251e OvaLC2W2fWD8ztptp727FcjeYUCEo41VdJHNsm8aIsc2X5pyeD3BvUP162GUcjvp3oKD6A eHNtq5d35Q7IwubC2A/fDtC/dVOlxpSyamY7CxqqDE4Vd69JVmqxG3TCZxWs0w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1705657196; a=rsa-sha256; cv=none; b=Kwf5rk0YHiuR3USdr+3zDSPK0PPWxuzOCdY/Clm4sljwvKvANNMRnu2guPzk6B98YYqZPb pjZ2lZy0IUm0ou5/8kqjWh/MIsCvN8f8rjnu+AFwTlZjxVqYHYP8874Tu1rl+pu0b8mcQL HLAThNGMwarWT5D550w+jXAdmD1ScDBT0RDUT/xRFv1YkwIfUbTAWKbY5eutrU00TFvSPB x5+w8goX7qRuc6WwV0dZY1QWp8kxESxjC4wzPpRqHEmLnp3Tgm4zzttBfwuE2ybl80zDZx qSxlASrh2iLMMfao204rQX0L19rIYc1nkro+EiZd4hLAQPEEqEOsQoZDA3S+EQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b="Lsk7n3Q/"; dmarc=none; 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" 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 1920621B59 for ; Fri, 19 Jan 2024 10:39:56 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rQlL8-0001zO-JF; Fri, 19 Jan 2024 04:39:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rQlL3-0001sq-FD for guix-patches@gnu.org; Fri, 19 Jan 2024 04:39:02 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rQlL2-0000Zv-JA for guix-patches@gnu.org; Fri, 19 Jan 2024 04:39:01 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rQlL4-0007hd-Cq for guix-patches@gnu.org; Fri, 19 Jan 2024 04:39:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#68554] [PATCH v3 3/6] gnu: Add dmd. Resent-From: Efraim Flashner Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 19 Jan 2024 09:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68554 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxim Cournoyer Cc: 68554@debbugs.gnu.org Received: via spool by 68554-submit@debbugs.gnu.org id=B68554.170565710329491 (code B ref 68554); Fri, 19 Jan 2024 09:39:02 +0000 Received: (at 68554) by debbugs.gnu.org; 19 Jan 2024 09:38:23 +0000 Received: from localhost ([127.0.0.1]:57500 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rQlKQ-0007fb-BT for submit@debbugs.gnu.org; Fri, 19 Jan 2024 04:38:22 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]:44516) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rQlKO-0007fL-1S for 68554@debbugs.gnu.org; Fri, 19 Jan 2024 04:38:21 -0500 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-40e8fec0968so7104535e9.1 for <68554@debbugs.gnu.org>; Fri, 19 Jan 2024 01:38:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705657092; x=1706261892; darn=debbugs.gnu.org; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:sender:from:to :cc:subject:date:message-id:reply-to; bh=VYiOM5qPyONfZUY76XTEf+0ZOTpHu5kaSSWFfgcRwuM=; b=Lsk7n3Q/YcgoKmJJPguaKTPK79sKY2eMRC895dpGueVopF2Mdno5UDpmBfTxaGBr45 JuWFYbl3bukhu9zONk+kMrUiELqA6tnWHG86H1GZ9sFjQR1FmTM6AD8+sUNMsbtkYJaB g/bQVyO+Psz6r5dBQAl1EHPmQdE1mdbOny3S4cycpmXR+1PoGzE1zGJcYTjvB7mie0FN hrGUucTVn0ywFF1vZow+kpO6TPRzEErLaWUnYJ4LHB2f458BRG8akU7QEC3vkrN39sWh wll3narFJ0fHACSZcRcCFtNxvly7Rs+ALkJe4xrV73LG1xSgK6qxWzpcSt2T7H8z9m0Y KR/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705657092; x=1706261892; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:sender :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=VYiOM5qPyONfZUY76XTEf+0ZOTpHu5kaSSWFfgcRwuM=; b=JnbMfbmNTzaStT5/+F55zxEGZ5CYuV8kX4OYVO2rBOPCdDRhpBFMvx4Rt7Vbh4vspW 2mtztf+rbdwPC+Eh4r1hc7ZGoy2bmSitCdKg/6rSTHAmBSwC+nGJ2+tD1rF8kM0xofke yvh11GsoHLjjFiDDIwyOcQxutH5IsJsR7B+OsXz4fdV5ijFd0CFBHIO5I+61qq6UH81s W8gFkPxi3jKhQKOwRCcy9+Hp8FTgXKw6V3VZMXpLrFdLtXFXEDtYKSXicgbuxNIcsHzi nywN8sJpwfhnqjncCZO9WuLpZLBIdOys8WMN5j1hh1ZN0B0oxYEzplQLcWTeglYrWHvB gziw== X-Gm-Message-State: AOJu0YyaDEJxckAVZLDnQtRdEV4tDMVfybdnZlWroQeIZT5IPB4IL+v2 h7ejadvMXF4RYpQVVEv2oceZrOy94vP/744I/wIvKMqGosAwRC0AqxBERiTE3ss= X-Google-Smtp-Source: AGHT+IFPh7xS+hIn8tb6c2CeGwrVzBq6wiffL0hzkVSCwSzn22gAVC9OM+YO04w6emeTFqoz9fePkg== X-Received: by 2002:a05:600c:2285:b0:40e:5947:bcc6 with SMTP id 5-20020a05600c228500b0040e5947bcc6mr1169381wmf.108.1705657091391; Fri, 19 Jan 2024 01:38:11 -0800 (PST) Received: from localhost ([141.226.15.142]) by smtp.gmail.com with ESMTPSA id i19-20020a05600c355300b0040e76b60235sm17228397wmq.8.2024.01.19.01.38.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 01:38:10 -0800 (PST) Date: Fri, 19 Jan 2024 11:38:09 +0200 From: Efraim Flashner Message-ID: Mail-Followup-To: Efraim Flashner , Maxim Cournoyer , 68554@debbugs.gnu.org References: <33263f493ea13d0a468a73c9b704e1a0496c0a91.1705639243.git.maxim.cournoyer@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="L/ASqhD7XjWrBa5l" Content-Disposition: inline In-Reply-To: <33263f493ea13d0a468a73c9b704e1a0496c0a91.1705639243.git.maxim.cournoyer@gmail.com> X-PGP-Key-ID: 0x41AAE7DCCA3D8351 X-PGP-Key: https://flashner.co.il/~efraim/efraim_flashner.asc X-PGP-Fingerprint: A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Scanner: mx10.migadu.com X-Migadu-Spam-Score: -4.29 X-Spam-Score: -4.29 X-Migadu-Queue-Id: 1920621B59 X-TUID: k08V4iefPVBn --L/ASqhD7XjWrBa5l Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jan 18, 2024 at 11:40:41PM -0500, Maxim Cournoyer wrote: > * gnu/packages/dlang.scm (dmd-bootstrap, dmd): New variables. >=20 > Change-Id: I53e00a429e2084a392341ef1bc7ea63f0fcaaab4 > --- >=20 > Changes in v3: > - Add packages built from dmd and D demangling support to qt-creator >=20 > Changes in v2: > - Build make flags via inheritance... > - Fixing the missing SYSCONFDIR make flag >=20 > gnu/packages/dlang.scm | 165 +++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 165 insertions(+) >=20 > 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-runti= me > ("python-lit" ,python-lit)))))) > =20 > +;;; Bootstrap version of phobos that is built with GDC, using GDC's stan= dard > +;;; library. > +(define dmd-bootstrap > + (package > + ;; This package is purposefully named just "dmd" and not "dmd-bootst= rap", > + ;; as the final dmd package rewrites references from this one to its= elf, > + ;; 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 suc= h as > + ;; '-conf'. > + #:tests? #f > + #:test-target "test" > + #:make-flags > + #~(list (string-append "CC=3D" #$(cc-for-target)) > + ;; XXX: Proceed despite conflicts from symbols provided by= both > + ;; the source built and GDC. > + "DFLAGS=3D-L--allow-multiple-definition" > + "ENABLE_RELEASE=3D1" > + (string-append "HOST_CXX=3D" #$(cxx-for-target)) > + "HOST_DMD=3Dgdmd" > + (string-append "INSTALL_DIR=3D" #$output) > + ;; Do not build the shared libphobos2.so library, to avoid > + ;; retaining a reference to gcc:lib. > + "SHARED=3D0" > + (string-append "SYSCONFDIR=3D" #$output "/etc") > + "VERBOSE=3D1" > + "-f" "posix.mak") > + #:phases > + #~(modify-phases %standard-phases > + (add-after 'unpack 'copy-phobos-source-and-chdir > + ;; Start with building phobos, which in turns will automatic= ally > + ;; 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 > + "1yw7nb5d78cx9m7sfibv7rfc7wj3w0dw9mfk3d269qpfpnwzs4= n9"))) > + "phobos") > + (chdir "phobos"))) > + (add-after 'copy-phobos-source-and-chdir 'adjust-phobos-instal= l-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 #$out= put))) 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=3D-L--allow-multiple-definition" > + "HOST_DMD=3Dgdmd" > + "SHARED=3D0"))) > + ((#: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 r= educe > + ;; 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") > --=20 > 2.41.0 >=20 >=20 >=20 >=20 --=20 Efraim Flashner =D7=A8=D7=A0=D7=A9=D7=9C=D7=A4 = =D7=9D=D7=99=D7=A8=D7=A4=D7=90 GPG key =3D A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted --L/ASqhD7XjWrBa5l Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAmWqQv4ACgkQQarn3Mo9 g1FB2hAAueDq671voq16bHMKLvulO3Rj5iNKtJ/FxjbNhrL+iowv0y9DSvJUxMM+ 1idx+DGDDDMymHlOI91SXTdpZztQr3OqqfTPiE8xGUxyrDB6pmVFK0nZgqkqZ1FV PvaigRcM3e/zW/klFRXXEtNjZnBgMqeD7DtK85OPDCp4H77DjaWjpffLuIag3Kjs 7vO0NPPXkH1cb9/IIodc4jxpDhWiA/ZXFeIUB3/rfW7XZSGpGMQ/bzwQZPQRh67c RMq/Le//BrAP3CkW/pHNacEA89cnC8Syb8Aae1GXB0nVNQMsdn+qiEu6sa8eCF8v uch7ReN4GimrsvZA6duyH/lz4bkhvmL21XhCGjkvPpfoI/8FvOFqgW53zc4kjGxZ RG0cF6paKeOUpFxcNsEFZU1mQwX9xwJLQnVj/ZyBhhbZ2fvARv4o0AF0DJLeWHmG G9ZJ6zLC53qTEqr/GB809z0ZFla0N1HD5hGYMEWCkorFQyy3Z5Yl9iUZlP36eC2B +5uLrJIdpghEgFf5OYh5fMVjYztRzsPlfwvDA1pORmWRpHKMIsXD/AMXzT4NkwkO ZzNkZci7Mnz0g7uq/K4PUZsK0wDfpy0xzT/k58XpZB7ZBhfMKhlb9AhL4o/URUUW EDGFx/bDDdIjS3/sI2N++gollYrttfQk/RAUtSbhT+k+h4/jiyY= =ygW4 -----END PGP SIGNATURE----- --L/ASqhD7XjWrBa5l--