2021-04-18 05:13:58 +02:00
|
|
|
{ lib
|
|
|
|
, fetchFromSourcehut
|
|
|
|
, buildPythonPackage
|
2019-01-22 03:01:52 +01:00
|
|
|
, buildGoModule
|
2021-04-18 05:13:58 +02:00
|
|
|
, python
|
|
|
|
, srht
|
|
|
|
, pygit2
|
|
|
|
, scmsrht
|
|
|
|
}:
|
2019-01-22 03:01:52 +01:00
|
|
|
let
|
2021-04-18 05:13:58 +02:00
|
|
|
version = "0.72.8";
|
|
|
|
|
|
|
|
src = fetchFromSourcehut {
|
|
|
|
owner = "~sircmpwn";
|
|
|
|
repo = "git.sr.ht";
|
|
|
|
rev = version;
|
|
|
|
sha256 = "sha256-AB2uzajO5PtcpJfbOOTfuDFM6is5K39v3AZJ1hShRNc=";
|
|
|
|
};
|
2019-01-22 03:01:52 +01:00
|
|
|
|
2019-11-04 03:20:02 +01:00
|
|
|
buildShell = src: buildGoModule {
|
|
|
|
inherit src version;
|
2019-12-30 02:03:37 +01:00
|
|
|
pname = "gitsrht-shell";
|
2021-04-18 05:13:58 +02:00
|
|
|
vendorSha256 = "sha256-aqUFICp0C2reqb2p6JCPAUIRsxzSv0t9BHoNWrTYfqk=";
|
2019-11-04 03:20:02 +01:00
|
|
|
};
|
|
|
|
|
2019-01-22 03:01:52 +01:00
|
|
|
buildDispatcher = src: buildGoModule {
|
|
|
|
inherit src version;
|
2019-12-30 02:03:37 +01:00
|
|
|
pname = "gitsrht-dispatcher";
|
2021-04-18 05:13:58 +02:00
|
|
|
vendorSha256 = "sha256-qWXPHo86s6iuRBhRMtmD5jxnAWKdrWHtA/iSUkdw89M=";
|
2019-01-22 03:01:52 +01:00
|
|
|
};
|
2019-12-30 02:03:37 +01:00
|
|
|
|
|
|
|
buildKeys = src: buildGoModule {
|
|
|
|
inherit src version;
|
|
|
|
pname = "gitsrht-keys";
|
2020-10-11 15:43:09 +02:00
|
|
|
vendorSha256 = "1d94cqy7x0q0agwg515xxsbl70b3qrzxbzsyjhn1pbyj532brn7f";
|
2019-12-30 02:03:37 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
buildUpdateHook = src: buildGoModule {
|
|
|
|
inherit src version;
|
|
|
|
pname = "gitsrht-update-hook";
|
2020-10-11 15:43:09 +02:00
|
|
|
vendorSha256 = "0fwzqpjv8x5y3w3bfjd0x0cvqjjak23m0zj88hf32jpw49xmjkih";
|
2019-12-30 02:03:37 +01:00
|
|
|
};
|
2020-06-23 02:18:41 +02:00
|
|
|
|
2021-04-18 05:13:58 +02:00
|
|
|
updateHook = buildUpdateHook "${src}/gitsrht-update-hook";
|
2019-01-22 03:01:52 +01:00
|
|
|
|
2021-04-18 05:13:58 +02:00
|
|
|
in
|
|
|
|
buildPythonPackage rec {
|
|
|
|
inherit src version;
|
|
|
|
pname = "gitsrht";
|
2019-01-22 03:01:52 +01:00
|
|
|
|
|
|
|
nativeBuildInputs = srht.nativeBuildInputs;
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
srht
|
|
|
|
pygit2
|
|
|
|
scmsrht
|
|
|
|
];
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
export PKGVER=${version}
|
2021-04-18 05:13:58 +02:00
|
|
|
export SRHT_PATH=${srht}/${python.sitePackages}/srht
|
2019-01-22 03:01:52 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $out/bin
|
2019-11-04 03:20:02 +01:00
|
|
|
cp ${buildShell "${src}/gitsrht-shell"}/bin/gitsrht-shell $out/bin/gitsrht-shell
|
2019-01-22 03:01:52 +01:00
|
|
|
cp ${buildDispatcher "${src}/gitsrht-dispatch"}/bin/gitsrht-dispatch $out/bin/gitsrht-dispatch
|
2019-12-30 02:03:37 +01:00
|
|
|
cp ${buildKeys "${src}/gitsrht-keys"}/bin/gitsrht-keys $out/bin/gitsrht-keys
|
2021-04-18 05:13:58 +02:00
|
|
|
cp ${updateHook}/bin/gitsrht-update-hook $out/bin/gitsrht-update-hook
|
2019-01-22 03:01:52 +01:00
|
|
|
'';
|
2021-04-18 05:13:58 +02:00
|
|
|
passthru = {
|
|
|
|
inherit updateHook;
|
|
|
|
};
|
2021-01-03 06:36:55 +01:00
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://git.sr.ht/~sircmpwn/git.sr.ht";
|
2019-01-22 03:01:52 +01:00
|
|
|
description = "Git repository hosting service for the sr.ht network";
|
|
|
|
license = licenses.agpl3;
|
|
|
|
maintainers = with maintainers; [ eadwu ];
|
|
|
|
};
|
2020-07-31 05:58:04 +02:00
|
|
|
}
|