From patchwork Mon Apr 22 23:57:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christopher Baines X-Patchwork-Id: 13731 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 C71B816EF2; Tue, 23 Apr 2019 00:58:19 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,UNPARSEABLE_RELAY, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 58F3216EED for ; Tue, 23 Apr 2019 00:58:19 +0100 (BST) Received: from localhost ([127.0.0.1]:45769 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hIipG-0007Zk-OR for patchwork@mira.cbaines.net; Mon, 22 Apr 2019 19:58:18 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45483) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hIipC-0007WV-Cs for guix-patches@gnu.org; Mon, 22 Apr 2019 19:58:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hIip6-0001fE-NK for guix-patches@gnu.org; Mon, 22 Apr 2019 19:58:12 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:38382) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hIip0-0001cM-TE for guix-patches@gnu.org; Mon, 22 Apr 2019 19:58:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hIip0-0006Dv-Ma for guix-patches@gnu.org; Mon, 22 Apr 2019 19:58:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#35386] [PATCH] gnu: direnv: Change to the go-build-system. Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 22 Apr 2019 23:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 35386 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 35386@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.155597745323884 (code B ref -1); Mon, 22 Apr 2019 23:58:02 +0000 Received: (at submit) by debbugs.gnu.org; 22 Apr 2019 23:57:33 +0000 Received: from localhost ([127.0.0.1]:51926 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hIioX-0006DA-3R for submit@debbugs.gnu.org; Mon, 22 Apr 2019 19:57:33 -0400 Received: from eggs.gnu.org ([209.51.188.92]:59079) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hIioV-0006Cx-Q2 for submit@debbugs.gnu.org; Mon, 22 Apr 2019 19:57:32 -0400 Received: from lists.gnu.org ([209.51.188.17]:42426) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hIioQ-00013N-Ey for submit@debbugs.gnu.org; Mon, 22 Apr 2019 19:57:26 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45215) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hIioO-0006tS-K7 for guix-patches@gnu.org; Mon, 22 Apr 2019 19:57:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hIioN-0000zl-5Y for guix-patches@gnu.org; Mon, 22 Apr 2019 19:57:24 -0400 Received: from mira.cbaines.net ([212.71.252.8]:42926) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hIioM-0000yw-Tj for guix-patches@gnu.org; Mon, 22 Apr 2019 19:57:23 -0400 Received: from localhost (cpc102582-walt20-2-0-cust14.13-2.cable.virginm.net [86.27.34.15]) by mira.cbaines.net (Postfix) with ESMTPSA id 87D1B16EE9 for ; Tue, 23 Apr 2019 00:57:20 +0100 (BST) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id 46eea4b2 for ; Mon, 22 Apr 2019 23:57:19 +0000 (UTC) From: Christopher Baines Date: Tue, 23 Apr 2019 00:57:19 +0100 Message-Id: <20190422235719.5427-1-mail@cbaines.net> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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 go-build-system is slightly more appropriate, and switching resolves an issue with combining the 'unpack phase from the gnu-build-system, and the 'setup-go-environment from the go-build-system. With both of those phases creating a directory, the first-subdirectory call at the end of the 'unpack phase can return different values depending on the filesystem ordering. * gnu/packages/shellutils.scm (direnv)[source]: Use the git repository, as this works better with the go-build-system. [build-system]: Change to the go-build-system. [arguments]: Adjust for the go-build-system. [native-inputs]: Remove go. --- gnu/packages/shellutils.scm | 51 ++++++++++++++++++++----------------- 1 file changed, 28 insertions(+), 23 deletions(-) diff --git a/gnu/packages/shellutils.scm b/gnu/packages/shellutils.scm index 59a8b744eb..56359ce160 100644 --- a/gnu/packages/shellutils.scm +++ b/gnu/packages/shellutils.scm @@ -105,35 +105,40 @@ are already there.") (name "direnv") (version "2.15.2") (source - (origin (method url-fetch) - (uri (string-append "https://github.com/direnv/" name - "/archive/v" version ".tar.gz")) - (file-name (string-append name "-" version ".tar.gz")) + (origin (method git-fetch) + (uri (git-reference + (url "https://github.com/direnv/direnv.git") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) (sha256 (base32 - "1hhmc6rb7b1d4s4kgb4blrq35h388ax37ap88dq3dgfcw9w6j1rm")))) - (build-system gnu-build-system) + "1y18619pmhfl0vrf4w0h75ybkkwgi9wcb7d9kv4n8drg1xp4aw4w")))) + (build-system go-build-system) (arguments - `(#:test-target "test" - #:make-flags (list (string-append "DESTDIR=" (assoc-ref %outputs "out"))) - #:modules ((guix build gnu-build-system) - ((guix build go-build-system) #:prefix go:) - (guix build union) - (guix build utils)) - #:imported-modules (,@%gnu-build-system-modules - (guix build union) - (guix build go-build-system)) + '(#:import-path "github.com/direnv/direnv" #:phases (modify-phases %standard-phases - (delete 'configure) - ;; Help the build scripts find the Go language dependencies. - (add-before 'unpack 'setup-go-environment - (assoc-ref go:%standard-phases 'setup-go-environment)) - (add-after 'install 'remove-go-references - (assoc-ref go:%standard-phases 'remove-go-references))))) + (add-after 'unpack 'delete-vendor + (lambda _ + ;; Using a snippet causes issues with the name of the directory, + ;; so delete the extra source code here. + (delete-file-recursively "src/github.com/direnv/direnv/vendor") + #t)) + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (setenv "HOME" "/tmp") + (with-directory-excursion "src/github.com/direnv/direnv" + ;; The following file needs to be writable so it can be + ;; modified by the testsuite. + (make-file-writable "test/scenarios/base/.envrc") + (invoke "make" "test") + ;; Clean up from the tests, especially so that the extra + ;; direnv executable that's generated is removed. + (invoke "make" "clean"))) + #t))))) (native-inputs - `(("go" ,go) - ("go-github-com-burntsushi-toml" ,go-github-com-burntsushi-toml) + `(("go-github-com-burntsushi-toml" ,go-github-com-burntsushi-toml) ("go-github-com-direnv-go-dotenv" ,go-github-com-direnv-go-dotenv) ("which" ,which))) (home-page "https://direnv.net/")