guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] 02/02: DRAFT maint: Masquerade as a Guix channel.


From: Ludovic Courtès
Subject: [Guile-commits] 02/02: DRAFT maint: Masquerade as a Guix channel.
Date: Sun, 29 Jan 2023 06:21:24 -0500 (EST)

civodul pushed a commit to branch wip-cuirass-ci
in repository guile.

commit f0a0c89558fdd414c460b6665e1ca6b65ad134ca
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Thu Jan 26 22:33:54 2023 +0100

    DRAFT maint: Masquerade as a Guix channel.
    
    By pretending to be a Guix channel, this repository can be consumed
    seamlessly by tools such as Cuirass.
    
    * .guix-channel: New file.
    * guix.scm: Turn into a symlink to...
    * build-aux/guix/guile-package.scm: ... this.  New file.
    * Makefile.am (EXTRA_DIST): Add them, except '.guix-channel'.
---
 .guix-channel                    |   5 ++
 Makefile.am                      |   4 +-
 build-aux/guix/guile-package.scm | 149 +++++++++++++++++++++++++++++++++++++++
 build-aux/manifest.scm           |   2 +-
 guix.scm                         | 143 +------------------------------------
 5 files changed, 159 insertions(+), 144 deletions(-)

diff --git a/.guix-channel b/.guix-channel
new file mode 100644
index 000000000..3a5a513ca
--- /dev/null
+++ b/.guix-channel
@@ -0,0 +1,5 @@
+;; This file lets us present this repo as a Guix channel.
+
+(channel
+  (version 0)
+  (directory "build-aux/guix"))
diff --git a/Makefile.am b/Makefile.am
index 850bab352..61b76a544 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -82,7 +82,9 @@ EXTRA_DIST = LICENSE HACKING GUILE-VERSION                    
\
             gnulib-local/build-aux/git-version-gen.diff        \
             libguile/texi-fragments-to-docstrings              \
             gdbinit                                            \
-            guix.scm build-aux/manifest.scm
+            guix.scm                                           \
+            build-aux/guix/guile-package.scm                   \
+            build-aux/manifest.scm
 
 TESTS = check-guile
 TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@
diff --git a/build-aux/guix/guile-package.scm b/build-aux/guix/guile-package.scm
new file mode 100644
index 000000000..6e5d691b8
--- /dev/null
+++ b/build-aux/guix/guile-package.scm
@@ -0,0 +1,149 @@
+;;; Copyright © 2023 Free Software Foundation, Inc.
+;;;
+;;; This file is part of GNU Guile.
+;;;
+;;; GNU Guile is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guile is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guile.  If not, see <http://www.gnu.org/licenses/>.
+
+;; This file defines a Guix package.  It can be used to spawn an
+;; interactive development environment:
+;;
+;;   guix shell
+;;
+;; Or it can be used to build Guile from a checkout in an isolated
+;; environment:
+;;
+;;   guix build -f guix.scm
+;;
+;; Likewise, you may cross-compile it:
+;;
+;;   guix build -f guix.scm --target=x86_64-w64-mingw32
+;;
+;; … or perform a native build for another architecture, assuming
+;; either offloading or transparent QEMU emulation is set up:
+;;
+;;   guix build -f guix.scm -s riscv64-linux
+
+(define-module (guile-package)
+  #:use-module (guix)
+  #:use-module (guix git-download)
+  #:use-module (guix build-system gnu)
+  #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (gnu packages)
+  #:use-module (gnu packages pkg-config)
+  #:export (guile))
+
+(define guile
+  (let ((vcs-file? (or (git-predicate
+                        (string-append (current-source-directory)
+                                       "/../.."))
+                       (const #t)))
+        (S specification->package))
+    (package
+      (name "guile")
+      (version "3.0.99-git")
+      (source (local-file "../.." "guile-checkout"
+                          #:recursive? #t
+                          #:select? vcs-file?))
+      (build-system gnu-build-system)
+      (arguments
+       (list #:configure-flags
+             #~'("--enable-mini-gmp"
+                 #$@(if (target-x86-32?) ;<https://issues.guix.gnu.org/49368>
+                        '("--disable-static" "CFLAGS=-g -O2 
-fexcess-precision=standard")
+                        '("--disable-static")))   ;saves 3 MiB
+
+             #:phases
+             #~(modify-phases %standard-phases
+                 (add-before 'bootstrap 'set-version
+                   (lambda _
+                     ;; Tell 'git-version-gen' what version this is, or it will
+                     ;; just pick "UNKNOWN", making it unusable as a 
replacement
+                     ;; for 'guile-3.0'.  XXX: This is inaccurate when using
+                     ;; '--with-branch' but using (package-version 
this-package)
+                     ;; wouldn't give us a valid version string.
+                     (call-with-output-file ".tarball-version"
+                       (lambda (port)
+                         (display #$version port)))
+
+                     ;; Set this one as well so 'version.test' passes.
+                     (substitute* "GUILE-VERSION"
+                       (("^GUILE_MICRO_VERSION=.*")
+                        "GUILE_MICRO_VERSION=99\n"))))
+                 (add-before 'configure 'pre-configure
+                   (lambda* (#:key inputs #:allow-other-keys)
+                     ;; Tell (ice-9 popen) the file name of Bash.
+                     (let ((bash (search-input-file inputs "/bin/sh")))
+                       (substitute* "module/ice-9/popen.scm"
+                         ;; If bash is #f allow fallback for user to provide
+                         ;; "bash" in PATH.  This happens when cross-building 
to
+                         ;; MinGW for which we do not have Bash yet.
+                         (("/bin/sh")
+                          (or bash "/bin/sh")))))))))
+
+      (native-inputs
+       (append (map S '("autoconf"
+                        "automake"
+                        "libtool"
+                        "gettext"
+                        "flex"
+                        "texinfo"
+                        "texlive-base"            ;for "make pdf"
+                        "texlive-epsf"
+                        "gperf"
+                        "git"
+                        "gdb"
+                        "strace"
+                        "readline"
+                        "lzip"))
+
+               ;; Ensure we get a cross-pkg-config when needed.
+               (list pkg-config)
+
+               ;; When cross-compiling, a native version of Guile itself
+               ;; is needed.
+               (if (%current-target-system)
+                   (list this-package)
+                   '())))
+      (inputs
+       (append (list (S "libffi"))
+
+               ;; We need Bash when cross-compiling because some of the
+               ;; scripts in bin/ refer to it.  Use 'bash-minimal' because
+               ;; we don't need an interactive Bash with Readline and all.
+               (if (target-mingw?)
+                   (list (S "libiconv"))
+                   (list (S "bash-minimal")))))
+      (propagated-inputs
+       (map S '("libunistring" "libgc")))
+
+      (outputs '("out" "debug"))
+
+      (native-search-paths
+       (list (search-path-specification
+              (variable "GUILE_LOAD_PATH")
+              (files '("share/guile/site/3.0")))
+             (search-path-specification
+              (variable "GUILE_LOAD_COMPILED_PATH")
+              (files '("lib/guile/3.0/site-ccache")))))
+      (synopsis "Scheme implementation intended especially for extensions")
+      (description
+       "Guile is the GNU Ubiquitous Intelligent Language for Extensions, the
+official extension language of the GNU system.  It is an implementation of
+the Scheme language which can be easily embedded in other applications to
+provide a convenient means of extending the functionality of the application
+without requiring the source code to be rewritten.")
+      (home-page "https://www.gnu.org/software/guile/";)
+      (license license:lgpl3+))))
+
+guile
diff --git a/build-aux/manifest.scm b/build-aux/manifest.scm
index 6fbe99752..5699f80f4 100644
--- a/build-aux/manifest.scm
+++ b/build-aux/manifest.scm
@@ -33,7 +33,7 @@ TARGET."
     (name (string-append (package-name package) "." system
                          (if target
                              (string-append "." target)
-                             "'")))
+                             "")))
     (item (with-parameters ((%current-system system)
                             (%current-target-system target))
             package))))
diff --git a/guix.scm b/guix.scm
deleted file mode 100644
index fe54d1499..000000000
--- a/guix.scm
+++ /dev/null
@@ -1,142 +0,0 @@
-;;; Copyright © 2023 Free Software Foundation, Inc.
-;;;
-;;; This file is part of GNU Guile.
-;;;
-;;; GNU Guile is free software; you can redistribute it and/or modify it
-;;; under the terms of the GNU General Public License as published by
-;;; the Free Software Foundation; either version 3 of the License, or (at
-;;; your option) any later version.
-;;;
-;;; GNU Guile is distributed in the hope that it will be useful, but
-;;; WITHOUT ANY WARRANTY; without even the implied warranty of
-;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-;;; GNU General Public License for more details.
-;;;
-;;; You should have received a copy of the GNU General Public License
-;;; along with GNU Guile.  If not, see <http://www.gnu.org/licenses/>.
-
-;; This file defines a Guix package.  It can be used to spawn an
-;; interactive development environment:
-;;
-;;   guix shell
-;;
-;; Or it can be used to build Guile from a checkout in an isolated
-;; environment:
-;;
-;;   guix build -f guix.scm
-;;
-;; Likewise, you may cross-compile it:
-;;
-;;   guix build -f guix.scm --target=x86_64-w64-mingw32
-;;
-;; … or perform a native build for another architecture, assuming
-;; either offloading or transparent QEMU emulation is set up:
-;;
-;;   guix build -f guix.scm -s riscv64-linux
-
-(use-modules (guix)
-             (guix git-download)
-             (guix build-system gnu)
-             ((guix licenses) #:prefix license:)
-             (gnu packages)
-             (gnu packages pkg-config))
-
-(let ((vcs-file? (or (git-predicate (current-source-directory))
-                     (const #t)))
-      (S specification->package))
-  (package
-    (name "guile")
-    (version "3.0.000-git")
-    (source (local-file "." "guile-checkout"
-                        #:recursive? #t
-                        #:select? vcs-file?))
-    (build-system gnu-build-system)
-    (arguments
-     (list #:configure-flags
-           #~'("--enable-mini-gmp"
-               #$@(if (target-x86-32?) ;<https://issues.guix.gnu.org/49368>
-                      '("--disable-static" "CFLAGS=-g -O2 
-fexcess-precision=standard")
-                      '("--disable-static")))     ;saves 3 MiB
-
-           #:phases
-           #~(modify-phases %standard-phases
-               (add-before 'bootstrap 'set-version
-                 (lambda _
-                   ;; Tell 'git-version-gen' what version this is, or it will
-                   ;; just pick "UNKNOWN", making it unusable as a replacement
-                   ;; for 'guile-3.0'.  XXX: This is inaccurate when using
-                   ;; '--with-branch' but using (package-version this-package)
-                   ;; wouldn't give us a valid version string.
-                   (call-with-output-file ".tarball-version"
-                     (lambda (port)
-                       (display #$version port)))
-
-                   ;; Set this one as well so 'version.test' passes.
-                   (substitute* "GUILE-VERSION"
-                     (("^GUILE_MICRO_VERSION=.*")
-                      "GUILE_MICRO_VERSION=99\n"))))
-               (add-before 'configure 'pre-configure
-                 (lambda* (#:key inputs #:allow-other-keys)
-                   ;; Tell (ice-9 popen) the file name of Bash.
-                   (let ((bash (search-input-file inputs "/bin/sh")))
-                     (substitute* "module/ice-9/popen.scm"
-                       ;; If bash is #f allow fallback for user to provide
-                       ;; "bash" in PATH.  This happens when cross-building to
-                       ;; MinGW for which we do not have Bash yet.
-                       (("/bin/sh")
-                        (or bash "/bin/sh")))))))))
-
-    (native-inputs
-     (append (map S '("autoconf"
-                      "automake"
-                      "libtool"
-                      "gettext"
-                      "flex"
-                      "texinfo"
-                      "texlive-base"              ;for "make pdf"
-                      "texlive-epsf"
-                      "gperf"
-                      "git"
-                      "gdb"
-                      "strace"
-                      "readline"
-                      "lzip"))
-
-             ;; Ensure we get a cross-pkg-config when needed.
-             (list pkg-config)
-
-             ;; When cross-compiling, a native version of Guile itself
-             ;; is needed.
-             (if (%current-target-system)
-                 (list this-package)
-                 '())))
-    (inputs
-     (append (list (S "libffi"))
-
-             ;; We need Bash when cross-compiling because some of the
-             ;; scripts in bin/ refer to it.  Use 'bash-minimal' because
-             ;; we don't need an interactive Bash with Readline and all.
-             (if (target-mingw?)
-                 (list (S "libiconv"))
-                 (list (S "bash-minimal")))))
-    (propagated-inputs
-     (map S '("libunistring" "libgc")))
-
-    (outputs '("out" "debug"))
-
-    (native-search-paths
-     (list (search-path-specification
-            (variable "GUILE_LOAD_PATH")
-            (files '("share/guile/site/3.0")))
-           (search-path-specification
-            (variable "GUILE_LOAD_COMPILED_PATH")
-            (files '("lib/guile/3.0/site-ccache")))))
-    (synopsis "Scheme implementation intended especially for extensions")
-    (description
-     "Guile is the GNU Ubiquitous Intelligent Language for Extensions, the
-official extension language of the GNU system.  It is an implementation of
-the Scheme language which can be easily embedded in other applications to
-provide a convenient means of extending the functionality of the application
-without requiring the source code to be rewritten.")
-    (home-page "https://www.gnu.org/software/guile/";)
-    (license license:lgpl3+)))
diff --git a/guix.scm b/guix.scm
new file mode 120000
index 000000000..716f374c1
--- /dev/null
+++ b/guix.scm
@@ -0,0 +1 @@
+build-aux/guix/guile-package.scm
\ No newline at end of file



reply via email to

[Prev in Thread] Current Thread [Next in Thread]