]> Git — Sourcephile - sourcephile-nix.git/blob - nixpkgs/patches/sourcehut.diff
losurdo: sourcehut: sync config with module changes
[sourcephile-nix.git] / nixpkgs / patches / sourcehut.diff
1 diff --git a/pkgs/applications/version-management/sourcehut/builds.nix b/pkgs/applications/version-management/sourcehut/builds.nix
2 index c8163caf8ea..5b313a3a4e9 100644
3 --- a/pkgs/applications/version-management/sourcehut/builds.nix
4 +++ b/pkgs/applications/version-management/sourcehut/builds.nix
5 @@ -11,13 +11,13 @@
6 , python
7 }:
8 let
9 - version = "0.66.7";
10 + version = "0.70.12";
11
12 buildWorker = src: buildGoModule {
13 inherit src version;
14 pname = "builds-sr-ht-worker";
15
16 - vendorSha256 = "sha256-giOaldV46aBqXyFH/cQVsbUr6Rb4VMhbBO86o48tRZY=";
17 + vendorSha256 = "sha256-ZEarWM/33t+pNXUEIpfd/DkBkhu3UUg17Hh8XXWOepA=";
18 };
19 in
20 buildPythonPackage rec {
21 @@ -28,7 +28,7 @@ buildPythonPackage rec {
22 owner = "~sircmpwn";
23 repo = "builds.sr.ht";
24 rev = version;
25 - sha256 = "sha256-2MLs/DOXHjEYarXDVUcPZe3o0fmZbzVxn528SE72lhM=";
26 + sha256 = "sha256-k5BOb48WVOhBVKRLZeSGNePclvl9cjjJPIEt6pU7M3I=";
27 };
28
29 nativeBuildInputs = srht.nativeBuildInputs;
30 diff --git a/pkgs/applications/version-management/sourcehut/core.nix b/pkgs/applications/version-management/sourcehut/core.nix
31 index d359d524eb2..2d9a18bb233 100644
32 --- a/pkgs/applications/version-management/sourcehut/core.nix
33 +++ b/pkgs/applications/version-management/sourcehut/core.nix
34 @@ -30,12 +30,12 @@
35
36 buildPythonPackage rec {
37 pname = "srht";
38 - version = "0.67.4";
39 + version = "0.67.14";
40
41 src = fetchgit {
42 url = "https://git.sr.ht/~sircmpwn/core.sr.ht";
43 rev = version;
44 - sha256 = "sha256-XvzFfcBK5Mq8p7xEBAF/eupUE1kkUBh5k+ByM/WA9bc=";
45 + sha256 = "sha256-u98Se7QvZF2Xi6LcGHZ3ixLv2pJLYHufP2G4FtDppJc=";
46 fetchSubmodules = true;
47 };
48
49 diff --git a/pkgs/applications/version-management/sourcehut/default.nix b/pkgs/applications/version-management/sourcehut/default.nix
50 index 401a1437b7d..00810f208cc 100644
51 --- a/pkgs/applications/version-management/sourcehut/default.nix
52 +++ b/pkgs/applications/version-management/sourcehut/default.nix
53 @@ -22,6 +22,7 @@ let
54 listssrht = self.callPackage ./lists.nix { };
55 mansrht = self.callPackage ./man.nix { };
56 metasrht = self.callPackage ./meta.nix { };
57 + pagessrht = self.callPackage ./pages.nix { };
58 pastesrht = self.callPackage ./paste.nix { };
59 todosrht = self.callPackage ./todo.nix { };
60
61 @@ -40,6 +41,7 @@ with python.pkgs; recurseIntoAttrs {
62 listssrht = toPythonApplication listssrht;
63 mansrht = toPythonApplication mansrht;
64 metasrht = toPythonApplication metasrht;
65 + pagessrht = pagessrht;
66 pastesrht = toPythonApplication pastesrht;
67 todosrht = toPythonApplication todosrht;
68 }
69 diff --git a/pkgs/applications/version-management/sourcehut/dispatch.nix b/pkgs/applications/version-management/sourcehut/dispatch.nix
70 index 637c6f9c1df..af2ea1e9a4f 100644
71 --- a/pkgs/applications/version-management/sourcehut/dispatch.nix
72 +++ b/pkgs/applications/version-management/sourcehut/dispatch.nix
73 @@ -9,13 +9,13 @@
74
75 buildPythonPackage rec {
76 pname = "dispatchsrht";
77 - version = "0.15.8";
78 + version = "0.15.32";
79
80 src = fetchFromSourcehut {
81 owner = "~sircmpwn";
82 repo = "dispatch.sr.ht";
83 rev = version;
84 - sha256 = "sha256-zWCGPjIgMKHXHJUs9aciV7IFgo0rpahon6KXHDwcfss=";
85 + sha256 = "sha256-4P4cXhjcZ8IBzpRfmYIJkzl9U4Plo36a48Pf/KjmhFY=";
86 };
87
88 nativeBuildInputs = srht.nativeBuildInputs;
89 diff --git a/pkgs/applications/version-management/sourcehut/git.nix b/pkgs/applications/version-management/sourcehut/git.nix
90 index e44fb9cd6c6..cbbc420123f 100644
91 --- a/pkgs/applications/version-management/sourcehut/git.nix
92 +++ b/pkgs/applications/version-management/sourcehut/git.nix
93 @@ -8,13 +8,13 @@
94 , scmsrht
95 }:
96 let
97 - version = "0.72.8";
98 + version = "0.72.43";
99
100 src = fetchFromSourcehut {
101 owner = "~sircmpwn";
102 repo = "git.sr.ht";
103 rev = version;
104 - sha256 = "sha256-AB2uzajO5PtcpJfbOOTfuDFM6is5K39v3AZJ1hShRNc=";
105 + sha256 = "sha256-mb/zFHekLhAH5cpkB7dfTRDATWvgZKVcxdwiA4SntnU=";
106 };
107
108 buildShell = src: buildGoModule {
109 diff --git a/pkgs/applications/version-management/sourcehut/hg.nix b/pkgs/applications/version-management/sourcehut/hg.nix
110 index cddb76cabf2..a7317980134 100644
111 --- a/pkgs/applications/version-management/sourcehut/hg.nix
112 +++ b/pkgs/applications/version-management/sourcehut/hg.nix
113 @@ -10,12 +10,12 @@
114
115 buildPythonPackage rec {
116 pname = "hgsrht";
117 - version = "0.27.4";
118 + version = "0.27.6";
119
120 src = fetchhg {
121 url = "https://hg.sr.ht/~sircmpwn/hg.sr.ht";
122 rev = version;
123 - sha256 = "1c0qfi0gmbfngvds6917fy9ii2iglawn429757rh7b4bvzn7n6mr";
124 + sha256 = "ibijvKjS4CiWTYrO6Qdh3RkD0EUE7BY8wjdPwrD6vkA=";
125 };
126
127 nativeBuildInputs = srht.nativeBuildInputs;
128 diff --git a/pkgs/applications/version-management/sourcehut/hub.nix b/pkgs/applications/version-management/sourcehut/hub.nix
129 index 17cb3fe4b61..ff5ffcca38a 100644
130 --- a/pkgs/applications/version-management/sourcehut/hub.nix
131 +++ b/pkgs/applications/version-management/sourcehut/hub.nix
132 @@ -6,13 +6,13 @@
133
134 buildPythonPackage rec {
135 pname = "hubsrht";
136 - version = "0.13.1";
137 + version = "0.13.5";
138
139 src = fetchFromSourcehut {
140 owner = "~sircmpwn";
141 repo = "hub.sr.ht";
142 rev = version;
143 - sha256 = "sha256-Kqzy4mh5Nn1emzHBco/LVuXro/tW3NX+OYqdEwBSQ/U=";
144 + sha256 = "sha256-hCsHwKCnXOdUnJuklb0C7+yq2JduswMjaYGWmNS6rkc=";
145 };
146
147 nativeBuildInputs = srht.nativeBuildInputs;
148 diff --git a/pkgs/applications/version-management/sourcehut/lists.nix b/pkgs/applications/version-management/sourcehut/lists.nix
149 index b419b49f7b5..7f616fda834 100644
150 --- a/pkgs/applications/version-management/sourcehut/lists.nix
151 +++ b/pkgs/applications/version-management/sourcehut/lists.nix
152 @@ -12,13 +12,13 @@
153
154 buildPythonPackage rec {
155 pname = "listssrht";
156 - version = "0.48.19";
157 + version = "0.49.1";
158
159 src = fetchFromSourcehut {
160 owner = "~sircmpwn";
161 repo = "lists.sr.ht";
162 rev = version;
163 - sha256 = "sha256-bsakEMyvWaxiE4/SGcAP4mlGG9jkdHfFxpt9H+TJn/8=";
164 + sha256 = "sha256-3YTn705lPFGHww/xUVXc7c8OkVq02usPbdoikMA34IQ=";
165 };
166
167 nativeBuildInputs = srht.nativeBuildInputs;
168 diff --git a/pkgs/applications/version-management/sourcehut/man.nix b/pkgs/applications/version-management/sourcehut/man.nix
169 index bd331f000a7..effe70059df 100644
170 --- a/pkgs/applications/version-management/sourcehut/man.nix
171 +++ b/pkgs/applications/version-management/sourcehut/man.nix
172 @@ -8,13 +8,13 @@
173
174 buildPythonPackage rec {
175 pname = "mansrht";
176 - version = "0.15.12";
177 + version = "0.15.18";
178
179 src = fetchFromSourcehut {
180 owner = "~sircmpwn";
181 repo = "man.sr.ht";
182 rev = version;
183 - sha256 = "sha256-MqH/8K9XRvEg6P7GHE6XXtWnhDP3wT8iGoNaFtYQbio=";
184 + sha256 = "sha256-hlp3WBKgRHEWlQvs2Ep1sWA8gVR91pQnd7gvl8jMaVE=";
185 };
186
187 nativeBuildInputs = srht.nativeBuildInputs;
188 diff --git a/pkgs/applications/version-management/sourcehut/meta.nix b/pkgs/applications/version-management/sourcehut/meta.nix
189 index a285d484ed2..87122a03cab 100644
190 --- a/pkgs/applications/version-management/sourcehut/meta.nix
191 +++ b/pkgs/applications/version-management/sourcehut/meta.nix
192 @@ -18,19 +18,19 @@
193 , python
194 }:
195 let
196 - version = "0.53.14";
197 + version = "0.54.3";
198
199 src = fetchFromSourcehut {
200 owner = "~sircmpwn";
201 repo = "meta.sr.ht";
202 rev = version;
203 - sha256 = "sha256-/+r/XLDkcSTW647xPMh5bcJmR2xZNNH74AJ5jemna2k=";
204 + sha256 = "sha256-u9cl0YGPnCo+AYLA4qkrqqzQhsf4IRR6W95JulpNIIE=";
205 };
206
207 buildApi = src: buildGoModule {
208 inherit src version;
209 pname = "metasrht-api";
210 - vendorSha256 = "sha256-eZyDrr2VcNMxI++18qUy7LA1Q1YDlWCoRtl00L8lfR4=";
211 + vendorSha256 = "sha256-s0Hjt/6S9vMBL5iGREQjmA1BQ1ImB2Va++9NxSfUZzw=";
212 };
213
214 in
215 diff --git a/pkgs/applications/version-management/sourcehut/pages-fix-syntax-error-in-schema.sql.patch b/pkgs/applications/version-management/sourcehut/pages-fix-syntax-error-in-schema.sql.patch
216 new file mode 100644
217 index 00000000000..9b3f6fbc6fb
218 --- /dev/null
219 +++ b/pkgs/applications/version-management/sourcehut/pages-fix-syntax-error-in-schema.sql.patch
220 @@ -0,0 +1,27 @@
221 +From 3df160ad289b25574322f587095d00d6641f057c Mon Sep 17 00:00:00 2001
222 +From: Juan Picca <juan.picca@jumapico.uy>
223 +Date: Wed, 21 Jul 2021 08:26:56 -0300
224 +Subject: [PATCH] Fix syntax error in schema.sql
225 +
226 +---
227 + schema.sql | 4 ++--
228 + 1 file changed, 2 insertions(+), 2 deletions(-)
229 +
230 +diff --git a/schema.sql b/schema.sql
231 +index 168377f..2e473ea 100644
232 +--- a/schema.sql
233 ++++ b/schema.sql
234 +@@ -28,8 +28,8 @@ CREATE TABLE sites (
235 + user_id integer NOT NULL references "user"(id),
236 + domain varchar NOT NULL,
237 + protocol protocol NOT NULL,
238 +- version varchar NOT NULL
239 +- UNIQUE (domain, protocol),
240 ++ version varchar NOT NULL,
241 ++ UNIQUE (domain, protocol)
242 + );
243 +
244 + COMMIT;
245 +--
246 +2.32.0
247 +
248 diff --git a/pkgs/applications/version-management/sourcehut/pages.nix b/pkgs/applications/version-management/sourcehut/pages.nix
249 new file mode 100644
250 index 00000000000..c4f0a217927
251 --- /dev/null
252 +++ b/pkgs/applications/version-management/sourcehut/pages.nix
253 @@ -0,0 +1,29 @@
254 +{ lib
255 +, fetchFromSourcehut
256 +, buildGoModule
257 +}:
258 +let
259 + version = "0.4.8";
260 +
261 + src = fetchFromSourcehut {
262 + owner = "~sircmpwn";
263 + repo = "pages.sr.ht";
264 + rev = version;
265 + sha256 = "sha256-z9w8v5e6LY6VUEczltyD55KEUUH7Gw1vUO00KPmT+D8=";
266 + };
267 +
268 +in
269 +buildGoModule {
270 + inherit src version;
271 + pname = "pagessrht";
272 + vendorSha256 = "sha256-xOd9i+PNlLxZrw/+z/C9V+AbOLEociW2YHY+x1K+mJI=";
273 + patches = [
274 + ./pages-fix-syntax-error-in-schema.sql.patch
275 + ];
276 + meta = with lib; {
277 + homepage = "https://git.sr.ht/~sircmpwn/pages.sr.ht";
278 + description = "Web hosting service for the sr.ht network";
279 + license = licenses.agpl3;
280 + maintainers = with maintainers; [ eadwu ];
281 + };
282 +}
283 diff --git a/pkgs/applications/version-management/sourcehut/paste.nix b/pkgs/applications/version-management/sourcehut/paste.nix
284 index 0d8c9135493..71a95bb10b0 100644
285 --- a/pkgs/applications/version-management/sourcehut/paste.nix
286 +++ b/pkgs/applications/version-management/sourcehut/paste.nix
287 @@ -8,13 +8,13 @@
288
289 buildPythonPackage rec {
290 pname = "pastesrht";
291 - version = "0.12.1";
292 + version = "0.12.4";
293
294 src = fetchFromSourcehut {
295 owner = "~sircmpwn";
296 repo = "paste.sr.ht";
297 rev = version;
298 - sha256 = "sha256-QQhd2LeH9BLmlHilhsv+9fZ+RPNmEMSmOpFA3dsMBFc=";
299 + sha256 = "sha256-hFjWa7L7JiQoG3Hm9NyoP2FNypDiW+nGDmQ2DoZkAIw=";
300 };
301
302 nativeBuildInputs = srht.nativeBuildInputs;
303 diff --git a/pkgs/applications/version-management/sourcehut/scm.nix b/pkgs/applications/version-management/sourcehut/scm.nix
304 index 1f385265360..1ce3fe867ed 100644
305 --- a/pkgs/applications/version-management/sourcehut/scm.nix
306 +++ b/pkgs/applications/version-management/sourcehut/scm.nix
307 @@ -10,13 +10,13 @@
308
309 buildPythonPackage rec {
310 pname = "scmsrht";
311 - version = "0.22.9";
312 + version = "0.22.12";
313
314 src = fetchFromSourcehut {
315 owner = "~sircmpwn";
316 repo = "scm.sr.ht";
317 rev = version;
318 - sha256 = "sha256-327G6C8FW+iZx+167D7TQsFtV6FGc8MpMVo9L/cUUqU=";
319 + sha256 = "sha256-ktDQ0pVljt85sN2v5QgBiqaW5wtVc5pRC8WT31HSwpI=";
320 };
321
322 nativeBuildInputs = srht.nativeBuildInputs;
323 diff --git a/pkgs/applications/version-management/sourcehut/todo.nix b/pkgs/applications/version-management/sourcehut/todo.nix
324 index 85e1f5637b6..8aa4730b1cb 100644
325 --- a/pkgs/applications/version-management/sourcehut/todo.nix
326 +++ b/pkgs/applications/version-management/sourcehut/todo.nix
327 @@ -12,13 +12,13 @@
328
329 buildPythonPackage rec {
330 pname = "todosrht";
331 - version = "0.64.14";
332 + version = "0.64.23";
333
334 src = fetchFromSourcehut {
335 owner = "~sircmpwn";
336 repo = "todo.sr.ht";
337 rev = version;
338 - sha256 = "sha256-huIAhn6h1F5w5ST4/yBwr82kAzyYwhLu+gpRuOQgnsE=";
339 + sha256 = "sha256-gagOaYlOfkho8nV7feboPjmOYazsMV72NfMngubxRFc=";
340 };
341
342 nativeBuildInputs = srht.nativeBuildInputs;
343 diff --git a/pkgs/applications/version-management/sourcehut/update.sh b/pkgs/applications/version-management/sourcehut/update.sh
344 index 156d4cc35e4..36040c6d14f 100755
345 --- a/pkgs/applications/version-management/sourcehut/update.sh
346 +++ b/pkgs/applications/version-management/sourcehut/update.sh
347 @@ -1,8 +1,11 @@
348 #! /usr/bin/env nix-shell
349 #! nix-shell -i bash -p git mercurial common-updater-scripts
350 +set -x
351
352 -cd "$(dirname "${BASH_SOURCE[0]}")"
353 +cd "$(dirname "${BASH_SOURCE[0]}")" || exit 1
354 root=../../../..
355 +tmp=$(mktemp -d)
356 +trap 'rm -rf "$tmp"' EXIT
357
358 default() {
359 (cd "$root" && nix-instantiate --eval --strict -A "sourcehut.python.pkgs.$1.meta.position" | sed -re 's/^"(.*):[0-9]+"$/\1/')
360 @@ -13,19 +16,18 @@ version() {
361 }
362
363 src_url() {
364 - (cd "$root" && nix-instantiate --eval --strict -A "sourcehut.python.pkgs.$1.src.drvAttrs.url" | tr -d '"')
365 + nix-instantiate --eval --strict --expr " with import $root {}; let src = sourcehut.python.pkgs.$1.drvAttrs.src; in src.url or src.meta.homepage" | tr -d '"'
366 }
367
368 get_latest_version() {
369 src="$(src_url "$1")"
370 - tmp=$(mktemp -d)
371 -
372 + rm -rf "$tmp"
373 if [ "$1" = "hgsrht" ]; then
374 - hg clone "$src" "$tmp" &> /dev/null
375 + hg clone "$src" "$tmp" >/dev/null
376 printf "%s" "$(cd "$tmp" && hg log --limit 1 --template '{latesttag}')"
377 else
378 - git clone "$src" "$tmp"
379 - printf "%s" "$(cd "$tmp" && git describe $(git rev-list --tags --max-count=1))"
380 + git clone "$src" "$tmp" >/dev/null
381 + printf "%s" "$(cd "$tmp" && git describe "$(git rev-list --tags --max-count=1)")"
382 fi
383 }
384
385 @@ -36,19 +38,33 @@ update_version() {
386
387 (cd "$root" && update-source-version "sourcehut.python.pkgs.$1" "$version")
388
389 + # Update vendorSha256 of Go modules
390 + nixFile="${1%srht}".nix
391 + nixFile="${nixFile/build/builds}"
392 + retry=true
393 + while "$retry"; do
394 + retry=false;
395 + exec < <(exec nix -L build -f "$root" sourcehut.python.pkgs."$1" 2>&1)
396 + while IFS=' :' read -r origin hash; do
397 + case "$origin" in
398 + (expected|specified) oldHash="$hash";;
399 + (got) sed -i "s|$oldHash|$(nix hash to-sri --type sha256 "$hash")|" "$nixFile"; retry=true; break;;
400 + (*) printf >&2 "%s\n" "$origin${hash:+:$hash}"
401 + esac
402 + done
403 + done
404 +
405 git add "$default_nix"
406 git commit -m "$1: $version_old -> $version"
407 }
408
409 -services=( "srht" "buildsrht" "dispatchsrht" "gitsrht" "hgsrht" "hubsrht" "listssrht" "mansrht"
410 - "metasrht" "pastesrht" "todosrht" "scmsrht" )
411 -
412 -# Whether or not a specific service is requested
413 -if [ -n "$1" ]; then
414 - version="$(get_latest_version "$1")"
415 - (cd "$root" && update-source-version "sourcehut.python.pkgs.$1" "$version")
416 +if [ $# -gt 0 ]; then
417 + services=("$@")
418 else
419 - for service in "${services[@]}"; do
420 - update_version "$service"
421 - done
422 + services=( "srht" "buildsrht" "dispatchsrht" "gitsrht" "hgsrht" "hubsrht" "listssrht" "mansrht"
423 + "metasrht" "pagessrht" "pastesrht" "todosrht" "scmsrht" )
424 fi
425 +
426 +for service in "${services[@]}"; do
427 + update_version "$service"
428 +done