guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

18/54: bootstrap: Add bzip2-mesboot0.


From: guix-commits
Subject: 18/54: bootstrap: Add bzip2-mesboot0.
Date: Fri, 22 Nov 2019 18:17:51 -0500 (EST)

janneke pushed a commit to branch wip-bootstrap
in repository guix.

commit c63021d59d967bc31910f55130d3c37d11a6edce
Author: Jan Nieuwenhuizen <address@hidden>
Date:   Sat Sep 21 22:32:18 2019 +0200

    bootstrap: Add bzip2-mesboot0.
    
    * gnu/packages/commencement.scm (bzip2-mesboot0): New variable.
---
 gnu/packages/commencement.scm | 65 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 65 insertions(+)

diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index b20f4cf..0c56d1f 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -466,6 +466,71 @@
                     (bin (string-append out "/bin")))
                (install-file "make" bin)))))))))
 
+(define bzip2-mesboot0
+  (package
+    (inherit bzip2)
+    (name "bzip2-mesboot0")
+    (version (package-version bzip2))
+    (source (bootstrap-origin (package-source bzip2)))
+    (supported-systems '("i686-linux" "x86_64-linux"))
+    (inputs '())
+    (propagated-inputs '())
+    (native-inputs `(("bash" ,%bootstrap-gash)
+                     ("guile" ,%bootstrap-guile)
+                     ("gzip" ,gzip-mesboot0)
+                     ("make" ,make-mesboot0)
+                     ("mes" ,mes-boot)
+                     ("tcc" ,tcc-boot0)))
+    (outputs '("out"))
+    (arguments
+     `(#:implicit-inputs? #f
+       #:guile ,%bootstrap-guile
+       #:parallel-build? #f
+       #:tests? #f            ; check is naive, also checks non-built PROGRAMS
+       #:strip-binaries? #f   ; no strip yet
+       #:make-flags (list "CC=tcc -I ." "AR=tcc -ar" "bzip2"
+                          (string-append "PREFIX="
+                                         (assoc-ref %outputs "out")))
+       #:phases
+       (modify-phases %standard-phases
+         (add-before 'unpack 'set-path
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref %outputs "out"))
+                    (gash (assoc-ref %build-inputs "bash"))
+                    (gzip (assoc-ref %build-inputs "gzip")))
+               (setenv "PATH" (string-append
+                               gash "/bin"
+                               ":" gzip "/bin"
+                               (if (getenv "PATH") ":" "")
+                               (getenv "PATH")))
+               (format (current-error-port) "PATH=~s\n" (getenv "PATH")))))
+         (add-after 'unpack 'scripted-patch
+           (lambda _
+             (substitute* "Makefile"
+               (("\tln " all)
+                (string-append "\t#" all)))
+             (substitute* "bzip2.c"
+               (("struct utimbuf uTimBuf;" all)
+                (string-append "// " all))
+               (("uTimBuf[.]" all)
+                (string-append "// " all))
+               (("retVal = utime [(] dstName, &uTimBuf [)];" all)
+                (string-append "retVal = 0; // " all)))
+             #t))
+         (replace 'configure
+           (lambda _
+             (with-output-to-file "utime.h"
+               (lambda _ (display "
+#define fchown(filedes, owner, group) 0
+#define fchmod(filedes, mode) 0
+")))
+             #t))
+         (replace 'check
+           (lambda _
+             (invoke "./bzip2" "--help")))
+         ;; FIXME: no compressing gzip yet
+         (delete 'compress-documentation))))))
+
 (define tcc-boot
   (package
     (inherit tcc-boot0)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]