diff options
| author | Arun Isaac | 2025-11-17 20:37:59 +0000 |
|---|---|---|
| committer | Arun Isaac | 2025-11-17 21:27:11 +0000 |
| commit | 37257000b37a83d4b1203371e886562b93479716 (patch) | |
| tree | e3d14996076e1437cb9280a445d38f064b08a042 /.guix/run64-release.scm | |
| parent | aa44d7672a917acd9d8cf33bfc93b6b8a4d69823 (diff) | |
| download | run64-0.1.0.tar.gz run64-0.1.0.tar.lz run64-0.1.0.zip | |
guix: Add G-expressions to create release tarballs. v0.1.0
Diffstat (limited to '.guix/run64-release.scm')
| -rw-r--r-- | .guix/run64-release.scm | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/.guix/run64-release.scm b/.guix/run64-release.scm new file mode 100644 index 0000000..bca9e39 --- /dev/null +++ b/.guix/run64-release.scm @@ -0,0 +1,67 @@ +;;; run64 --- SRFI-64 test runner +;;; Copyright © 2025 Arun Isaac <arunisaac@systemreboot.net> +;;; +;;; This file is part of run64. +;;; +;;; run64 is free software: you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation, either version 3 of the License, or +;;; (at your option) any later version. +;;; +;;; run64 is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;;; General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with run64. If not, see <https://www.gnu.org/licenses/>. + +(define-module (run64-release) + #:use-module ((gnu packages base) #:select (gnu-make)) + #:use-module ((gnu packages compression) #:select (lzip)) + #:use-module ((gnu packages version-control) #:select (git-minimal)) + #:use-module (guix gexp) + #:use-module (ice-9 match) + #:use-module (ice-9 popen) + #:use-module (srfi srfi-26) + #:use-module (rnrs io ports)) + +(define (call-with-input-pipe command proc) + "Call @var{proc} with input pipe to @var{command}. @var{command} is a list of +program arguments." + (match command + ((prog args ...) + (let ((port #f)) + (dynamic-wind + (lambda () + (set! port (apply open-pipe* OPEN_READ prog args))) + (cut proc port) + (cut close-pipe port)))))) + +(define version + (call-with-input-pipe (list "git" "tag" "--sort=-taggerdate" "--list" "v*") + (compose (cut substring <> (string-length "v")) + get-line))) + +(define run64-git-repo + (local-file "../.git" + "run64-git-repo" + #:recursive? #t)) + +(define run64-release-gexp + (with-imported-modules '((guix build utils)) + #~(begin + (use-modules (guix build utils)) + + (set-path-environment-variable + "PATH" '("bin") '(#$git-minimal #$gnu-make #$lzip)) + (invoke "git" "clone" (string-append "file://" #$run64-git-repo) (getcwd)) + (invoke "make" "dist" #$(string-append "version=" version)) + (copy-file #$(string-append "run64-" version ".tar.lz") + #$output)))) + +(define run64-release + (computed-file (string-append "run64-" version ".tar.lz") + run64-release-gexp)) + +run64-release |
