diff options
Diffstat (limited to 'pkgs/applications/version-management')
-rw-r--r-- | pkgs/applications/version-management/sourcehut/hg.nix | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/pkgs/applications/version-management/sourcehut/hg.nix b/pkgs/applications/version-management/sourcehut/hg.nix index f3e778b2f31bc..2aa4cc2c50595 100644 --- a/pkgs/applications/version-management/sourcehut/hg.nix +++ b/pkgs/applications/version-management/sourcehut/hg.nix @@ -1,21 +1,41 @@ { lib , fetchhg +, buildGoModule , buildPythonPackage , srht , hglib , scmsrht , unidiff , python +, unzip }: buildPythonPackage rec { pname = "hgsrht"; - version = "0.29.4"; + version = "0.31.2"; src = fetchhg { url = "https://hg.sr.ht/~sircmpwn/hg.sr.ht"; rev = version; - sha256 = "Jn9M/R5tJK/GeJDWGo3LWCK2nwsfI9zh+/yo2M+X6Sk="; + sha256 = "F0dBykSSrlis+mumULLxvKNxD75DWR9+IDTYbmhkMDI="; + }; + postPatch = '' + substituteInPlace Makefile \ + --replace "all: api hgsrht-keys" "" + ''; + + hgsrht-api = buildGoModule ({ + inherit src version; + pname = "hgsrht-api"; + modRoot = "api"; + vendorSha256 = "sha256-W7A22qSIgJgcfS7xYNrmbYKaZBXbDtPilM9I6DxmTeU="; + } // import ./fix-gqlgen-trimpath.nix {inherit unzip;}); + + hgsrht-keys = buildGoModule { + inherit src version; + pname = "hgsrht-keys"; + modRoot = "hgsrht-keys"; + vendorSha256 = "sha256-7ti8xCjSrxsslF7/1X/GY4FDl+69hPL4UwCDfjxmJLU="; }; nativeBuildInputs = srht.nativeBuildInputs; @@ -32,6 +52,11 @@ buildPythonPackage rec { export SRHT_PATH=${srht}/${python.sitePackages}/srht ''; + postInstall = '' + ln -s ${hgsrht-api}/bin/api $out/bin/hgsrht-api + ln -s ${hgsrht-keys}/bin/hgsrht-keys $out/bin/hgsrht-keys + ''; + pythonImportsCheck = [ "hgsrht" ]; meta = with lib; { |