(define-module (jfsutils) #:use-module (gnu packages linux) #:use-module (gnu packages) #:use-module (guix build-system gnu) #:use-module (guix build-system trivial) #:use-module (guix download) #:use-module (guix licenses) #:use-module (guix packages) #:use-module (guix utils)) (define-public jfsutils (package (name "jfsutils") (version "1.1.15") (source (origin (method url-fetch) (uri (string-append "http://jfs.sourceforge.net/project/pub/jfsutils-" version ".tar.gz")) (sha256 (base32 "0kbsy2sk1jv4m82rxyl25gwrlkzvl3hzdga9gshkxkhm83v1aji4")) (patches (search-patches "jfsutils.patch")))) (build-system gnu-build-system) (inputs `(("util-linux" ,util-linux))) (home-page "http://jfs.sourceforge.net/") (synopsis "IBM JFS file system tools") (description "This package provides commands to create and check JFS file systems.") ;; COPYING is gpl3, the headers are gpl2+? (license gpl3)) ) (define jfsutils/static (static-package (package (inherit jfsutils) (inputs `()) (native-inputs `(("util-linux:static" ,util-linux "static") ("util-linux" ,util-linux))) (arguments ;; Force static linkage (substitute-keyword-arguments (package-arguments jfsutils) ((#:configure-flags _) '(list "LDFLAGS=-static"))))))) (define-public jfs_fsck/static (package (name "jfs_fsck-static") (version (package-version jfsutils)) (build-system trivial-build-system) (source #f) (inputs `(("jfsutils" ,jfsutils/static))) (arguments `(#:modules ((guix build utils)) #:builder (begin (use-modules (guix build utils) (ice-9 ftw) (srfi srfi-26)) (let ((jfs_fsck (string-append (assoc-ref %build-inputs "jfsutils") "/sbin/jfs_fsck")) (bin (string-append (assoc-ref %outputs "out") "/sbin"))) (mkdir-p bin) (with-directory-excursion bin (copy-file jfs_fsck "jfs_fsck") (remove-store-references "jfs_fsck") (chmod "jfs_fsck" #o555)) #t)))) (home-page (package-home-page jfsutils)) (synopsis "Statically-linked jfs_fsck command from jfsutils") (description "This package provides statically-linked jfs_fsck command taken from the jfsutils package. It is meant to be used in initrds.") (license (package-license jfsutils))))