From patchwork Sat Feb 22 15:34:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Timothy Sample X-Patchwork-Id: 20366 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 DA0EB27BBE4; Sat, 22 Feb 2020 15:35:11 +0000 (GMT) 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, 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 C50C227BBEA for ; Sat, 22 Feb 2020 15:35:10 +0000 (GMT) Received: from localhost ([::1]:43684 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j5WoA-0005Sx-9L for patchwork@mira.cbaines.net; Sat, 22 Feb 2020 10:35:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59704) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j5Wo3-0005SZ-Lm for guix-patches@gnu.org; Sat, 22 Feb 2020 10:35:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j5Wo1-0004u9-Vc for guix-patches@gnu.org; Sat, 22 Feb 2020 10:35:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:43921) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j5Wo1-0004tx-MY for guix-patches@gnu.org; Sat, 22 Feb 2020 10:35:01 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1j5Wo1-0004r4-I5 for guix-patches@gnu.org; Sat, 22 Feb 2020 10:35:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#39309] [PATCH WIP] gnu: add stack. Resent-From: Timothy Sample Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 22 Feb 2020 15:35:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39309 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: John Soo Cc: 39309@debbugs.gnu.org Received: via spool by 39309-submit@debbugs.gnu.org id=B39309.158238570018652 (code B ref 39309); Sat, 22 Feb 2020 15:35:01 +0000 Received: (at 39309) by debbugs.gnu.org; 22 Feb 2020 15:35:00 +0000 Received: from localhost ([127.0.0.1]:49894 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j5Wnz-0004ql-Md for submit@debbugs.gnu.org; Sat, 22 Feb 2020 10:35:00 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:36517) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j5Wnx-0004qX-Mk for 39309@debbugs.gnu.org; Sat, 22 Feb 2020 10:34:58 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 3F54121D26; Sat, 22 Feb 2020 10:34:52 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Sat, 22 Feb 2020 10:34:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=rB1U/6 /VNSY/5YFSz264dyU13OYjvtbsin6cLBVm5Lk=; b=zuMUyHsEidxKoZLIvI1C/g zL/YmGx9ia8JWDXEF1xZSS6A7IdY0mNvpZEdnFdJUV4MbiXVPl4pXhFQFsROqdgR crSic97hrNWh8fpGhe0A529uJiWk6mq1jfp4gNyjtCjh48BVcdOGJrp1FKUCSWXx Qf3fgHHO7dRe8VyQF1z0JifJstTTNhMb3nvw8bT3Qu8vzk8A1NiE3FDpCnUeEESf pT7U69iBHQDJywhwcxEigcJhhfty0d3RKbpHVEtniROsxPXIBjdQrb6sZz3JMKlX dQ5EH4mqJ1SaMzIYHwNbKDnpHGY8inJ4F+FiInCavAiziFZoxxM6dFgleBXoUexA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrkeeigdejkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufhffjgfkfgggtgesmhdtreertderjeenucfhrhhomhepvfhimhhothhh hicuufgrmhhplhgvuceoshgrmhhplhgvthesnhhghihrohdrtghomheqnecukfhppeejge drudduiedrudekiedrgeegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehm rghilhhfrhhomhepshgrmhhplhgvthesnhhghihrohdrtghomh X-ME-Proxy: Received: from mrblack (74-116-186-44.qc.dsl.ebox.net [74.116.186.44]) by mail.messagingengine.com (Postfix) with ESMTPA id C0F5C328005E; Sat, 22 Feb 2020 10:34:51 -0500 (EST) From: Timothy Sample References: <87k14vou0u.fsf@ngyro.com> <87y2t6ayax.fsf@ngyro.com> <875zg78fcm.fsf@ngyro.com> <8736b57t7v.fsf@ngyro.com> Date: Sat, 22 Feb 2020 10:34:51 -0500 In-Reply-To: <8736b57t7v.fsf@ngyro.com> (Timothy Sample's message of "Wed, 19 Feb 2020 23:55:48 -0500") Message-ID: <87mu9ahbz8.fsf@ngyro.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 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 Hello again, Timothy Sample writes: > On the other hand, there are probably less than a dozen Haskell > packages that need flags [...]. Turns out there are thirteen! > I will make a patch that does this and see what the damages are. I’ve attached the patch. The name of the keyword is not great, so suggestions there are welcome. I managed to build all of our Haskell packages (except for some usual suspects that fail for other reasons). It’s not so bad, but it’s a bit of a hack. I’m now wondering why Guix’s treatment of “LIBRARY_PATH” is not just solving this outright without the need for those flags. Before I consider pushing the patch, I’m going to answer that question. Ideally, Guix could do more of what it’s good at: understanding the complete package graph. :) -- Tim From 01ff315ee02d033fd5335f4f53405db89fd81c14 Mon Sep 17 00:00:00 2001 From: Timothy Sample Date: Sat, 22 Feb 2020 09:56:36 -0500 Subject: [PATCH] build-system/haskell: Add 'extra-directories?' keyword. See . * guix/build-system/haskell.scm (haskell-build): Add 'extra-directories?' keyword and pass it through to the builder. * guix/build/haskell-build-system.scm (configure): Use it to toggle passing 'extra-include-dirs' and 'extra-lib-dirs' to Cabal. * gnu/packages/haskell-xyz.scm (ghc-alsa-core, ghc-hmatrix, ghc-hmatrix-gsl, ghc-hslua, ghc-iwlib, ghc-libyaml, ghc-ncurses, ghc-openglraw, ghc-x11, ghc-x11-xft, ghc-zlib): Enable 'extra-directories?'. gnu/packages/haskell-crypto.scm (ghc-digest, ghc-hsopenssl): Likewise. --- gnu/packages/haskell-crypto.scm | 4 ++++ gnu/packages/haskell-xyz.scm | 26 ++++++++++++++++++++++---- guix/build-system/haskell.scm | 2 ++ guix/build/haskell-build-system.scm | 17 +++++++++-------- 4 files changed, 37 insertions(+), 12 deletions(-) diff --git a/gnu/packages/haskell-crypto.scm b/gnu/packages/haskell-crypto.scm index 4170ec82f0..637a5d421e 100644 --- a/gnu/packages/haskell-crypto.scm +++ b/gnu/packages/haskell-crypto.scm @@ -343,6 +343,8 @@ generators, and more.") (base32 "04gy2zp8yzvv7j9bdfvmfzcz3sqyqa6rwslqcn4vyair2vmif5v4")))) (build-system haskell-build-system) + (arguments + `(#:extra-directories? #t)) (inputs `(("zlib" ,zlib))) (home-page @@ -790,6 +792,8 @@ extensions.") (base32 "0qivl9clmybfglwxqp2sq308rv4ia4rhwshcsc8b029bvpp0mpsi")))) (build-system haskell-build-system) + (arguments + `(#:extra-directories? #t)) (inputs `(("ghc-network" ,ghc-network) ("openssl" ,openssl))) diff --git a/gnu/packages/haskell-xyz.scm b/gnu/packages/haskell-xyz.scm index e368082c03..9992744245 100644 --- a/gnu/packages/haskell-xyz.scm +++ b/gnu/packages/haskell-xyz.scm @@ -327,6 +327,8 @@ tool lex or flex for C/C++.") (base32 "1avh4a419h9d2zsslg6j8hm87ppgsgqafz8ll037rk2yy1g4jl7b")))) (build-system haskell-build-system) + (arguments + `(#:extra-directories? #t)) (inputs `(("ghc-extensible-exceptions" ,ghc-extensible-exceptions) ("alsa-lib" ,alsa-lib))) @@ -5352,6 +5354,8 @@ accessed or modified.") (sha256 (base32 "1sqy1aci5zfagkb34mz3xdil7cl96z4b4cx28cha54vc5sx1lhpg")))) (build-system haskell-build-system) + (arguments + `(#:extra-directories? #t)) (inputs `(("ghc-random" ,ghc-random) ("ghc-split" ,ghc-split) @@ -5383,6 +5387,8 @@ numerical computations based on BLAS and LAPACK.") (sha256 (base32 "0v6dla426x4ywaq59jm89ql1i42n39iw6z0j378xwb676v9kfxhm")))) (build-system haskell-build-system) + (arguments + `(#:extra-directories? #t)) (inputs `(("ghc-hmatrix" ,ghc-hmatrix) ("ghc-vector" ,ghc-vector) @@ -5600,7 +5606,8 @@ handler built in.") "183bgl5jcx5y2r94lviqfw0a5w9089nxjd1z40k8vx9y2h60pm6j")))) (build-system haskell-build-system) (arguments - `(#:configure-flags '("-fsystem-lua"))) + `(#:configure-flags '("-fsystem-lua") + #:extra-directories? #t)) (inputs `(("lua" ,lua) ("ghc-exceptions" ,ghc-exceptions) @@ -6210,6 +6217,8 @@ instances for conversion to and from JSON .ipynb files.") (sha256 (base32 "0khmfwql4vwj55idsxmhjhrbqzfir3g9wm5lmpvnf77mm95cfpdz")))) (build-system haskell-build-system) + (arguments + `(#:extra-directories? #t)) (inputs `(("wireless-tools" ,wireless-tools))) (home-page "https://github.com/jaor/iwlib") @@ -6556,7 +6565,8 @@ compiler versions.") #t)))) (build-system haskell-build-system) (arguments - `(#:configure-flags `("--flags=system-libyaml"))) + `(#:configure-flags `("--flags=system-libyaml") + #:extra-directories? #t)) (inputs `(("ghc-conduit" ,ghc-conduit) ("ghc-resourcet" ,ghc-resourcet) @@ -7698,7 +7708,8 @@ between 2 and 3 times faster than the Mersenne Twister.") "0gsyyaqyh5r9zc0rhwpj5spyd6i4w2vj61h4nihgmmh0yyqvf3z5")))) (build-system haskell-build-system) (arguments - '(#:phases + '(#:extra-directories? #t + #:phases (modify-phases %standard-phases (add-before 'build 'fix-includes (lambda _ @@ -8036,6 +8047,8 @@ version 1.3).") (base32 "0zgllb4bcash2i2cispa3j565aw3dpxs41ghmhpvyvi4a6xmyldx")))) (build-system haskell-build-system) + (arguments + `(#:extra-directories? #t)) (inputs `(("ghc-half" ,ghc-half) ("ghc-fixed" ,ghc-fixed) @@ -13150,6 +13163,8 @@ modernized interface.") (sha256 (base32 "0gg6852mrlgl8zng1j84fismz7k81jr5fk92glgkscf8q6ryg0bm")))) (build-system haskell-build-system) + (arguments + `(#:extra-directories? #t)) (inputs `(("libx11" ,libx11) ("libxrandr" ,libxrandr) @@ -13174,6 +13189,8 @@ bindings are a direct translation of the C bindings.") "X11-xft-" version ".tar.gz")) (sha256 (base32 "1lgqb0s2qfwwgbvwxhjbi23rbwamzdi0l0slfr20c3jpcbp3zfjf")))) + (arguments + `(#:extra-directories? #t)) (inputs `(("ghc-x11" ,ghc-x11) ("ghc-utf8-string" ,ghc-utf8-string) @@ -13374,7 +13391,8 @@ modifying, and extracting files from zip archives in Haskell.") "1l11jraslcrp9d4wnhwfyhwk4fsiq1aq8i6vj81vcq1m2zzi1y7h")))) (build-system haskell-build-system) (arguments - `(#:phases + `(#:extra-directories? #t + #:phases (modify-phases %standard-phases (add-before 'configure 'strip-test-framework-constraints (lambda _ diff --git a/guix/build-system/haskell.scm b/guix/build-system/haskell.scm index 1ec11c71d8..25f4797d16 100644 --- a/guix/build-system/haskell.scm +++ b/guix/build-system/haskell.scm @@ -106,6 +106,7 @@ version REVISION." (tests? #t) (test-target "test") (configure-flags ''()) + extra-directories? (phases '(@ (guix build haskell-build-system) %standard-phases)) (outputs '("out")) @@ -134,6 +135,7 @@ provides a 'Setup.hs' file as its build system." (derivation->output-path revision)) (revision revision)) #:configure-flags ,configure-flags + #:extra-directories? ,extra-directories? #:haddock-flags ,haddock-flags #:system ,system #:test-target ,test-target diff --git a/guix/build/haskell-build-system.scm b/guix/build/haskell-build-system.scm index 91f62138d0..f69e16582a 100644 --- a/guix/build/haskell-build-system.scm +++ b/guix/build/haskell-build-system.scm @@ -72,8 +72,8 @@ and parameters ~s~%" (apply invoke "runhaskell" setup-file command params)) (error "no Setup.hs nor Setup.lhs found")))) -(define* (configure #:key outputs inputs tests? (configure-flags '()) - #:allow-other-keys) +(define* (configure #:key outputs inputs tests? extra-directories? + (configure-flags '()) #:allow-other-keys) "Configure a given Haskell package." (let* ((out (assoc-ref outputs "out")) (doc (assoc-ref outputs "doc")) @@ -84,6 +84,10 @@ and parameters ~s~%" (((_ . dir) ...) dir) (_ '()))) + (include-dirs (map (cut string-append "--extra-include-dirs=" <>) + (search-path-as-list '("include") input-dirs))) + (lib-dirs (map (cut string-append "--extra-lib-dirs=" <>) + (search-path-as-list '("lib") input-dirs))) (ghc-path (getenv "GHC_PACKAGE_PATH")) (params (append `(,(string-append "--prefix=" out)) `(,(string-append "--libdir=" (or lib out) "/lib")) @@ -94,12 +98,9 @@ and parameters ~s~%" '("--libsubdir=$compiler/$pkg-$version") `(,(string-append "--package-db=" %tmp-db-dir)) '("--global") - `(,@(map - (cut string-append "--extra-include-dirs=" <>) - (search-path-as-list '("include") input-dirs))) - `(,@(map - (cut string-append "--extra-lib-dirs=" <>) - (search-path-as-list '("lib") input-dirs))) + (if extra-directories? + (append include-dirs lib-dirs) + '()) (if tests? '("--enable-tests") '()) -- 2.25.0