-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cbffa89
commit a86b665
Showing
1 changed file
with
35 additions
and
24 deletions.
There are no files selected for viewing
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
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 |