From patchwork Mon Apr 27 18:22:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marius Bakke X-Patchwork-Id: 21687 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id BAE7E27BBE4; Mon, 27 Apr 2020 19:28:08 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,MAILING_LIST_MULTI,T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 34AFE27BBE1 for ; Mon, 27 Apr 2020 19:28:08 +0100 (BST) Received: from localhost ([::1]:58168 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jT8UB-0003Mi-L7 for patchwork@mira.cbaines.net; Mon, 27 Apr 2020 14:28:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35782) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jT8PX-00021R-71 for guix-patches@gnu.org; Mon, 27 Apr 2020 14:23:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jT8PH-00037x-Qd for guix-patches@gnu.org; Mon, 27 Apr 2020 14:23:18 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:54796) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jT8PH-00037p-9g for guix-patches@gnu.org; Mon, 27 Apr 2020 14:23:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jT8PH-0004aD-6G for guix-patches@gnu.org; Mon, 27 Apr 2020 14:23:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#40908] [PATCH core-updates 1/5] gnu: %guile-static: Rewrite in terms of 'make-guile-static'. References: <20200427182027.27813-1-mbakke@fastmail.com> In-Reply-To: <20200427182027.27813-1-mbakke@fastmail.com> Resent-From: Marius Bakke Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 27 Apr 2020 18:23:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40908 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 40908@debbugs.gnu.org Received: via spool by 40908-submit@debbugs.gnu.org id=B40908.158801177017558 (code B ref 40908); Mon, 27 Apr 2020 18:23:03 +0000 Received: (at 40908) by debbugs.gnu.org; 27 Apr 2020 18:22:50 +0000 Received: from localhost ([127.0.0.1]:38104 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jT8P3-0004Z2-7u for submit@debbugs.gnu.org; Mon, 27 Apr 2020 14:22:49 -0400 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]:36025) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jT8Om-0004Xm-2D for 40908@debbugs.gnu.org; Mon, 27 Apr 2020 14:22:46 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id E6FDE793 for <40908@debbugs.gnu.org>; Mon, 27 Apr 2020 14:22:23 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Mon, 27 Apr 2020 14:22:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h= from:to:subject:date:message-id:mime-version :content-transfer-encoding; s=fm2; bh=tkNC5JQnPY6XgwIaAkIwnfm1/K kKx/WfNyF6gRNnonM=; b=RMtriytspESr7kBtG7tlrxdy1tSH/BkNM02iUIo2yn iqWF4z06xPqmBOEtahDmeWoCGkj64G8GXXv7+0nS+ydz3mqFp6zcpYy0YOI25N3D U1K6TwufhyxlqeYNvtNmwivIIs08rPXJygV7PBxLnEtZafuzH2h+H/eJhuknmn2W v5Ibxp7olhGktOHBeb9OLTmViQcc5re4X4spSH4AajsrZfwEzPfC1cnyFsxJnusx bZCfTEwe3JK/NYdXHJzaAQ/WX+1nhhhpoufU8hFhrxMyoVDIYNiWR8qfE5ZK3v1n H0GzJvQ9HPu0c4hoj0U0jkuSX+qCYsw+JjU5J+IIhS+g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:date:from :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=tkNC5JQnPY6XgwIaA kIwnfm1/KkKx/WfNyF6gRNnonM=; b=OYF0NEHLdtmqt0JQpcHl3xJMLH6LvGghK WRLVzlVavBaDgNF97z+4nsaVD2b+u4J7NunyZfFwDSeKbHnH4yK6RruPV8BeZ1QO o0f56EqITRXJe+j7st1rgdsVRa4uTyQ6KEAzykEbuXbV2+hIjM4A5s4hdkVB2pd2 9poIszJ9i0ZRErdzhdJvGHXd34pHEF5eFuFe9H59WG1ooHvvUllqHFSQbEcGDFYz XVUvBiqYagAVyIGwuJLYml9aIEYSeJ+sOB2pAwXdUgHKnBAxFSLzlB43FbK2DIBE x9vsjTSyLa0ZyqGqCbnN8ykGVoC0xwfJY0MjUTdlQ2CU+LBiAJsXw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrheelgdduvddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgggfestdekredtre dttdenucfhrhhomhepofgrrhhiuhhsuceurghkkhgvuceomhgsrghkkhgvsehfrghsthhm rghilhdrtghomheqnecukfhppeekgedrvddtvddrieekrdejheenucevlhhushhtvghruf hiiigvpedunecurfgrrhgrmhepmhgrihhlfhhrohhmpehmsggrkhhkvgesfhgrshhtmhgr ihhlrdgtohhm X-ME-Proxy: Received: from localhost (ti0006q161-2604.bb.online.no [84.202.68.75]) by mail.messagingengine.com (Postfix) with ESMTPA id 2909D3065E7C for <40908@debbugs.gnu.org>; Mon, 27 Apr 2020 14:22:23 -0400 (EDT) From: Marius Bakke Date: Mon, 27 Apr 2020 20:22:18 +0200 Message-Id: <20200427182222.28142-1-mbakke@fastmail.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches The derivation remains unchanged. * gnu/packages/make-bootstrap.scm (make-guile-static): New procedure. (%guile-static): Adjust accordingly. --- gnu/packages/make-bootstrap.scm | 124 ++++++++++++++++---------------- 1 file changed, 64 insertions(+), 60 deletions(-) diff --git a/gnu/packages/make-bootstrap.scm b/gnu/packages/make-bootstrap.scm index 5716ed3886..f4d7fd6a2a 100644 --- a/gnu/packages/make-bootstrap.scm +++ b/gnu/packages/make-bootstrap.scm @@ -676,70 +676,74 @@ for `sh' in $PATH, and without nscd, and with static NSS modules." #t)))) (inputs `(("mes" ,%mes-minimal))))) +(define* (make-guile-static guile patches) + (package-with-relocatable-glibc + (static-package + (package + (inherit guile) + (source + (origin (inherit (package-source guile)) + (patches (append (map search-patch patches) + (origin-patches (package-source guile)))))) + (name (string-append (package-name guile) "-static")) + (synopsis "Statically-linked and relocatable Guile") + + ;; Remove the 'debug' output (see above for the reason.) + (outputs (delete "debug" (package-outputs guile))) + + (inputs + `(("libunistring:static" ,libunistring "static") + ,@(package-inputs guile))) + + (propagated-inputs + `(("bdw-gc" ,libgc/static-libs) + ,@(alist-delete "bdw-gc" + (package-propagated-inputs guile)))) + (arguments + (substitute-keyword-arguments (package-arguments guile) + ((#:configure-flags flags '()) + ;; When `configure' checks for ltdl availability, it + ;; doesn't try to link using libtool, and thus fails + ;; because of a missing -ldl. Work around that. + ''("LDFLAGS=-ldl")) + ((#:phases phases '%standard-phases) + `(modify-phases ,phases + + ;; Do not record the absolute file name of 'sh' in + ;; (ice-9 popen). This makes 'open-pipe' unusable in + ;; a build chroot ('open-pipe*' is fine) but avoids + ;; keeping a reference to Bash. + (delete 'pre-configure) + + (add-before 'configure 'static-guile + (lambda _ + (substitute* "libguile/Makefile.in" + ;; Create a statically-linked `guile' + ;; executable. + (("^guile_LDFLAGS =") + "guile_LDFLAGS = -all-static") + + ;; Add `-ldl' *after* libguile-2.0.la. + (("^guile_LDADD =(.*)$" _ ldadd) + (string-append "guile_LDADD = " + (string-trim-right ldadd) + " -ldl\n"))))))) + ((#:tests? _ #f) + ;; There are uses of `dynamic-link' in + ;; {foreign,coverage}.test that don't fly here. + #f) + ((#:parallel-build? _ #f) + ;; Work around the fact that the Guile build system is + ;; not deterministic when parallel-build is enabled. + #f))))))) + (define %guile-static ;; A statically-linked Guile that is relocatable--i.e., it can search ;; .scm and .go files relative to its installation directory, rather ;; than in hard-coded configure-time paths. - (let* ((patches (cons* (search-patch "guile-relocatable.patch") - (search-patch "guile-default-utf8.patch") - (search-patch "guile-linux-syscalls.patch") - (origin-patches (package-source guile-2.0)))) - (source (origin (inherit (package-source guile-2.0)) - (patches patches))) - (guile (package (inherit guile-2.0) - (name (string-append (package-name guile-2.0) "-static")) - (source source) - (synopsis "Statically-linked and relocatable Guile") - - ;; Remove the 'debug' output (see above for the reason.) - (outputs (delete "debug" (package-outputs guile-2.0))) - - (inputs - `(("libunistring:static" ,libunistring "static") - ,@(package-inputs guile-2.2))) - - (propagated-inputs - `(("bdw-gc" ,libgc/static-libs) - ,@(alist-delete "bdw-gc" - (package-propagated-inputs guile-2.0)))) - (arguments - (substitute-keyword-arguments (package-arguments guile-2.0) - ((#:configure-flags flags '()) - ;; When `configure' checks for ltdl availability, it - ;; doesn't try to link using libtool, and thus fails - ;; because of a missing -ldl. Work around that. - ''("LDFLAGS=-ldl")) - ((#:phases phases '%standard-phases) - `(modify-phases ,phases - - ;; Do not record the absolute file name of 'sh' in - ;; (ice-9 popen). This makes 'open-pipe' unusable in - ;; a build chroot ('open-pipe*' is fine) but avoids - ;; keeping a reference to Bash. - (delete 'pre-configure) - - (add-before 'configure 'static-guile - (lambda _ - (substitute* "libguile/Makefile.in" - ;; Create a statically-linked `guile' - ;; executable. - (("^guile_LDFLAGS =") - "guile_LDFLAGS = -all-static") - - ;; Add `-ldl' *after* libguile-2.0.la. - (("^guile_LDADD =(.*)$" _ ldadd) - (string-append "guile_LDADD = " - (string-trim-right ldadd) - " -ldl\n"))))))) - ((#:tests? _ #f) - ;; There are uses of `dynamic-link' in - ;; {foreign,coverage}.test that don't fly here. - #f) - ((#:parallel-build? _ #f) - ;; Work around the fact that the Guile build system is - ;; not deterministic when parallel-build is enabled. - #f)))))) - (package-with-relocatable-glibc (static-package guile)))) + (make-guile-static guile-2.0 '("guile-relocatable.patch" + "guile-default-utf8.patch" + "guile-linux-syscalls.patch"))) (define %guile-static-stripped ;; A stripped static Guile binary, for use during bootstrap.