From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44704) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gCrgn-0007qx-W1 for guix-patches@gnu.org; Wed, 17 Oct 2018 15:41:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gCrgk-0000fe-LX for guix-patches@gnu.org; Wed, 17 Oct 2018 15:41:05 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:51404) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gCrgk-0000fX-Eq for guix-patches@gnu.org; Wed, 17 Oct 2018 15:41:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gCrgk-0005Ht-BL for guix-patches@gnu.org; Wed, 17 Oct 2018 15:41:02 -0400 Subject: [bug#33077] [PATCH 1/2] build-system/haskell: Use 'strip-store-file-name'. References: <87d0s8fk5p.fsf@gmail.com> In-Reply-To: <87d0s8fk5p.fsf@gmail.com> Resent-Message-ID: From: Alex Vong Date: Thu, 18 Oct 2018 03:40:18 +0800 Message-ID: <874ldkfjkt.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 33077@debbugs.gnu.org Cc: alexvong1995@gmail.com --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-build-system-haskell-Use-strip-store-file-name.patch Content-Transfer-Encoding: quoted-printable From=200c4ece986917593b4f940c780e788009a38ce4b0 Mon Sep 17 00:00:00 2001 From: Alex Vong Date: Thu, 18 Oct 2018 02:53:32 +0800 Subject: [PATCH 1/2] build-system/haskell: Use 'strip-store-file-name'. See the discussion at . * guix/build/haskell-build-system.scm (package-name-version): Remove it. (configure): Use 'strip-store-file-name' instead of 'package-name-version'. (setup-compiler): Likewise. (make-ghc-package-database): Likewise. (register): Likewise. * gnu/packages/haskell.scm (ghc-cairo)[arguments]: Likewise. * gnu/packages/agda.scm (agda)[arguments]: Likewise. =2D-- gnu/packages/agda.scm | 4 ++-- gnu/packages/haskell.scm | 4 ++-- guix/build/haskell-build-system.scm | 19 ++++++++----------- 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/gnu/packages/agda.scm b/gnu/packages/agda.scm index 6bb38aac4..26c5012bb 100644 =2D-- a/gnu/packages/agda.scm +++ b/gnu/packages/agda.scm @@ -85,6 +85,7 @@ (lambda* (#:key outputs inputs tests? (configure-flags '()) #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) + (name-version (strip-store-file-name out)) (input-dirs (match inputs (((_ . dir) ...) dir) @@ -95,8 +96,7 @@ `(,(string-append "--bindir=3D" out "/= bin")) `(,(string-append "--docdir=3D" out =2D "/share/doc/" ((@@ (guix build h= askell-build-system) =2D package-name-= version) out))) + "/share/doc/" name-version)) '("--libsubdir=3D$compiler/$pkg-$versi= on") '("--package-db=3D../package.conf.d") '("--global") diff --git a/gnu/packages/haskell.scm b/gnu/packages/haskell.scm index 0a90ac523..57435dca0 100644 =2D-- a/gnu/packages/haskell.scm +++ b/gnu/packages/haskell.scm @@ -10619,6 +10619,7 @@ expose it from another module in the hierarchy. (lambda* (#:key outputs inputs tests? (configure-flags '()) #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) + (name-version (strip-store-file-name out)) (input-dirs (match inputs (((_ . dir) ...) dir) @@ -10629,8 +10630,7 @@ expose it from another module in the hierarchy. `(,(string-append "--bindir=3D" out "/= bin")) `(,(string-append "--docdir=3D" out =2D "/share/doc/" ((@@ (guix build h= askell-build-system) =2D package-name-= version) out))) + "/share/doc/" name-version)) '("--libsubdir=3D$compiler/$pkg-$versi= on") '("--package-db=3D../package.conf.d") '("--global") diff --git a/guix/build/haskell-build-system.scm b/guix/build/haskell-build= -system.scm index 72714a29a..3cd49d4f4 100644 =2D-- a/guix/build/haskell-build-system.scm +++ b/guix/build/haskell-build-system.scm @@ -78,6 +78,7 @@ and parameters ~s~%" (doc (assoc-ref outputs "doc")) (lib (assoc-ref outputs "lib")) (bin (assoc-ref outputs "bin")) + (name-version (strip-store-file-name out)) (input-dirs (match inputs (((_ . dir) ...) dir) @@ -88,7 +89,7 @@ and parameters ~s~%" `(,(string-append "--bindir=3D" (or bin out) "/bi= n")) `(,(string-append "--docdir=3D" (or doc out) =2D "/share/doc/" (package-name-version out))) + "/share/doc/" name-version)) '("--libsubdir=3D$compiler/$pkg-$version") `(,(string-append "--package-db=3D" %tmp-db-dir)) '("--global") @@ -127,12 +128,6 @@ and parameters ~s~%" "Install a given Haskell package." (run-setuphs "copy" '())) =20 =2D(define (package-name-version store-dir) =2D "Given a store directory STORE-DIR return 'name-version' of the packag= e." =2D (let* ((base (basename store-dir))) =2D (string-drop base =2D (+ 1 (string-index base #\-))))) =2D (define (grep rx port) "Given a regular-expression RX including a group, read from PORT until t= he first match and return the content of the group." @@ -147,7 +142,7 @@ first match and return the content of the group." (define* (setup-compiler #:key system inputs outputs #:allow-other-keys) "Setup the compiler environment." (let* ((haskell (assoc-ref inputs "haskell")) =2D (name-version (package-name-version haskell))) + (name-version (strip-store-file-name haskell))) (cond ((string-match "ghc" name-version) (make-ghc-package-database system inputs outputs)) @@ -164,6 +159,7 @@ first match and return the content of the group." (define (make-ghc-package-database system inputs outputs) "Generate the GHC package database." (let* ((haskell (assoc-ref inputs "haskell")) + (name-version (strip-store-file-name haskell)) (input-dirs (match inputs (((_ . dir) ...) dir) @@ -171,7 +167,7 @@ first match and return the content of the group." ;; Silence 'find-files' (see 'evaluate-search-paths') (conf-dirs (with-null-error-port (search-path-as-list =2D `(,(string-append "lib/" (package-name-version has= kell))) + `(,(string-append "lib/" name-version)) input-dirs #:pattern ".*\\.conf.d$"))) (conf-files (append-map (cut find-files <> "\\.conf$") conf-dirs)= )) (mkdir-p %tmp-db-dir) @@ -231,9 +227,10 @@ given Haskell package." =20 (let* ((out (assoc-ref outputs "out")) (haskell (assoc-ref inputs "haskell")) + (name-verion (strip-store-file-name haskell)) (lib (string-append out "/lib")) =2D (config-dir (string-append lib "/" =2D (package-name-version haskell) + (config-dir (string-append lib + "/" name-verion "/" name ".conf.d")) (id-rx (make-regexp "^id: *(.*)$")) (config-file (string-append out "/" name ".conf")) =2D-=20 2.19.1 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYIAB0WIQSof2ZdXkE0FM5aU4XzrkvbI+zaGwUCW8eQIgAKCRDzrkvbI+za G8TqAQCGINbia8x8UdOtQafj4VmotC2C2tRhIgiZQlhZ98iZBwD7BGMrP9PAakOd QFwxyXcTh3b9/W8Or8g+y2Qo2ha9ngM= =Ybho -----END PGP SIGNATURE----- --==-=-=--