autotools.scm 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
  3. ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
  4. ;;; Copyright © 2015 Mathieu Lirzin <mthl@openmailbox.org>
  5. ;;; Copyright © 2014 Manolis Fragkiskos Ragkousis <manolis837@gmail.com>
  6. ;;; Copyright © 2015, 2017, 2018 Mark H Weaver <mhw@netris.org>
  7. ;;; Copyright © 2016 David Thompson <davet@gnu.org>
  8. ;;; Copyright © 2017 Nikita <nikita@n0.is>
  9. ;;; Copyright © 2017, 2019, 2021 Efraim Flashner <efraim@flashner.co.il>
  10. ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
  11. ;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
  12. ;;; Copyright © 2019 Pierre-Moana Levesque <pierre.moana.levesque@gmail.com>
  13. ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
  14. ;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
  15. ;;;
  16. ;;; This file is part of GNU Guix.
  17. ;;;
  18. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  19. ;;; under the terms of the GNU General Public License as published by
  20. ;;; the Free Software Foundation; either version 3 of the License, or (at
  21. ;;; your option) any later version.
  22. ;;;
  23. ;;; GNU Guix is distributed in the hope that it will be useful, but
  24. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  25. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  26. ;;; GNU General Public License for more details.
  27. ;;;
  28. ;;; You should have received a copy of the GNU General Public License
  29. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  30. (define-module (gnu packages autotools)
  31. #:use-module (guix licenses)
  32. #:use-module (gnu packages)
  33. #:use-module (gnu packages perl)
  34. #:use-module (gnu packages python)
  35. #:use-module (gnu packages m4)
  36. #:use-module (gnu packages man)
  37. #:use-module (gnu packages bash)
  38. #:use-module (guix utils)
  39. #:use-module (guix packages)
  40. #:use-module (guix download)
  41. #:use-module (guix git-download)
  42. #:use-module (guix build-system gnu)
  43. #:use-module (guix build-system trivial)
  44. #:use-module (ice-9 match)
  45. #:export (autoconf-wrapper))
  46. (define-public autoconf-2.69
  47. (package
  48. (name "autoconf")
  49. (version "2.69")
  50. (source
  51. (origin
  52. (method url-fetch)
  53. (uri (string-append "mirror://gnu/autoconf/autoconf-"
  54. version ".tar.xz"))
  55. (sha256
  56. (base32
  57. "113nlmidxy9kjr45kg9x3ngar4951mvag1js2a3j8nxcz34wxsv4"))))
  58. (build-system gnu-build-system)
  59. (inputs
  60. `(("bash" ,bash-minimal)
  61. ("perl" ,perl)
  62. ("m4" ,m4)))
  63. (native-inputs
  64. `(("perl" ,perl)
  65. ("m4" ,m4)))
  66. (arguments
  67. `(;; XXX: testsuite: 209 and 279 failed. The latter is an impurity. It
  68. ;; should use our own "cpp" instead of "/lib/cpp".
  69. #:tests? #f
  70. ,@(if (%current-target-system)
  71. `(#:phases
  72. (modify-phases %standard-phases
  73. (add-after 'install 'patch-non-shebang-references
  74. (lambda* (#:key build inputs outputs #:allow-other-keys)
  75. ;; `patch-shebangs' patches shebangs only, and the Perl
  76. ;; scripts use a re-exec feature that references the
  77. ;; build hosts' perl. Also, BASH and M4 store references
  78. ;; hide in the scripts.
  79. (let ((bash (assoc-ref inputs "bash"))
  80. (m4 (assoc-ref inputs "m4"))
  81. (perl (assoc-ref inputs "perl"))
  82. (out (assoc-ref outputs "out"))
  83. (store-directory (%store-directory)))
  84. (substitute* (find-files (string-append out "/bin"))
  85. (((string-append store-directory "/[^/]*-bash-[^/]*"))
  86. bash)
  87. (((string-append store-directory "/[^/]*-m4-[^/]*"))
  88. m4)
  89. (((string-append store-directory "/[^/]*-perl-[^/]*"))
  90. perl))
  91. #t)))))
  92. '())))
  93. (home-page "https://www.gnu.org/software/autoconf/")
  94. (synopsis "Create source code configuration scripts")
  95. (description
  96. "Autoconf offers the developer a robust set of M4 macros which expand
  97. into shell code to test the features of Unix-like systems and to adapt
  98. automatically their software package to these systems. The resulting shell
  99. scripts are self-contained and portable, freeing the user from needing to
  100. know anything about Autoconf or M4.")
  101. (license gpl3+))) ; some files are under GPLv2+
  102. ;; This is the renaissance version, which is not widely supported yet.
  103. (define-public autoconf-2.71
  104. (package
  105. (inherit autoconf-2.69)
  106. (version "2.71")
  107. (source
  108. (origin
  109. (method url-fetch)
  110. (uri (string-append "mirror://gnu/autoconf/autoconf-"
  111. version ".tar.xz"))
  112. (sha256
  113. (base32
  114. "197sl23irn6s9pd54rxj5vcp5y8dv65jb9yfqgr2g56cxg7q6k7i"))))
  115. (arguments
  116. (substitute-keyword-arguments (package-arguments autoconf-2.69)
  117. ((#:tests? _ #f)
  118. ;; FIXME: To run the test suite, fix all the instances where scripts
  119. ;; generates "#! /bin/sh" shebangs.
  120. #f)
  121. ((#:phases phases '%standard-phases)
  122. `(modify-phases ,phases
  123. (add-before 'check 'prepare-tests
  124. (lambda _
  125. (for-each patch-shebang
  126. (append (find-files "tests"
  127. (lambda (file stat)
  128. (executable-file? file)))
  129. (find-files "bin"
  130. (lambda (file stat)
  131. (executable-file? file)))))
  132. #t))
  133. (add-after 'install 'unpatch-shebangs
  134. (lambda* (#:key outputs #:allow-other-keys)
  135. ;; Scripts that "autoconf -i" installs (config.guess,
  136. ;; config.sub, and install-sh) must use a regular shebang
  137. ;; rather than a reference to the store. Restore it.
  138. ;; TODO: Move this phase to 'autoconf-2.69'.
  139. (let* ((out (assoc-ref outputs "out"))
  140. (build-aux (string-append
  141. out "/share/autoconf/build-aux")))
  142. (substitute* (find-files build-aux)
  143. (("^#!.*/bin/sh") "#!/bin/sh")))))))))))
  144. (define-public autoconf autoconf-2.69)
  145. (define-public autoconf-2.68
  146. (package (inherit autoconf)
  147. (version "2.68")
  148. (source
  149. (origin
  150. (method url-fetch)
  151. (uri (string-append "mirror://gnu/autoconf/autoconf-"
  152. version ".tar.xz"))
  153. (sha256
  154. (base32
  155. "1fjm21k2na07f3vasf288a0zx66lbv0hd3l9bvv3q8p62s3pg569"))))))
  156. (define-public autoconf-2.64
  157. ;; As of GDB 7.8, GDB is still developed using this version of Autoconf.
  158. (package (inherit autoconf)
  159. (version "2.64")
  160. (source
  161. (origin
  162. (method url-fetch)
  163. (uri (string-append "mirror://gnu/autoconf/autoconf-"
  164. version ".tar.xz"))
  165. (sha256
  166. (base32
  167. "0j3jdjpf5ly39dlp0bg70h72nzqr059k0x8iqxvaxf106chpgn9j"))))))
  168. (define-public autoconf-2.13
  169. ;; GNU IceCat 52.x requires autoconf-2.13 to build!
  170. (package (inherit autoconf)
  171. (version "2.13")
  172. (source
  173. (origin
  174. (method url-fetch)
  175. (uri (string-append "mirror://gnu/autoconf/autoconf-"
  176. version ".tar.gz"))
  177. (sha256
  178. (base32
  179. "07krzl4czczdsgzrrw9fiqx35xcf32naf751khg821g5pqv12qgh"))))
  180. (arguments
  181. `(#:tests? #f
  182. #:phases
  183. ;; The 'configure' script in autoconf-2.13 can't cope with "SHELL=" and
  184. ;; "CONFIG_SHELL=" arguments, so we set them as environment variables
  185. ;; and pass a simplified set of arguments.
  186. (modify-phases %standard-phases
  187. (replace 'configure
  188. (lambda* (#:key build inputs outputs #:allow-other-keys)
  189. (let ((bash (which "bash"))
  190. (out (assoc-ref outputs "out")))
  191. (setenv "CONFIG_SHELL" bash)
  192. (setenv "SHELL" bash)
  193. (invoke bash "./configure"
  194. (string-append "--prefix=" out)
  195. (string-append "--build=" build))))))))))
  196. (define (make-autoconf-wrapper autoconf)
  197. "Return a wrapper around AUTOCONF that generates `configure' scripts that
  198. use our own Bash instead of /bin/sh in shebangs. For that reason, it should
  199. only be used internally---users should not end up distributing `configure'
  200. files with a system-specific shebang."
  201. (package (inherit autoconf)
  202. (name (string-append (package-name autoconf) "-wrapper"))
  203. (build-system trivial-build-system)
  204. (inputs `(("guile"
  205. ;; XXX: Kludge to hide the circular dependency.
  206. ,(module-ref (resolve-interface '(gnu packages guile))
  207. 'guile-3.0/fixed))
  208. ("autoconf" ,autoconf)
  209. ("bash" ,bash-minimal)))
  210. (arguments
  211. '(#:modules ((guix build utils))
  212. #:builder
  213. (begin
  214. (use-modules (guix build utils))
  215. (let* ((out (assoc-ref %outputs "out"))
  216. (bin (string-append out "/bin"))
  217. (autoconf (string-append
  218. (assoc-ref %build-inputs "autoconf")
  219. "/bin/autoconf"))
  220. (guile (string-append
  221. (assoc-ref %build-inputs "guile")
  222. "/bin/guile"))
  223. (sh (string-append
  224. (assoc-ref %build-inputs "bash")
  225. "/bin/sh"))
  226. (modules ((compose dirname dirname dirname)
  227. (search-path %load-path
  228. "guix/build/utils.scm"))))
  229. (mkdir-p bin)
  230. ;; Symlink all the binaries but `autoconf'.
  231. (with-directory-excursion bin
  232. (for-each (lambda (file)
  233. (unless (string=? (basename file) "autoconf")
  234. (symlink file (basename file))))
  235. (find-files (dirname autoconf) ".*")))
  236. ;; Add an `autoconf' binary that wraps the real one.
  237. (call-with-output-file (string-append bin "/autoconf")
  238. (lambda (port)
  239. ;; Shamefully, Guile can be used in shebangs only if a
  240. ;; single argument is passed (-ds); otherwise it gets
  241. ;; them all as a single argument and fails to parse them.
  242. (format port "#!~a
  243. export GUILE_LOAD_PATH=\"~a\"
  244. export GUILE_LOAD_COMPILED_PATH=\"~a\"
  245. exec ~a --no-auto-compile \"$0\" \"$@\"
  246. !#~%"
  247. sh modules modules guile)
  248. (write
  249. `(begin
  250. (use-modules (guix build utils))
  251. (let ((result (apply system* ,autoconf
  252. (cdr (command-line)))))
  253. (when (and (file-exists? "configure")
  254. (not (file-exists? "/bin/sh")))
  255. ;; Patch regardless of RESULT, because `autoconf
  256. ;; -Werror' can both create a `configure' file and
  257. ;; return a non-zero exit code.
  258. (patch-shebang "configure"))
  259. (exit (status:exit-val result))))
  260. port)))
  261. (chmod (string-append bin "/autoconf") #o555)
  262. #t))))
  263. ;; Do not show it in the UI since it's meant for internal use.
  264. (properties '((hidden? . #t)))))
  265. ;; Only use this package when autoconf is not usable,
  266. ;; see <https://issues.guix.gnu.org/46564#1>.
  267. (define-public autoconf-wrapper
  268. (make-autoconf-wrapper autoconf))
  269. (define-public autoconf-archive
  270. (package
  271. (name "autoconf-archive")
  272. (version "2021.02.19")
  273. (source
  274. (origin
  275. (method url-fetch)
  276. (uri (string-append "mirror://gnu/autoconf-archive/autoconf-archive-"
  277. version ".tar.xz"))
  278. (sha256
  279. (base32
  280. "1gcwqspcxiygnyk02smsk8ivzs9r69ji38izxzzsijyx52fyp9p8"))))
  281. (build-system gnu-build-system)
  282. (home-page "https://www.gnu.org/software/autoconf-archive/")
  283. (synopsis "Collection of freely reusable Autoconf macros")
  284. (description
  285. "Autoconf Archive is a collection of over 450 new macros for Autoconf,
  286. greatly expanding the domain of its functionality. These macros have been
  287. contributed as free software by the community.")
  288. (license gpl3+)))
  289. (define-public autobuild
  290. (package
  291. (name "autobuild")
  292. (version "5.3")
  293. (source (origin
  294. (method url-fetch)
  295. (uri (string-append "mirror://savannah/autobuild/autobuild-"
  296. version ".tar.gz"))
  297. (sha256
  298. (base32
  299. "0gv7g61ja9q9zg1m30k4snqwwy1kq7b4df6sb7d2qra7kbdq8af1"))))
  300. (build-system gnu-build-system)
  301. (inputs `(("perl" ,perl)))
  302. (synopsis "Process generated build logs")
  303. (description "Autobuild is a package that processes build logs generated
  304. when building software. Autobuild is primarily focused on packages using
  305. Autoconf and Automake, but can be used with other build systems too.
  306. Autobuild generates an HTML summary file, containing links to each build log.
  307. The summary includes project name, version, build hostname, host type (cross
  308. compile aware), date of build, and indication of success or failure. The
  309. output is indexed in many ways to simplify browsing.")
  310. (home-page "https://josefsson.org/autobuild/")
  311. (license gpl3+)))
  312. (define-public automake
  313. (package
  314. (name "automake")
  315. (version "1.16.3")
  316. (source (origin
  317. (method url-fetch)
  318. (uri (string-append "mirror://gnu/automake/automake-"
  319. version ".tar.xz"))
  320. (sha256
  321. (base32
  322. "0fmz2fhmzcpacnprl5msphvaflwiy0hvpgmqlgfny72ddijzfazz"))
  323. (patches
  324. (search-patches "automake-skip-amhello-tests.patch"))))
  325. (build-system gnu-build-system)
  326. (inputs
  327. `(("autoconf" ,autoconf-wrapper)
  328. ("bash" ,bash-minimal)
  329. ("perl" ,perl)))
  330. (native-inputs
  331. `(("autoconf" ,autoconf-wrapper)
  332. ("perl" ,perl)))
  333. (native-search-paths
  334. (list (search-path-specification
  335. (variable "ACLOCAL_PATH")
  336. (files '("share/aclocal")))))
  337. (arguments
  338. `(#:modules ((guix build gnu-build-system)
  339. (guix build utils)
  340. (srfi srfi-1)
  341. (srfi srfi-26)
  342. (rnrs io ports))
  343. #:phases
  344. (modify-phases %standard-phases
  345. (add-before 'patch-source-shebangs 'patch-tests-shebangs
  346. (lambda _
  347. (let ((sh (which "sh")))
  348. (substitute* (find-files "t" "\\.(sh|tap)$")
  349. (("#![[:blank:]]?/bin/sh")
  350. (string-append "#!" sh)))
  351. ;; Set these variables for all the `configure' runs
  352. ;; that occur during the test suite.
  353. (setenv "SHELL" sh)
  354. (setenv "CONFIG_SHELL" sh)
  355. #t)))
  356. (add-before 'check 'skip-test
  357. (lambda _
  358. ;; This test requires 'etags' and fails if it's missing.
  359. ;; Skip it.
  360. (substitute* "t/tags-lisp-space.sh"
  361. (("^required.*" all)
  362. (string-append "exit 77\n" all "\n")))
  363. #t))
  364. ,@(if (%current-target-system)
  365. `((add-after 'install 'patch-non-shebang-references
  366. (lambda* (#:key build inputs outputs #:allow-other-keys)
  367. ;; `patch-shebangs' patches shebangs only, and the Perl
  368. ;; scripts use a re-exec feature that references the
  369. ;; build hosts' perl. Also, AUTOCONF and BASH store
  370. ;; references hide in the scripts.
  371. (let ((autoconf (assoc-ref inputs "autoconf"))
  372. (bash (assoc-ref inputs "bash"))
  373. (perl (assoc-ref inputs "perl"))
  374. (out (assoc-ref outputs "out"))
  375. (store-directory (%store-directory)))
  376. (substitute* (find-files (string-append out "/bin"))
  377. (((string-append store-directory "/[^/]*-autoconf-[^/]*"))
  378. autoconf)
  379. (((string-append store-directory "/[^/]*-bash-[^/]*"))
  380. bash)
  381. (((string-append store-directory "/[^/]*-perl-[^/]*"))
  382. perl))
  383. #t))))
  384. '())
  385. ;; Files like `install-sh', `mdate.sh', etc. must use
  386. ;; #!/bin/sh, otherwise users could leak erroneous shebangs
  387. ;; in the wild. See <http://bugs.gnu.org/14201> for an
  388. ;; example.
  389. (add-after 'install 'unpatch-shebangs
  390. (lambda* (#:key outputs #:allow-other-keys)
  391. (let* ((out (assoc-ref outputs "out"))
  392. (dir (string-append out "/share")))
  393. (define (starts-with-shebang? file)
  394. (equal? (call-with-input-file file
  395. (lambda (p)
  396. (list (get-u8 p) (get-u8 p))))
  397. (map char->integer '(#\# #\!))))
  398. (for-each (lambda (file)
  399. (when (and (starts-with-shebang? file)
  400. (executable-file? file))
  401. (format #t "restoring shebang on `~a'~%"
  402. file)
  403. (substitute* file
  404. (("^#!.*/bin/sh")
  405. "#!/bin/sh")
  406. (("^#!.*/bin/env(.*)$" _ args)
  407. (string-append "#!/usr/bin/env"
  408. args)))))
  409. (find-files dir ".*"))
  410. #t))))))
  411. (home-page "https://www.gnu.org/software/automake/")
  412. (synopsis "Making GNU standards-compliant Makefiles")
  413. (description
  414. "Automake the part of the GNU build system for producing
  415. standards-compliant Makefiles. Build requirements are entered in an
  416. intuitive format and then Automake works with Autoconf to produce a robust
  417. Makefile, simplifying the entire process for the developer.")
  418. (license gpl2+))) ; some files are under GPLv3+
  419. (define-public libtool
  420. (package
  421. (name "libtool")
  422. (version "2.4.6")
  423. (source (origin
  424. (method url-fetch)
  425. (uri (string-append "mirror://gnu/libtool/libtool-"
  426. version ".tar.xz"))
  427. (sha256
  428. (base32
  429. "0vxj52zm709125gwv9qqlw02silj8bnjnh4y07arrz60r31ai1vw"))
  430. (patches (search-patches "libtool-skip-tests2.patch"))))
  431. (build-system gnu-build-system)
  432. (propagated-inputs `(("m4" ,m4)))
  433. (native-inputs `(("m4" ,m4)
  434. ("perl" ,perl)
  435. ;; XXX: this shouldn't be necessary, but without it test
  436. ;; 102 fails because it cannot find ltdl/libltdl.la.
  437. ("libltdl" ,libltdl)
  438. ("help2man" ,help2man) ;because we modify ltmain.sh
  439. ("automake" ,automake) ;some tests rely on 'aclocal'
  440. ("autoconf" ,autoconf-wrapper))) ;others on 'autom4te'
  441. (arguments
  442. `(;; Libltdl is provided as a separate package, so don't install it here.
  443. #:configure-flags '("--disable-ltdl-install")
  444. ;; XXX: There are test failures on mips64el-linux starting from 2.4.4:
  445. ;; <http://hydra.gnu.org/build/181662>.
  446. ;; Also, do not run tests when cross compiling
  447. #:tests? ,(not (or (%current-target-system)
  448. (string-prefix? "mips64"
  449. (%current-system))))
  450. #:phases
  451. (modify-phases %standard-phases
  452. (add-before 'check 'pre-check
  453. (lambda* (#:key inputs native-inputs #:allow-other-keys)
  454. ;; Run the test suite in parallel, if possible.
  455. (setenv "TESTSUITEFLAGS"
  456. (string-append
  457. "-j"
  458. (number->string (parallel-job-count))))
  459. ;; Patch references to /bin/sh.
  460. (let ((bash (assoc-ref (or native-inputs inputs) "bash")))
  461. (substitute* "tests/testsuite"
  462. (("/bin/sh")
  463. (string-append bash "/bin/sh")))
  464. #t)))
  465. ;; These files may be copied into source trees by libtoolize,
  466. ;; therefore they must not point to store file names that would be
  467. ;; leaked with tarballs generated by make dist.
  468. (add-after 'install 'restore-build-aux-shebang
  469. (lambda* (#:key outputs #:allow-other-keys)
  470. (let* ((out (assoc-ref outputs "out"))
  471. (dir (string-append out "/share/libtool/build-aux")))
  472. (for-each (lambda (file)
  473. (format #t "restoring shebang on `~a'~%" file)
  474. (substitute* file
  475. (("^#!.*/bin/sh") "#!/bin/sh")))
  476. (find-files dir ".*"))
  477. #t))))))
  478. (synopsis "Generic shared library support tools")
  479. (description
  480. "GNU Libtool helps in the creation and use of shared libraries, by
  481. presenting a single consistent, portable interface that hides the usual
  482. complexity of working with shared libraries across platforms.")
  483. (license gpl3+)
  484. (home-page "https://www.gnu.org/software/libtool/")))
  485. (define-public config
  486. (let ((revision "1")
  487. (commit "c8ddc8472f8efcadafc1ef53ca1d863415fddd5f"))
  488. (package
  489. (name "config")
  490. (version (git-version "0.0.0" revision commit)) ;no release tag
  491. (source (origin
  492. (method git-fetch)
  493. (uri (git-reference
  494. (url "https://git.savannah.gnu.org/git/config.git/")
  495. (commit commit)))
  496. (file-name (git-file-name name version))
  497. (sha256
  498. (base32
  499. "0x6ycvkmmhhhag97wsf0pw8n5fvh12rjvrck90rz17my4ys16qwv"))))
  500. (build-system gnu-build-system)
  501. (arguments
  502. `(#:phases (modify-phases %standard-phases
  503. (add-after 'unpack 'patch-/bin/sh
  504. (lambda _
  505. (substitute* "testsuite/config-guess.sh"
  506. (("#!/bin/sh")
  507. (string-append "#!" (which "sh"))))
  508. #t))
  509. (replace 'build
  510. (lambda _
  511. (invoke "make" "manpages")))
  512. (delete 'configure)
  513. (replace 'install
  514. (lambda* (#:key outputs #:allow-other-keys)
  515. (let* ((out (assoc-ref outputs "out"))
  516. (bin (string-append out "/bin"))
  517. (man1 (string-append out "/share/man/man1")))
  518. (install-file "config.guess" bin)
  519. (install-file "config.sub" bin)
  520. (install-file "doc/config.guess.1" man1)
  521. (install-file "doc/config.sub.1" man1)
  522. #t))))))
  523. (native-inputs
  524. `(("help2man" ,help2man)))
  525. (home-page "https://savannah.gnu.org/projects/config")
  526. (synopsis "Ubiquitous config.guess and config.sub scripts")
  527. (description "The `config.guess' script tries to guess a canonical system triple,
  528. and `config.sub' validates and canonicalizes. These are used as part of
  529. configuration in nearly all GNU packages (and many others).")
  530. (license gpl2+))))
  531. (define-public libltdl
  532. ;; This is a libltdl package separate from the libtool package. This is
  533. ;; useful because, unlike libtool, it has zero extra dependencies (making it
  534. ;; readily usable during bootstrap), and it builds very quickly since
  535. ;; Libtool's extensive test suite isn't run.
  536. (package
  537. (name "libltdl")
  538. (version "2.4.6")
  539. (source (origin
  540. (method url-fetch)
  541. (uri (string-append "mirror://gnu/libtool/libtool-"
  542. version ".tar.xz"))
  543. (sha256
  544. (base32
  545. "0vxj52zm709125gwv9qqlw02silj8bnjnh4y07arrz60r31ai1vw"))))
  546. (build-system gnu-build-system)
  547. (arguments
  548. '(#:configure-flags '("--enable-ltdl-install") ;really install it
  549. #:phases (modify-phases %standard-phases
  550. (add-before 'configure 'change-directory
  551. (lambda _ (chdir "libltdl") #t)))))
  552. (synopsis "System-independent dlopen wrapper of GNU libtool")
  553. (description (package-description libtool))
  554. (home-page (package-home-page libtool))
  555. (license lgpl2.1+)))
  556. (define-public pyconfigure
  557. (package
  558. (name "pyconfigure")
  559. (version "0.2.3")
  560. (source (origin
  561. (method url-fetch)
  562. (uri (string-append "mirror://gnu/pyconfigure/pyconfigure-"
  563. version ".tar.gz"))
  564. (sha256
  565. (base32
  566. "0kxi9bg7l6ric39vbz9ykz4a21xlihhh2zcc3297db8amvhqwhrp"))))
  567. (build-system gnu-build-system)
  568. (arguments
  569. `(#:phases
  570. (modify-phases %standard-phases
  571. (add-before 'configure 'patch-python
  572. (lambda _
  573. (substitute* "pyconf.in"
  574. (("/usr/bin/env python") (which "python3")))
  575. #t)))))
  576. (inputs
  577. `(("python" ,python-3)))
  578. (synopsis "@command{configure} interface for Python-based packages")
  579. (description
  580. "GNU pyconfigure provides template files for easily implementing
  581. standards-compliant configure scripts and Makefiles for Python-based packages.
  582. It is designed to work alongside existing Python setup scripts, making it easy
  583. to integrate into existing projects. Powerful and flexible Autoconf macros
  584. are available, allowing you to easily make adjustments to the installation
  585. procedure based on the capabilities of the target computer.")
  586. (home-page "https://www.gnu.org/software/pyconfigure/manual/")
  587. (license
  588. (fsf-free
  589. "https://www.gnu.org/prep/maintain/html_node/License-Notices-for-Other-Files.html"))))