From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id QLbdEj9/sGNFmQAAbAwnHQ (envelope-from ) for ; Sat, 31 Dec 2022 19:28:15 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id WMrZEj9/sGNEfwEA9RJhRA (envelope-from ) for ; Sat, 31 Dec 2022 19:28:15 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id DE06D386DB for ; Sat, 31 Dec 2022 19:28:14 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pBgaR-000586-FB; Sat, 31 Dec 2022 13:28:03 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pBgaQ-00057n-Cn for guix-patches@gnu.org; Sat, 31 Dec 2022 13:28:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pBgaQ-000142-4f for guix-patches@gnu.org; Sat, 31 Dec 2022 13:28:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pBgaQ-0001qS-0N for guix-patches@gnu.org; Sat, 31 Dec 2022 13:28:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#60358] [PATCH v7 4/5] gnu: Add gnulib. References: In-Reply-To: Resent-From: Vivien Kraus Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 31 Dec 2022 18:28:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60358 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 60358@debbugs.gnu.org Cc: Liliana Marie Prikler Received: via spool by 60358-submit@debbugs.gnu.org id=B60358.16725112297004 (code B ref 60358); Sat, 31 Dec 2022 18:28:01 +0000 Received: (at 60358) by debbugs.gnu.org; 31 Dec 2022 18:27:09 +0000 Received: from localhost ([127.0.0.1]:39818 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pBgZZ-0001ot-0a for submit@debbugs.gnu.org; Sat, 31 Dec 2022 13:27:09 -0500 Received: from planete-kraus.eu ([89.234.140.182]:49024) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pBgZW-0001nJ-LU for 60358@debbugs.gnu.org; Sat, 31 Dec 2022 13:27:07 -0500 Received: from planete-kraus.eu (localhost.lan [127.0.0.1]) by planete-kraus.eu (OpenSMTPD) with ESMTP id d0e18f07; Sat, 31 Dec 2022 18:27:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=planete-kraus.eu; h=from :date:subject:to:cc:message-id:mime-version; s=dkim; bh=9IurLtZa wLZuGjc9uKcno7HWi3U=; b=bBd141WBGWBWmYZ9ELqulJ4RtILEM2qmyqEExOtn t0dVQ8YdM6zJPFVEAtUTtGnWZ1OkZGrMQtBcZb8imVPY2cWdF7LE7KgzhCyFRoDZ GcQBX5jAIrQYhnRoKNqdvsz+phGkndEk04kFQG6DL3D0VGg5rm0BLb62Rg2AfkM+ sH0= Received: by planete-kraus.eu (OpenSMTPD) with ESMTPSA id 166307ca (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); Sat, 31 Dec 2022 18:27:04 +0000 (UTC) Date: Tue, 27 Dec 2022 17:23:30 +0100 Message-ID: <443f01dcd18783358bb44f96a57fe4162dcdfeb0.camel@planete-kraus.eu> MIME-Version: 1.0 User-Agent: Evolution 3.46.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Vivien Kraus X-ACL-Warn: , Vivien Kraus via Guix-patches From: Vivien Kraus via Guix-patches via Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1672511295; a=rsa-sha256; cv=none; b=P2nZH5wdsilj8bAXgwAQjDr70NH27aVrYfNol2Wn1vnkMQ2dZRF3R5eJvzAOGNLX60TmBJ 5+8TI8AAB1ydfyk4LCfjOb0jeTQvkqxYx/BKkxF8PSzYBdT/dzU7ziRvyAx3SUhc8bfK+g IDgd+zkZBiG9dYSAoCfFoALYZ353WlVi365Hd+X5a+0JgFXsWzjcaCiGqSgZlBO7++cw1K u4GQGKawZc/0tSq1EoC7a3KZ0B7moMiDm1m3clN9bERq3Wvppr9kY64jNP8ujFEluOcYEc fU8tuTuVcYKUjb2H/C0n4SGSCSM4DAsFIzkOK0CXpX0D8Ojkv8Ey1pmoANKn6A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=planete-kraus.eu header.s=dkim header.b=bBd141WB; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1672511295; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=rbHcDKo3PCX2FPFzLZgvmKup0+vgxP38/UMKMMoAcrU=; b=Yy3WOIJS8Pe3XHhgbCTD0+1LCvZM1ziWjyeWbDgWToIT/j2kizybYvTVT3/tHfOR8Zcvz3 ULlqfXXmledvXKVBU1x8ZuHa+3BWcaX0FgGr7woAQOJfK/LROSS87aPQowZP4ga3gZjfvR zqIx0yhfNDUjp7Io/zjYvtTS0BzIb/yhGXC0eyE2b7L0wKUsUTgsHQx6pcdi3ZYYF93xhE JDON14eGnUc0f2uYq7nuRaHMk3JSAVhxFYkNGrVh1Y5wLkHGnzD+BSDDZCp9hWK0DcQ7++ sVgWPQee1pXsgyErUGivM6VfnkZfyRnGHE9ZcYlG5575o1/hbRrACBsQZp+L4A== X-Spam-Score: 1.86 X-Migadu-Queue-Id: DE06D386DB Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=planete-kraus.eu header.s=dkim header.b=bBd141WB; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org X-Migadu-Scanner: scn0.migadu.com X-Migadu-Spam-Score: 1.86 X-TUID: q/pdKyfkXxsT * gnu/packages/build-tools.scm (gnulib): New variable. (gnulib-checkout): New function. It returns a package with a specific commit of gnulib. --- gnu/packages/build-tools.scm | 220 +++++++++++++++++++++++++++++++++++ 1 file changed, 220 insertions(+) diff --git a/gnu/packages/build-tools.scm b/gnu/packages/build-tools.scm index 6c1350c44f..d2eeb88db6 100644 --- a/gnu/packages/build-tools.scm +++ b/gnu/packages/build-tools.scm @@ -32,27 +32,36 @@ ;;; along with GNU Guix. If not, see . (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 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 +74,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 +813,213 @@ (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 ((count-purged + (file-system-fold + ;; enter? + (lambda (name stat result) + #t) + ;; leaf + (lambda (name stat result) + (if (or (string-suffix? ".c" name) + (string-suffix? ".h" name) + (string-suffix? ".gperf" name)) + (call-with-input-file name + (lambda (port) + (let ((first-line (read-line port))) + (if (equal? + first-line + "/* DO NOT EDIT! GENERATED AUTOMATICALLY! */") + (begin + (delete-file name) + (1+ result)) + result)))) + result)) + ;; down + (lambda (name stat result) + result) + ;; up + (lambda (name stat result) + result) + ;; skip + (lambda (name stat result) + (error "No directory should be spared")) + ;; error + (lambda (name stat errno result) + (error "A file is inaccessible")) + ;; Initial value + 0 + (getcwd)))) + (unless (eqv? count-purged 332) + (format (current-error-port) "There were ~s files purged.\n" count-purged) + (error "Please check the number of automatically generated files."))) + ;; 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 gnu-build-system) + (arguments + (list + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack '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" ".") + (invoke "git" "commit" "-m" + "Syntax checks are only run against committed files, so commit everything."))) + (add-after 'fix-tests 'disable-failing-tests + (lambda _ + (substitute* "cfg.mk" + (("local-checks-to-skip =") + "local-checks-to-skip = \\ + sc_Wundef_boolean \\ + 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") + "disabled_check_sym_list") + (("sc_cpp_indent_check") + "disabled_cpp_indent_check") + (("sc_check_copyright") + "disabled_check_copyright") + (("sc_prohibit_AC_LIBOBJ_in_m4") + "disabled_prohibit_AC_LIBOBJ_in_m4") + (("sc_prefer_ac_check_funcs_once") + "disabled_prefer_ac_check_funcs_once") + (("sc_prohibit_leading_TABs") + "disabled_prohibit_leading_TABs")))) + (delete 'configure) + (add-after 'unpack 'regenerate-unicode + (lambda* (#:key inputs #:allow-other-keys) + (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" + `(,@(map (lambda (f) + (search-input-file inputs f)) + '("share/ucd/UnicodeData.txt" + "share/ucd/PropList.txt" + "share/ucd/DerivedCoreProperties.txt" + "share/ucd/emoji/emoji-data.txt" + "share/ucd/ArabicShaping.txt" + "share/ucd/Scripts.txt" + "share/ucd/Blocks.txt" + "share/ucd/PropList-3.0.1.txt" + "share/ucd/EastAsianWidth.txt" + "share/ucd/LineBreak.txt" + "share/ucd/auxiliary/WordBreakProperty.txt" + "share/ucd/auxiliary/GraphemeBreakProperty.txt" + "share/ucd/CompositionExclusions.txt" + "share/ucd/SpecialCasing.txt" + "share/ucd/CaseFolding.txt")) + ;; This is the version of the UCD used, it should be + ;; the same as the native-input. + #$(package-version ucd-next))) + (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")) + (copy-file (search-input-file inputs "share/ucd/NameAliases.txt") + "../tests/uniname/NameAliases.txt") + (copy-file (search-input-file inputs "share/ucd/UnicodeData.txt") + "../tests/uniname/UnicodeData.txt") + (copy-file (search-input-file inputs "share/ucd/NormalizationTest.txt") + "../tests/uninorm/NormalizationTest.txt") + (copy-file (search-input-file inputs "share/ucd/auxiliary/GraphemeBreakTest.txt") + "../tests/unigbrk/GraphemeBreakTest.txt") + (copy-file (search-input-file inputs "share/ucd/auxiliary/WordBreakTest.txt") + "../tests/uniwbrk/WordBreakTest.txt") + (delete-file "gen-uni-tables")))) + (replace 'install + (lambda _ + (install-file "gnulib-tool" + (string-append #$output "/bin")) + (delete-file-recursively ".git") + (copy-recursively "." (string-append #$output "/src/gnulib/"))))))) + (inputs ;; Shebangs for some auxiliary build files. + (list python perl clisp)) + (native-inputs + (list + python perl clisp + ;; Unicode data: + ucd-next ;; If you change it, also change #$(package-version ucd-next) + ;; in the regenerate-unicode phase. + ucd3.0-update1 + ;; 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-28" + #:commit "14a7b0ce5462c90ce86d97bf952185ec2500d341" + #:hash (base32 "0fz25ccdlxf4xp37rjsl1fslc4g0x12qpvadz4qw0cq18dvx5kbx"))) -- 2.38.1