about summary refs log tree commit diff
path: root/pkgs/applications/version-management/sourcehut/git.nix
diff options
context:
space:
mode:
authorJulien Moutinho <julm+nixpkgs@sourcephile.fr>2022-05-06 00:03:52 +0200
committertomberek <tomberek@users.noreply.github.com>2022-06-08 19:46:04 -0400
commitb57ed0fa1de7c6a138e310c009f969dcda347f7c (patch)
tree5b9f080f4046975fbc63e75d91f538033b78eaaf /pkgs/applications/version-management/sourcehut/git.nix
parent43f856ab2c411ddd2aca58b84a157f807672c8ab (diff)
sourcehut.gitsrht: 0.77.3 -> 0.78.18
Diffstat (limited to 'pkgs/applications/version-management/sourcehut/git.nix')
-rw-r--r--pkgs/applications/version-management/sourcehut/git.nix54
1 files changed, 33 insertions, 21 deletions
diff --git a/pkgs/applications/version-management/sourcehut/git.nix b/pkgs/applications/version-management/sourcehut/git.nix
index 318bee4cf5177..e56022604fa7d 100644
--- a/pkgs/applications/version-management/sourcehut/git.nix
+++ b/pkgs/applications/version-management/sourcehut/git.nix
@@ -1,47 +1,57 @@
 { lib
 , fetchFromSourcehut
-, buildPythonPackage
 , buildGoModule
+, buildPythonPackage
 , python
 , srht
 , pygit2
 , scmsrht
+, unzip
 }:
 let
-  version = "0.77.3";
+  version = "0.78.18";
 
   src = fetchFromSourcehut {
     owner = "~sircmpwn";
     repo = "git.sr.ht";
     rev = version;
-    sha256 = "sha256-eJvXCcmdiUzTK0EqNJkLEZsAfr6toD/378HObnMbOWM=";
+    sha256 = "sha256-pGWphdFKaOIBIKWMxfNAFqXZQx/qHcrwb5Ylj9uag7s=";
   };
 
-  buildShell = src: buildGoModule {
+  gitApi = buildGoModule ({
     inherit src version;
-    pname = "gitsrht-shell";
-    vendorSha256 = "sha256-aqUFICp0C2reqb2p6JCPAUIRsxzSv0t9BHoNWrTYfqk=";
-  };
+    pname = "gitsrht-api";
+    modRoot = "api";
+    vendorSha256 = "sha256-0YI20liP0X1McfiSUy29zJk2UqqAPBIfIfPLoJOE1uI=";
+  } // import ./fix-gqlgen-trimpath.nix {inherit unzip;});
 
-  buildDispatcher = src: buildGoModule {
+  gitDispatch = buildGoModule {
     inherit src version;
-    pname = "gitsrht-dispatcher";
+    pname = "gitsrht-dispatch";
+    modRoot = "gitsrht-dispatch";
     vendorSha256 = "sha256-qWXPHo86s6iuRBhRMtmD5jxnAWKdrWHtA/iSUkdw89M=";
   };
 
-  buildKeys = src: buildGoModule {
+  gitKeys = buildGoModule {
     inherit src version;
     pname = "gitsrht-keys";
+    modRoot = "gitsrht-keys";
     vendorSha256 = "sha256-9pojS69HCKVHUceyOpGtv9ewcxFD4WsOVsEzkmWJkF4=";
   };
 
-  buildUpdateHook = src: buildGoModule {
+  gitShell = buildGoModule {
     inherit src version;
-    pname = "gitsrht-update-hook";
-    vendorSha256 = "sha256-sBlG7EFqdDm7CkAHVX50Mf4N3sl1rPNmWExG/bfbfGA=";
+    pname = "gitsrht-shell";
+    modRoot = "gitsrht-shell";
+    vendorSha256 = "sha256-WqfvSPuVsOHA//86u33atMfeA11+DJhjLmWy8Ivq0NI=";
   };
 
-  updateHook = buildUpdateHook "${src}/gitsrht-update-hook";
+  gitUpdateHook = buildGoModule {
+    inherit src version;
+    pname = "gitsrht-update-hook";
+    modRoot = "gitsrht-update-hook";
+    vendorSha256 = "sha256-Bc3yPabS2S+qiroHFKrtkII/CfzBDYQ6xWxKHAME+Tc=";
+  };
 
 in
 buildPythonPackage rec {
@@ -52,6 +62,10 @@ buildPythonPackage rec {
     # Revert change breaking Unix socket support for Redis
     patches/redis-socket/git/0001-Revert-Add-webhook-queue-monitoring.patch
   ];
+  postPatch = ''
+    substituteInPlace Makefile \
+      --replace "all: api gitsrht-dispatch gitsrht-keys gitsrht-shell gitsrht-update-hook" ""
+  '';
 
   nativeBuildInputs = srht.nativeBuildInputs;
 
@@ -68,14 +82,12 @@ buildPythonPackage rec {
 
   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
+    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
   '';
-  passthru = {
-    inherit updateHook;
-  };
 
   pythonImportsCheck = [ "gitsrht" ];