3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/applications/version-management/sourcehut/git.nix
Julien Moutinho 2c599ba5d0 Revert "sourcehut: update go-redis to support Unix sockets"
This reverts commit 1eba3869b4c4ee1f19ddc6fbb7f068756cf2e895.

Those patches have been merged upstream.
2021-12-28 22:18:45 -05:00

84 lines
2 KiB
Nix

{ lib
, fetchFromSourcehut
, buildPythonPackage
, buildGoModule
, python
, srht
, pygit2
, scmsrht
}:
let
version = "0.73.6";
src = fetchFromSourcehut {
owner = "~sircmpwn";
repo = "git.sr.ht";
rev = version;
sha256 = "sha256-9WdeHXmyX5K/ldaE9AbSWTRlsrSDuKtm8QhthEHfmuU=";
};
buildShell = src: buildGoModule {
inherit src version;
pname = "gitsrht-shell";
vendorSha256 = "sha256-aqUFICp0C2reqb2p6JCPAUIRsxzSv0t9BHoNWrTYfqk=";
};
buildDispatcher = src: buildGoModule {
inherit src version;
pname = "gitsrht-dispatcher";
vendorSha256 = "sha256-qWXPHo86s6iuRBhRMtmD5jxnAWKdrWHtA/iSUkdw89M=";
};
buildKeys = src: buildGoModule {
inherit src version;
pname = "gitsrht-keys";
vendorSha256 = "sha256-7ti8xCjSrxsslF7/1X/GY4FDl+69hPL4UwCDfjxmJLU=";
};
buildUpdateHook = src: buildGoModule {
inherit src version;
pname = "gitsrht-update-hook";
vendorSha256 = "sha256-q8DFk0k3UcmSIiovmZPGsbK2cFU21ID8+2F+LbI62sg=";
};
updateHook = buildUpdateHook "${src}/gitsrht-update-hook";
in
buildPythonPackage rec {
inherit src version;
pname = "gitsrht";
nativeBuildInputs = srht.nativeBuildInputs;
propagatedBuildInputs = [
srht
pygit2
scmsrht
];
preBuild = ''
export PKGVER=${version}
export SRHT_PATH=${srht}/${python.sitePackages}/srht
'';
postInstall = ''
mkdir -p $out/bin
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
'';
passthru = {
inherit updateHook;
};
pythonImportsCheck = [ "gitsrht" ];
meta = with lib; {
homepage = "https://git.sr.ht/~sircmpwn/git.sr.ht";
description = "Git repository hosting service for the sr.ht network";
license = licenses.agpl3Only;
maintainers = with maintainers; [ eadwu ];
};
}