summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2018-08-17 00:55:20 +0200
committerFlorian Dold <florian.dold@gmail.com>2018-08-17 00:55:20 +0200
commitc68a881754b126948381ee174048fceda9d2460f (patch)
treebe720c1e97ebc95d75417b87b91cb98bc74aa974 /contrib
parent671997ed586173d92a4776bc1dc92541e90ecb52 (diff)
fix guix git version
Diffstat (limited to 'contrib')
-rw-r--r--contrib/guix/gnu/packages/gnunet.scm24
1 files changed, 21 insertions, 3 deletions
diff --git a/contrib/guix/gnu/packages/gnunet.scm b/contrib/guix/gnu/packages/gnunet.scm
index 4f006769d..b24b58282 100644
--- a/contrib/guix/gnu/packages/gnunet.scm
+++ b/contrib/guix/gnu/packages/gnunet.scm
@@ -24,6 +24,8 @@
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
(define-module (gnu packages gnunet)
+ #:use-module (ice-9 popen)
+ #:use-module (ice-9 rdelim)
#:use-module (gnu packages)
#:use-module (gnu packages file)
#:use-module (gnu packages base)
@@ -61,6 +63,7 @@
#:use-module (gnu packages xiph)
#:use-module (gnu packages backup)
#:use-module ((guix licenses) #:prefix license:)
+ #:use-module ((guix build utils) #:prefix build-utils:)
#:use-module (guix packages)
#:use-module (guix download)
#:use-module (guix utils)
@@ -244,12 +247,27 @@ supports HTTP, HTTPS and GnuTLS.")
(define %source-dir (dirname (current-filename)))
+(define (git-output . args)
+ "Execute 'git ARGS ...' command and return its output without trailing
+newspace."
+ (build-utils:with-directory-excursion %source-dir
+ (let* ((port (apply open-pipe* OPEN_READ "git" args))
+ (output (read-string port)))
+ (close-port port)
+ (string-trim-right output #\newline))))
+
+(define (current-git-version)
+ (git-output "describe" "--tags"))
+
+(define (git-sources)
+ (local-file (dirname (dirname (dirname (dirname %source-dir))))
+ #:recursive? #t))
+
(define-public gnunet
(package
(name "gnunet")
- (version "0.10.1")
- (source (local-file (dirname (dirname (dirname %source-dir)))
- #:recursive? #t))
+ (version (current-git-version))
+ (source (git-sources))
(build-system gnu-build-system)
(inputs
`(("glpk" ,glpk)