guix-commits
[Top][All Lists]
Advanced

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

25/35: bootstrap: Add bzip2-mesboot0.


From: guix-commits
Subject: 25/35: bootstrap: Add bzip2-mesboot0.
Date: Wed, 20 Nov 2019 15:19:40 -0500 (EST)

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

commit 0948206924df364f0205d9a1765f4e2a5333cdef
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 | 63 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 63 insertions(+)

diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index 2cf599b..9eb2ad8 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -474,6 +474,69 @@
                      (bin (string-append out "/bin")))
                 (install-file "make" bin))))))))))
 
+(define-public bzip2-mesboot0
+  (package-with-bootstrap-guile
+   (package
+     (inherit bzip2)
+     (name "bzip2-mesboot0")
+     (version (package-version 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")))))))))
+
 (define tcc-boot
   (package-with-bootstrap-guile
    (package



reply via email to

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