projects/guix·blob java-team · refs

109 lines · 4.7 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013, 2014 Eric Bavier <[email protected]>
3;;; Copyright © 2015, 2016 Efraim Flashner <[email protected]>
4;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <[email protected]>
5;;; Copyright © 2020 Marius Bakke <[email protected]>
6;;; Copyright © 2023 Kaelyn Takata <[email protected]>
7;;;
8;;; This file is part of GNU Guix.
9;;;
10;;; GNU Guix is free software; you can redistribute it and/or modify it
11;;; under the terms of the GNU General Public License as published by
12;;; the Free Software Foundation; either version 3 of the License, or (at
13;;; your option) any later version.
14;;;
15;;; GNU Guix is distributed in the hope that it will be useful, but
16;;; WITHOUT ANY WARRANTY; without even the implied warranty of
17;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18;;; GNU General Public License for more details.
19;;;
20;;; You should have received a copy of the GNU General Public License
21;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
22
23(define-module (gnu packages autogen)
24 #:use-module (guix packages)
25 #:use-module (guix licenses)
26 #:use-module (guix download)
27 #:use-module (guix build-system gnu)
28 #:use-module (gnu packages)
29 #:use-module (gnu packages perl)
30 #:use-module (gnu packages pkg-config)
31 #:use-module (gnu packages base)
32 #:use-module (gnu packages guile))
33
34(define-public autogen
35 (package
36 (name "autogen")
37 (version "5.18.16")
38 (source
39 (origin
40 (method url-fetch)
41 (uri (string-append "mirror://gnu/autogen/rel" version
42 "/autogen-" version ".tar.xz"))
43 (sha256
44 (base32 "16mlbdys8q4ckxlvxyhwkdnh1ay9f6g0cyp1kylkpalgnik398gq"))
45 (modules '((guix build utils)))
46 (snippet
47 '(begin
48 ;; Address '-Werror=format-overflow' error.
49 (substitute* "getdefs/getdefs.c"
50 (("def_bf\\[[[:space:]]*MAXNAMELEN[[:space:]]*\\]")
51 "def_bf[MAXNAMELEN + 10]"))
52 ;; Address '-Werror=format-truncation' error on i686.
53 (substitute* "autoopts/usage.c"
54 (("vfmt\\[sizeof\\(vfmtfmt\\)\\]")
55 "vfmt[sizeof(vfmtfmt) + 6]"))))))
56 (build-system gnu-build-system)
57 (native-inputs (list pkg-config which))
58 (inputs (list guile-3.0 perl)) ; for doc generator mdoc
59 (arguments
60 '(#:configure-flags
61 ;; XXX Needed to build 5.18.16. ./configure fails without it:
62 ;; “Something went wrong bootstrapping makefile fragments for
63 ;; automatic dependency tracking. Try re-running configure with […]”
64 (list "--disable-dependency-tracking")
65
66 ;; XXX: Parallel tests may cause an indefinite hang with GNU Make 4.3.
67 #:parallel-tests? #f
68
69 #:phases
70 (modify-phases %standard-phases
71 (add-after 'unpack 'support-guile-3.0
72 ;; Upstream bug:
73 ;; https://sourceforge.net/p/autogen/bugs/196/
74 ;;
75 ;; Supported in Debian and openSUSE:
76 ;; https://salsa.debian.org/debian/autogen/-/blob/master/debian/patches/40_suse_04-guile-version.patch
77 (lambda _
78 (substitute* "agen5/guile-iface.h"
79 (("#elif GUILE_VERSION < 203000") "#elif GUILE_VERSION < 301000"))
80 (substitute* "configure"
81 (("2.2 2.0 1.8") "3.0 2.2 2.0 1.8"))))
82 (add-after 'unpack 'use-numeric-ids-in-tarball
83 ;; Pass arguments to tar to generate tarball with consistent uid
84 ;; and gid to ensure reproducible build
85 (lambda _
86 (substitute* "pkg/libopts/mklibsrc.sh"
87 (("--sort=name --format=gnu")
88 "--sort=name --format=gnu --owner=0 --group=0 --numeric-owner"))))
89 (add-before 'build 'set-man-page-date
90 ;; Avoid embedding the current date for reproducible builds
91 (lambda _
92 (setenv "MAN_PAGE_DATE" "2012-04-18")))
93 (add-before 'patch-source-shebangs 'patch-test-scripts
94 (lambda _
95 (let ((sh (which "sh")))
96 (substitute*
97 (append (find-files "agen5/test" "\\.test$")
98 (find-files "autoopts/test" "\\.(test|in)$"))
99 (("/bin/sh") sh))
100 #t))))))
101 (home-page "https://www.gnu.org/software/autogen/")
102 (synopsis "Automated program generator")
103 (description
104 "AutoGen is a program to ease the maintenance of programs that contain
105large amounts of repetitive text. It automates the construction of these
106sections of the code, simplifying the task of keeping the text in sync. It
107also includes an add-on package called AutoOpts, which is specialized for the
108maintenance and documentation of program options.")
109 (license gpl3+)))