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
|
|
|
|
, pygit2
|
|
|
|
, scmsrht
|
2022-06-16 17:23:12 +00:00
|
|
|
, unzip
|
2021-05-20 23:08:51 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
let
|
2022-06-16 17:23:12 +00:00
|
|
|
version = "0.78.20";
|
2021-05-20 23:08:51 +00:00
|
|
|
|
|
|
|
src = fetchFromSourcehut {
|
|
|
|
owner = "~sircmpwn";
|
|
|
|
repo = "git.sr.ht";
|
|
|
|
rev = version;
|
2022-06-16 17:23:12 +00:00
|
|
|
sha256 = "sha256-rZsTtHobsgRVmMOjPa1fiKrPsNyFu/gOsmO0cTl5MqQ=";
|
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";
|
|
|
|
vendorSha256 = "sha256-cCs9FUBusaAou9w4TDOg8GKxhRcsPbSNcQpxvFH/+so=";
|
|
|
|
} // import ./fix-gqlgen-trimpath.nix { inherit unzip; });
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-06-16 17:23:12 +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";
|
2021-05-20 23:08:51 +00:00
|
|
|
vendorSha256 = "sha256-qWXPHo86s6iuRBhRMtmD5jxnAWKdrWHtA/iSUkdw89M=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-06-16 17:23:12 +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";
|
2021-12-30 13:39:12 +00:00
|
|
|
vendorSha256 = "sha256-9pojS69HCKVHUceyOpGtv9ewcxFD4WsOVsEzkmWJkF4=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-06-16 17:23:12 +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";
|
|
|
|
vendorSha256 = "sha256-WqfvSPuVsOHA//86u33atMfeA11+DJhjLmWy8Ivq0NI=";
|
2020-09-25 04:45:31 +00:00
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
gitUpdateHook = buildGoModule {
|
|
|
|
inherit src version;
|
|
|
|
pname = "gitsrht-update-hook";
|
|
|
|
modRoot = "gitsrht-update-hook";
|
|
|
|
vendorSha256 = "sha256-Bc3yPabS2S+qiroHFKrtkII/CfzBDYQ6xWxKHAME+Tc=";
|
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
in
|
|
|
|
buildPythonPackage rec {
|
|
|
|
inherit src version;
|
|
|
|
pname = "gitsrht";
|
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
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
srht
|
|
|
|
pygit2
|
|
|
|
scmsrht
|
|
|
|
];
|
|
|
|
|
|
|
|
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;
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = with maintainers; [ eadwu ];
|
|
|
|
};
|
2020-08-20 17:08:02 +00:00
|
|
|
}
|