(begin (use-modules (guix build gnu-build-system) (guix build utils) (srfi srfi-1) (srfi srfi-26)) (begin (define %build-inputs (quote (("source" . "/gnu/store/n9x5ybavz6szp3pkmj2k6d82cs0fkhdg-bash-5.2.tar.xz") ("gcc" . "/gnu/store/2discsj7rhk4ijrdsmbyha6lnkmwxjs4-gcc-cross-boot0-wrapped-14.3.0") ("libc" . "/gnu/store/i8bpwlqcr7gmqvl6sklxdz84b5cwr25h-glibc-intermediate-2.41") ("libc:static" . "/gnu/store/l2hm5h62xi5w6ird8dkad7vimszph0ns-glibc-intermediate-2.41-static") ("ld-wrapper-cross" . "/gnu/store/ay6q6m0bjfdx5jrp8nw5si3ydyl0yqad-ld-wrapper-boot0-0") ("binutils-cross" . "/gnu/store/hh4dbnxr2bczpkhjpb6wvhpj1dzqv6zs-binutils-cross-boot0-2.44") ("bzip2" . "/gnu/store/bwhk7mi9i4ys5w2wsbnfyigwwp8pqfkq-bzip2-boot0-1.0.8") ("coreutils" . "/gnu/store/gn9ngz6psd2frzslwifsvli61dmijgbq-coreutils-boot0-9.1") ("gawk" . "/gnu/store/way59xg0d2n2kgpb9yidbz7973fjjp0i-gawk-boot0-5.3.0") ("patch" . "/gnu/store/141gc4fwp7rbvmq6ynbwqibm9c4dv3f6-patch-boot0-2.7.6") ("sed" . "/gnu/store/div48p18zfc15mnj9xfd6nc0d126ckji-sed-boot0-4.9") ("tar" . "/gnu/store/3miwwqidab1k6dynbhvx9smw8r35xc2m-tar-boot0-1.35") ("make" . "/gnu/store/amvqxzwkwdy7qx2b6g4pdv9723w8wyb4-make-boot0-4.4.1") ("diffutils" . "/gnu/store/dvqkmj2ix0sfgfcijvx03wxay7b50y2k-diffutils-boot0-3.12") ("findutils" . "/gnu/store/bgzkm5jsik7zl1mnlgcmdjs3r7wky3g1-findutils-boot0-4.10.0") ("file" . "/gnu/store/a3j8vzdjnhmyp6g4h168ffgddib6zmk6-file-boot0-5.46") ("bash" . "/gnu/store/ac973jmmvv70y6xjn2d5rnih6gd19s2f-bash-mesboot-5.2.37") ("coreutils" . "/gnu/store/48zzvabsg1rsrq99wd2i92d60lzmd71k-coreutils-mesboot-9.1") ("grep" . "/gnu/store/igkvc8k782fi29yanvp04hv3s2ymsg1s-grep-mesboot-3.11") ("sed" . "/gnu/store/600v63djvfg1c30cplszglb2729qxvk0-sed-mesboot-4.8") ("tar" . "/gnu/store/wq0kn0nvnx3zk424mq3q62hhydxscwhq-tar-mesboot-1.35") ("xz" . "/gnu/store/1n6fngk89jk1y0grxxi3q0k8l4bnmf9p-xz-mesboot-5.4.5") ("gcc-wrapper" . "/gnu/store/hws34smywkwzb6dhq4dm7dwc5n3asdfx-gcc-mesboot-wrapper-4.9.4") ("gawk" . "/gnu/store/zfkrb361iy4l1avx02qz39pl5czxyacv-gawk-mesboot-3.1.8") ("make" . "/gnu/store/b0pb60c7r0b3xgpp2bvlflah3gv00w2q-make-mesboot-3.82") ("gzip" . "/gnu/store/fgx3c56cfylbfjdi731s3zggp03js9d3-gzip-mesboot-1.2.4") ("patch" . "/gnu/store/i29sqgr7lhaq1crnqwa5rxi43d8skfw1-patch-mesboot-2.5.9") ("guile" . "/gnu/store/lgi9x15a0w35mcpd7g1kb9274r6wy4pv-guile-bootstrap-2.0") ("kernel-headers" . "/gnu/store/d41d6s3pmn5ys0ihi82056qq7z9fjsyk-linux-libre-headers-6.12.17")))) (define %outputs (list (cons "out" ((@ (guile) getenv) "out")) (cons "doc" ((@ (guile) getenv) "doc")))) (define %output (assoc-ref %outputs "out")) (gnu-build #:source "/gnu/store/n9x5ybavz6szp3pkmj2k6d82cs0fkhdg-bash-5.2.tar.xz" #:system "x86_64-linux" #:build "x86_64-unknown-linux-gnu" #:outputs %outputs #:inputs %build-inputs #:search-paths (quote (("C_INCLUDE_PATH" ("include") ":" directory #f) ("CPLUS_INCLUDE_PATH" ("include/c++" "include") ":" directory #f) ("OBJC_INCLUDE_PATH" ("include") ":" directory #f) ("OBJCPLUS_INCLUDE_PATH" ("include/c++" "include") ":" directory #f) ("LIBRARY_PATH" ("lib" "lib64") ":" directory #f) ("GUIX_LOCPATH" ("lib/locale") ":" directory #f) ("TZDIR" ("share/zoneinfo") #f directory #f) ("BASH_LOADABLES_PATH" ("lib/bash") ":" directory #f) ("C_INCLUDE_PATH" ("include" "lib/gcc-lib/i686-unknown-linux-gnu/2.95.3/include") ":" directory #f) ("LIBRARY_PATH" ("lib") ":" directory #f))) #:phases (modify-phases (modify-phases (modify-phases %standard-phases (add-after (quote install) (quote install-sh-symlink) (lambda* (#:key outputs #:allow-other-keys) (let ((out (assoc-ref outputs "out"))) (with-directory-excursion (string-append out "/bin") (symlink "bash" "sh") #t)))) (add-after (quote install) (quote move-development-files) (lambda* (#:key outputs #:allow-other-keys) (let ((out (assoc-ref outputs "out")) (include (assoc-ref outputs "include")) (lib (cut string-append <> "/lib/bash"))) (mkdir-p (lib include)) (rename-file (string-append (lib out) "/Makefile.inc") (string-append (lib include) "/Makefile.inc")) (rename-file (string-append out "/lib/pkgconfig") (string-append include "/lib/pkgconfig")) (substitute* (string-append (lib include) "/Makefile.inc") (("^INSTALL =.*") "INSTALL = install -c\n")) #t)))) (delete (quote move-development-files))) (add-after (quote strip) (quote remove-everything-but-the-binary) (lambda* (#:key outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) (bin (string-append out "/bin"))) (remove-store-references (string-append bin "/bash")) (delete-file (string-append bin "/bashbug")) (delete-file-recursively (string-append out "/share")) #t)))) #:locale "C.UTF-8" #:separate-from-pid1? #t #:bootstrap-scripts %bootstrap-scripts #:configure-flags (append (cons* "--disable-shared" "LDFLAGS=-static" (list "CFLAGS=-g -O2 -Wno-error=implicit-function-declaration" "--without-bash-malloc" "--disable-readline" "--disable-history" "--disable-help-builtin" "--disable-progcomp" "--disable-net-redirections" "--disable-nls" "ac_cv_func_dlopen=no")) (list (string-append "LDFLAGS=-static -L" (assoc-ref %build-inputs "libc:static") "/lib"))) #:make-flags (quote ()) #:out-of-source? #f #:tests? #f #:test-target "check" #:parallel-build? #f #:parallel-tests? #f #:patch-shebangs? #t #:license-file-regexp "^(COPYING.*|LICEN[CS]E.*|[Ll]icen[cs]e.*|Copy[Rr]ight(\\.(txt|md))?)$" #:strip-binaries? #t #:validate-runpath? #t #:make-dynamic-linker-cache? #t #:license-file-regexp "^(COPYING.*|LICEN[CS]E.*|[Ll]icen[cs]e.*|Copy[Rr]ight(\\.(txt|md))?)$" #:strip-flags (quote ("--strip-all")) #:strip-directories (quote ("lib" "lib64" "libexec" "bin" "sbin")))))