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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -6,21 +6,25 @@
buildGoModule (rec {
pname = "pagessrht";
version = "0.15.4";
version = "0.15.7";
src = fetchFromSourcehut {
owner = "~sircmpwn";
repo = "pages.sr.ht";
rev = version;
hash = "sha256-3kdQVIL7xaIPu2elxj1k+4/y75bd+OKP5+VPSniF7w8=";
hash = "sha256-Lobuf12ybSO7Y4ztOLMFW0dmPFaBSEPCy4Nmh89tylI=";
};
postPatch = ''
substituteInPlace Makefile \
--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 = ''
mkdir -p $out/share/sql/
@ -36,4 +40,4 @@ buildGoModule (rec {
};
# There is no ./loaders but this does not cause troubles
# 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
version = "0.15.2";
gqlgen = import ./fix-gqlgen-trimpath.nix { inherit unzip; gqlgenVersion = "0.17.20"; };
version = "0.15.4";
gqlgen = import ./fix-gqlgen-trimpath.nix { inherit unzip; gqlgenVersion = "0.17.45"; };
src = fetchFromSourcehut {
owner = "~sircmpwn";
repo = "paste.sr.ht";
rev = version;
hash = "sha256-ZZzcd14Jbo1MfET7B56X/fl9xWXpCJ8TuKrGVgJwZfQ=";
hash = "sha256-M38hAMRdMzcqxJv7j7foOIYEImr/ZYz/lbYOF9R9g2M=";
};
pastesrht-api = buildGoModule ({
inherit src version;
pname = "pastesrht-api";
modRoot = "api";
vendorHash = "sha256-jiE73PUPSHxtWp7XBdH4mJw95pXmZjCl4tk2wQUf2M4=";
vendorHash = "sha256-vt5nSPcx+Y/SaWcqjV38DTL3ZtzmdjbkJYMv5Fhhnq4=";
} // gqlgen);
in
buildPythonPackage rec {

View File

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

View File

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

View File

@ -1,5 +1,5 @@
#! /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
cd "$(dirname "${BASH_SOURCE[0]}")" || exit 1
@ -34,21 +34,29 @@ get_latest_version() {
rm -rf "$tmp"
if [ "$1" = "hgsrht" ]; then
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
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
}
update_version() {
default_nix="$(default "$1")"
oldVersion="$(version "$1")"
version="$(get_latest_version "$1")"
read -r version gqlgen_ver < <(get_latest_version "$1")
local p="$(attr_path "$1")"
(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
retry=true
while "$retry"; do
@ -63,7 +71,7 @@ update_version() {
done
done
if [ "$oldVersion" != "$version" ]; then
if [ "$oldVersion" != "$version" ] || [ "$old_gqlgen_ver" != "$gqlgen_ver" ]; then
git add "$default_nix"
git commit -m "sourcehut.$1: $oldVersion -> $version"
fi