about 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:01:39 +0200
committertomberek <tomberek@users.noreply.github.com>2022-06-08 19:46:04 -0400
commit43f856ab2c411ddd2aca58b84a157f807672c8ab (patch)
tree20808b10768235fe8c333b75b94c7ecabdc42c77 /pkgs/applications/version-management/sourcehut
parentdad23bcdd07268194154b52c481610c7e8342ada (diff)
sourcehut.buildsrht: 0.75.2 -> 0.79.1
Diffstat (limited to 'pkgs/applications/version-management/sourcehut')
-rw-r--r--pkgs/applications/version-management/sourcehut/builds.nix25
1 files changed, 19 insertions, 6 deletions
diff --git a/pkgs/applications/version-management/sourcehut/builds.nix b/pkgs/applications/version-management/sourcehut/builds.nix
index 350afd07fe196..e2cc01eb9c70a 100644
--- a/pkgs/applications/version-management/sourcehut/builds.nix
+++ b/pkgs/applications/version-management/sourcehut/builds.nix
@@ -1,7 +1,7 @@
 { lib
 , fetchFromSourcehut
-, buildPythonPackage
 , buildGoModule
+, buildPythonPackage
 , srht
 , redis
 , celery
@@ -9,21 +9,29 @@
 , markdown
 , ansi2html
 , python
+, unzip
 }:
 let
-  version = "0.75.2";
+  version = "0.79.1";
 
   src = fetchFromSourcehut {
     owner = "~sircmpwn";
     repo = "builds.sr.ht";
     rev = version;
-    sha256 = "sha256-SwyxMzmp9baRQ0vceuEn/OpfIv7z7jwq/l67hdOHXjM=";
+    sha256 = "sha256-8fZ6KdD+9+n0uO3jm0AUyG08oCUNFq1K55ZOwLbkpHk=";
   };
 
-  buildWorker = src: buildGoModule {
+  buildsrht-api = buildGoModule ({
     inherit src version;
-    pname = "builds-sr-ht-worker";
+    pname = "buildsrht-api";
+    modRoot = "api";
+    vendorSha256 = "sha256-roTwqtg4Y846PNtLdRN/LV3Jd0LVElqjFy3DJcrwoaI=";
+  } // import ./fix-gqlgen-trimpath.nix {inherit unzip;});
 
+  buildsrht-worker = buildGoModule {
+    inherit src version;
+    sourceRoot = "source/worker";
+    pname = "buildsrht-worker";
     vendorSha256 = "sha256-Pf1M9a43eK4jr6QMi6kRHA8DodXQU0pqq9ua5VC3ER0=";
   };
 in
@@ -35,6 +43,10 @@ buildPythonPackage rec {
     # Revert change breaking Unix socket support for Redis
     patches/redis-socket/build/0001-Revert-Add-build-submission-and-queue-monitoring.patch
   ];
+  postPatch = ''
+    substituteInPlace Makefile \
+      --replace "all: api worker" ""
+  '';
 
   nativeBuildInputs = srht.nativeBuildInputs;
 
@@ -58,7 +70,8 @@ buildPythonPackage rec {
 
     cp -r images $out/lib
     cp contrib/submit_image_build $out/bin/builds.sr.ht
-    cp ${buildWorker "${src}/worker"}/bin/worker $out/bin/builds.sr.ht-worker
+    ln -s ${buildsrht-api}/bin/api $out/bin/buildsrht-api
+    ln -s ${buildsrht-worker}/bin/worker $out/bin/buildsrht-worker
   '';
 
   pythonImportsCheck = [ "buildsrht" ];