aboutsummaryrefslogtreecommitdiff
path: root/.guix/modules
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2023-08-14 11:27:43 +0300
committerFrederick Muriuki Muriithi2023-08-14 11:27:43 +0300
commit2fb99e7b2fae1396bb53c5c231003c780a311941 (patch)
tree38d3ef7a552f6d3824ea1472d0ee283e1589f3ef /.guix/modules
parentafea61acbe5808939a4e147787122386d3e17377 (diff)
downloadgn-auth-2fb99e7b2fae1396bb53c5c231003c780a311941.tar.gz
Set version to hard-coded value in checkout
Diffstat (limited to '.guix/modules')
-rw-r--r--.guix/modules/gn/packages/gn-auth.scm35
1 files changed, 19 insertions, 16 deletions
diff --git a/.guix/modules/gn/packages/gn-auth.scm b/.guix/modules/gn/packages/gn-auth.scm
index 0ee7405..cd07d76 100644
--- a/.guix/modules/gn/packages/gn-auth.scm
+++ b/.guix/modules/gn/packages/gn-auth.scm
@@ -54,22 +54,25 @@
(define (get-latest-version)
"Get latest version tag from repository."
- (let ((%repo #f)
- (%tags (list))
- (%repo-head #f))
- (begin (libgit2-init!)
- (set! %repo (repository-open %source-dir))
- (set! %repo-head (reference-target (repository-head %repo)))
- (tag-foreach %repo
- (lambda (tname tref)
- (set! %tags (list (cons tname (tag-lookup %repo tref))))
- 0))
- (libgit2-shutdown!)
- (if (zero? (length %tags))
- (string-append "v0.0.0-" (substring (oid->string %repo-head) 0 8))
- (process-version
- %repo-head
- (list-last (sort-list %tags (lambda (item) (error item)))))))))
+ (if (git-predicate %source-dir)
+ (let ((%repo #f)
+ (%tags (list))
+ (%repo-head #f))
+ (begin (libgit2-init!)
+ (set! %repo (repository-open %source-dir))
+ (set! %repo-head (reference-target (repository-head %repo)))
+ (tag-foreach %repo
+ (lambda (tname tref)
+ (set! %tags (list (cons tname (tag-lookup %repo tref))))
+ 0))
+ (libgit2-shutdown!)
+ (if (zero? (length %tags))
+ (string-append "v0.0.0-" (substring (oid->string %repo-head) 0 8))
+ (process-version
+ %repo-head
+ (list-last (sort-list %tags (lambda (item) (error item))))))))
+ ;; Figure out a way to get the version in the checkouts when building
+ "v0.0.0"))
(define vcs-file?
(or (git-predicate %source-dir)