;;;; Copyright (C) 2020, 2021 Julien Lepiller ;;;; ;;;; SPDX-License-Identifier: AGPL-3.0-or-later ;;;; ;;;; 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 . ;;;; (define-module (packages gitile) #:use-module (guix packages) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix build-system gnu) #:use-module (guix git-download) #:use-module (guix git) #:use-module (gnu packages autotools) #:use-module (gnu packages gnupg) #:use-module (gnu packages guile) #:use-module (gnu packages guile-xyz) #:use-module (gnu packages pkg-config) #:use-module (gnu packages texinfo) #:use-module (gnu packages tls)) (define my-guile-syntax-highlight (package (inherit guile-syntax-highlight) (source (origin (method git-fetch) (uri (git-reference (url "https://git.dthompson.us/guile-syntax-highlight.git") (commit "897fa5156ff41588e0d281eb00e4e94de63ccd8a"))) (file-name (git-file-name "guile-syntax-highlight" "0.1.897fa51")) (sha256 (base32 "18zlg4mkgd3swgv2ggfz91ivnnzc0zhvc9ybgrxg1y762va9hyvj")))) (native-inputs `(("autoconf" ,autoconf) ("automake" ,automake) ("texinfo" ,texinfo) ,@(package-native-inputs guile-syntax-highlight))))) (define-public gitile (let ((commit "aab4989efe4b5bcd3b1ac7fe108e1290de975fc0") (revision "0")) (package (name "gitile") (version (git-version "0.1.4" revision commit)) (source (origin (method git-fetch) (uri (git-reference (url "https://git.lepiller.eu/git/gitile") (commit commit))) (file-name (git-file-name name version)) (sha256 (base32 "0rslmrqspv32pbf9qz0glm8d3cxb1bz1sgi6ak2zl7blg25lw2l1")))) (build-system gnu-build-system) (arguments `(#:imported-modules ((guix build guile-build-system) ,@%gnu-build-system-modules) #:make-flags (list "GUILE_AUTO_COMPILE=0") #:phases (modify-phases %standard-phases (replace 'bootstrap (lambda _ ;; The 'bootstrap' script lacks a shebang, leading to "Exec ;; format error" with glibc 2.35. (invoke "autoreconf" "-vfi"))) (add-after 'install-bin 'wrap-program (lambda* (#:key inputs outputs #:allow-other-keys) (use-modules (guix build guile-build-system)) ;; Wrap the 'gitile' command to refer to the right modules. (let* ((out (assoc-ref outputs "out")) (commonmark (assoc-ref inputs "guile-commonmark")) (git (assoc-ref inputs "guile-git")) (bytes (assoc-ref inputs "guile-bytestructures")) (fibers (assoc-ref inputs "guile-fibers")) (gcrypt (assoc-ref inputs "guile-gcrypt")) (syntax-highlight (assoc-ref inputs "guile-syntax-highlight")) (deps (list out commonmark git bytes fibers gcrypt syntax-highlight)) (guile (assoc-ref inputs "guile")) (effective (target-guile-effective-version)) (mods (string-drop-right ;drop trailing colon (string-join deps (string-append "/share/guile/site/" effective ":") 'suffix) 1)) (objs (string-drop-right (string-join deps (string-append "/lib/guile/" effective "/site-ccache:") 'suffix) 1))) (wrap-program (string-append out "/bin/gitile") `("GUILE_LOAD_PATH" ":" prefix (,mods)) `("GUILE_LOAD_COMPILED_PATH" ":" prefix (,objs))))))))) (native-inputs (list autoconf automake guile-3.0 pkg-config)) (inputs (list guile-3.0 guile-commonmark guile-fibers-1.3 guile-gcrypt guile-git guile-syntax-highlight-for-gitile guile-gnutls)) (home-page "https://git.lepiller.eu/gitile") (synopsis "Simple Git forge written in Guile") (description "Gitile is a Git forge written in Guile that lets you visualize your public Git repositories on a web interface.") (license license:agpl3+)))) gitile