2021-05-20 23:08:51 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromSourcehut
|
2020-04-24 23:36:52 +00:00
|
|
|
, buildGoModule
|
2022-06-16 17:23:12 +00:00
|
|
|
, buildPythonPackage
|
2021-05-20 23:08:51 +00:00
|
|
|
, python
|
|
|
|
, srht
|
|
|
|
, scmsrht
|
2023-11-16 04:20:00 +00:00
|
|
|
, pygit2
|
|
|
|
, minio
|
2024-01-02 11:29:13 +00:00
|
|
|
, pythonOlder
|
2022-06-16 17:23:12 +00:00
|
|
|
, unzip
|
2024-01-02 11:29:13 +00:00
|
|
|
, pip
|
|
|
|
, setuptools
|
2021-05-20 23:08:51 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
let
|
2024-02-29 20:09:43 +00:00
|
|
|
version = "0.85.7";
|
|
|
|
gqlgen = import ./fix-gqlgen-trimpath.nix { inherit unzip; };
|
2021-05-20 23:08:51 +00:00
|
|
|
|
|
|
|
src = fetchFromSourcehut {
|
|
|
|
owner = "~sircmpwn";
|
|
|
|
repo = "git.sr.ht";
|
|
|
|
rev = version;
|
2024-02-29 20:09:43 +00:00
|
|
|
hash = "sha256-jkESrrVE+0O2g64zzPOpqhl8DpvmosQvuF0s6Xd+lbM=";
|
2021-05-20 23:08:51 +00:00
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
gitApi = buildGoModule ({
|
2020-04-24 23:36:52 +00:00
|
|
|
inherit src version;
|
2022-06-16 17:23:12 +00:00
|
|
|
pname = "gitsrht-api";
|
|
|
|
modRoot = "api";
|
2024-02-29 20:09:43 +00:00
|
|
|
vendorHash = "sha256-yWVpldqwpEZmeI18tvdIgof8GgSFEP70c8T5XDkryn0=";
|
|
|
|
} // gqlgen);
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
gitDispatch = buildGoModule ({
|
2020-04-24 23:36:52 +00:00
|
|
|
inherit src version;
|
2022-06-16 17:23:12 +00:00
|
|
|
pname = "gitsrht-dispatch";
|
|
|
|
modRoot = "gitsrht-dispatch";
|
2024-02-29 20:09:43 +00:00
|
|
|
vendorHash = "sha256-yWVpldqwpEZmeI18tvdIgof8GgSFEP70c8T5XDkryn0=";
|
2023-11-16 04:20:00 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace gitsrht-dispatch/main.go \
|
|
|
|
--replace /var/log/gitsrht-dispatch /var/log/sourcehut/gitsrht-dispatch
|
|
|
|
'';
|
2024-02-29 20:09:43 +00:00
|
|
|
} // gqlgen);
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
gitKeys = buildGoModule ({
|
2020-04-24 23:36:52 +00:00
|
|
|
inherit src version;
|
|
|
|
pname = "gitsrht-keys";
|
2022-06-16 17:23:12 +00:00
|
|
|
modRoot = "gitsrht-keys";
|
2024-02-29 20:09:43 +00:00
|
|
|
vendorHash = "sha256-yWVpldqwpEZmeI18tvdIgof8GgSFEP70c8T5XDkryn0=";
|
2023-11-16 04:20:00 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace gitsrht-keys/main.go \
|
|
|
|
--replace /var/log/gitsrht-keys /var/log/sourcehut/gitsrht-keys
|
|
|
|
'';
|
2024-02-29 20:09:43 +00:00
|
|
|
} // gqlgen);
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
gitShell = buildGoModule ({
|
2020-04-24 23:36:52 +00:00
|
|
|
inherit src version;
|
2022-06-16 17:23:12 +00:00
|
|
|
pname = "gitsrht-shell";
|
|
|
|
modRoot = "gitsrht-shell";
|
2024-02-29 20:09:43 +00:00
|
|
|
vendorHash = "sha256-yWVpldqwpEZmeI18tvdIgof8GgSFEP70c8T5XDkryn0=";
|
2023-11-16 04:20:00 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace gitsrht-shell/main.go \
|
|
|
|
--replace /var/log/gitsrht-shell /var/log/sourcehut/gitsrht-shell
|
|
|
|
'';
|
2024-02-29 20:09:43 +00:00
|
|
|
} // gqlgen);
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
gitUpdateHook = buildGoModule ({
|
2022-06-16 17:23:12 +00:00
|
|
|
inherit src version;
|
|
|
|
pname = "gitsrht-update-hook";
|
|
|
|
modRoot = "gitsrht-update-hook";
|
2024-02-29 20:09:43 +00:00
|
|
|
vendorHash = "sha256-yWVpldqwpEZmeI18tvdIgof8GgSFEP70c8T5XDkryn0=";
|
2023-11-16 04:20:00 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace gitsrht-update-hook/main.go \
|
|
|
|
--replace /var/log/gitsrht-update-hook /var/log/sourcehut/gitsrht-update-hook
|
|
|
|
'';
|
2024-02-29 20:09:43 +00:00
|
|
|
} // gqlgen);
|
2021-05-20 23:08:51 +00:00
|
|
|
in
|
|
|
|
buildPythonPackage rec {
|
|
|
|
inherit src version;
|
|
|
|
pname = "gitsrht";
|
2024-01-02 11:29:13 +00:00
|
|
|
pyproject = true;
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace Makefile \
|
|
|
|
--replace "all: api gitsrht-dispatch gitsrht-keys gitsrht-shell gitsrht-update-hook" ""
|
|
|
|
'';
|
2022-02-20 05:27:41 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
pip
|
|
|
|
setuptools
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
srht
|
|
|
|
scmsrht
|
2023-11-16 04:20:00 +00:00
|
|
|
pygit2
|
|
|
|
minio
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
export PKGVER=${version}
|
2021-05-20 23:08:51 +00:00
|
|
|
export SRHT_PATH=${srht}/${python.sitePackages}/srht
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $out/bin
|
2022-06-16 17:23:12 +00:00
|
|
|
ln -s ${gitApi}/bin/api $out/bin/gitsrht-api
|
|
|
|
ln -s ${gitDispatch}/bin/gitsrht-dispatch $out/bin/gitsrht-dispatch
|
|
|
|
ln -s ${gitKeys}/bin/gitsrht-keys $out/bin/gitsrht-keys
|
|
|
|
ln -s ${gitShell}/bin/gitsrht-shell $out/bin/gitsrht-shell
|
|
|
|
ln -s ${gitUpdateHook}/bin/gitsrht-update-hook $out/bin/gitsrht-update-hook
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
2021-01-09 10:05:03 +00:00
|
|
|
|
2021-12-30 13:39:12 +00:00
|
|
|
pythonImportsCheck = [ "gitsrht" ];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://git.sr.ht/~sircmpwn/git.sr.ht";
|
|
|
|
description = "Git repository hosting service for the sr.ht network";
|
2021-12-30 13:39:12 +00:00
|
|
|
license = licenses.agpl3Only;
|
2024-02-29 20:09:43 +00:00
|
|
|
maintainers = with maintainers; [ eadwu christoph-heiss ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2020-08-20 17:08:02 +00:00
|
|
|
}
|