diff options
author | Ludovic Courtès <ludo@gnu.org> | 2012-09-01 19:21:06 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2012-09-02 23:12:17 +0200 |
commit | 6818af7ba54b2e03a774e344412430a6687e3218 (patch) | |
tree | 06d876b1ce989d2d27d7b07e14fccb288f947fb9 /distro/base.scm | |
parent | 60f984b2627e55aafc963f04f7ef8dbccfec7f9a (diff) | |
download | guix-patches-6818af7ba54b2e03a774e344412430a6687e3218.tar guix-patches-6818af7ba54b2e03a774e344412430a6687e3218.tar.gz |
distro: Add bzip2.
* distro/base.scm (bzip2): New variable.
(%final-inputs): Add bzip2.
Diffstat (limited to 'distro/base.scm')
-rw-r--r-- | distro/base.scm | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/distro/base.scm b/distro/base.scm index 99872213c0..005eefb2fb 100644 --- a/distro/base.scm +++ b/distro/base.scm @@ -211,6 +211,74 @@ superior compression ratio of gzip is just a bonus.") (license "GPLv3+") (home-page "http://www.gnu.org/software/gzip/"))) +(define-public bzip2 + (let ((fix-man-dir + ;; Move man pages to $out/share/. + '(lambda* (#:key outputs #:allow-other-keys) + (with-directory-excursion (assoc-ref outputs "out") + (mkdir "share") + (rename-file "man" "share")))) + (build-shared-lib + ;; Build a shared library. + '(lambda* (#:key inputs #:allow-other-keys) + (zero? (system* "make" "-f" "Makefile-libbz2_so")))) + (install-shared-lib + '(lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (libdir (string-append out "/lib"))) + ;; XXX: mv libbz2.so* $libdir + (file-system-fold (const #t) + (lambda (path stat result) ; leaf + (define base (basename path)) + (when (string-prefix? "libbz2.so" base) + (format #t "installing `~a' to `~a'~%" + base libdir) + (copy-file path + (string-append libdir "/" + base)))) + (const #t) ; down + (const #t) ; up + (const #t) ; skip + (lambda (path stat errno result) + (error "i/o error" path (strerror errno))) + #t + "."))))) + (package + (name "bzip2") + (version "1.0.6") + (source (origin + (method http-fetch) + (uri (string-append "http://www.bzip.org/" version "/bzip2-" + version ".tar.gz")) + (sha256 + (base32 + "1kfrc7f0ja9fdn6j1y6yir6li818npy6217hvr3wzmnmzhs8z152")))) + (build-system gnu-build-system) + (arguments + `(#:modules ((guix build gnu-build-system) + (guix build utils) + (srfi srfi-1) + (ice-9 ftw)) + #:phases + (alist-cons-before + 'build 'build-shared-lib ,build-shared-lib + (alist-cons-after + 'install 'fix-man-dir ,fix-man-dir + (alist-cons-after + 'install 'install-shared-lib ,install-shared-lib + (alist-delete 'configure %standard-phases)))) + #:make-flags (list (string-append "PREFIX=" + (assoc-ref %outputs "out"))))) + (description "high-quality data compression program") + (long-description + "bzip2 is a freely available, patent free (see below), high-quality data +compressor. It typically compresses files to within 10% to 15% of the best +available techniques (the PPM family of statistical compressors), whilst +being around twice as fast at compression and six times faster at +decompression.") + (license "BSD-style") + (home-page "http://www.bzip.org/")))) + (define-public xz (package (name "xz") @@ -1317,6 +1385,7 @@ with the Linux kernel.") (list name (finalize package)))) `(("tar" ,tar) ("gzip" ,gzip) + ("bzip2" ,bzip2) ("xz" ,xz) ("diffutils" ,diffutils) ("patch" ,patch) |