all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Vivien Kraus via Guix-patches via <guix-patches@gnu.org>
To: 60358@debbugs.gnu.org
Cc: Liliana Marie Prikler <liliana.prikler@gmail.com>
Subject: [bug#60358] [PATCH v9 3/4] gnu: Add gnulib.
Date: Tue, 27 Dec 2022 17:23:30 +0100	[thread overview]
Message-ID: <18b9463408e0f046dec50c933e3f02fb2783467d.camel@planete-kraus.eu> (raw)
In-Reply-To: <bd7d5613d104b8bb364e12686574a4f8f275911e.camel@planete-kraus.eu>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 11592 bytes --]

* gnu/packages/build-tools.scm (gnulib-checkout, gnulib): New variables
---
 gnu/packages/build-tools.scm | 201 +++++++++++++++++++++++++++++++++++
 1 file changed, 201 insertions(+)

diff --git a/gnu/packages/build-tools.scm b/gnu/packages/build-tools.scm
index 6c1350c44f..3e6a16f3f5 100644
--- a/gnu/packages/build-tools.scm
+++ b/gnu/packages/build-tools.scm
@@ -32,27 +32,37 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (gnu packages build-tools)
+  #:use-module (ice-9 optargs)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix utils)
   #:use-module (guix packages)
   #:use-module (guix gexp)
   #:use-module (guix download)
   #:use-module (guix git-download)
+  #:use-module (guix git)
   #:use-module (guix build-system cmake)
+  #:use-module (guix build-system copy)
+  #:use-module (guix modules)
   #:use-module (gnu packages)
   #:use-module (gnu packages adns)
+  #:use-module (gnu packages autotools)
   #:use-module (gnu packages base)
   #:use-module (gnu packages bash)
   #:use-module (gnu packages check)
+  #:use-module (gnu packages code)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages cpp)
+  #:use-module (gnu packages cppi)
   #:use-module (gnu packages elf)
+  #:use-module (gnu packages gcc)
   #:use-module (gnu packages linux)
+  #:use-module (gnu packages lisp)
   #:use-module (gnu packages logging)
   #:use-module (gnu packages lua)
   #:use-module (gnu packages ninja)
   #:use-module (gnu packages package-management)
   #:use-module (gnu packages pcre)
+  #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages pretty-print)
   #:use-module (gnu packages protobuf)
@@ -65,6 +75,7 @@ (define-module (gnu packages build-tools)
   #:use-module (gnu packages rpc)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages tls)
+  #:use-module (gnu packages unicode)
   #:use-module (gnu packages version-control)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system python))
@@ -803,3 +814,193 @@ (define-public genie
 same settings to multiple projects.  It supports generating projects using GNU
 Makefiles, JSON Compilation Database, and experimentally Ninja.")
       (license license:bsd-3))))
+
+(define*-public (gnulib-checkout #:key
+                                 version
+                                 (revision "1")
+                                 commit
+                                 hash)
+  "Return as a package the exact gnulib checkout."
+  (package
+    (name "gnulib")
+    (version (git-version version revision commit))
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://git.savannah.gnu.org/git/gnulib.git/")
+             (commit commit)))
+       (file-name (git-file-name name version))
+       (sha256 hash)
+       (snippet
+        (with-imported-modules (source-module-closure '((guix build utils)))
+          #~(begin
+              (use-modules (guix build utils)
+                           (ice-9 ftw)
+                           (ice-9 rdelim))
+              ;; .c, .h and .gperf files whose first line is /* DO NOT EDIT!
+              ;; GENERATED AUTOMATICALLY! */ are generated automatically based
+              ;; on the unicode database. Since we replace the unicode
+              ;; database with our own, we need to regenerate them. So, they
+              ;; are removed from the source. They are sprinkled all over the
+              ;; place unfortunately, so we can’t exclude whole directories.
+              (let ((generated-automatically?
+                     (lambda (filename . unused)
+                       (and (or (string-suffix? ".c" filename)
+                                (string-suffix? ".h" filename)
+                                (string-suffix? ".gperf" filename))
+                            (call-with-input-file filename
+                              (lambda (port)
+                                (let ((first-line (read-line port)))
+                                  (equal?
+                                   first-line
+                                   "/* DO NOT EDIT! GENERATED AUTOMATICALLY! */"))))))))
+                (for-each delete-file (find-files (getcwd) generated-automatically?)))
+              ;; Other files are copied from UCD.
+              (for-each delete-file
+                        '("tests/unigbrk/GraphemeBreakTest.txt"
+                          "tests/uninorm/NormalizationTest.txt"
+                          "tests/uniname/UnicodeData.txt"
+                          "tests/uniname/NameAliases.txt"
+                          ;; FIXME: tests/uniname/HangulSyllableNames.txt
+                          ;; seems like a UCD file but it is not distributed
+                          ;; with UCD.
+                          "tests/uniwbrk/WordBreakTest.txt")))))))
+    (build-system copy-build-system)
+    (arguments
+     (list
+      #:install-plan
+      #~'(("./gnulib-tool" "bin/")
+          ("." "src/gnulib" #:exclude-regexp ("\\.git.*")))
+      #:modules '((ice-9 match)
+                  (guix build utils)
+                  (guix build copy-build-system)
+                  ((guix build gnu-build-system) #:prefix gnu:))
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-before 'install 'gnu:check
+            (assoc-ref gnu:%standard-phases 'check))
+          (add-before 'gnu:check 'fix-tests
+            (lambda _
+              (substitute* "Makefile"
+                (("-f maint.mk syntax-check")
+                 "_gl-Makefile=yes -f maint.mk syntax-check"))
+              (invoke "git" "init")
+              (invoke "git" "config" "user.name" "Guix")
+              (invoke "git" "config" "user.email" "guix@localhost")
+              (invoke "git" "add" ".")
+              ;; Syntax checks are only run against committed files.
+              (invoke "git" "commit" "-m" "Prepare for tests.")))
+          (add-before 'gnu:check 'disable-failing-tests
+            (lambda _
+              (substitute* "cfg.mk"
+                (("local-checks-to-skip =")
+                 ;; sc_copyright_check fails because the fake commit date may
+                 ;; be later than the copyright year.
+                 "local-checks-to-skip = \\
+  sc_Wundef_boolean \\
+  sc_copyright_check \\
+  sc_file_system \\
+  sc_indent \\
+  sc_keep_gnulib_texi_files_mostly_ascii \\
+  sc_prohibit_assert_without_use \\
+  sc_prohibit_close_stream_without_use \\
+  sc_prohibit_defined_have_decl_tests \\
+  sc_prohibit_doubled_word \\
+  sc_prohibit_empty_lines_at_EOF \\
+  sc_prohibit_intprops_without_use \\
+  sc_prohibit_openat_without_use \\
+  sc_prohibit_test_minus_ao \\
+  sc_unportable_grep_q"))
+              (substitute* "Makefile"
+                (("sc_(\
+check_(sym_list|copyright)\
+|cpp_indent_check\
+|prohibit_(AC_LIBOBJ_in_m4|leading_TABs)\
+|prefer_ac_check_funcs_once)" rule)
+                 (string-append "disabled_" rule)))))
+          (add-before 'gnu:check 'regenerate-unicode
+            (lambda* (#:key inputs #:allow-other-keys)
+              (define (find-ucd-file name)
+                (search-input-file inputs (string-append "share/ucd/" name)))
+              (define (find-ucd-files . names)
+                (map find-ucd-file names))
+              (with-directory-excursion "lib"
+                ;; See the compile-command buffer-local variable in
+                ;; lib/gen-uni-tables.c
+                (invoke #+(file-append gcc "/bin/gcc") "-O" "-Wall" "gen-uni-tables.c"
+                        "-Iunictype" "-o" "gen-uni-tables")
+                (apply invoke
+                       "./gen-uni-tables"
+                       (append
+                        (find-ucd-files "UnicodeData.txt"
+                                        "PropList.txt"
+                                        "DerivedCoreProperties.txt"
+                                        "emoji/emoji-data.txt"
+                                        "ArabicShaping.txt"
+                                        "Scripts.txt"
+                                        "Blocks.txt")
+                        (list
+                         #$(origin
+                             (method url-fetch)
+                             (uri (string-append
+                                   "https://www.unicode.org/Public/"
+                                   "3.0-Update1/PropList-3.0.1.txt"))
+                             (sha256
+                              (base32
+                               "0k6wyijyzdl5g3nibcwfm898kfydx1pqaz28v7fdvnzdvd5fz7lh"))))
+                        (find-ucd-files "EastAsianWidth.txt"
+                                        "LineBreak.txt"
+                                        "auxiliary/WordBreakProperty.txt"
+                                        "auxiliary/GraphemeBreakProperty.txt"
+                                        "CompositionExclusions.txt"
+                                        "SpecialCasing.txt"
+                                        "CaseFolding.txt")
+                         (list #$(package-version (this-package-native-input "ucd")))))
+                (invoke "clisp" "-C" "uniname/gen-uninames.lisp"
+                        (search-input-file inputs "share/ucd/UnicodeData.txt")
+                        "uniname/uninames.h"
+                        (search-input-file inputs "share/ucd/NameAliases.txt"))
+                (for-each
+                 (match-lambda
+                  ((ucd-file . directory)
+                   (copy-file (find-ucd-file ucd-file)
+                              (string-append "../tests/" directory "/"
+                                             (basename ucd-file)))))
+                 '(("NameAliases.txt" . "uniname")
+                   ("UnicodeData.txt" . "uniname")
+                   ("NormalizationTest.txt" . "uninorm")
+                   ("auxiliary/GraphemeBreakTest.txt" . "unigbrk")
+                   ("auxiliary/WordBreakTest.txt" . "uniwbrk")))
+                (delete-file "gen-uni-tables")))))))
+    (inputs ;; Shebangs for some auxiliary build files.
+     (list python perl clisp))
+    (native-inputs
+     (list
+      python perl clisp
+      ;; Unicode data:
+      ucd-next
+      ;; Programs for the tests:
+      cppi indent git autoconf))
+    (home-page "https://www.gnu.org/software/gnulib/")
+    (synopsis "Source files to share among distributions")
+    (description
+     "Gnulib is a central location for common infrastructure needed by GNU
+packages.  It provides a wide variety of functionality, e.g., portability
+across many systems, working with Unicode strings, cryptographic computation,
+and much more.  The code is intended to be shared at the level of source
+files, rather than being a standalone library that is distributed, built, and
+installed.  The included @command{gnulib-tool} script helps with using Gnulib
+code in other packages.  Gnulib also includes copies of licensing and
+maintenance-related files, for convenience.")
+    (native-search-paths
+     (list (search-path-specification
+            (variable "GNULIB_SRCDIR")
+            (files (list "src/gnulib")))))
+    (license (list license:lgpl2.0+ license:gpl3+))))
+
+(define-public gnulib
+  (gnulib-checkout
+   #:version "2022-12-31"
+   #:commit "875461ffdf58ac04677957b4ae4160465b83b940"
+   #:hash (base32 "0bf7a6wdns9c5wwv60qfcn9llg0j6jz5ryd2qgsqqx2i6xkmp77c")))
-- 
2.38.1




  parent reply	other threads:[~2023-01-01 15:17 UTC|newest]

Thread overview: 83+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-27 16:23 [bug#60358] [PATCH] gnu: Add gnulib Vivien Kraus via Guix-patches via
2022-12-27 16:23 ` [bug#60358] [PATCH v6 2/3] " Vivien Kraus via Guix-patches via
2022-12-27 16:23 ` [bug#60358] [PATCH v11 3/4] " Vivien Kraus via Guix-patches via
2023-01-01 20:48   ` Vivien Kraus via Guix-patches via
2022-12-27 16:23 ` [bug#60358] [PATCH v8 " Vivien Kraus via Guix-patches via
2022-12-27 16:23 ` Vivien Kraus via Guix-patches via [this message]
2023-01-01 16:25   ` [bug#60358] [PATCH v9 " Liliana Marie Prikler
2023-01-01 16:55     ` Vivien Kraus via Guix-patches via
2023-01-01 17:31       ` Liliana Marie Prikler
2022-12-27 16:23 ` [bug#60358] [PATCH v4 1/3] " Vivien Kraus via Guix-patches via
2022-12-27 16:23 ` [bug#60358] [PATCH v10 3/4] " Vivien Kraus via Guix-patches via
2022-12-27 16:23 ` [bug#60358] [PATCH v7 4/5] " Vivien Kraus via Guix-patches via
2022-12-31 19:26   ` Liliana Marie Prikler
2022-12-27 16:23 ` [bug#60358] [PATCH v5 1/5] " Vivien Kraus via Guix-patches via
2022-12-31  6:53   ` Liliana Marie Prikler
2022-12-27 17:33 ` [bug#60358] Providing gnulib Vivien Kraus via Guix-patches via
2022-12-27 18:44 ` [bug#60358] [PATCH] gnu: Add gnulib Simon Josefsson via Guix-patches via
2022-12-28  1:57   ` Vivien Kraus via Guix-patches via
2022-12-29 14:44     ` Simon Josefsson via Guix-patches via
2022-12-29 15:56       ` Simon Josefsson via Guix-patches via
2022-12-27 20:45 ` Liliana Marie Prikler
2022-12-27 16:23   ` [bug#60358] [PATCH v2 1/2] " Vivien Kraus via Guix-patches via
2022-12-28  2:20   ` [bug#60358] [PATCH v2 2/2] gnu: guile-gnutls: Update to 3.7.11 Vivien Kraus via Guix-patches via
2022-12-28  2:50     ` Vivien Kraus via Guix-patches via
2022-12-29 14:55       ` Simon Josefsson via Guix-patches via
2022-12-27 16:23         ` [bug#60358] [PATCH v3 1/2] gnu: Add gnulib Vivien Kraus via Guix-patches via
2022-12-29 20:02           ` Liliana Marie Prikler
2022-12-30 11:45             ` Vivien Kraus via Guix-patches via
2022-12-30 19:35               ` Liliana Marie Prikler
2022-12-28  2:20         ` [bug#60358] [PATCH v3 2/2] gnu: guile-gnutls: Update to 3.7.11 Vivien Kraus via Guix-patches via
2022-12-29 15:25           ` Vivien Kraus via Guix-patches via
2022-12-29 15:37             ` Simon Josefsson via Guix-patches via
2022-12-29 16:06               ` Vivien Kraus via Guix-patches via
2022-12-29 16:14                 ` Simon Josefsson via Guix-patches via
2022-12-28  2:20 ` [bug#60358] [PATCH v8 4/4] " Vivien Kraus via Guix-patches via
2022-12-28  2:20 ` [bug#60358] [PATCH v11 " Vivien Kraus via Guix-patches via
2022-12-28  2:20 ` [bug#60358] [PATCH v10 " Vivien Kraus via Guix-patches via
2023-01-15  7:07   ` bug#60358: " Liliana Marie Prikler
2022-12-28  2:20 ` [bug#60358] [PATCH v5 5/5] " Vivien Kraus via Guix-patches via
2022-12-31  6:53   ` Liliana Marie Prikler
2022-12-28  2:20 ` [bug#60358] [PATCH v6 3/3] " Vivien Kraus via Guix-patches via
2022-12-28  2:20 ` [bug#60358] [PATCH v7 5/5] " Vivien Kraus via Guix-patches via
2022-12-28  2:20 ` [bug#60358] [PATCH v9 4/4] " Vivien Kraus via Guix-patches via
2022-12-28  2:20 ` [bug#60358] [PATCH v4 3/3] " Vivien Kraus via Guix-patches via
2022-12-30 11:30 ` [bug#60358] [PATCH v4 2/3] gnu: gnulib: Enable tests Vivien Kraus via Guix-patches via
2022-12-30 11:30 ` [bug#60358] [PATCH v5 2/5] " Vivien Kraus via Guix-patches via
2022-12-30 21:20 ` [bug#60358] [PATCH v6 1/3] gnu: UCD: Add version 3.0-update1 Vivien Kraus via Guix-patches via
2022-12-30 21:20 ` [bug#60358] [PATCH v5 3/5] " Vivien Kraus via Guix-patches via
2022-12-31  6:49   ` Liliana Marie Prikler
2022-12-31 10:56     ` Vivien Kraus via Guix-patches via
2022-12-31 14:07       ` Liliana Marie Prikler
2022-12-30 21:20 ` [bug#60358] [PATCH v7 " Vivien Kraus via Guix-patches via
2022-12-31 19:17   ` Liliana Marie Prikler
2023-01-01  0:24     ` Vivien Kraus via Guix-patches via
2023-01-01  1:28       ` Liliana Marie Prikler
2022-12-30 22:05 ` [bug#60358] [PATCH v5 4/5] gnu: gnulib: Regenerate the unicode data Vivien Kraus via Guix-patches via
2022-12-31 17:33 ` [bug#60358] [PATCH v11 1/4] gnu: libunibreak: Use ucd instead of ucd-next Vivien Kraus via Guix-patches via
2022-12-31 17:33 ` [bug#60358] [PATCH v10 " Vivien Kraus via Guix-patches via
2022-12-31 17:33 ` [bug#60358] [PATCH v7 1/5] " Vivien Kraus via Guix-patches via
2022-12-31 17:33 ` [bug#60358] [PATCH v8 1/4] " Vivien Kraus via Guix-patches via
2022-12-31 17:33 ` [bug#60358] [PATCH v9 " Vivien Kraus via Guix-patches via
2022-12-31 17:34 ` [bug#60358] [PATCH v10 2/4] gnu: ucd-next: Update to 15.0.0 Vivien Kraus via Guix-patches via
2022-12-31 17:34 ` [bug#60358] [PATCH v7 2/5] " Vivien Kraus via Guix-patches via
2022-12-31 17:34 ` [bug#60358] [PATCH v9 2/4] " Vivien Kraus via Guix-patches via
2022-12-31 17:34 ` [bug#60358] [PATCH v11 " Vivien Kraus via Guix-patches via
2022-12-31 17:34 ` [bug#60358] [PATCH v8 " Vivien Kraus via Guix-patches via
2023-01-01 21:45 ` [bug#60358] [PATCH v11 0/4] Use a cover letter Vivien Kraus via Guix-patches via
2022-12-31 17:33   ` [bug#60358] [PATCH v11 1/4] gnu: libunibreak: Use ucd instead of ucd-next Vivien Kraus via Guix-patches via
2022-12-31 17:34     ` [bug#60358] [PATCH v11 2/4] gnu: ucd-next: Update to 15.0.0 Vivien Kraus via Guix-patches via
2022-12-27 16:23       ` [bug#60358] [PATCH v11 3/4] gnu: Add gnulib Vivien Kraus via Guix-patches via
2022-12-28  2:20         ` [bug#60358] [PATCH v11 4/4] gnu: guile-gnutls: Update to 3.7.11 Vivien Kraus via Guix-patches via
2023-01-01 21:59 ` [bug#60358] [PATCH v11 0/4] Using a cover letter with a shallow thread style Vivien Kraus via Guix-patches via
2022-12-27 16:23   ` [bug#60358] [PATCH v11 3/4] gnu: Add gnulib Vivien Kraus via Guix-patches via
2022-12-28  2:20   ` [bug#60358] [PATCH v11 4/4] gnu: guile-gnutls: Update to 3.7.11 Vivien Kraus via Guix-patches via
2022-12-31 17:33   ` [bug#60358] [PATCH v11 1/4] gnu: libunibreak: Use ucd instead of ucd-next Vivien Kraus via Guix-patches via
2022-12-31 17:34   ` [bug#60358] [PATCH v11 2/4] gnu: ucd-next: Update to 15.0.0 Vivien Kraus via Guix-patches via
2023-01-02 19:43 ` [bug#60358] [PATCH v12 0/4] Add my name to the copyright line Vivien Kraus via Guix-patches via
2022-12-27 16:23   ` [bug#60358] [PATCH v12 3/4] gnu: Add gnulib Vivien Kraus via Guix-patches via
2023-01-16 11:59     ` [bug#60358] [PATCH] " Ludovic Courtès
2022-12-28  2:20   ` [bug#60358] [PATCH v12 4/4] gnu: guile-gnutls: Update to 3.7.11 Vivien Kraus via Guix-patches via
2022-12-31 17:33   ` [bug#60358] [PATCH v12 1/4] gnu: libunibreak: Use ucd instead of ucd-next Vivien Kraus via Guix-patches via
2022-12-31 17:34   ` [bug#60358] [PATCH v12 2/4] gnu: ucd-next: Update to 15.0.0 Vivien Kraus via Guix-patches via
2023-01-07 10:21 ` [bug#60358] gnulib: Should this be in its own module? Vivien Kraus via Guix-patches via

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=18b9463408e0f046dec50c933e3f02fb2783467d.camel@planete-kraus.eu \
    --to=guix-patches@gnu.org \
    --cc=60358@debbugs.gnu.org \
    --cc=liliana.prikler@gmail.com \
    --cc=vivien@planete-kraus.eu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.