(define-public glibc/hurd (package (inherit glibc) (name "glibc-hurd") (source (origin (method git-fetch) (uri (git-reference (url "git://git.sv.gnu.org/hurd/glibc") (commit "bdb7a18d78b04ac3ef7a2d905485500f13bb69fb"))) (sha256 (base32 "0v4hy6yimshbvhbhdbbjdir5fm3xr56zj3lnpf01d4nfa0c1h8k1")) )) (propagated-inputs `(("gnumach-headers" ,gnumach-headers) ("hurd-headers" ,hurd-headers))) (native-inputs `(("patch/glibc-make" ,(search-patch "glibc-make-4.0.patch")) ("mig" ,mig) ("perl" ,perl) ("libpthread" ,(origin (method git-fetch) (uri (git-reference (url "git://git.sv.gnu.org/hurd/libpthread") (commit "fa9eb2c255e1d46beadcd81edd459b9c3d7dcb8c"))) (sha256 (base32 "0v4hy6yimshbvhbhdbbjdir5fm3xr56zj3lnpf01d4nfa0c1h8k1")))) )) (arguments `(#:out-of-source? #t #:configure-flags (list "--build=i686-pc-gnu" "--host=i686-pc-gnu" "--without-cvs" "--enable-add-ons=" ;;"--sysconfdir=/etc" "--disable-profile" "--disable-multi-arch" ;; (string-append "--localedir=" (assoc-ref %outputs "locales") ;; "/share/locale") ;; `--localedir' is not honored, so work around it. ;; See . (string-append "libc_cv_localedir=" (assoc-ref %outputs "locales") "/share/locale") ;; (string-append "--with-headers=" ;; (assoc-ref %build-inputs "gnumach-headers") ;; "/include") ;; Use our Bash instead of /bin/sh. (string-append "BASH_SHELL=" (assoc-ref %build-inputs "bash") "/bin/bash")) #:phases (alist-cons-before 'configure 'pre-configure (lambda* (#:key inputs outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) (bin (string-append out "/bin"))) ;; Use `pwd', not `/bin/pwd'. (substitute* "configure" (("/bin/pwd") "pwd")) ;; Copy a statically-linked Bash in the output, with ;; no references to other store paths. (mkdir-p bin) (copy-file (string-append (assoc-ref inputs "static-bash") "/bin/bash") (string-append bin "/bash")) (remove-store-references (string-append bin "/bash")) (chmod (string-append bin "/bash") #o555) ;; Keep a symlink, for `patch-shebang' resolution. (with-directory-excursion bin (symlink "bash" "sh")) ;; Have `system' use that Bash. (substitute* "sysdeps/posix/system.c" (("#define[[:blank:]]+SHELL_PATH.*$") (format #f "#define SHELL_PATH \"~a/bin/bash\"\n" out))) ;; Same for `popen'. (substitute* "libio/iopopen.c" (("/bin/sh") (string-append out "/bin/bash"))))) (alist-cons-after 'install 'install-locales (lambda _ (zero? (system* "make" "localedata/install-locales"))) (alist-cons-after 'unpack 'apply-patch (lambda _ (zero? (system* "patch" "-p1" "-i" (assoc-ref %build-inputs "patch/glibc-make")))) (alist-replace 'unpack ;; FIXME: Remove this when gnu-build-system handles that ;; case correctly. (lambda* (#:key source #:allow-other-keys) (mkdir "source") (chdir "source") (copy-recursively source ".") #t) %standard-phases)))))) ))