From e7a778834471481a7c60566709aa07a1f3773ba4 Mon Sep 17 00:00:00 2001 From: Vivien Kraus Date: Mon, 24 Oct 2022 02:57:38 +0200 Subject: Automatic channel synchronization --- vkraus/packages/disfluid.scm | 219 ++++++++++++++++++------------------------- 1 file changed, 91 insertions(+), 128 deletions(-) (limited to 'vkraus/packages') diff --git a/vkraus/packages/disfluid.scm b/vkraus/packages/disfluid.scm index 8494db0..4c415b1 100644 --- a/vkraus/packages/disfluid.scm +++ b/vkraus/packages/disfluid.scm @@ -28,6 +28,8 @@ #:use-module (guix scripts pack) #:use-module + (guix gexp) + #:use-module (guix packages) #:use-module ((guix licenses) #:prefix license:) @@ -51,17 +53,28 @@ (define-public disfluid (package (name "disfluid") - (version "0.0.4-92-ga6cdc03") + (version "0.0.4-95-g7ec8aa7") (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://labo.planete-kraus.eu/disfluid.git") - (commit - "a6cdc031cf634944179663bed9d03b243f25ebc1"))) - (sha256 - (base32 - "05f5335cxnjw61x3qd3cgmdvh5ldxcxai4zyyqip41a9xcsw0hkg")))) + (directory-union + "source-with-translations" + (list (origin + (method git-fetch) + (uri (git-reference + (url "https://labo.planete-kraus.eu/disfluid.git") + (commit + "7ec8aa7ddc78a5d37c49bcd88b97d78810a162ae"))) + (sha256 + (base32 + "1xcis61lp8c9p2n6syzd1b5izkyb7pkpwgvcsljkqji99jljdsjk"))) + (origin + (method git-fetch) + (uri (git-reference + (url "https://labo.planete-kraus.eu/disfluid.git") + (commit + "d9b077381a782fc72993f0ae6f75d2f77370a56d"))) + (sha256 + (base32 + "1cjsrnlk53vgqdlsx20dd0b6xzbwdwryd3wkrccqx67i5n7alypg")))))) (build-system gnu-build-system) (arguments `(#:phases @@ -72,18 +85,17 @@ 'fix-mtime (lambda _ (let ((disfluid-mtimes - '(("doc/disfluid.texi" . 1666200543)))) + '(("doc/disfluid.texi" . 1666200543) + ("po/disfluid.pot" . 1666573595)))) (for-each - (lambda (fix-mtime) - (utime (car fix-mtime) - (cdr fix-mtime) - (cdr fix-mtime))) + ((@ (ice-9 match) match-lambda) + ((file . mtime) (utime file mtime mtime))) disfluid-mtimes)))) (add-before 'bootstrap 'fix-hall.scm (lambda _ - (let ((disfluid-version "0.0.4-92-ga6cdc03")) + (let ((disfluid-version "0.0.4-95-g7ec8aa7")) (substitute* "hall.scm" (("SNAPSHOT") disfluid-version))))) @@ -101,26 +113,55 @@ (add-after 'hall-scan 'hall-build-system - (lambda _ (invoke "hall" "build-system" "-x"))) + (lambda _ + (invoke "hall" "build-system" "-x") + (substitute* + "Makefile.am" + (("EXTRA_DIST =") + "EXTRA_DIST = guix.scm channels.scm")))) (add-after 'hall-build-system 'support-config.scm (lambda _ - (substitute* - "configure.ac" - (("AC_OUTPUT") - "\nAX_RECURSIVE_EVAL([$prefix], EXPANDED_PREFIX)\nAX_RECURSIVE_EVAL([$bindir], EXPANDED_BINDIR)\nAX_RECURSIVE_EVAL([$exec_prefix], EXPANDED_EXEC_PREFIX)\nAX_RECURSIVE_EVAL([$guilemoduledir], EXPANDED_GUILEMODULEDIR)\nAX_RECURSIVE_EVAL([$guileobjectdir], EXPANDED_GUILEOBJECTDIR)\nAX_RECURSIVE_EVAL([$localedir], EXPANDED_LOCALEDIR)\nAC_SUBST([EXPANDED_PREFIX])\nAC_SUBST([EXPANDED_EXEC_PREFIX])\nAC_SUBST([EXPANDED_LOCALEDIR])\nAC_SUBST([EXPANDED_BINDIR])\nAC_SUBST([EXPANDED_GUILEMODULEDIR])\nAC_SUBST([EXPANDED_GUILEOBJECTDIR])\nAC_CONFIG_FILES([disfluid/config.scm])\nAC_OUTPUT\n")) - (let ((port (open-file "Makefile.am" "a"))) - (format - port - "\ndist-hook:\n\trm -rf $(distdir)/disfluid/config.scm\n") - (close-port port)) + (let ((expanded-variables + '(("prefix" . "PREFIX") + ("bindir" . "BINDIR") + ("exec_prefix" . "EXEC_PREFIX") + ("guilemoduledir" . "GUILEMODULEDIR") + ("guileobjectdir" . "GUILEOBJECTDIR") + ("localedir" . "LOCALEDIR")))) + (let ((subst (string-join + (map ((@ (ice-9 match) match-lambda) + ((var . expanded) + (format + #f + "AX_RECURSIVE_EVAL([$~a], EXPANDED_~a)\nAC_SUBST([EXPANDED_~a])" + var + expanded + expanded))) + expanded-variables) + "\n"))) + (substitute* + "configure.ac" + (("AC_OUTPUT") + (string-append + subst + "\nAC_CONFIG_FILES([disfluid/config.scm])\nAC_OUTPUT"))))) + (rename-file "Makefile.am" "hall.mk") + (call-with-output-file + "Makefile.am" + (lambda (port) + (format + port + "include %reldir%/hall.mk\n\ndist-hook:\n\trm -rf $(distdir)/disfluid/config.scm\n"))) (call-with-output-file "disfluid/config.scm.in" (lambda (port) (for-each - (lambda (expr) (write expr port) (newline port)) - `((define-module + (lambda (code) + ((@ (ice-9 pretty-print) pretty-print) code port) + (newline port)) + '((define-module (disfluid config) #:export (package @@ -151,16 +192,16 @@ (("AC_CONFIG_FILES\\(\\[Makefile") "AC_CONFIG_FILES([Makefile po/Makefile.in")) (substitute* - "Makefile.am" + "hall.mk" (("EXTRA_DIST =") "EXTRA_DIST = guix.scm channels.scm")) - (rename-file "Makefile.am" "general.am") + (rename-file "Makefile.am" "withconfig.mk") (call-with-output-file "Makefile.am" (lambda (port) (format port - "SUBDIRS = po\ninclude general.am\n\n# END OF MAKEFILE\n"))) + "SUBDIRS = po\ninclude withconfig.mk\n"))) (mkdir-p "po") (call-with-output-file "po/Makevars" @@ -175,19 +216,15 @@ port "\n(for pattern in '*.scm' ;\n do find . -name \"$pattern\" ;\n done) > po/POTFILES.in\n") (chmod port 493))) - (invoke "bash" "collect-potfiles.sh"))) - (add-after - 'gettextize - 'support-texi2xml - (lambda _ - (substitute* - "Makefile.am" - (("# END OF MAKEFILE") - "\n\nEXTRA_DIST += doc/disfluid.xml\n\ndoc/disfluid.xml: doc/disfluid.texi\n\t$(AM_V_GEN) $(TEXI2ANY) --xml -o $(srcdir)/$@ $<\n\n# END OF MAKEFILE")) - (substitute* - "configure.ac" - (("AC_OUTPUT") - "\nAM_MISSING_PROG([TEXI2ANY], [texi2any])\nAC_OUTPUT")))) + (call-with-output-file + "collect-linguas.sh" + (lambda (port) + (format + port + "\n(for pofile in po/*.po ;\n do echo \"$pofile\" | cut -d '/' -f 2 | cut -d '.' -f 1 ;\n done) > po/LINGUAS\n") + (chmod port 493))) + (invoke "bash" "collect-potfiles.sh") + (invoke "bash" "collect-linguas.sh"))) (add-after 'hall-build-system 'define-package-bugreport @@ -198,7 +235,7 @@ (format #f "AC_INIT([disfluid], [~a], [vivien@planete-kraus.eu])\ndnl AC_INIT" - "0.0.4-92-ga6cdc03"))))) + "0.0.4-95-g7ec8aa7"))))) (add-after 'bootstrap 'fix-po-makefile-shell @@ -219,15 +256,15 @@ "DISTCHECK_CONFIGURE_FLAGS=SHELL=~a" (search-input-file inputs "/bin/bash")))) (copy-file - "disfluid-0.0.4-92-ga6cdc03.tar.gz" - "/tmp/disfluid-0.0.4-92-ga6cdc03.tar.gz") + "disfluid-0.0.4-95-g7ec8aa7.tar.gz" + "/tmp/disfluid-0.0.4-95-g7ec8aa7.tar.gz") (with-directory-excursion "/tmp" (invoke "tar" "xf" - "disfluid-0.0.4-92-ga6cdc03.tar.gz") - (delete-file "disfluid-0.0.4-92-ga6cdc03.tar.gz") + "disfluid-0.0.4-95-g7ec8aa7.tar.gz") + (delete-file "disfluid-0.0.4-95-g7ec8aa7.tar.gz") (invoke "tar" "--sort=name" @@ -237,11 +274,11 @@ "--numeric-owner" "--pax-option=exthdr.name=%d/PaxHeaders/%f,delete=atime,delete=ctime" "-cf" - "disfluid-0.0.4-92-ga6cdc03.tar.gz" - "disfluid-0.0.4-92-ga6cdc03")) + "disfluid-0.0.4-95-g7ec8aa7.tar.gz" + "disfluid-0.0.4-95-g7ec8aa7")) (copy-file - "/tmp/disfluid-0.0.4-92-ga6cdc03.tar.gz" - "disfluid-0.0.4-92-ga6cdc03.tar.gz"))) + "/tmp/disfluid-0.0.4-95-g7ec8aa7.tar.gz" + "disfluid-0.0.4-95-g7ec8aa7.tar.gz"))) (add-after 'build 'html @@ -254,7 +291,7 @@ (let ((out (assoc-ref outputs "out"))) (mkdir-p (string-append out "/share/disfluid")) (copy-file - "disfluid-0.0.4-92-ga6cdc03.tar.gz" + "disfluid-0.0.4-95-g7ec8aa7.tar.gz" (string-append out "/share/disfluid/complete-corresponding-source.tar.gz"))))) @@ -303,78 +340,4 @@ (home-page "https://disfluid.planete-kraus.eu") (license license:agpl3+))) -(define-public (disfluid-commit-ostree repo) - (define disfluid-bin-pack - (mlet* %store-monad - ((profile - (profile-derivation - (packages->manifest (list disfluid)))) - (tarball - (self-contained-tarball - "disfluid-pack" - profile - #:symlinks - '(("/var/bin" -> "bin"))))) - (return tarball))) - (define disfluid-bin-drv - (run-with-store - (open-connection) - disfluid-bin-pack)) - (define script - (program-file - "update-flatpakrepo" - (with-imported-modules - (source-module-closure '((guix build utils))) - (gexp (begin - (use-modules (guix build utils)) - (let ((output (mkdtemp "/tmp/prepare-XXXXXX"))) - (mkdir-p (string-append output "/files")) - (copy-file - (ungexp disfluid-bin-drv) - (string-append output "/disfluid-pack.tar.gz")) - (chmod (string-append output "/disfluid-pack.tar.gz") - 420) - (invoke - (ungexp (file-append gzip "/bin/gzip")) - "-d" - (string-append output "/disfluid-pack.tar.gz")) - (invoke - (ungexp (file-append tar "/bin/tar")) - "-C" - (string-append output "/files") - "-xf" - (string-append output "/disfluid-pack.tar")) - (call-with-output-file - (string-append output "/metadata") - (lambda (port) - (format - port - "[Application]\nname=eu.planete_kraus.Disfluid\nruntime=eu.planete_kraus.Disfluid\nsdk=eu.planete_kraus.Disfluid\ncommand=disfluid\n\n[Context]\nshared=network;ipc;\nsockets=x11;wayland;\nfilesystems=\n"))) - (invoke - (ungexp (file-append libostree "/bin/ostree")) - "commit" - (format - #f - "--branch=deploy/app/eu.planete_kraus.Disfluid/x86_64/stable") - output - (format #f "--repo=~a" (ungexp repo))) - (invoke - (ungexp (file-append coreutils "/bin/chmod")) - "-R" - "u+w" - output) - (delete-file-recursively output))))))) - (invoke - (run-with-store - (open-connection) - (mlet %store-monad - ((update-flatpakrepo - (gexp->derivation - "invoke-update-flatpakrepo" - (gexp (symlink (ungexp script) (ungexp output)))))) - (mbegin - %store-monad - (built-derivations (list update-flatpakrepo)) - (return - (derivation->output-path update-flatpakrepo))))))) disfluid -- cgit v1.2.3