From patchwork Sun Oct 9 17:22:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: M X-Patchwork-Id: 43254 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 015E127BBEA; Sun, 9 Oct 2022 18:23:15 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,SPF_HELO_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id EA81427BBE9 for ; Sun, 9 Oct 2022 18:23:14 +0100 (BST) Received: from localhost ([::1]:37376 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oha1B-0000cl-Kf for patchwork@mira.cbaines.net; Sun, 09 Oct 2022 13:23:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51684) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oha11-0000Zz-A1 for guix-patches@gnu.org; Sun, 09 Oct 2022 13:23:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:45812) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oha11-0002Zs-1u for guix-patches@gnu.org; Sun, 09 Oct 2022 13:23:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oha10-0006x6-IF for guix-patches@gnu.org; Sun, 09 Oct 2022 13:23:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#58398] [core-updates] gnu: dbm: Regenerate Autotools files. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 09 Oct 2022 17:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 58398 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 58398@debbugs.gnu.org Cc: Maxime Devos X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.166533618026701 (code B ref -1); Sun, 09 Oct 2022 17:23:02 +0000 Received: (at submit) by debbugs.gnu.org; 9 Oct 2022 17:23:00 +0000 Received: from localhost ([127.0.0.1]:44890 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oha0x-0006wa-MQ for submit@debbugs.gnu.org; Sun, 09 Oct 2022 13:23:00 -0400 Received: from lists.gnu.org ([209.51.188.17]:40246) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oha0v-0006wT-UY for submit@debbugs.gnu.org; Sun, 09 Oct 2022 13:22:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51680) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oha0v-0000Zb-PH for guix-patches@gnu.org; Sun, 09 Oct 2022 13:22:57 -0400 Received: from michel.telenet-ops.be ([2a02:1800:110:4::f00:18]:48714) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oha0q-0002Yu-Pv for guix-patches@gnu.org; Sun, 09 Oct 2022 13:22:57 -0400 Received: from localhost.localdomain ([IPv6:2a02:1811:8c09:9d00:5dba:d409:33f7:a16]) by michel.telenet-ops.be with bizsmtp id VtNm2800D20ykKC06tNm3k; Sun, 09 Oct 2022 19:22:48 +0200 From: Maxime Devos Date: Sun, 9 Oct 2022 19:22:44 +0200 Message-Id: <20221009172244.26683-1-maximedevos@telenet.be> X-Mailer: git-send-email 2.37.3 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1665336168; bh=hV9q1prn4lempa1Qtp1tyTFQ7vBMJ3QcJWnpQZ7kpaY=; h=From:To:Cc:Subject:Date; b=ltCbsULuzw1nteFfkBXeg1QIFskIMis+x4I3JG/XhG2NwR52YrXJEd20A9W4HYxMx ifgvdNJjzISrp74YtT6evy113WJ+PUXlDx+xN5l4tVeYqAePP+hAgdvK31Loi7SzMh 557aHhOnRAh3hXWerNYP5Qfy5DVWASxTKhi6VWvEJeHHlNrN3kqREXN+uJoW8emOZH /Lud/ZRNnzUujCnY+k3OUo0nCVieDqCkVm7hrSQQmmlf0XhwWgmxWMxAoh+hiXBRaB 0+1jW0VrBlllOp//uDQURViANcKOJQn3qP5cTyANT4BXEP2l8t1PWQK/4pw6zIDvAM bMrrlKVXgcMfg== Received-SPF: pass client-ip=2a02:1800:110:4::f00:18; envelope-from=maximedevos@telenet.be; helo=michel.telenet-ops.be X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches This way, overriding the 'detection of 'build' isn't needed anymore. I switched from 'config' to 'automake' to prevent a hang of './pre-inst-env guix build bdb@4.8' with ever-increasing memory usage, presumably indicating a cycle. Build-tested on a x86_64-linux with: $ ./pre-inst-env guix build --system=x86_64-linux bdb@4 bdb@5 bdb@6 $ ./pre-inst-env guix build --system=x86_64-linux --target=aarch64-linux-gnu bdb@4 bdb@5 bdb@6 It could not be tested with a non-x86_64 system (aarch64-linux) because of an (presumably unrelated) coreutils build failure. * gnu/packages/dbm.scm (bdb-snippet): New procedure. (bdb-4.8)[source]: Add the snippet. [arguments]: Copy "config.sub"," "config.guess" and "install-sh" in a new 'boostrap phase', this time from automake. Move macros from aclocal_java to aclocal. Move configure flags to #:configure-flags. Remove 'configure' phase, instead add a pre-configure phase for adjusting Makefile.in and use '#:out-of-source' to perform an out-of-source build. Run "s_config" to fix up the version numbers. (bdb-5.3)[source]: Inherit from bdb-4.8's source, to get the snippet. (bdb-6)[source]: Likewise, and be careful to not add a patch. --- gnu/packages/dbm.scm | 149 ++++++++++++++++++++++++------------------- 1 file changed, 82 insertions(+), 67 deletions(-) base-commit: ccc2658e2a111590ec25e308946e47a24d357785 prerequisite-patch-id: 87e197146284fb770478e0c2d73027e68ee3db6d prerequisite-patch-id: 32ea6453c34258e3ac8a8766aa14ebb5fe1f5f88 prerequisite-patch-id: b359f1dbbcd6374492720ebd67b0212bd3dfe246 diff --git a/gnu/packages/dbm.scm b/gnu/packages/dbm.scm index 8c49094697..4a8acb7ab6 100644 --- a/gnu/packages/dbm.scm +++ b/gnu/packages/dbm.scm @@ -6,7 +6,7 @@ ;;; Copyright © 2018 Mark H Weaver ;;; Copyright © 2020 Jakub Kądziołka ;;; Copyright © 2021 Leo Le Bouter -;;; Copyright © 2021 Maxime Devos +;;; Copyright © 2021, 2022 Maxime Devos ;;; ;;; This file is part of GNU Guix. ;;; @@ -29,6 +29,7 @@ (define-module (gnu packages dbm) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix packages) #:use-module (guix download) + #:use-module (guix gexp) #:use-module (guix build-system gnu) #:use-module (guix utils) #:use-module (ice-9 match)) @@ -38,6 +39,29 @@ (define-module (gnu packages dbm) ;;; This module has been separated from (gnu packages databases) to reduce the ;;; number of module references for core packages. +(define bdb-snippet + ;; Remove some bundled and generated files. Some of the old + ;; Autotools files are too old for some architectures + ;; (e.g. aarch64 and powerpc64le). + #~(begin + (for-each delete-file-recursively + '("dist/configure" + "dist/config.sub" + "dist/config.guess" + "dist/install-sh" + "dist/ltmain.sh" + "dist/aclocal/libtool.m4" + "dist/aclocal/ltoptions.m4" + "dist/aclocal/ltsugar.m4" + "dist/aclocal/ltversion.m4" + "dist/aclocal/lt~obsolete.m4")) + (substitute* "dist/configure.ac" + ;; Placate 'automake'. + (("AC_DEFINE\\(DB_WIN32\\)") + "AC_DEFINE(DB_WIN32, [], [Description])") + (("AC_DEFINE\\(HAVE_SYSTEM_INCLUDE_FILES\\)") + "AC_DEFINE(HAVE_SYSTEM_INCLUDE_FILES, [], [Description])")))) + (define-public bdb-4.8 (package (name "bdb") @@ -51,76 +75,65 @@ (define-public bdb-4.8 (sha256 (base32 "0ampbl2f0hb1nix195kz1syrqqxpmvnvnfvphambj7xjrl3iljg0")) - (patches (search-patches "bdb-5.3-atomics-on-gcc-9.patch")))) + (patches (search-patches "bdb-5.3-atomics-on-gcc-9.patch")) + (modules '((guix build utils) + (srfi srfi-1))) + (snippet bdb-snippet))) (build-system gnu-build-system) (outputs '("out" ; programs, libraries, headers "doc")) ; 94 MiB of HTML docs (arguments - `(#:tests? #f ; no check target available - #:disallowed-references ("doc") - #:phases - (modify-phases %standard-phases - ;; The configure script is too old to recognise aarch64 and - ;; powerpc64le as valid architectures. The trick below works - ;; for "--build", but not for "--host", so update config.sub. - ,@(if (and (%current-target-system) - (or (target-ppc64le? (%current-target-system)) - (target-aarch64? (%current-target-system)))) - `((add-after 'unpack 'update-config.sub - (lambda* (#:key native-inputs #:allow-other-keys) - (delete-file "dist/config.sub") - (symlink - (search-input-file native-inputs "/bin/config.sub") - "dist/config.sub")))) - '()) - (replace 'configure - (lambda* (#:key target outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out")) - (doc (assoc-ref outputs "doc"))) - ;; '--docdir' is not honored, so we need to patch. - (substitute* "dist/Makefile.in" - (("docdir[[:blank:]]*=.*") - (string-append "docdir = " doc "/share/doc/bdb"))) - - (chdir "build_unix") - (invoke "../dist/configure" - (string-append "--prefix=" out) - (string-append "CONFIG_SHELL=" (which "bash")) - (string-append "SHELL=" (which "bash")) - - ;; Bdb's config script doesn't recognize very many - ;; architectures, and is a dependant on the 'config' - ;; package, so we manually define the build target. - ,@(match (%current-system) - ("aarch64-linux" - '("--build=aarch64-unknown-linux-gnu")) - ("powerpc64le-linux" - '("--build=powerpc64le-unknown-linux-gnu")) - ("riscv64-linux" - '("--build=riscv64-unknown-linux-gnu")) - (_ '())) + (list #:tests? #f ; no check target available + #:disallowed-references '("doc") + #:out-of-source? #true + #:configure-flags + #~(list + ;; Remove 7 MiB of .a files. + "--disable-static" - ,@(if (%current-target-system) ; cross building - '((string-append "--host=" target)) - '()) + ;; The compatibility mode is needed by some packages, + ;; notably iproute2. + "--enable-compat185" - ;; Remove 7 MiB of .a files. - "--disable-static" - - ;; The compatibility mode is needed by some packages, - ;; notably iproute2. - "--enable-compat185" - - ;; The following flag is needed so that the inclusion - ;; of db_cxx.h into C++ files works; it leads to - ;; HAVE_CXX_STDHEADERS being defined in db_cxx.h. - "--enable-cxx"))))))) - (native-inputs - (if (and (%current-target-system) - (or (target-ppc64le? (%current-target-system)) - (target-aarch64? (%current-target-system)))) - `(("config" ,config)) ; for config.sub - '())) + ;; The following flag is needed so that the inclusion + ;; of db_cxx.h into C++ files works; it leads to + ;; HAVE_CXX_STDHEADERS being defined in db_cxx.h. + "--enable-cxx") + #:phases + #~(modify-phases %standard-phases + (replace 'bootstrap + (lambda* (#:key inputs native-inputs outputs + #:allow-other-keys #:rest arguments) + (with-directory-excursion "dist" + (for-each (lambda (x) + (install-file x "aclocal")) + (find-files "aclocal_java")) + (apply (assq-ref %standard-phases 'bootstrap) arguments) + (let ((automake-files (search-input-directory + (or native-inputs inputs) + "share/automake-1.16"))) + (define (replace file) + (symlink (string-append automake-files "/" file) file)) + (for-each replace '("config.sub" "config.guess" + "install-sh")))))) + (add-before 'configure 'pre-configure + (lambda _ + (chdir "dist") + ;; '--docdir' is not honored, so we need to patch. + (substitute* "Makefile.in" + (("docdir[[:blank:]]*=.*") + (string-append "docdir = " #$output:doc + "/share/doc/bdb"))) + ;; Replace __EDIT_DB_VERSION__... by actual version numbers. + ;; s_config is responsible for this, but also runs autoconf + ;; again, so patch out the autoconf bits. + (substitute* "s_config" + (("^.*(aclocal|autoconf|autoheader|config\\.hin).*$") "") + (("^.*auto4mte.*$") "") + (("rm (.*) configure") "") + (("chmod (.*) config.guess(.*)$") "")) + (invoke "sh" "s_config")))))) + (native-inputs (list autoconf automake libtool)) (synopsis "Berkeley database") (description "Berkeley DB is an embeddable database allowing developers the choice of @@ -135,7 +148,7 @@ (define-public bdb-5.3 (name "bdb") (version "5.3.28") (source (origin - (method url-fetch) + (inherit (package-source bdb-4.8)) (uri (string-append "https://download.oracle.com/berkeley-db/db-" version ".tar.gz")) (sha256 @@ -149,12 +162,14 @@ (define-public bdb-6 (name "bdb") (version "6.2.32") (source (origin + (inherit (package-source bdb-4.8)) (method url-fetch) (uri (string-append "https://download.oracle.com/berkeley-db/db-" version ".tar.gz")) (sha256 (base32 - "1yx8wzhch5wwh016nh0kfxvknjkafv6ybkqh6nh7lxx50jqf5id9")))) + "1yx8wzhch5wwh016nh0kfxvknjkafv6ybkqh6nh7lxx50jqf5id9")) + (patches '()))) ;; Starting with version 6, BDB is distributed under AGPL3. Many individual ;; files are covered by the 3-clause BSD license. (license (list license:agpl3+ license:bsd-3))))