2021-04-18 03:13:58 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromSourcehut
|
|
|
|
, buildPythonPackage
|
2019-01-22 02:01:52 +00:00
|
|
|
, buildGoModule
|
2021-04-18 03:13:58 +00:00
|
|
|
, python
|
|
|
|
, srht
|
|
|
|
, pygit2
|
|
|
|
, scmsrht
|
|
|
|
}:
|
2019-01-22 02:01:52 +00:00
|
|
|
let
|
2022-02-12 00:41:16 +00:00
|
|
|
version = "0.77.3";
|
2021-04-18 03:13:58 +00:00
|
|
|
|
|
|
|
src = fetchFromSourcehut {
|
|
|
|
owner = "~sircmpwn";
|
|
|
|
repo = "git.sr.ht";
|
|
|
|
rev = version;
|
2022-02-12 00:41:16 +00:00
|
|
|
sha256 = "sha256-eJvXCcmdiUzTK0EqNJkLEZsAfr6toD/378HObnMbOWM=";
|
2021-04-18 03:13:58 +00:00
|
|
|
};
|
2019-01-22 02:01:52 +00:00
|
|
|
|
2021-12-13 19:52:10 +00:00
|
|
|
buildShell = src: buildGoModule {
|
2019-11-04 02:20:02 +00:00
|
|
|
inherit src version;
|
2019-12-30 01:03:37 +00:00
|
|
|
pname = "gitsrht-shell";
|
2021-04-18 03:13:58 +00:00
|
|
|
vendorSha256 = "sha256-aqUFICp0C2reqb2p6JCPAUIRsxzSv0t9BHoNWrTYfqk=";
|
2019-11-04 02:20:02 +00:00
|
|
|
};
|
|
|
|
|
2021-12-13 19:52:10 +00:00
|
|
|
buildDispatcher = src: buildGoModule {
|
2019-01-22 02:01:52 +00:00
|
|
|
inherit src version;
|
2021-12-13 19:52:10 +00:00
|
|
|
pname = "gitsrht-dispatcher";
|
2021-04-18 03:13:58 +00:00
|
|
|
vendorSha256 = "sha256-qWXPHo86s6iuRBhRMtmD5jxnAWKdrWHtA/iSUkdw89M=";
|
2019-01-22 02:01:52 +00:00
|
|
|
};
|
2019-12-30 01:03:37 +00:00
|
|
|
|
2021-12-13 19:52:10 +00:00
|
|
|
buildKeys = src: buildGoModule {
|
2019-12-30 01:03:37 +00:00
|
|
|
inherit src version;
|
|
|
|
pname = "gitsrht-keys";
|
2021-12-14 05:44:48 +00:00
|
|
|
vendorSha256 = "sha256-9pojS69HCKVHUceyOpGtv9ewcxFD4WsOVsEzkmWJkF4=";
|
2019-12-30 01:03:37 +00:00
|
|
|
};
|
|
|
|
|
2021-12-13 19:52:10 +00:00
|
|
|
buildUpdateHook = src: buildGoModule {
|
2019-12-30 01:03:37 +00:00
|
|
|
inherit src version;
|
|
|
|
pname = "gitsrht-update-hook";
|
2021-12-14 05:44:48 +00:00
|
|
|
vendorSha256 = "sha256-sBlG7EFqdDm7CkAHVX50Mf4N3sl1rPNmWExG/bfbfGA=";
|
2021-08-27 09:42:25 +00:00
|
|
|
};
|
2019-01-22 02:01:52 +00:00
|
|
|
|
2021-12-13 19:52:10 +00:00
|
|
|
updateHook = buildUpdateHook "${src}/gitsrht-update-hook";
|
|
|
|
|
2021-04-18 03:13:58 +00:00
|
|
|
in
|
|
|
|
buildPythonPackage rec {
|
|
|
|
inherit src version;
|
|
|
|
pname = "gitsrht";
|
2019-01-22 02:01:52 +00:00
|
|
|
|
2022-02-11 23:42:12 +00:00
|
|
|
patches = [
|
|
|
|
# Revert change breaking Unix socket support for Redis
|
|
|
|
patches/redis-socket/git/0001-Revert-Add-webhook-queue-monitoring.patch
|
|
|
|
];
|
|
|
|
|
2019-01-22 02:01:52 +00:00
|
|
|
nativeBuildInputs = srht.nativeBuildInputs;
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
srht
|
|
|
|
pygit2
|
|
|
|
scmsrht
|
|
|
|
];
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
export PKGVER=${version}
|
2021-04-18 03:13:58 +00:00
|
|
|
export SRHT_PATH=${srht}/${python.sitePackages}/srht
|
2019-01-22 02:01:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $out/bin
|
2021-12-13 19:52:10 +00:00
|
|
|
cp ${buildShell "${src}/gitsrht-shell"}/bin/gitsrht-shell $out/bin/gitsrht-shell
|
|
|
|
cp ${buildDispatcher "${src}/gitsrht-dispatch"}/bin/gitsrht-dispatch $out/bin/gitsrht-dispatch
|
|
|
|
cp ${buildKeys "${src}/gitsrht-keys"}/bin/gitsrht-keys $out/bin/gitsrht-keys
|
|
|
|
cp ${updateHook}/bin/gitsrht-update-hook $out/bin/gitsrht-update-hook
|
2019-01-22 02:01:52 +00:00
|
|
|
'';
|
2021-04-18 03:13:58 +00:00
|
|
|
passthru = {
|
2021-12-13 19:52:10 +00:00
|
|
|
inherit updateHook;
|
2021-04-18 03:13:58 +00:00
|
|
|
};
|
2021-01-03 05:36:55 +00:00
|
|
|
|
2021-08-15 21:11:47 +00:00
|
|
|
pythonImportsCheck = [ "gitsrht" ];
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://git.sr.ht/~sircmpwn/git.sr.ht";
|
2019-01-22 02:01:52 +00:00
|
|
|
description = "Git repository hosting service for the sr.ht network";
|
2021-08-15 20:54:11 +00:00
|
|
|
license = licenses.agpl3Only;
|
2019-01-22 02:01:52 +00:00
|
|
|
maintainers = with maintainers; [ eadwu ];
|
|
|
|
};
|
2020-07-31 03:58:04 +00:00
|
|
|
}
|