summary refs log tree commit diff
path: root/pkgs/applications/version-management/sourcehut
diff options
context:
space:
mode:
authorJulien Moutinho <julm+nixpkgs@sourcephile.fr>2022-05-06 00:04:22 +0200
committertomberek <tomberek@users.noreply.github.com>2022-06-08 19:46:04 -0400
commit658d8f1240b30b629f1d6d73961953d0acc26f43 (patch)
tree2edff1e41eb64d7ad3f1e10487fc4c64d8ed9dc1 /pkgs/applications/version-management/sourcehut
parentb57ed0fa1de7c6a138e310c009f969dcda347f7c (diff)
sourcehut.hgsrht: 0.29.4 -> 0.31.2
Diffstat (limited to 'pkgs/applications/version-management/sourcehut')
-rw-r--r--pkgs/applications/version-management/sourcehut/hg.nix29
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; {