diff options
Diffstat (limited to 'guix/vkraus/packages/disfluid.scm')
-rw-r--r-- | guix/vkraus/packages/disfluid.scm | 207 |
1 files changed, 207 insertions, 0 deletions
diff --git a/guix/vkraus/packages/disfluid.scm b/guix/vkraus/packages/disfluid.scm new file mode 100644 index 0000000..f372315 --- /dev/null +++ b/guix/vkraus/packages/disfluid.scm @@ -0,0 +1,207 @@ +;; disfluid, implementation of the Solid specification +;; Copyright (C) 2020, 2021 Vivien Kraus + +;; This program is free software: you can redistribute it and/or modify +;; it under the terms of the GNU Affero General Public License as +;; published by the Free Software Foundation, either version 3 of the +;; License, or (at your option) any later version. + +;; This program 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 Affero General Public License for more details. + +;; You should have received a copy of the GNU Affero General Public License +;; along with this program. If not, see <https://www.gnu.org/licenses/>. + +(define-module (vkraus packages disfluid) + #: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 disfluid-snapshot + (package + (name "disfluid-snapshot") + (version "SNAPSHOT") + (source "./disfluid-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)))) + (wrap-program + (format #f "~a/bin/disfluid" out) + `("GUILE_LOAD_PATH" ":" = ,mod-paths) + `("GUILE_LOAD_COMPILED_PATH" ":" = ,go-paths)) + (symlink (format #f "~a/bin/disfluid" out) + (format #f "~a/bin/webid-oidc" out)) + (for-each + (lambda (program) + (wrap-program + (format #f "~a/bin/disfluid-~a" out program) + `("GUILE_LOAD_PATH" ":" = ,mod-paths) + `("GUILE_LOAD_COMPILED_PATH" ":" = ,go-paths))) + '(example-app hello)))))))) + (native-inputs + `(("pkg-config" ,pkg-config) + ("guile" ,guile-3.0) + ("guile-json" ,guile-json-4) + ("guile-rdf" ,guile-rdf) + ("guile-jsonld" ,guile-jsonld) + ("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) + ("guile-jsonld" ,guile-rdf) + ("gnutls" ,gnutls) + ("nettle" ,nettle))) + (synopsis "Demanding Interoperability to Strengthen the Free (Libre) Web: Introducing Disfluid") + (description "Demanding Interoperability to Strengthen the Free (Libre) Web: Introducing Disfluid") + (home-page "https://labo.planete-kraus.eu/webid-oidc.git") + (license license:agpl3+) + (native-search-paths + (list (search-path-specification + (variable "LTDL_LIBRARY_PATH") + (files '("lib"))))))) + +(define-public (disfluid-release version release-date commit hash) + (package + (inherit disfluid-snapshot) + (name "disfluid") + (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))) + (with-output-to-file ".tarball-release-date" + (lambda _ (format #t "~a~%" ,release-date))) + #t)))))) + +(define-public (disfluid-htmlize disfluid) + (package + (inherit disfluid) + (name "disfluid-html") + (arguments + '(#:modules ((guix build utils) + (guix build gnu-build-system) + (ice-9 textual-ports)) + #: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)))) + (add-after + 'build-html 'complete-corresponding-source + (lambda* (#:key make-flags parallel-build? #:allow-other-keys) + (apply invoke "make" "dist" + `(,@(if parallel-build? + `("-j" ,(number->string (parallel-job-count))) + '()) + ,@make-flags)))) + (replace + 'install + (lambda* (#:key make-flags parallel-build? outputs #:allow-other-keys) + (apply invoke "make" "install-html" + `(,@(if parallel-build? + `("-j" ,(number->string (parallel-job-count))) + '()) + ,@make-flags)) + (let ((version + (car + (string-split + (call-with-input-file ".tarball-version" + get-string-all) + #\newline)))) + (copy-file (string-append + "disfluid-" version ".tar.gz") + (string-append + (assoc-ref outputs "out") + "/share/doc/disfluid/disfluid.html/complete-corresponding-source.tar.gz")))))))) + (synopsis "HTML documentation for Disfluid") + (description "The manual for disfluid is provided as a texinfo +file, which is exported to HTML. Also include the complete +corresponding source, as an AGPL requirement."))) + +(define-public (make-website disfluid) + (file-append (disfluid-htmlize disfluid) "/share/doc/disfluid/disfluid.html")) |