Created
March 18, 2024 12:42
-
-
Save drupol/243f1d062a2ba02694f22076fc63a898 to your computer and use it in GitHub Desktop.
guix.scm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(use-modules (guix) | |
(guix build-system gnu)) | |
(define-public datetime | |
(package | |
(name "datetime") | |
(version "1.0") | |
(source (local-file "./src" #:recursive? #t)) | |
(build-system gnu-build-system) | |
(arguments | |
`(#:phases | |
(modify-phases %standard-phases | |
(delete 'configure) | |
(delete 'check) | |
(replace 'build | |
(lambda* (#:key inputs #:allow-other-keys) | |
(invoke "gcc" "datetime.c" "-o" "datetime"))) | |
(replace 'install | |
(lambda* (#:key outputs #:allow-other-keys) | |
(let ((out (assoc-ref outputs "out"))) | |
(mkdir-p (string-append out "/bin")) | |
(install-file "datetime" (string-append out "/bin")))))))) | |
(synopsis "DateTime Program") | |
(description "This package contains a simple program that shows the current date and time.") | |
(home-page #f) | |
(license #f))) | |
datetime |
I'm pretty sure that install-file
will also create parent directories. So the above mkdir-p
is not necessary.
Instead of deleting the check
phase, you could add #:tests? #f
in arguments
.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If inputs is not used, I think you can simply do:
(lambda _ (invoke "gcc" "datetime.c" "-o" "datetime"))