From 443c2c3357e491da1b520d3979798092cf2e6fb2 Mon Sep 17 00:00:00 2001 From: Vivien Kraus Date: Wed, 1 Jan 2020 00:00:00 +0100 Subject: Set up the project infrastructure --- guix/vkraus/packages/ChangeLog | 19 +++++ guix/vkraus/packages/webid-oidc.scm | 158 ++++++++++++++++++++++++++++++++++++ 2 files changed, 177 insertions(+) create mode 100644 guix/vkraus/packages/ChangeLog create mode 100644 guix/vkraus/packages/webid-oidc.scm (limited to 'guix') diff --git a/guix/vkraus/packages/ChangeLog b/guix/vkraus/packages/ChangeLog new file mode 100644 index 0000000..be450e6 --- /dev/null +++ b/guix/vkraus/packages/ChangeLog @@ -0,0 +1,19 @@ +2021-06-19 Vivien Kraus + + * webid-oidc.scm (webid-oidc-snapshot): No need to list the guile + packages as propagated-inputs, since the load and compiled path + are written in the programs. + +2020-12-06 Vivien Kraus + + * webid-oidc.scm (webid-oidc-snapshot): Call wrap-program to set + up the paths. + +2020-11-26 Vivien Kraus + + * webid-oidc.scm (webid-oidc-snapshot): change the guix name of + the snapshot package so that there is no conflict with the + release. + (webid-oidc-release): use an explicit guix package name, we don't + want to inherit the snapshot name. + diff --git a/guix/vkraus/packages/webid-oidc.scm b/guix/vkraus/packages/webid-oidc.scm new file mode 100644 index 0000000..1edb33a --- /dev/null +++ b/guix/vkraus/packages/webid-oidc.scm @@ -0,0 +1,158 @@ +(define-module (vkraus packages webid-oidc) + #:use-module (guix packages) + #:use-module (guix gexp) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix download) + #:use-module (guix git-download) + #:use-module (guix build-system gnu) + #:use-module (gnu packages) + #:use-module (gnu packages base) + #:use-module (gnu packages guile) + #:use-module (gnu packages guile-xyz) + #:use-module (gnu packages nettle) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages texinfo) + #:use-module (gnu packages autotools) + #:use-module (gnu packages gettext) + #:use-module (gnu packages man) + #:use-module (gnu packages tls)) + +(define-public webid-oidc-snapshot + (package + (name "webid-oidc-snapshot") + (version "SNAPSHOT") + (source "./webid-oidc-SNAPSHOT.tar.gz") + (build-system gnu-build-system) + (arguments + '(#:modules ((guix build utils) + (guix build gnu-build-system) + (ice-9 rdelim) + (ice-9 popen)) + #:phases + (modify-phases + %standard-phases + (add-after + 'install 'wrap-program + (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) + (define (remove-duplicates list) + (define (aux selected seen-table rest) + (if (null? rest) + (reverse selected) + (let ((next (car rest)) + (rest (cdr rest))) + (if (hash-ref seen-table next #f) + (aux selected seen-table rest) + (begin + (hash-set! seen-table next #t) + (aux (cons next selected) seen-table rest)))))) + (aux '() (make-hash-table (length list)) list)) + (let* ((out (assoc-ref outputs "out")) + (the-guile (assoc-ref (or native-inputs inputs) "guile")) + (the-guile-exec (format #f "~a/bin/guile" the-guile)) + (effective-version + (read-line + (open-pipe* OPEN_READ + the-guile-exec + "-c" + "(display (effective-version))"))) + (guile-propagated-inputs + (remove-duplicates + (cons out + (map cdr inputs)))) + (mod-paths + (filter + file-exists? + (map (lambda (prop-input) + (format #f "~a/share/guile/site/~a" + prop-input effective-version)) + guile-propagated-inputs))) + (go-paths + (filter + file-exists? + (map (lambda (prop-input) + (format #f "~a/lib/guile/~a/site-ccache" + prop-input effective-version)) + guile-propagated-inputs)))) + (for-each + (lambda (program) + (wrap-program + (format #f "~a/bin/webid-oidc-~a" out program) + `("GUILE_LOAD_PATH" ":" = ,mod-paths) + `("GUILE_LOAD_COMPILED_PATH" ":" = ,go-paths))) + '()))))))) + (native-inputs + `(("pkg-config" ,pkg-config) + ("guile" ,guile-3.0) + ("guile-json" ,guile-json-4) + ("guile-rdf" ,guile-rdf) + ("texinfo" ,texinfo) + ("autoconf" ,autoconf) + ("autoconf-archive" ,autoconf-archive) + ("automake" ,automake) + ("libtool" ,libtool) + ("gettext" ,gnu-gettext) + ("coreutils" ,coreutils) ;; for link (wrap-program) + ("help2man" ,help2man) + ("which" ,which))) + (inputs `(("guile" ,guile-3.0) + ("guile-json" ,guile-json-4) + ("guile-rdf" ,guile-rdf) + ("gnutls" ,gnutls) + ("nettle" ,nettle))) + (synopsis "") + (description "") + (home-page "https://labo.planete-kraus.eu/webid-oidc.git") + (license license:gpl3+) + (native-search-paths + (list (search-path-specification + (variable "LTDL_LIBRARY_PATH") + (files '("lib"))))))) + +(define-public (webid-oidc-release version commit hash) + (package + (inherit webid-oidc-snapshot) + (name "webid-oidc") + (version version) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://labo.planete-kraus.eu/webid-oidc.git") + (commit commit))) + (sha256 (base32 hash)) + (snippet + `(begin + (with-output-to-file ".tarball-version" + (lambda _ (format #t "~a~%" ,version))) + #t)))))) + +(define-public (webid-oidc-htmlize webid-oidc) + (package + (inherit webid-oidc) + (name "webid-oidc-html") + (arguments + '(#:phases + (modify-phases + %standard-phases + (add-after + 'build 'build-html + (lambda* (#:key make-flags parallel-build? #:allow-other-keys) + (apply invoke "make" "html" + `(,@(if parallel-build? + `("-j" ,(number->string (parallel-job-count))) + '()) + ,@make-flags)))) + (replace + 'install + (lambda* (#:key make-flags parallel-build? #:allow-other-keys) + (apply invoke "make" "install-html" + `(,@(if parallel-build? + `("-j" ,(number->string (parallel-job-count))) + '()) + ,@make-flags))))))) + (synopsis "HTML documentation for webid-oidc") + (description "The manual for webid-oidc is provided as a texinfo +file, which is exported to HTML."))) + +(define-public (make-website webid-oidc) + (file-append (webid-oidc-htmlize webid-oidc) "/share/doc/webid-oidc/webid-oidc.html")) -- cgit v1.2.3