nixpkgs/pkgs/applications/version-management/sourcehut/git.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

97 lines
2.3 KiB
Nix
Raw Normal View History

2021-04-18 04:13:58 +01:00
{ lib
, fetchFromSourcehut
, buildGoModule
2022-05-05 23:03:52 +01:00
, buildPythonPackage
2021-04-18 04:13:58 +01:00
, python
, srht
, scmsrht
, pygit2
, minio
2022-05-05 23:03:52 +01:00
, unzip
2021-04-18 04:13:58 +01:00
}:
let
version = "0.84.2";
2021-04-18 04:13:58 +01:00
src = fetchFromSourcehut {
owner = "~sircmpwn";
repo = "git.sr.ht";
rev = version;
sha256 = "sha256-sAkTsQlWtNDQ5vAhA2EeOvuJcj9A6AG8pgDyIKtr65s=";
2021-04-18 04:13:58 +01:00
};
2022-05-05 23:03:52 +01:00
gitApi = buildGoModule ({
inherit src version;
2022-05-05 23:03:52 +01:00
pname = "gitsrht-api";
modRoot = "api";
vendorHash = "sha256-LAYp0zgosZnFEbtxzjuTH9++0lbxhACr705HqXJz3D0=";
} // import ./fix-gqlgen-trimpath.nix { inherit unzip; });
2022-05-05 23:03:52 +01:00
gitDispatch = buildGoModule {
inherit src version;
2022-05-05 23:03:52 +01:00
pname = "gitsrht-dispatch";
modRoot = "gitsrht-dispatch";
vendorHash = "sha256-EDvSZ3/g0xDSohrsAIpNhk+F0yy8tbnTW/3tURTonMc=";
};
2019-12-30 01:03:37 +00:00
2022-05-05 23:03:52 +01:00
gitKeys = buildGoModule {
2019-12-30 01:03:37 +00:00
inherit src version;
pname = "gitsrht-keys";
2022-05-05 23:03:52 +01:00
modRoot = "gitsrht-keys";
vendorHash = "sha256-9pojS69HCKVHUceyOpGtv9ewcxFD4WsOVsEzkmWJkF4=";
2019-12-30 01:03:37 +00:00
};
2022-05-05 23:03:52 +01:00
gitShell = buildGoModule {
2019-12-30 01:03:37 +00:00
inherit src version;
2022-05-05 23:03:52 +01:00
pname = "gitsrht-shell";
modRoot = "gitsrht-shell";
vendorHash = "sha256-WqfvSPuVsOHA//86u33atMfeA11+DJhjLmWy8Ivq0NI=";
};
2022-05-05 23:03:52 +01:00
gitUpdateHook = buildGoModule {
inherit src version;
pname = "gitsrht-update-hook";
modRoot = "gitsrht-update-hook";
vendorHash = "sha256-Bc3yPabS2S+qiroHFKrtkII/CfzBDYQ6xWxKHAME+Tc=";
2022-05-05 23:03:52 +01:00
};
2021-04-18 04:13:58 +01:00
in
buildPythonPackage rec {
inherit src version;
pname = "gitsrht";
2022-05-05 23:03:52 +01:00
postPatch = ''
substituteInPlace Makefile \
--replace "all: api gitsrht-dispatch gitsrht-keys gitsrht-shell gitsrht-update-hook" ""
'';
propagatedBuildInputs = [
srht
scmsrht
pygit2
minio
];
preBuild = ''
export PKGVER=${version}
2021-04-18 04:13:58 +01:00
export SRHT_PATH=${srht}/${python.sitePackages}/srht
'';
postInstall = ''
mkdir -p $out/bin
2022-05-05 23:03:52 +01: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
'';
2021-01-03 05:36:55 +00:00
2021-08-15 22:11:47 +01:00
pythonImportsCheck = [ "gitsrht" ];
meta = with lib; {
homepage = "https://git.sr.ht/~sircmpwn/git.sr.ht";
description = "Git repository hosting service for the sr.ht network";
2021-08-15 21:54:11 +01:00
license = licenses.agpl3Only;
maintainers = with maintainers; [ eadwu ];
};
}