Merge pull request #302939 from christoph-heiss/sourcehut-update

sourcehut.*: update all packages
This commit is contained in:
tomberek 2024-04-09 22:58:25 -04:00 committed by GitHub
commit 6fe145f2d0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
14 changed files with 70 additions and 58 deletions

View File

@ -16,28 +16,28 @@
, setuptools , setuptools
}: }:
let let
version = "0.89.13"; version = "0.89.15";
gqlgen = import ./fix-gqlgen-trimpath.nix { inherit unzip; gqlgenVersion = "0.17.39"; }; gqlgen = import ./fix-gqlgen-trimpath.nix { inherit unzip; gqlgenVersion = "0.17.39"; };
src = fetchFromSourcehut { src = fetchFromSourcehut {
owner = "~sircmpwn"; owner = "~sircmpwn";
repo = "builds.sr.ht"; repo = "builds.sr.ht";
rev = version; rev = version;
hash = "sha256-JpRVRzuHB6cgk/qW1j4zF8/K1xwz3J4nZhijmz5kVWU="; hash = "sha256-rmNaBnTPDDQO/ImkGkMwW8fyjQyBUBchTEnbtAK24pw=";
}; };
buildsrht-api = buildGoModule ({ buildsrht-api = buildGoModule ({
inherit src version; inherit src version;
pname = "buildsrht-api"; pname = "buildsrht-api";
modRoot = "api"; modRoot = "api";
vendorHash = "sha256-kTqoUfFEoNdDDzVNJ7XIbH7tbsl5MdBL+/UDHFv7D+A="; vendorHash = "sha256-dwpuB+aYqzhGSdGVq/F9FTdHWMBkGMtVuZ7I3hB3b+Q=";
} // gqlgen); } // gqlgen);
buildsrht-worker = buildGoModule ({ buildsrht-worker = buildGoModule ({
inherit src version; inherit src version;
pname = "buildsrht-worker"; pname = "buildsrht-worker";
modRoot = "worker"; modRoot = "worker";
vendorHash = "sha256-kTqoUfFEoNdDDzVNJ7XIbH7tbsl5MdBL+/UDHFv7D+A="; vendorHash = "sha256-dwpuB+aYqzhGSdGVq/F9FTdHWMBkGMtVuZ7I3hB3b+Q=";
} // gqlgen); } // gqlgen);
in in
buildPythonPackage rec { buildPythonPackage rec {

View File

@ -28,7 +28,7 @@
buildPythonPackage rec { buildPythonPackage rec {
pname = "srht"; pname = "srht";
version = "0.71.5"; version = "0.71.8";
pyproject = true; pyproject = true;
disabled = pythonOlder "3.7"; disabled = pythonOlder "3.7";
@ -37,7 +37,7 @@ buildPythonPackage rec {
owner = "~sircmpwn"; owner = "~sircmpwn";
repo = "core.sr.ht"; repo = "core.sr.ht";
rev = version; rev = version;
hash = "sha256-YIoKOiTi/9X4bSiG+GvnwzvKYhbfywrv/dTjxaJOOTQ="; hash = "sha256-rDpm2HJOWScvIxOmHcat6y4CWdBE9T2gE/jZskYAFB0=";
fetchSubmodules = true; fetchSubmodules = true;
}; };

View File

@ -1,13 +1,13 @@
{ unzip { unzip
, gqlgenVersion ? "0.17.42" , gqlgenVersion
}: }:
{ {
overrideModAttrs = (_: { overrideModAttrs = (_: {
# No need to workaround -trimpath: it's not used in goModules, # No need to workaround -trimpath: it's not used in goModules,
# but do download `go generate`'s dependencies nonetheless. # but do download `go generate`'s dependencies nonetheless.
preBuild = '' preBuild = ''
go generate ./loaders if [ -d ./loaders ]; then go generate ./loaders; fi
go generate ./graph if [ -d ./graph ]; then go generate ./graph; fi
''; '';
}); });
@ -25,8 +25,8 @@
# If it fails, the gqlgenVersion may have to be updated. # If it fails, the gqlgenVersion may have to be updated.
preBuild = '' preBuild = ''
unzip ''${GOPROXY#"file://"}/github.com/99designs/gqlgen/@v/v${gqlgenVersion}.zip unzip ''${GOPROXY#"file://"}/github.com/99designs/gqlgen/@v/v${gqlgenVersion}.zip
go generate ./loaders if [ -d ./loaders ]; then go generate ./loaders; fi
go generate ./graph if [ -d ./graph ]; then go generate ./graph; fi
rm -rf github.com rm -rf github.com
''; '';
} }

View File

@ -13,28 +13,28 @@
, setuptools , setuptools
}: }:
let let
version = "0.85.7"; version = "0.85.9";
gqlgen = import ./fix-gqlgen-trimpath.nix { inherit unzip; }; gqlgen = import ./fix-gqlgen-trimpath.nix { inherit unzip; gqlgenVersion = "0.17.42"; };
src = fetchFromSourcehut { src = fetchFromSourcehut {
owner = "~sircmpwn"; owner = "~sircmpwn";
repo = "git.sr.ht"; repo = "git.sr.ht";
rev = version; rev = version;
hash = "sha256-jkESrrVE+0O2g64zzPOpqhl8DpvmosQvuF0s6Xd+lbM="; hash = "sha256-tmbBw6x3nqN9nRIR3xOXQ+L5EACXLQYLXQYK3lsOsAI=";
}; };
gitApi = buildGoModule ({ gitApi = buildGoModule ({
inherit src version; inherit src version;
pname = "gitsrht-api"; pname = "gitsrht-api";
modRoot = "api"; modRoot = "api";
vendorHash = "sha256-yWVpldqwpEZmeI18tvdIgof8GgSFEP70c8T5XDkryn0="; vendorHash = "sha256-4KwnUi6ILUagMDXzuBG9CRT2N8uyjvRM74TwJqIzicc=";
} // gqlgen); } // gqlgen);
gitDispatch = buildGoModule ({ gitDispatch = buildGoModule ({
inherit src version; inherit src version;
pname = "gitsrht-dispatch"; pname = "gitsrht-dispatch";
modRoot = "gitsrht-dispatch"; modRoot = "gitsrht-dispatch";
vendorHash = "sha256-yWVpldqwpEZmeI18tvdIgof8GgSFEP70c8T5XDkryn0="; vendorHash = "sha256-4KwnUi6ILUagMDXzuBG9CRT2N8uyjvRM74TwJqIzicc=";
postPatch = '' postPatch = ''
substituteInPlace gitsrht-dispatch/main.go \ substituteInPlace gitsrht-dispatch/main.go \
@ -46,7 +46,7 @@ let
inherit src version; inherit src version;
pname = "gitsrht-keys"; pname = "gitsrht-keys";
modRoot = "gitsrht-keys"; modRoot = "gitsrht-keys";
vendorHash = "sha256-yWVpldqwpEZmeI18tvdIgof8GgSFEP70c8T5XDkryn0="; vendorHash = "sha256-4KwnUi6ILUagMDXzuBG9CRT2N8uyjvRM74TwJqIzicc=";
postPatch = '' postPatch = ''
substituteInPlace gitsrht-keys/main.go \ substituteInPlace gitsrht-keys/main.go \
@ -58,7 +58,7 @@ let
inherit src version; inherit src version;
pname = "gitsrht-shell"; pname = "gitsrht-shell";
modRoot = "gitsrht-shell"; modRoot = "gitsrht-shell";
vendorHash = "sha256-yWVpldqwpEZmeI18tvdIgof8GgSFEP70c8T5XDkryn0="; vendorHash = "sha256-4KwnUi6ILUagMDXzuBG9CRT2N8uyjvRM74TwJqIzicc=";
postPatch = '' postPatch = ''
substituteInPlace gitsrht-shell/main.go \ substituteInPlace gitsrht-shell/main.go \
@ -70,7 +70,7 @@ let
inherit src version; inherit src version;
pname = "gitsrht-update-hook"; pname = "gitsrht-update-hook";
modRoot = "gitsrht-update-hook"; modRoot = "gitsrht-update-hook";
vendorHash = "sha256-yWVpldqwpEZmeI18tvdIgof8GgSFEP70c8T5XDkryn0="; vendorHash = "sha256-4KwnUi6ILUagMDXzuBG9CRT2N8uyjvRM74TwJqIzicc=";
postPatch = '' postPatch = ''
substituteInPlace gitsrht-update-hook/main.go \ substituteInPlace gitsrht-update-hook/main.go \

View File

@ -14,8 +14,8 @@
}: }:
let let
version = "0.32.4"; version = "0.33.0";
gqlgen = import ./fix-gqlgen-trimpath.nix { inherit unzip; gqlgenVersion = "0.17.20"; }; gqlgen = import ./fix-gqlgen-trimpath.nix { inherit unzip; gqlgenVersion = "0.17.45"; };
pyproject = true; pyproject = true;
@ -25,7 +25,7 @@ let
owner = "~sircmpwn"; owner = "~sircmpwn";
repo = "hg.sr.ht"; repo = "hg.sr.ht";
rev = version; rev = version;
hash = "sha256-mYkA44c9wy/Iy1h1lXkVpc9gN7rQXFm4T3YBlQ1Dj60="; hash = "sha256-+BYeE+8dXY/MLLYyBBLD+eKqmrPiKyyCGIZLkCPzNYM=";
vc = "hg"; vc = "hg";
}; };
@ -33,7 +33,7 @@ let
inherit src version; inherit src version;
pname = "hgsrht-api"; pname = "hgsrht-api";
modRoot = "api"; modRoot = "api";
vendorHash = "sha256-vuOYpnF3WjA6kOe9MVSuVMhJBQqCmIex+QUBJrP+VDs="; vendorHash = "sha256-K+KMhcvkG/qeQTnlHS4xhLCcvBQNNp2DcScJPm8Dbic=";
} // gqlgen); } // gqlgen);
hgsrht-keys = buildGoModule { hgsrht-keys = buildGoModule {

View File

@ -12,21 +12,21 @@
}: }:
let let
version = "0.17.5"; version = "0.17.7";
gqlgen = import ./fix-gqlgen-trimpath.nix { inherit unzip; gqlgenVersion = "0.17.41"; }; gqlgen = import ./fix-gqlgen-trimpath.nix { inherit unzip; gqlgenVersion = "0.17.43"; };
src = fetchFromSourcehut { src = fetchFromSourcehut {
owner = "~sircmpwn"; owner = "~sircmpwn";
repo = "hub.sr.ht"; repo = "hub.sr.ht";
rev = version; rev = version;
hash = "sha256-GbBxK3XE+Y6Jiap0Nxa8vk4Kv6IbcdSi4NN59AeKwjA="; hash = "sha256-IyY7Niy/vZSAXjYZMlxY6uuQ8nH/4yT4+MaRjHtl6G4=";
}; };
hubsrht-api = buildGoModule ({ hubsrht-api = buildGoModule ({
inherit src version; inherit src version;
pname = "hubsrht-api"; pname = "hubsrht-api";
modRoot = "api"; modRoot = "api";
vendorHash = "sha256-wmuM0SxQbohTDaU8zmkw1TQTmqhOy1yAl1jRWk6TKL8="; vendorHash = "sha256-GVN11nEJqIHh8MtKvIXe4zcUwJph9eTSkJ2R+ufD+ic=";
} // gqlgen); } // gqlgen);
in in
buildPythonPackage rec { buildPythonPackage rec {

View File

@ -15,21 +15,21 @@
}: }:
let let
version = "0.57.14"; version = "0.57.18";
gqlgen = import ./fix-gqlgen-trimpath.nix { inherit unzip; gqlgenVersion = "0.17.36"; }; gqlgen = import ./fix-gqlgen-trimpath.nix { inherit unzip; gqlgenVersion = "0.17.45"; };
src = fetchFromSourcehut { src = fetchFromSourcehut {
owner = "~sircmpwn"; owner = "~sircmpwn";
repo = "lists.sr.ht"; repo = "lists.sr.ht";
rev = version; rev = version;
hash = "sha256-rzOxlat7Lbgt0Wl6vvnAC+fS3MynFVKFvVdIdxgA5e0="; hash = "sha256-l+QPocnwHTjrU+M0wnm4tBrbz8KmSb6DovC+skuAnLc=";
}; };
listssrht-api = buildGoModule ({ listssrht-api = buildGoModule ({
inherit src version; inherit src version;
pname = "listssrht-api"; pname = "listssrht-api";
modRoot = "api"; modRoot = "api";
vendorHash = "sha256-OWgrPvXVlvJPcoABP0ZxKzoYFhU44j/I44sBBRbd6KY="; vendorHash = "sha256-UeVs/+uZNtv296bzXIBio2wcg3Uzu3fBM4APzF9O0hY=";
} // gqlgen); } // gqlgen);
in in
buildPythonPackage rec { buildPythonPackage rec {

View File

@ -12,21 +12,21 @@
}: }:
let let
version = "0.16.3"; version = "0.16.5";
gqlgen = import ./fix-gqlgen-trimpath.nix { inherit unzip; gqlgenVersion = "0.17.36"; }; gqlgen = import ./fix-gqlgen-trimpath.nix { inherit unzip; gqlgenVersion = "0.17.43"; };
src = fetchFromSourcehut { src = fetchFromSourcehut {
owner = "~sircmpwn"; owner = "~sircmpwn";
repo = "man.sr.ht"; repo = "man.sr.ht";
rev = version; rev = version;
hash = "sha256-o1A3LmwH6WgpFqjKyL3UTru9q7TgKdOdbKZfJHR6fCA="; hash = "sha256-JFMtif2kIE/fs5PNcQtkJikAFNszgZTU7BG/8fTncTI=";
}; };
mansrht-api = buildGoModule ({ mansrht-api = buildGoModule ({
inherit src version; inherit src version;
pname = "mansrht-api"; pname = "mansrht-api";
modRoot = "api"; modRoot = "api";
vendorHash = "sha256-6AzKWytdyuofCFaDEdeO24mv1mtpnQEJydrjVWGY2eU="; vendorHash = "sha256-GVN11nEJqIHh8MtKvIXe4zcUwJph9eTSkJ2R+ufD+ic=";
} // gqlgen); } // gqlgen);
in in
buildPythonPackage rec { buildPythonPackage rec {

View File

@ -18,21 +18,21 @@
, setuptools , setuptools
}: }:
let let
version = "0.68.5"; version = "0.69.8";
gqlgen = import ./fix-gqlgen-trimpath.nix { inherit unzip; gqlgenVersion = "0.17.36"; }; gqlgen = import ./fix-gqlgen-trimpath.nix { inherit unzip; gqlgenVersion = "0.17.43"; };
src = fetchFromSourcehut { src = fetchFromSourcehut {
owner = "~sircmpwn"; owner = "~sircmpwn";
repo = "meta.sr.ht"; repo = "meta.sr.ht";
rev = version; rev = version;
hash = "sha256-mwUqBzi7nMTZL7uwv7hBjGkO8U3krXXpvfUCaYHgHBU="; hash = "sha256-K7p6cytkPYgUuYr7BVfU/+sVbSr2YEmreIDnTatUMyk=";
}; };
metasrht-api = buildGoModule ({ metasrht-api = buildGoModule ({
inherit src version; inherit src version;
pname = "metasrht-api"; pname = "metasrht-api";
modRoot = "api"; modRoot = "api";
vendorHash = "sha256-4T1xnHDjxsIyddA51exNwwz6ZWeuT7N8LBsCJ7c8sRI="; vendorHash = "sha256-vIkUK1pigVU8vZL5xpHLeinOga5eXXHTuDkHxwUz6uM=";
} // gqlgen); } // gqlgen);
in in
buildPythonPackage rec { buildPythonPackage rec {

View File

@ -6,21 +6,25 @@
buildGoModule (rec { buildGoModule (rec {
pname = "pagessrht"; pname = "pagessrht";
version = "0.15.4"; version = "0.15.7";
src = fetchFromSourcehut { src = fetchFromSourcehut {
owner = "~sircmpwn"; owner = "~sircmpwn";
repo = "pages.sr.ht"; repo = "pages.sr.ht";
rev = version; rev = version;
hash = "sha256-3kdQVIL7xaIPu2elxj1k+4/y75bd+OKP5+VPSniF7w8="; hash = "sha256-Lobuf12ybSO7Y4ztOLMFW0dmPFaBSEPCy4Nmh89tylI=";
}; };
postPatch = '' postPatch = ''
substituteInPlace Makefile \ substituteInPlace Makefile \
--replace "all: server" "" --replace "all: server" ""
# fix build failure due to unused import
substituteInPlace server.go \
--replace-warn ' "fmt"' ""
''; '';
vendorHash = "sha256-DP+6rxjiXzs0RbSuMD20XwO/+v7QXCNgXj2LxZ96lWE="; vendorHash = "sha256-9hpOkP6AYSZe7MW1mrwFEKq7TvVt6OcF6eHWY4jARuU=";
postInstall = '' postInstall = ''
mkdir -p $out/share/sql/ mkdir -p $out/share/sql/
@ -36,4 +40,4 @@ buildGoModule (rec {
}; };
# There is no ./loaders but this does not cause troubles # There is no ./loaders but this does not cause troubles
# to go generate # to go generate
} // import ./fix-gqlgen-trimpath.nix { inherit unzip; }) } // import ./fix-gqlgen-trimpath.nix { inherit unzip; gqlgenVersion = "0.17.42"; })

View File

@ -12,21 +12,21 @@
}: }:
let let
version = "0.15.2"; version = "0.15.4";
gqlgen = import ./fix-gqlgen-trimpath.nix { inherit unzip; gqlgenVersion = "0.17.20"; }; gqlgen = import ./fix-gqlgen-trimpath.nix { inherit unzip; gqlgenVersion = "0.17.45"; };
src = fetchFromSourcehut { src = fetchFromSourcehut {
owner = "~sircmpwn"; owner = "~sircmpwn";
repo = "paste.sr.ht"; repo = "paste.sr.ht";
rev = version; rev = version;
hash = "sha256-ZZzcd14Jbo1MfET7B56X/fl9xWXpCJ8TuKrGVgJwZfQ="; hash = "sha256-M38hAMRdMzcqxJv7j7foOIYEImr/ZYz/lbYOF9R9g2M=";
}; };
pastesrht-api = buildGoModule ({ pastesrht-api = buildGoModule ({
inherit src version; inherit src version;
pname = "pastesrht-api"; pname = "pastesrht-api";
modRoot = "api"; modRoot = "api";
vendorHash = "sha256-jiE73PUPSHxtWp7XBdH4mJw95pXmZjCl4tk2wQUf2M4="; vendorHash = "sha256-vt5nSPcx+Y/SaWcqjV38DTL3ZtzmdjbkJYMv5Fhhnq4=";
} // gqlgen); } // gqlgen);
in in
buildPythonPackage rec { buildPythonPackage rec {

View File

@ -10,7 +10,7 @@
buildPythonPackage rec { buildPythonPackage rec {
pname = "scmsrht"; pname = "scmsrht";
version = "0.22.23"; version = "0.22.24";
pyproject = true; pyproject = true;
disabled = pythonOlder "3.7"; disabled = pythonOlder "3.7";
@ -19,7 +19,7 @@ buildPythonPackage rec {
owner = "~sircmpwn"; owner = "~sircmpwn";
repo = "scm.sr.ht"; repo = "scm.sr.ht";
rev = version; rev = version;
hash = "sha256-058dOEYJDY3jtxH1VkV1CFq5CZTkauSnTWg57DCnNtw="; hash = "sha256-9IgMmYzInfrten7z8bznlSFJlUjHf3k3z76lkP6tP50=";
}; };
nativeBuildInputs = [ nativeBuildInputs = [

View File

@ -13,21 +13,21 @@
}: }:
let let
version = "0.75.6"; version = "0.75.10";
gqlgen = import ./fix-gqlgen-trimpath.nix { inherit unzip; gqlgenVersion = "0.17.36"; }; gqlgen = import ./fix-gqlgen-trimpath.nix { inherit unzip; gqlgenVersion = "0.17.45"; };
src = fetchFromSourcehut { src = fetchFromSourcehut {
owner = "~sircmpwn"; owner = "~sircmpwn";
repo = "todo.sr.ht"; repo = "todo.sr.ht";
rev = version; rev = version;
hash = "sha256-BPJ1M9dX+xNIw++VZ0Si/rjnfI9BY95TE2o+u7JRVAU="; hash = "sha256-3dVZdupsygM7/6T1Mn7yRc776aa9pKgwF0hgZX6uVQ0=";
}; };
todosrht-api = buildGoModule ({ todosrht-api = buildGoModule ({
inherit src version; inherit src version;
pname = "todosrht-api"; pname = "todosrht-api";
modRoot = "api"; modRoot = "api";
vendorHash = "sha256-vTKIJFE8AFR2eZFwG9ba6FWPW02og3ZVcrsqUnOkJIQ="; vendorHash = "sha256-fImOQLnQLHTrg5ikuYRZ+u+78exAiYA19DGQoUjQBOM=";
} // gqlgen); } // gqlgen);
in in
buildPythonPackage rec { buildPythonPackage rec {

View File

@ -1,5 +1,5 @@
#! /usr/bin/env nix-shell #! /usr/bin/env nix-shell
#! nix-shell -i bash -p git mercurial common-updater-scripts #! nix-shell -i bash -p gnused git mercurial common-updater-scripts
set -eux -o pipefail set -eux -o pipefail
cd "$(dirname "${BASH_SOURCE[0]}")" || exit 1 cd "$(dirname "${BASH_SOURCE[0]}")" || exit 1
@ -34,21 +34,29 @@ get_latest_version() {
rm -rf "$tmp" rm -rf "$tmp"
if [ "$1" = "hgsrht" ]; then if [ "$1" = "hgsrht" ]; then
hg clone "$src" "$tmp" >/dev/null hg clone "$src" "$tmp" >/dev/null
printf "%s" "$(cd "$tmp" && hg log --limit 1 --template '{latesttag}')" printf "%s %s\n" \
"$(cd "$tmp" && hg log --limit 1 --template '{latesttag}')" \
"$(cd "$tmp" && sed -ne 's/^\s*github\.com\/99designs\/gqlgen v\(.*\)$/\1/p' go.mod)"
else else
git clone "$src" "$tmp" >/dev/null git clone "$src" "$tmp" >/dev/null
printf "%s" "$(cd "$tmp" && git describe "$(git rev-list --tags --max-count=1)")" printf "%s %s\n" \
"$(cd "$tmp" && git describe "$(git rev-list --tags --max-count=1)")" \
"$(cd "$tmp" && sed -ne 's/^\s*github\.com\/99designs\/gqlgen v\(.*\)$/\1/p' go.mod)"
fi fi
} }
update_version() { update_version() {
default_nix="$(default "$1")" default_nix="$(default "$1")"
oldVersion="$(version "$1")" oldVersion="$(version "$1")"
version="$(get_latest_version "$1")" read -r version gqlgen_ver < <(get_latest_version "$1")
local p="$(attr_path "$1")" local p="$(attr_path "$1")"
(cd "$root" && update-source-version "$p" "$version") (cd "$root" && update-source-version "$p" "$version")
# update `gqlgenVersion` if necessary
old_gqlgen_ver="$(sed -ne 's/^.*gqlgenVersion = "\(.*\)".*$/\1/p' "$default_nix")"
sed -ri "s|gqlgenVersion = \"$old_gqlgen_ver\";|gqlgenVersion = \"$gqlgen_ver\";|w /dev/stdout" "$default_nix"
# Update vendorHash of Go modules # Update vendorHash of Go modules
retry=true retry=true
while "$retry"; do while "$retry"; do
@ -63,7 +71,7 @@ update_version() {
done done
done done
if [ "$oldVersion" != "$version" ]; then if [ "$oldVersion" != "$version" ] || [ "$old_gqlgen_ver" != "$gqlgen_ver" ]; then
git add "$default_nix" git add "$default_nix"
git commit -m "sourcehut.$1: $oldVersion -> $version" git commit -m "sourcehut.$1: $oldVersion -> $version"
fi fi