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.4 KiB
Nix
Raw Normal View History

2021-04-18 03:13:58 +00:00
{ lib
, fetchFromSourcehut
, buildGoModule
2022-05-05 22:03:52 +00:00
, buildPythonPackage
2021-04-18 03:13:58 +00:00
, python
, srht
, pygit2
, scmsrht
2022-05-05 22:03:52 +00:00
, unzip
2021-04-18 03:13:58 +00:00
}:
let
2022-06-02 12:29:48 +00:00
version = "0.78.20";
2021-04-18 03:13:58 +00:00
src = fetchFromSourcehut {
owner = "~sircmpwn";
repo = "git.sr.ht";
rev = version;
2022-06-02 12:29:48 +00:00
sha256 = "sha256-rZsTtHobsgRVmMOjPa1fiKrPsNyFu/gOsmO0cTl5MqQ=";
2021-04-18 03:13:58 +00:00
};
2022-05-05 22:03:52 +00:00
gitApi = buildGoModule ({
inherit src version;
2022-05-05 22:03:52 +00:00
pname = "gitsrht-api";
modRoot = "api";
2022-06-02 12:29:48 +00:00
vendorSha256 = "sha256-cCs9FUBusaAou9w4TDOg8GKxhRcsPbSNcQpxvFH/+so=";
2022-06-02 11:44:52 +00:00
} // import ./fix-gqlgen-trimpath.nix { inherit unzip; });
2022-05-05 22:03:52 +00:00
gitDispatch = buildGoModule {
inherit src version;
2022-05-05 22:03:52 +00:00
pname = "gitsrht-dispatch";
modRoot = "gitsrht-dispatch";
2021-04-18 03:13:58 +00:00
vendorSha256 = "sha256-qWXPHo86s6iuRBhRMtmD5jxnAWKdrWHtA/iSUkdw89M=";
};
2019-12-30 01:03:37 +00:00
2022-05-05 22:03:52 +00:00
gitKeys = buildGoModule {
2019-12-30 01:03:37 +00:00
inherit src version;
pname = "gitsrht-keys";
2022-05-05 22:03:52 +00:00
modRoot = "gitsrht-keys";
2021-12-14 05:44:48 +00:00
vendorSha256 = "sha256-9pojS69HCKVHUceyOpGtv9ewcxFD4WsOVsEzkmWJkF4=";
2019-12-30 01:03:37 +00:00
};
2022-05-05 22:03:52 +00:00
gitShell = buildGoModule {
2019-12-30 01:03:37 +00:00
inherit src version;
2022-05-05 22:03:52 +00:00
pname = "gitsrht-shell";
modRoot = "gitsrht-shell";
vendorSha256 = "sha256-WqfvSPuVsOHA//86u33atMfeA11+DJhjLmWy8Ivq0NI=";
};
2022-05-05 22:03:52 +00:00
gitUpdateHook = buildGoModule {
inherit src version;
pname = "gitsrht-update-hook";
modRoot = "gitsrht-update-hook";
vendorSha256 = "sha256-Bc3yPabS2S+qiroHFKrtkII/CfzBDYQ6xWxKHAME+Tc=";
};
2021-04-18 03:13:58 +00:00
in
buildPythonPackage rec {
inherit src version;
pname = "gitsrht";
2022-05-05 22:03:52 +00:00
postPatch = ''
substituteInPlace Makefile \
--replace "all: api gitsrht-dispatch gitsrht-keys gitsrht-shell gitsrht-update-hook" ""
'';
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
'';
postInstall = ''
mkdir -p $out/bin
2022-05-05 22:03:52 +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
'';
2021-01-03 05:36:55 +00:00
2021-08-15 21:11:47 +00: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 20:54:11 +00:00
license = licenses.agpl3Only;
maintainers = with maintainers; [ eadwu ];
};
}