guix-commits
[Top][All Lists]
Advanced

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

06/10: gnu: Add ziptime.


From: guix-commits
Subject: 06/10: gnu: Add ziptime.
Date: Mon, 30 Nov 2020 15:47:11 -0500 (EST)

nckx pushed a commit to branch master
in repository guix.

commit 65c110e27a8ce3889d0efecc36b43316265a2d8a
Author: Tobias Geerinckx-Rice <me@tobias.gr>
AuthorDate: Mon Nov 30 20:01:09 2020 +0100

    gnu: Add ziptime.
    
    * gnu/packages/compression.scm (ziptime): New public variable.
---
 gnu/packages/compression.scm | 49 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)

diff --git a/gnu/packages/compression.scm b/gnu/packages/compression.scm
index 1d643cd..79300bb 100644
--- a/gnu/packages/compression.scm
+++ b/gnu/packages/compression.scm
@@ -1606,6 +1606,55 @@ recreates the stored directory structure by default.")
     (license (license:non-copyleft "file://LICENSE"
                                    "See LICENSE in the distribution."))))
 
+(define-public ziptime
+  (let ((commit "2a5bc9dfbf7c6a80e5f7cb4dd05b4036741478bc")
+        (revision "0"))
+  (package
+    (name "ziptime")
+    (version (git-version "0.0.0" revision commit))
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://android.googlesource.com/platform/build";)
+             (commit commit)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0hrn61b3a97dlc4iqc28rwx8k8zf7ycbwzqqp93vj34zy5a541kn"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f                      ; no test suite
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'change-directory
+           (lambda _
+             (chdir "tools/ziptime")))
+         (delete 'configure)            ; nothing to configure
+         (replace 'build
+           ;; There is no Makefile, only an ‘Android.bp’ file.  Ignore it.
+           (lambda _
+             (let ((c++ ,(cxx-for-target)))
+               (apply invoke c++ "-O2" "-o" "ziptime"
+                      (find-files "." "\\.cpp$")))))
+         (replace 'install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (bin (string-append out "/bin"))
+                    (doc (string-append out "/share/doc/" ,name "-" ,version)))
+               (install-file "ziptime" bin)
+               (install-file "README.txt" doc)))))))
+    ;; There is no separate home page for this tiny bundled build tool.
+    (home-page (string-append 
"https://android.googlesource.com/platform/build/";
+                              "+/master/tools/ziptime/README.txt"))
+    (synopsis "Normalize @file{.zip} archive header timestamps")
+    (description
+     "Ziptime helps make @file{.zip} archives reproducible by replacing
+timestamps in the file header with a fixed time (1 January 2008).
+
+``Extra fields'' are not changed, so you'll need to use the @code{-X} option to
+@command{zip} to prevent it from storing the ``universal time'' field.")
+    (license license:asl2.0))))
+
 (define-public zziplib
   (package
     (name "zziplib")



reply via email to

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