Skip to content

Commit

Permalink
Use local checkout for guix package
Browse files Browse the repository at this point in the history
  • Loading branch information
arximboldi committed Jul 24, 2017
1 parent cbffa89 commit a86b665
Showing 1 changed file with 35 additions and 24 deletions.
59 changes: 35 additions & 24 deletions guix.scm
Original file line number Diff line number Diff line change
@@ -1,37 +1,48 @@
(define-module (arximboldi packages schmutz)
#:use-module (rnrs io ports)
#:use-module (ice-9 popen)
#:use-module (ice-9 rdelim)
#:use-module (guix packages)
#:use-module (guix download)
#:use-module (guix gexp)
#:use-module (guix git-download)
#:use-module (guix build-system cmake)
#:use-module (guix licenses)
#:use-module (gnu packages guile)
#:use-module (gnu packages pkg-config)
#:use-module (gnu packages version-control))

(define (read-command cmd)
(let* ((port (open-input-pipe cmd))
(str (read-line port)))
(close-pipe port)
(if (eof-object? str) "" str)))

(define %git-commit (read-command "git rev-parse HEAD"))
(define %git-status (read-command "git status --porcelain"))
(define %git-version (string-append "git-"
%git-commit
(if (string-null? %git-status)
"" "-dirty")))
(define %source-dir (dirname (current-filename)))

(define-public schmutz
(let ((commit "1a0e716e330356dd138e918f7ae91e70369282cd"))
(package
(name "schmutz")
(version (string-append "0.0.0-git-" (string-take commit 9)))
(synopsis "Bind C++ code to Scheme")
(description "Bind C++ code to Scheme")
(home-page "https://github.com/arximboldi/schmutz")
(license boost1.0)
(build-system cmake-build-system)
(arguments `(#:tests? #f))
(source
(origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/arximboldi/schmutz.git")
(commit commit)))
(file-name (string-append "immer-" version "-checkout"))
(sha256
(base32 "0c4wdd6365nkl1fynycvs5qgmrmr8x3ipsl18m6znjbmbxwnx3vq"))))
(native-inputs
`(("pkg-config" ,pkg-config)
("git" ,git)))
(inputs
`(("guile" ,guile-2.2))))))
(package
(name "schmutz")
(version %git-version)
(synopsis "Bind C++ code to Scheme")
(description "Bind C++ code to Scheme")
(home-page "https://github.com/arximboldi/schmutz")
(license boost1.0)
(build-system cmake-build-system)
(arguments `(#:tests? #f))
(source (local-file %source-dir
#:recursive? #t
#:select? (git-predicate %source-dir)))
(native-inputs
`(("pkg-config" ,pkg-config)
("git" ,git)))
(inputs
`(("guile" ,guile-2.2)))))

schmutz

0 comments on commit a86b665

Please sign in to comment.