summaryrefslogtreecommitdiff
path: root/guix/vkraus/packages/webid-oidc.scm
blob: 372892e03293feb10c6a1c0a3169ed7e6b151688 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
(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)
  #:use-module (gnu packages xml)
  #:use-module (gnu packages emacs)
  #:use-module (gnu packages emacs-xyz))

(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)
          (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
                  (cons out
                        (map (lambda (name)
                               (assoc-ref inputs name))
                             '("guile-json" "guile-rdf" "gnutls"))))
                 (mod-paths
                  (map (lambda (prop-input)
                         (format #f "~a/share/guile/site/~a"
                                 prop-input effective-version))
                       guile-propagated-inputs))
                 (go-paths
                  (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)))
             '(issuer reverse-proxy hello client-service))))))))
   (native-inputs
    `(("pkg-config" ,pkg-config)
      ("guile" ,guile-3.0)
      ("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)
      ("libxslt" ,libxslt)))
   (inputs `(("guile" ,guile-3.0)
             ("nettle" ,nettle)))
   (propagated-inputs
    `(("guile" ,guile-3.0)
      ("guile-json" ,guile-json-4)
      ("guile-rdf" ,guile-rdf)
      ("gnutls" ,gnutls)))
   (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
  (webid-oidc-release
   "0.4.4"
   "0.4.4"
   "02d1a5k0aw3iqlnbyls4rgymlzanq7wsyzq1ahy2gplyq6iy53iz"))

(define-public webid-oidc-html
  (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 webid-oidc:website
  (file-append webid-oidc-html "/share/doc/webid-oidc/webid-oidc.html"))