unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] build-system/haskell: CONFIG_SHELL env variable.
@ 2015-10-23 17:37 Paul van der Walt
  2015-10-23 18:04 ` [PATCH] gnu: haskell: Remove CONFIG_SHELL patches Paul van der Walt
  2015-10-25 21:58 ` [PATCH] build-system/haskell: CONFIG_SHELL env variable Ludovic Courtès
  0 siblings, 2 replies; 4+ messages in thread
From: Paul van der Walt @ 2015-10-23 17:37 UTC (permalink / raw)
  To: guix-devel

For Cabal packages with "build-type: Configure", a configure shell
script is run to set up build parameters.  These scripts need the
CONFIG_SHELL environment variable to be set to function properly.

* guix/build/haskell-build-system.scm (configure): Set CONFIG_SHELL if
  necessary.
---
 guix/build/haskell-build-system.scm | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/guix/build/haskell-build-system.scm b/guix/build/haskell-build-system.scm
index c0cb789..4506e96 100644
--- a/guix/build/haskell-build-system.scm
+++ b/guix/build/haskell-build-system.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch>
+;;; Copyright © 2015 Paul van der Walt <paul@denknerd.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -96,6 +97,14 @@ and parameters ~s~%"
                              '("--enable-tests")
                              '())
                          configure-flags)))
+    ;; For packages where the Cabal build-type is set to "Configure",
+    ;; ./configure will be executed.  In these cases, the following
+    ;; environment variable is needed to be able to find the shell executable.
+    ;; For other package types, the configure script isn't present.  For more
+    ;; information, see the Build Information section of
+    ;; <https://www.haskell.org/cabal/users-guide/developing-packages.html>.
+    (when (file-exists? "configure")
+      (setenv "CONFIG_SHELL" "sh"))
     (run-setuphs "configure" params)))
 
 (define* (build #:rest empty)
-- 
2.6.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] gnu: haskell: Remove CONFIG_SHELL patches.
  2015-10-23 17:37 [PATCH] build-system/haskell: CONFIG_SHELL env variable Paul van der Walt
@ 2015-10-23 18:04 ` Paul van der Walt
  2015-10-25 21:58 ` [PATCH] build-system/haskell: CONFIG_SHELL env variable Ludovic Courtès
  1 sibling, 0 replies; 4+ messages in thread
From: Paul van der Walt @ 2015-10-23 18:04 UTC (permalink / raw)
  To: guix-devel

A previous commit to the haskell-build-system made sure that if
necessary, the CONFIG_SHELL environment variable is set.  That obviates
the individual patches applied to some packages.  Remove them.

* gnu/packages/haskell.scm (ghc-network): Remove CONFIG_SHELL patch.
* gnu/packages/haskell.scm (ghc-old-time): Remove CONFIG_SHELL patch.
* gnu/packages/haskell.scm (ghc-sdl-image): Remove CONFIG_SHELL patch.
* gnu/packages/haskell.scm (ghc-sdl-mixer): Remove CONFIG_SHELL patch.
* gnu/packages/haskell.scm (ghc-sdl): Remove CONFIG_SHELL patch.
* gnu/packages/haskell.scm (ghc-unix-time): Remove CONFIG_SHELL patch.
* gnu/packages/haskell.scm (ghc-x11): Remove CONFIG_SHELL patch.
---
 gnu/packages/haskell.scm | 53 +++++-------------------------------------------
 1 file changed, 5 insertions(+), 48 deletions(-)

diff --git a/gnu/packages/haskell.scm b/gnu/packages/haskell.scm
index 4303093..652efc3 100644
--- a/gnu/packages/haskell.scm
+++ b/gnu/packages/haskell.scm
@@ -865,14 +865,6 @@ OpenAL.")
         (base32
          "1sa3zx3vrs1gbinxx33zwq0x2bsf3i964bff7419p7vzidn36k46"))))
     (build-system haskell-build-system)
-    (arguments
-     `(#:phases
-       (modify-phases %standard-phases
-         (add-after
-          'unpack 'fix-/bin/sh
-          (lambda _
-            ;; Use `sh', not `/bin/sh'.
-            (setenv "CONFIG_SHELL" "sh"))))))
     (inputs
      `(("sdl" ,sdl)))
     (home-page "https://hackage.haskell.org/package/SDL")
@@ -903,14 +895,7 @@ award winning Linux port of \"Civilization: Call To Power.\"")
      `(#:configure-flags
        (let* ((sdl-mixer (assoc-ref %build-inputs "sdl-mixer"))
               (sdl-mixer-include (string-append sdl-mixer "/include/SDL")))
-         (list (string-append "--extra-include-dirs=" sdl-mixer-include)))
-       #:phases
-       (modify-phases %standard-phases
-         (add-after
-          'unpack 'fix-/bin/sh
-          (lambda _
-            ;; Use `sh', not `/bin/sh'.
-            (setenv "CONFIG_SHELL" "sh"))))))
+         (list (string-append "--extra-include-dirs=" sdl-mixer-include)))))
     (propagated-inputs
      `(("ghc-sdl" ,ghc-sdl)))
     (inputs
@@ -942,14 +927,7 @@ MIDI, Ogg Vorbis, and SMPEG MP3 libraries.")
      `(#:configure-flags
        (let* ((sdl-image (assoc-ref %build-inputs "sdl-image"))
               (sdl-image-include (string-append sdl-image "/include/SDL")))
-         (list (string-append "--extra-include-dirs=" sdl-image-include)))
-       #:phases
-       (modify-phases %standard-phases
-         (add-after
-          'unpack 'fix-/bin/sh
-          (lambda _
-            ;; Use `sh', not `/bin/sh'.
-            (setenv "CONFIG_SHELL" "sh"))))))
+         (list (string-append "--extra-include-dirs=" sdl-image-include)))))
     (propagated-inputs
      `(("ghc-sdl" ,ghc-sdl)))
     (inputs
@@ -1216,12 +1194,6 @@ date and time formats.")
         (base32
          "1h9b26s3kfh2k0ih4383w90ibji6n0iwamxp6rfp2lbq1y5ibjqw"))))
     (build-system haskell-build-system)
-    (arguments
-     `(#:phases
-       (modify-phases %standard-phases
-         (add-after 'unpack 'fix-/bin/sh
-                    (lambda _
-                      (setenv "CONFIG_SHELL" "sh"))))))
     (propagated-inputs
      `(("ghc-old-locale" ,ghc-old-locale)))
     (home-page "http://hackage.haskell.org/package/old-time")
@@ -1433,12 +1405,6 @@ environment variables.")
                            "X11-" version ".tar.gz"))
        (sha256
         (base32 "1kzjcynm3rr83ihqx2y2d852jc49da4p18gv6jzm7g87z22x85jj"))))
-    (arguments
-     `(#:phases (modify-phases %standard-phases
-                  (add-before 'configure 'set-sh
-                              (lambda _
-                                (setenv "CONFIG_SHELL" "sh")
-                                #t)))))
     (build-system haskell-build-system)
     (inputs
      `(("libx11" ,libx11)
@@ -1801,13 +1767,8 @@ but also need those types.")
          "0dyvyxwaffb94bgri1wc4b9wqaasy32pyjn0lww3dqblxv8fn5ax"))))
     (build-system haskell-build-system)
     (arguments
-     `(#:tests? #f ; FIXME: Test fails with "System.Time not found".  This is
-                   ; weird, that should be provided by GHC 7.10.2.
-       #:phases
-       (modify-phases %standard-phases
-         (add-after 'unpack 'fix-/bin/sh
-                    (lambda _
-                      (setenv "CONFIG_SHELL" "sh"))))))
+     `(#:tests? #f)) ; FIXME: Test fails with "System.Time not found".  This
+                     ; is weird, that should be provided by GHC 7.10.2.
     (propagated-inputs
      `(("ghc-old-time" ,ghc-old-time)
        ("ghc-old-locale" ,ghc-old-locale)))
@@ -3162,11 +3123,7 @@ boxed and storable vectors.")
     (inputs
      `(("ghc-hunit" ,ghc-hunit)))
     (arguments
-     `(#:tests? #f  ; FIXME: currently missing libraries used for tests.
-       #:phases
-       (modify-phases %standard-phases
-         (add-before 'configure 'set-sh
-                     (lambda _ (setenv "CONFIG_SHELL" "sh"))))))
+     `(#:tests? #f))      ; FIXME: currently missing libraries used for tests.
     (home-page "https://github.com/haskell/network")
     (synopsis "Low-level networking interface")
     (description
-- 
2.6.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] build-system/haskell: CONFIG_SHELL env variable.
  2015-10-23 17:37 [PATCH] build-system/haskell: CONFIG_SHELL env variable Paul van der Walt
  2015-10-23 18:04 ` [PATCH] gnu: haskell: Remove CONFIG_SHELL patches Paul van der Walt
@ 2015-10-25 21:58 ` Ludovic Courtès
  2015-10-26  9:18   ` Paul van der Walt
  1 sibling, 1 reply; 4+ messages in thread
From: Ludovic Courtès @ 2015-10-25 21:58 UTC (permalink / raw)
  To: Paul van der Walt; +Cc: guix-devel

Paul van der Walt <paul@denknerd.org> skribis:

> For Cabal packages with "build-type: Configure", a configure shell
> script is run to set up build parameters.  These scripts need the
> CONFIG_SHELL environment variable to be set to function properly.
>
> * guix/build/haskell-build-system.scm (configure): Set CONFIG_SHELL if
>   necessary.

LGTM.

> A previous commit to the haskell-build-system made sure that if
> necessary, the CONFIG_SHELL environment variable is set.  That obviates
> the individual patches applied to some packages.  Remove them.
>
> * gnu/packages/haskell.scm (ghc-network): Remove CONFIG_SHELL patch.
> * gnu/packages/haskell.scm (ghc-old-time): Remove CONFIG_SHELL patch.
> * gnu/packages/haskell.scm (ghc-sdl-image): Remove CONFIG_SHELL patch.
> * gnu/packages/haskell.scm (ghc-sdl-mixer): Remove CONFIG_SHELL patch.
> * gnu/packages/haskell.scm (ghc-sdl): Remove CONFIG_SHELL patch.
> * gnu/packages/haskell.scm (ghc-unix-time): Remove CONFIG_SHELL patch.
> * gnu/packages/haskell.scm (ghc-x11): Remove CONFIG_SHELL patch.

Please use the shorter style, and mention the “syntactical” change:

  * gnu/packages/haskell.scm (ghc-network, ghc-old-time,
    ghc-sdl-image)[arguments]: Remove 'fix-/bin/sh’ phase.

Apart from this, LGTM.

Thanks!

Ludo’.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] build-system/haskell: CONFIG_SHELL env variable.
  2015-10-25 21:58 ` [PATCH] build-system/haskell: CONFIG_SHELL env variable Ludovic Courtès
@ 2015-10-26  9:18   ` Paul van der Walt
  0 siblings, 0 replies; 4+ messages in thread
From: Paul van der Walt @ 2015-10-26  9:18 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

Hey Ludo,

On 2015-10-25 at 22:58, quoth Ludovic Courtès:
>> * gnu/packages/haskell.scm (ghc-network): Remove CONFIG_SHELL patch.
>> * gnu/packages/haskell.scm (ghc-old-time): Remove CONFIG_SHELL patch.
>> * gnu/packages/haskell.scm (ghc-sdl-image): Remove CONFIG_SHELL patch.
>> * gnu/packages/haskell.scm (ghc-sdl-mixer): Remove CONFIG_SHELL patch.
>> * gnu/packages/haskell.scm (ghc-sdl): Remove CONFIG_SHELL patch.
>> * gnu/packages/haskell.scm (ghc-unix-time): Remove CONFIG_SHELL patch.
>> * gnu/packages/haskell.scm (ghc-x11): Remove CONFIG_SHELL patch.
>
> Please use the shorter style, and mention the “syntactical” change:
>
>   * gnu/packages/haskell.scm (ghc-network, ghc-old-time,
>     ghc-sdl-image)[arguments]: Remove 'fix-/bin/sh’ phase.
>
> Apart from this, LGTM.

Thank you; fixed and pushed! :)

p.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-10-26  9:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-23 17:37 [PATCH] build-system/haskell: CONFIG_SHELL env variable Paul van der Walt
2015-10-23 18:04 ` [PATCH] gnu: haskell: Remove CONFIG_SHELL patches Paul van der Walt
2015-10-25 21:58 ` [PATCH] build-system/haskell: CONFIG_SHELL env variable Ludovic Courtès
2015-10-26  9:18   ` Paul van der Walt

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).