summaryrefslogtreecommitdiff
path: root/guix/vkraus/packages/web-client-with-cache.scm
blob: 46b31e9c34dc5ae244f61f4f9369cd37cb99873e (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
(define-module (vkraus packages web-client-with-cache)
  #:use-module (guix packages)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix download)
  #:use-module (guix git-download)
  #:use-module (guix gexp)
  #:use-module (guix modules)
  #:use-module (guix build-system gnu)
  #:use-module (guix build-system copy)
  #:use-module (guix build-system trivial)
  #:use-module (gnu packages)
  #:use-module (gnu packages autotools)
  #:use-module (gnu packages base)
  #:use-module (gnu packages bash)
  #:use-module (gnu packages guile)
  #:use-module (gnu packages guile-xyz)
  #:use-module (gnu packages compression)
  #:use-module (gnu packages emacs)
  #:use-module (gnu packages emacs-xyz)
  #:use-module (gnu packages pkg-config)
  #:use-module (gnu packages texinfo)
  #:use-module (gnu packages tex))

(define-public (make-web-client-with-cache version commit hash)
  (package
    (name "guile-web-client-with-cache")
    (version version)
    (source
     (origin
      (method git-fetch)
      (uri (git-reference
	    (url "https://labo.planete-kraus.eu/web-client-with-cache.git")
	    (commit commit)))
      (sha256 (base32 hash))))
    (build-system gnu-build-system)
    (arguments
     `(#:phases
       (modify-phases
	%standard-phases
	(add-after
	 'unpack 'set-version
	 (lambda* args
	   (call-with-output-file ".tarball-version"
	     (lambda (port)
	       (display ,version port)))
	   #t)))))
    (native-inputs
     `(("emacs" ,emacs)
       ("emacs-org" ,emacs-org)
       ("autoconf" ,autoconf)
       ("autoconf-archive" ,autoconf-archive)
       ("automake" ,automake)
       ("pkg-config" ,pkg-config)
       ("guile-3.0" ,guile-3.0)
       ("texinfo" ,texinfo)))
    (inputs
     `(("guile-3.0" ,guile-3.0)))
    (propagated-inputs
     `(("guile-3.0" ,guile-3.0)))
    (synopsis "A web client for guile, with cache")
    (description "Uses client-side Cache-Control, ETag, and
Last-Modified to cache web resources in memory.")
    (home-page "https://labo.planete-kraus.eu/web-client-with-cache.git/")
    (license license:gpl3+)))

(define-public guile-web-client-with-cache
  (make-web-client-with-cache
   "0.3.3"
   "0.3.3"
   "1afifbkfa6jml98q8c5xnikr6w95pg463dbp287l6pigbwabpyji"))

(define-public guile-web-client-with-cache-html
  (package
   (inherit guile-web-client-with-cache)
   (name "guile-web-client-with-cache-html")
   (arguments
    `(#:phases
       (modify-phases
	%standard-phases
	(add-after
	 'unpack 'set-version
	 (lambda* args
	   (call-with-output-file ".tarball-version"
	     (lambda (port)
	       (display ,(package-version guile-web-client-with-cache) port)))
	   #t))
	(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 guile-web-client-with-cache")
   (description "The manual for guile-web-client-with-cache is provided as a texinfo file, which is converted to HTML.")))

(define-public guile-web-client-with-cache-dist
  (let ((dist (dist-package
	       guile-web-client-with-cache
	       (package-source guile-web-client-with-cache)
	       #:phases
	       `(modify-phases
		 %dist-phases
		 (add-after
		  'unpack 'set-version
		  (lambda* args
		    (call-with-output-file ".tarball-version"
		      (lambda (port)
			(display ,(package-version guile-web-client-with-cache) port)))
		    #t))))))
    (package
     (inherit dist)
     (native-inputs
      (cons* `("texlive" ,texlive)
	     (package-native-inputs dist)))
     (synopsis "Release tarball for guile-web-client-with-cache")
     (description "This package provides a tarball for the release of web-client-with-cache."))))

(define-public guile-web-client-with-cache:website
  (directory-union
   "website"
   (list
    (file-append guile-web-client-with-cache-html "/share/doc/web-client-with-cache/web-client-with-cache.html")
    (file-union
     "downloads"
     `(("source.tar.gz"
	,(file-append
	  guile-web-client-with-cache-dist
	  (format #f "/web-client-with-cache-~a.tar.gz"
		  (package-version guile-web-client-with-cache-dist)))))))))