all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH 1/7] git-download: Add some helpers.
@ 2017-01-02 17:19 David Craven
  2017-01-02 17:19 ` [PATCH 2/7] gnu: Order module imports in (gnu packages haskell) alphabetically David Craven
                   ` (6 more replies)
  0 siblings, 7 replies; 20+ messages in thread
From: David Craven @ 2017-01-02 17:19 UTC (permalink / raw)
  To: guix-devel

* guix/git-download.scm (git-version, git-file-name): New variables.
---
 guix/git-download.scm | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/guix/git-download.scm b/guix/git-download.scm
index 81d1d4fbf..c453aaa6d 100644
--- a/guix/git-download.scm
+++ b/guix/git-download.scm
@@ -30,7 +30,9 @@
             git-reference-commit
             git-reference-recursive?
 
-            git-fetch))
+            git-fetch
+            git-version
+            git-file-name))
 
 ;;; Commentary:
 ;;;
@@ -110,4 +112,10 @@ HASH-ALGO (a symbol).  Use NAME as the file name, or a generic name if #f."
                       #:guile-for-build guile
                       #:local-build? #t)))
 
+(define (git-version version revision commit)
+  (string-append version "-" revision "." (string-take commit 7)))
+
+(define (git-file-name name version)
+  (string-append name "-" version "-checkout"))
+
 ;;; git-download.scm ends here
-- 
2.11.0

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

* [PATCH 2/7] gnu: Order module imports in (gnu packages haskell) alphabetically.
  2017-01-02 17:19 [PATCH 1/7] git-download: Add some helpers David Craven
@ 2017-01-02 17:19 ` David Craven
  2017-01-03 12:22   ` Ludovic Courtès
  2017-01-02 17:19 ` [PATCH 3/7] gnu: idris: Update to 0.99 David Craven
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 20+ messages in thread
From: David Craven @ 2017-01-02 17:19 UTC (permalink / raw)
  To: guix-devel

* gnu/packages/haskell.scm: Order module imports alphabetically.
---
 gnu/packages/haskell.scm | 32 ++++++++++++++++----------------
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/gnu/packages/haskell.scm b/gnu/packages/haskell.scm
index 8e5927a00..b4f225160 100644
--- a/gnu/packages/haskell.scm
+++ b/gnu/packages/haskell.scm
@@ -25,33 +25,33 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (gnu packages haskell)
-  #:use-module (ice-9 regex)
-  #:use-module ((guix licenses) #:prefix license:)
-  #:use-module (guix packages)
-  #:use-module (guix download)
-  #:use-module (guix utils)
-  #:use-module (guix build-system gnu)
-  #:use-module (guix build-system haskell)
-  #:use-module (gnu packages pkg-config)
-  #:use-module (gnu packages perl)
+  #:use-module (gnu packages bootstrap)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages elf)
-  #:use-module (gnu packages gl)
-  #:use-module (gnu packages sdl)
-  #:use-module (gnu packages bootstrap)
-  #:use-module (gnu packages zip)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages ghostscript)
-  #:use-module (gnu packages libffi)
+  #:use-module (gnu packages gl)
   #:use-module (gnu packages libedit)
+  #:use-module (gnu packages libffi)
   #:use-module (gnu packages lua)
   #:use-module (gnu packages maths)
   #:use-module (gnu packages multiprecision)
   #:use-module (gnu packages ncurses)
-  #:use-module (gnu packages python)
   #:use-module (gnu packages pcre)
+  #:use-module (gnu packages perl)
+  #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages python)
+  #:use-module (gnu packages sdl)
   #:use-module (gnu packages xml)
-  #:use-module (gnu packages xorg))
+  #:use-module (gnu packages xorg)
+  #:use-module (gnu packages zip)
+  #:use-module (guix build-system gnu)
+  #:use-module (guix build-system haskell)
+  #:use-module (guix download)
+  #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix packages)
+  #:use-module (guix utils)
+  #:use-module (ice-9 regex))
 
 (define ghc-bootstrap-x86_64-7.8.4
   (origin
-- 
2.11.0

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

* [PATCH 3/7] gnu: idris: Update to 0.99.
  2017-01-02 17:19 [PATCH 1/7] git-download: Add some helpers David Craven
  2017-01-02 17:19 ` [PATCH 2/7] gnu: Order module imports in (gnu packages haskell) alphabetically David Craven
@ 2017-01-02 17:19 ` David Craven
  2017-01-03 12:22   ` Ludovic Courtès
  2017-01-03 12:29   ` Ludovic Courtès
  2017-01-02 17:19 ` [PATCH 4/7] gnu: Add idris-lightyear David Craven
                   ` (4 subsequent siblings)
  6 siblings, 2 replies; 20+ messages in thread
From: David Craven @ 2017-01-02 17:19 UTC (permalink / raw)
  To: guix-devel

* gnu/packages/haskell.scm (idris): Update to 0.99.
---
 gnu/packages/haskell.scm | 55 ++++++++++++++++++++++++------------------------
 1 file changed, 28 insertions(+), 27 deletions(-)

diff --git a/gnu/packages/haskell.scm b/gnu/packages/haskell.scm
index b4f225160..c55386e2f 100644
--- a/gnu/packages/haskell.scm
+++ b/gnu/packages/haskell.scm
@@ -7,7 +7,7 @@
 ;;; Copyright © 2016 ng0 <ng0@we.make.ritual.n0.is>
 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2015, 2016 Ricardo Wurmus <rekado@elephly.net>
-;;; Copyright © 2016 David Craven <david@craven.ch>
+;;; Copyright © 2016, 2017 David Craven <david@craven.ch>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -6670,24 +6670,9 @@ constant-time:
     (license license:bsd-3)))
 
 (define-public idris
-  ;; TODO: IDRIS_LIBRARY_PATH only accepts a single path and not a colon
-  ;; separated list.
-  ;; TODO: When installing idris the location of the standard libraries
-  ;; cannot be specified.
-  ;; NOTE: Creating an idris build system:
-  ;; Idris packages can be packaged and installed using a trivial
-  ;; build system.
-  ;; (zero? (system* (string-append idris "/bin/idris")
-  ;;                                "--ibcsubdir"
-  ;;                                (string-append out "/idris/libs/lightyear")
-  ;;                                "--install" "lightyear.ipkg")
-  ;; (native-search-paths
-  ;;   (list (search-path-specification
-  ;;          (variable "IDRIS_LIBRARY_PATH")
-  ;;          (files '("idris/libs")))))
   (package
     (name "idris")
-    (version "0.12.3")
+    (version "0.99")
     (source (origin
               (method url-fetch)
               (uri (string-append
@@ -6695,17 +6680,8 @@ constant-time:
                     "idris-" version "/idris-" version ".tar.gz"))
               (sha256
                (base32
-                "1ijrbgzaahw9aagn4al55nqcggrg9ajlrkq2fjc1saq3xdd3v7rs"))))
+                "1sd4vy5rx0mp32xj99qijhknkgw4d2rxvz6wiy3pym6kaqmc497i"))))
     (build-system haskell-build-system)
-    (arguments
-     `(;; FIXME: runhaskell Setup.hs test doesn't set paths required by test
-       ;; suite.
-       #:tests? #f
-       #:phases
-       (modify-phases %standard-phases
-         (add-before 'configure 'patch-cc-command
-           (lambda _
-             (setenv "CC" "gcc"))))))
     (inputs
      `(("gmp" ,gmp)
        ("ncurses" ,ncurses)
@@ -6741,6 +6717,31 @@ constant-time:
        ("ghc-vector" ,ghc-vector)
        ("ghc-zip-archive" ,ghc-zip-archive)
        ("ghc-zlib" ,ghc-zlib)))
+    (arguments
+     `(#:tests? #f ; FIXME: Test suite doesn't run in a sandbox.
+       #:configure-flags
+       (list (string-append "--datasubdir="
+                            (assoc-ref %outputs "out") "/lib/idris"))
+       #:phases
+       (modify-phases %standard-phases
+         (add-before 'configure 'set-cc-command
+           (lambda _
+             (setenv "CC" "gcc")
+             #t))
+         (add-after 'install 'fix-libs-install-location
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (lib (string-append out "/lib/idris"))
+                    (modules (string-append lib "/libs")))
+               (for-each
+                (lambda (module)
+                  (symlink (string-append modules "/" module)
+                           (string-append lib "/" module)))
+                '("prelude" "base" "contrib" "effects" "pruviloj"))))))))
+    (native-search-paths
+     (list (search-path-specification
+            (variable "IDRIS_LIBRARY_PATH")
+            (files '("lib/idris")))))
     (home-page "http://www.idris-lang.org")
     (synopsis "General purpose language with full dependent types")
     (description "Idris is a general purpose language with full dependent
-- 
2.11.0

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

* [PATCH 4/7] gnu: Add idris-lightyear.
  2017-01-02 17:19 [PATCH 1/7] git-download: Add some helpers David Craven
  2017-01-02 17:19 ` [PATCH 2/7] gnu: Order module imports in (gnu packages haskell) alphabetically David Craven
  2017-01-02 17:19 ` [PATCH 3/7] gnu: idris: Update to 0.99 David Craven
@ 2017-01-02 17:19 ` David Craven
  2017-01-03 12:26   ` Ludovic Courtès
  2017-01-02 17:19 ` [PATCH 5/7] gnu: Add idris-wl-pprint David Craven
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 20+ messages in thread
From: David Craven @ 2017-01-02 17:19 UTC (permalink / raw)
  To: guix-devel

* gnu/packages/haskell.scm (idris-lightyear, idris-default-arguments):
  New variables.
---
 gnu/packages/haskell.scm | 71 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 71 insertions(+)

diff --git a/gnu/packages/haskell.scm b/gnu/packages/haskell.scm
index c55386e2f..2e31c0dbb 100644
--- a/gnu/packages/haskell.scm
+++ b/gnu/packages/haskell.scm
@@ -48,6 +48,7 @@
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system haskell)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix utils)
@@ -6751,6 +6752,76 @@ can be specified precisely in the type.  The language is closely related to
 Epigram and Agda.")
     (license license:bsd-3)))
 
+;; Idris modules use the gnu-build-system so that the IDRIS_LIBRARY_PATH is set.
+(define (idris-default-arguments name)
+  `(#:modules ((guix build gnu-build-system)
+               (guix build utils)
+               (ice-9 ftw)
+               (ice-9 match))
+    #:phases
+    (modify-phases %standard-phases
+      (delete 'configure)
+      (delete 'build)
+      (delete 'check)
+      (replace 'install
+        (lambda* (#:key inputs outputs #:allow-other-keys)
+          (let* ((out (assoc-ref outputs "out"))
+                 (idris (assoc-ref inputs "idris"))
+                 (idris-bin (string-append idris "/bin/idris"))
+                 (idris-libs (string-append idris "/lib/idris/libs"))
+                 (module-name (and (string-prefix? "idris-" ,name)
+                                   (substring ,name 6)))
+                 (ibcsubdir (string-append out "/lib/idris/" module-name))
+                 (ipkg (string-append module-name ".ipkg"))
+                 (idris-library-path (getenv "IDRIS_LIBRARY_PATH"))
+                 (idris-path (string-split idris-library-path #\:))
+                 (idris-path-files (apply append
+                                          (map (lambda (path)
+                                                 (map (lambda (dir)
+                                                        (string-append path "/" dir))
+                                                      (scandir path))) idris-path)))
+                 (idris-path-subdirs (filter (lambda (path)
+                                               (and path (match (stat:type (stat path))
+                                                           ('directory #t)
+                                                           (_ #f))))
+                                                    idris-path-files))
+                 (install-cmd (cons* idris-bin
+                                     "--ibcsubdir" ibcsubdir
+                                     "--install" ipkg
+                                     (apply append (map (lambda (path)
+                                                          (list "--idrispath"
+                                                                path))
+                                                        idris-path-subdirs)))))
+            (setenv "IDRIS_LIBRARY_PATH" idris-libs)
+            ;; FIXME: Seems to be a bug in idris that causes a dubious failure.
+            (apply system* install-cmd)
+            #t))))))
+
+(define-public idris-lightyear
+  (let ((commit "6d65ad111b4bed2bc131396f8385528fc6b3678a"))
+    (package
+      (name "idris-lightyear")
+      (version (git-version "0.1" "1" commit))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/ziman/lightyear")
+                      (commit commit)))
+                (file-name (git-file-name name version))
+                (sha256
+                 (base32
+                  "1pkxnn3ryr0v0cin4nasw7kgkc9dnnpja1nfbj466mf3qv5s98af"))))
+      (build-system gnu-build-system)
+      (native-inputs
+       `(("idris" ,idris)))
+      (arguments (idris-default-arguments name))
+      (home-page "https://github.com/ziman/lightyear")
+      (synopsis "Lightweight parser combinator library for Idris")
+      (description "Lightweight parser combinator library for Idris, inspired
+by Parsec.  This package is used (almost) the same way as Parsec, except for one
+difference: backtracking.")
+      (license license:bsd-2))))
+
 (define-public ghc-base16-bytestring
   (package
     (name "ghc-base16-bytestring")
-- 
2.11.0

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

* [PATCH 5/7] gnu: Add idris-wl-pprint.
  2017-01-02 17:19 [PATCH 1/7] git-download: Add some helpers David Craven
                   ` (2 preceding siblings ...)
  2017-01-02 17:19 ` [PATCH 4/7] gnu: Add idris-lightyear David Craven
@ 2017-01-02 17:19 ` David Craven
  2017-01-03 12:28   ` Ludovic Courtès
  2017-01-02 17:19 ` [PATCH 6/7] gnu: Add idris-bifunctors David Craven
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 20+ messages in thread
From: David Craven @ 2017-01-02 17:19 UTC (permalink / raw)
  To: guix-devel

* gnu/packages/haskell.scm (idris-wl-pprint): New variable.
---
 gnu/packages/haskell.scm | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/gnu/packages/haskell.scm b/gnu/packages/haskell.scm
index 2e31c0dbb..bc6d6d4b1 100644
--- a/gnu/packages/haskell.scm
+++ b/gnu/packages/haskell.scm
@@ -6822,6 +6822,31 @@ by Parsec.  This package is used (almost) the same way as Parsec, except for one
 difference: backtracking.")
       (license license:bsd-2))))
 
+(define-public idris-wl-pprint
+  (let ((commit "1d365fcf4ba075859844dbc5eb96a90f57b9f338"))
+    (package
+      (name "idris-wl-pprint")
+      (version (git-version "0.1" "1" commit))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/shayan-najd/wl-pprint")
+                      (commit commit)))
+                (file-name (git-file-name name version))
+                (sha256
+                 (base32
+                  "0g7c3y9smifdz4sivi3qmvymhdr7v9kfq45fmfmmvkqcrix0spzn"))))
+      (build-system gnu-build-system)
+      (native-inputs
+       `(("idris" ,idris)))
+      (arguments (idris-default-arguments name))
+      (home-page "https://github.com/shayan-najd/wl-pprint")
+      (synopsis "Pretty printing library")
+      (description "A pretty printing library for Idris based on Phil Wadler's
+paper A Prettier Printer and on Daan Leijen's extensions in the Haskell
+wl-pprint library.")
+      (license license:bsd-2))))
+
 (define-public ghc-base16-bytestring
   (package
     (name "ghc-base16-bytestring")
-- 
2.11.0

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

* [PATCH 6/7] gnu: Add idris-bifunctors.
  2017-01-02 17:19 [PATCH 1/7] git-download: Add some helpers David Craven
                   ` (3 preceding siblings ...)
  2017-01-02 17:19 ` [PATCH 5/7] gnu: Add idris-wl-pprint David Craven
@ 2017-01-02 17:19 ` David Craven
  2017-01-03 12:27   ` Ludovic Courtès
  2017-01-02 17:19 ` [PATCH 7/7] gnu: Add idris-lens David Craven
  2017-01-03 12:28 ` [PATCH 1/7] git-download: Add some helpers Ludovic Courtès
  6 siblings, 1 reply; 20+ messages in thread
From: David Craven @ 2017-01-02 17:19 UTC (permalink / raw)
  To: guix-devel

* gnu/packages/haskell.scm (idris-bifunctors): New variable.
---
 gnu/packages/haskell.scm | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/gnu/packages/haskell.scm b/gnu/packages/haskell.scm
index bc6d6d4b1..4fb6032bf 100644
--- a/gnu/packages/haskell.scm
+++ b/gnu/packages/haskell.scm
@@ -6847,6 +6847,30 @@ paper A Prettier Printer and on Daan Leijen's extensions in the Haskell
 wl-pprint library.")
       (license license:bsd-2))))
 
+(define-public idris-bifunctors
+  (let ((commit "53d06a6ccfe70c49c9ae8c8a4135981dd2173202"))
+    (package
+      (name "idris-bifunctors")
+      (version (git-version "0.1" "1" commit))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/HuwCampbell/Idris-Bifunctors")
+                      (commit commit)))
+                (file-name (string-append name "-" version "-checkout"))
+                (sha256
+                 (base32
+                  "02vbsd3rmgnj0l1qq787709qcxjbr9890cbad4ykn27f77jk81h4"))))
+      (build-system gnu-build-system)
+      (native-inputs
+       `(("idris" ,idris)))
+      (arguments (idris-default-arguments name))
+      (home-page "https://github.com/HuwCampbell/Idris-Bifunctors")
+      (synopsis "Bifunctor library")
+      (description "This is a bifunctor library for Idris based off the
+excellent Haskell Bifunctors package from Edward Kmett.")
+      (license license:bsd-3))))
+
 (define-public ghc-base16-bytestring
   (package
     (name "ghc-base16-bytestring")
-- 
2.11.0

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

* [PATCH 7/7] gnu: Add idris-lens.
  2017-01-02 17:19 [PATCH 1/7] git-download: Add some helpers David Craven
                   ` (4 preceding siblings ...)
  2017-01-02 17:19 ` [PATCH 6/7] gnu: Add idris-bifunctors David Craven
@ 2017-01-02 17:19 ` David Craven
  2017-01-03 12:27   ` Ludovic Courtès
  2017-01-03 12:28 ` [PATCH 1/7] git-download: Add some helpers Ludovic Courtès
  6 siblings, 1 reply; 20+ messages in thread
From: David Craven @ 2017-01-02 17:19 UTC (permalink / raw)
  To: guix-devel

* gnu/packages/haskell.scm (idris-lens): New variable.
---
 gnu/packages/haskell.scm | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/gnu/packages/haskell.scm b/gnu/packages/haskell.scm
index 4fb6032bf..a88f0aa48 100644
--- a/gnu/packages/haskell.scm
+++ b/gnu/packages/haskell.scm
@@ -6871,6 +6871,32 @@ wl-pprint library.")
 excellent Haskell Bifunctors package from Edward Kmett.")
       (license license:bsd-3))))
 
+(define-public idris-lens
+  (let ((commit "26f012005f6849806cea630afe317e42cae97f29"))
+    (package
+      (name "idris-lens")
+      (version (git-version "0.1" "1" commit))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/HuwCampbell/idris-lens")
+                      (commit commit)))
+                (file-name (git-file-name name version))
+                (sha256
+                 (base32
+                  "06jzfj6rad08rk92w8jk5byi79svmyg0mrcqhibgx8rkjjy6vmai"))))
+      (build-system gnu-build-system)
+      (native-inputs
+       `(("idris" ,idris)))
+      (propagated-inputs
+       `(("idris-bifunctors" ,idris-bifunctors)))
+      (arguments (idris-default-arguments name))
+      (home-page "https://github.com/HuwCampbell/idris-lens")
+      (synopsis "Van Laarhoven lenses for Idris")
+      (description "Lenses are composable functional references.  They allow
+accessing and modifying data within a structure.")
+      (license license:bsd-3))))
+
 (define-public ghc-base16-bytestring
   (package
     (name "ghc-base16-bytestring")
-- 
2.11.0

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

* Re: [PATCH 2/7] gnu: Order module imports in (gnu packages haskell) alphabetically.
  2017-01-02 17:19 ` [PATCH 2/7] gnu: Order module imports in (gnu packages haskell) alphabetically David Craven
@ 2017-01-03 12:22   ` Ludovic Courtès
  0 siblings, 0 replies; 20+ messages in thread
From: Ludovic Courtès @ 2017-01-03 12:22 UTC (permalink / raw)
  To: David Craven; +Cc: guix-devel

David Craven <david@craven.ch> skribis:

> * gnu/packages/haskell.scm: Order module imports alphabetically.

OK!

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

* Re: [PATCH 3/7] gnu: idris: Update to 0.99.
  2017-01-02 17:19 ` [PATCH 3/7] gnu: idris: Update to 0.99 David Craven
@ 2017-01-03 12:22   ` Ludovic Courtès
  2017-01-03 12:29   ` Ludovic Courtès
  1 sibling, 0 replies; 20+ messages in thread
From: Ludovic Courtès @ 2017-01-03 12:22 UTC (permalink / raw)
  To: David Craven; +Cc: guix-devel

David Craven <david@craven.ch> skribis:

> * gnu/packages/haskell.scm (idris): Update to 0.99.

LGTM!

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

* Re: [PATCH 4/7] gnu: Add idris-lightyear.
  2017-01-02 17:19 ` [PATCH 4/7] gnu: Add idris-lightyear David Craven
@ 2017-01-03 12:26   ` Ludovic Courtès
  2017-01-03 13:13     ` David Craven
  0 siblings, 1 reply; 20+ messages in thread
From: Ludovic Courtès @ 2017-01-03 12:26 UTC (permalink / raw)
  To: David Craven; +Cc: guix-devel

David Craven <david@craven.ch> skribis:

> * gnu/packages/haskell.scm (idris-lightyear, idris-default-arguments):
>   New variables.
> ---
>  gnu/packages/haskell.scm | 71 ++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 71 insertions(+)
>
> diff --git a/gnu/packages/haskell.scm b/gnu/packages/haskell.scm
> index c55386e2f..2e31c0dbb 100644
> --- a/gnu/packages/haskell.scm
> +++ b/gnu/packages/haskell.scm
> @@ -48,6 +48,7 @@
>    #:use-module (guix build-system gnu)
>    #:use-module (guix build-system haskell)
>    #:use-module (guix download)
> +  #:use-module (guix git-download)
>    #:use-module ((guix licenses) #:prefix license:)
>    #:use-module (guix packages)
>    #:use-module (guix utils)
> @@ -6751,6 +6752,76 @@ can be specified precisely in the type.  The language is closely related to
>  Epigram and Agda.")
>      (license license:bsd-3)))
>  
> +;; Idris modules use the gnu-build-system so that the IDRIS_LIBRARY_PATH is set.
> +(define (idris-default-arguments name)
> +  `(#:modules ((guix build gnu-build-system)
> +               (guix build utils)
> +               (ice-9 ftw)
> +               (ice-9 match))
> +    #:phases
> +    (modify-phases %standard-phases

[...]

> +      (build-system gnu-build-system)
> +      (native-inputs
> +       `(("idris" ,idris)))
> +      (arguments (idris-default-arguments name))

I think this is asking for a new build system with its own modules and
phases.

IMO you can push this patch as is and provide an ‘idris-build-system’
later on, or do the latter first.  Either way is fine with me as long as
we don’t wait until there are ten users of ‘idris-default-arguments’.

WDYT?

Thanks,
Ludo’.

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

* Re: [PATCH 7/7] gnu: Add idris-lens.
  2017-01-02 17:19 ` [PATCH 7/7] gnu: Add idris-lens David Craven
@ 2017-01-03 12:27   ` Ludovic Courtès
  0 siblings, 0 replies; 20+ messages in thread
From: Ludovic Courtès @ 2017-01-03 12:27 UTC (permalink / raw)
  To: David Craven; +Cc: guix-devel

David Craven <david@craven.ch> skribis:

> * gnu/packages/haskell.scm (idris-lens): New variable.

Same comment regarding ‘idris-default-arguments’, but otherwise LGTM!

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

* Re: [PATCH 6/7] gnu: Add idris-bifunctors.
  2017-01-02 17:19 ` [PATCH 6/7] gnu: Add idris-bifunctors David Craven
@ 2017-01-03 12:27   ` Ludovic Courtès
  0 siblings, 0 replies; 20+ messages in thread
From: Ludovic Courtès @ 2017-01-03 12:27 UTC (permalink / raw)
  To: David Craven; +Cc: guix-devel

David Craven <david@craven.ch> skribis:

> * gnu/packages/haskell.scm (idris-bifunctors): New variable.

LGTM!

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

* Re: [PATCH 5/7] gnu: Add idris-wl-pprint.
  2017-01-02 17:19 ` [PATCH 5/7] gnu: Add idris-wl-pprint David Craven
@ 2017-01-03 12:28   ` Ludovic Courtès
  0 siblings, 0 replies; 20+ messages in thread
From: Ludovic Courtès @ 2017-01-03 12:28 UTC (permalink / raw)
  To: David Craven; +Cc: guix-devel

David Craven <david@craven.ch> skribis:

> * gnu/packages/haskell.scm (idris-wl-pprint): New variable.

OK!

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

* Re: [PATCH 1/7] git-download: Add some helpers.
  2017-01-02 17:19 [PATCH 1/7] git-download: Add some helpers David Craven
                   ` (5 preceding siblings ...)
  2017-01-02 17:19 ` [PATCH 7/7] gnu: Add idris-lens David Craven
@ 2017-01-03 12:28 ` Ludovic Courtès
  6 siblings, 0 replies; 20+ messages in thread
From: Ludovic Courtès @ 2017-01-03 12:28 UTC (permalink / raw)
  To: David Craven; +Cc: guix-devel

David Craven <david@craven.ch> skribis:

> * guix/git-download.scm (git-version, git-file-name): New variables.
> ---
>  guix/git-download.scm | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/guix/git-download.scm b/guix/git-download.scm
> index 81d1d4fbf..c453aaa6d 100644
> --- a/guix/git-download.scm
> +++ b/guix/git-download.scm
> @@ -30,7 +30,9 @@
>              git-reference-commit
>              git-reference-recursive?
>  
> -            git-fetch))
> +            git-fetch
> +            git-version
> +            git-file-name))
>  
>  ;;; Commentary:
>  ;;;
> @@ -110,4 +112,10 @@ HASH-ALGO (a symbol).  Use NAME as the file name, or a generic name if #f."
>                        #:guile-for-build guile
>                        #:local-build? #t)))
>  
> +(define (git-version version revision commit)
> +  (string-append version "-" revision "." (string-take commit 7)))
> +
> +(define (git-file-name name version)
> +  (string-append name "-" version "-checkout"))

Please add a docstring.  OK with this change, thank you!

Ludo’.

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

* Re: [PATCH 3/7] gnu: idris: Update to 0.99.
  2017-01-02 17:19 ` [PATCH 3/7] gnu: idris: Update to 0.99 David Craven
  2017-01-03 12:22   ` Ludovic Courtès
@ 2017-01-03 12:29   ` Ludovic Courtès
  1 sibling, 0 replies; 20+ messages in thread
From: Ludovic Courtès @ 2017-01-03 12:29 UTC (permalink / raw)
  To: David Craven; +Cc: guix-devel

BTW, perhaps we should eventually move these packages to idris.scm.
Thoughts?

Ludo’.

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

* Re: [PATCH 4/7] gnu: Add idris-lightyear.
  2017-01-03 12:26   ` Ludovic Courtès
@ 2017-01-03 13:13     ` David Craven
  2017-01-03 15:05       ` Ludovic Courtès
  2017-01-03 15:08       ` David Craven
  0 siblings, 2 replies; 20+ messages in thread
From: David Craven @ 2017-01-03 13:13 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

> IMO you can push this patch as is and provide an ‘idris-build-system’
> later on, or do the latter first.  Either way is fine with me as long as
> we don’t wait until there are ten users of ‘idris-default-arguments’.
> WDYT?

Regarding that, I think it's harder than it should be to add new build
systems at the moment. I think that adding a new build system requires
a substantial amount of boiler plate.

Would it make sense to have a phase-build-system that could be easily
extended with custom phases and cherry pick from a collection of
generic phases or something like that? Then we could simplify the
gnu-build-system to include only gnu-build-system specific stuff?

This could also be a good time to reinvestigate using gexp's in the
build systems. Would the problem that Danny had with imported modules
compiled not finding libgcrypt be solved by using gexp's?

I'm aware that this would be a substantial effort and maybe it's not
currently that important. But there seems to be interest in also
adding an ocaml-build-system, and the rust-build-system is a work in
progress. Maybe we could ease the transition by having the new build
systems use a phase-build-system as a base, without having to change
existing build-systems and giving some more lead way in experimenting,
since it wouldn't break any existing packages.

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

* Re: [PATCH 4/7] gnu: Add idris-lightyear.
  2017-01-03 13:13     ` David Craven
@ 2017-01-03 15:05       ` Ludovic Courtès
  2017-01-03 15:08       ` David Craven
  1 sibling, 0 replies; 20+ messages in thread
From: Ludovic Courtès @ 2017-01-03 15:05 UTC (permalink / raw)
  To: David Craven; +Cc: guix-devel

David Craven <david@craven.ch> skribis:

>> IMO you can push this patch as is and provide an ‘idris-build-system’
>> later on, or do the latter first.  Either way is fine with me as long as
>> we don’t wait until there are ten users of ‘idris-default-arguments’.
>> WDYT?
>
> Regarding that, I think it's harder than it should be to add new build
> systems at the moment. I think that adding a new build system requires
> a substantial amount of boiler plate.
>
> Would it make sense to have a phase-build-system that could be easily
> extended with custom phases and cherry pick from a collection of
> generic phases or something like that? Then we could simplify the
> gnu-build-system to include only gnu-build-system specific stuff?

Yeah, it’s too much boilerplate, though in this case I think it would be
quite reasonable

  (define (set-build-arguments b)
    (bag
      (inherit b)
      (arguments '(#:modules … #:phases …))))

  (define idris-build-system
    (build-system
      (lower (compose set-build-arguments
                      (build-system-lower gnu-build-system)))))

and then you could have:

  (define-module (guix build idris-build-system)
    #:use-module ((guix build gnu-build-system) #:prefix gnu:))
    #:export (%standard-phases))

  (define %standard-phases
    (modify-phases gnu:%standard-phases …))

> This could also be a good time to reinvestigate using gexp's in the
> build systems. Would the problem that Danny had with imported modules
> compiled not finding libgcrypt be solved by using gexp's?

The ‘wip-build-systems-gexp’ branch is still around and I plan to look
into it again…

> I'm aware that this would be a substantial effort and maybe it's not
> currently that important. But there seems to be interest in also
> adding an ocaml-build-system, and the rust-build-system is a work in
> progress. Maybe we could ease the transition by having the new build
> systems use a phase-build-system as a base, without having to change
> existing build-systems and giving some more lead way in experimenting,
> since it wouldn't break any existing packages.

I’m not sure what a ‘phase-build-system’ would look like, if not like
‘gnu-build-system’, but it’s an interesting idea to explore.

Dave Thompson recently suggested that maybe phases could be first-class,
i.e., directly exposed on the “host side”, which is indeed a valid
design question.  Another thing worth exploring!

Ludo’.

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

* Re: [PATCH 4/7] gnu: Add idris-lightyear.
  2017-01-03 13:13     ` David Craven
  2017-01-03 15:05       ` Ludovic Courtès
@ 2017-01-03 15:08       ` David Craven
  2017-01-03 18:21         ` David Craven
  1 sibling, 1 reply; 20+ messages in thread
From: David Craven @ 2017-01-03 15:08 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

> Regarding that, I think it's harder than it should be to add new build
> systems at the moment. I think that adding a new build system requires
> a substantial amount of boiler plate.

Actually I withdraw this statement. Except copying the guile-for-build
procedure into every build-system, there isn't any boilerplate. I
think the impression that there was boilerplate came from the fact
that I copied an existing build-system before I understood how it
worked.

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

* Re: [PATCH 4/7] gnu: Add idris-lightyear.
  2017-01-03 15:08       ` David Craven
@ 2017-01-03 18:21         ` David Craven
  2017-01-05 10:43           ` Ludovic Courtès
  0 siblings, 1 reply; 20+ messages in thread
From: David Craven @ 2017-01-03 18:21 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

> I’m not sure what a ‘phase-build-system’ would look like, if not like
> ‘gnu-build-system’, but it’s an interesting idea to explore.

I think you are right, it would look exactly like the
gnu-build-system. I think my issue wasn't technical but psychological.
It feels like other build-systems aren't first class citizens, but
that's a minor issue and wouldn't change anything worthwhile.

> Dave Thompson recently suggested that maybe phases could be first-class,
> i.e., directly exposed on the “host side”, which is indeed a valid
> design question.  Another thing worth exploring!

Sounds interesting. Did he provide an example of what that would look like?

> The ‘wip-build-systems-gexp’ branch is still around and I plan to look
> into it again…

I was impressed by how easy it was to rebase it after 1.5 years!

> Yeah, it’s too much boilerplate, though in this case I think it would be
> quite reasonable

Yes that looks quite reasonable.

Thank!
David

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

* Re: [PATCH 4/7] gnu: Add idris-lightyear.
  2017-01-03 18:21         ` David Craven
@ 2017-01-05 10:43           ` Ludovic Courtès
  0 siblings, 0 replies; 20+ messages in thread
From: Ludovic Courtès @ 2017-01-05 10:43 UTC (permalink / raw)
  To: David Craven; +Cc: guix-devel

David Craven <david@craven.ch> skribis:

>> I’m not sure what a ‘phase-build-system’ would look like, if not like
>> ‘gnu-build-system’, but it’s an interesting idea to explore.
>
> I think you are right, it would look exactly like the
> gnu-build-system. I think my issue wasn't technical but psychological.
> It feels like other build-systems aren't first class citizens, but
> that's a minor issue and wouldn't change anything worthwhile.

OK.

>> Dave Thompson recently suggested that maybe phases could be first-class,
>> i.e., directly exposed on the “host side”, which is indeed a valid
>> design question.  Another thing worth exploring!
>
> Sounds interesting. Did he provide an example of what that would look like?

I don’t think so, but maybe they’ll have to now?  ;-)

>> The ‘wip-build-systems-gexp’ branch is still around and I plan to look
>> into it again…
>
> I was impressed by how easy it was to rebase it after 1.5 years!

If you rebased it and there were no suspicious conflicts, feel free to
delete + push!

Thanks,
Ludo’.

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

end of thread, other threads:[~2017-01-05 10:43 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-02 17:19 [PATCH 1/7] git-download: Add some helpers David Craven
2017-01-02 17:19 ` [PATCH 2/7] gnu: Order module imports in (gnu packages haskell) alphabetically David Craven
2017-01-03 12:22   ` Ludovic Courtès
2017-01-02 17:19 ` [PATCH 3/7] gnu: idris: Update to 0.99 David Craven
2017-01-03 12:22   ` Ludovic Courtès
2017-01-03 12:29   ` Ludovic Courtès
2017-01-02 17:19 ` [PATCH 4/7] gnu: Add idris-lightyear David Craven
2017-01-03 12:26   ` Ludovic Courtès
2017-01-03 13:13     ` David Craven
2017-01-03 15:05       ` Ludovic Courtès
2017-01-03 15:08       ` David Craven
2017-01-03 18:21         ` David Craven
2017-01-05 10:43           ` Ludovic Courtès
2017-01-02 17:19 ` [PATCH 5/7] gnu: Add idris-wl-pprint David Craven
2017-01-03 12:28   ` Ludovic Courtès
2017-01-02 17:19 ` [PATCH 6/7] gnu: Add idris-bifunctors David Craven
2017-01-03 12:27   ` Ludovic Courtès
2017-01-02 17:19 ` [PATCH 7/7] gnu: Add idris-lens David Craven
2017-01-03 12:27   ` Ludovic Courtès
2017-01-03 12:28 ` [PATCH 1/7] git-download: Add some helpers Ludovic Courtès

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.