From 0abd1d8e92cfd363bd1e3c01183feeee14761c9e Mon Sep 17 00:00:00 2001 From: Winter Date: Sat, 29 Oct 2022 22:35:42 -0400 Subject: [PATCH] sourcehut: fix build --- .../version-management/sourcehut/builds.nix | 2 +- .../version-management/sourcehut/core.nix | 12 ++++++++---- .../version-management/sourcehut/dispatch.nix | 2 +- .../version-management/sourcehut/git.nix | 2 +- .../applications/version-management/sourcehut/hg.nix | 2 +- .../version-management/sourcehut/hub.nix | 2 +- .../version-management/sourcehut/lists.nix | 4 ++-- .../version-management/sourcehut/man.nix | 2 +- .../version-management/sourcehut/meta.nix | 2 +- .../version-management/sourcehut/paste.nix | 2 +- .../version-management/sourcehut/scm.nix | 2 +- .../version-management/sourcehut/todo.nix | 4 ++-- 12 files changed, 21 insertions(+), 17 deletions(-) diff --git a/pkgs/applications/version-management/sourcehut/builds.nix b/pkgs/applications/version-management/sourcehut/builds.nix index 1655ad28aaf9a..f45e592a90ffb 100644 --- a/pkgs/applications/version-management/sourcehut/builds.nix +++ b/pkgs/applications/version-management/sourcehut/builds.nix @@ -54,7 +54,7 @@ buildPythonPackage rec { --replace "all: api worker" "" ''; - nativeBuildInputs = srht.nativeBuildInputs; + nativeBuildInputs = srht.sharedNativeBuildInputs; propagatedBuildInputs = [ srht diff --git a/pkgs/applications/version-management/sourcehut/core.nix b/pkgs/applications/version-management/sourcehut/core.nix index ff56c62c62e99..355ca3de4cbc8 100644 --- a/pkgs/applications/version-management/sourcehut/core.nix +++ b/pkgs/applications/version-management/sourcehut/core.nix @@ -52,10 +52,9 @@ buildPythonPackage rec { patches/redis-socket/core/0001-Fix-Unix-socket-support-in-RedisQueueCollector.patch ]; - nativeBuildInputs = [ - sassc - nodejs - ]; + # We need to pass these inputs through to dependent services but we also don't want to pass through hooks, because we + # don't want non-idempotent hooks to run more than once (which would be possible because hooks get put in nativeBuildInputs) + nativeBuildInputs = passthru.sharedNativeBuildInputs; propagatedBuildInputs = [ pgpy @@ -92,6 +91,11 @@ buildPythonPackage rec { dontUseSetuptoolsCheck = true; pythonImportsCheck = [ "srht" ]; + passthru.sharedNativeBuildInputs = [ + sassc + nodejs + ]; + meta = with lib; { homepage = "https://git.sr.ht/~sircmpwn/srht"; description = "Core modules for sr.ht"; diff --git a/pkgs/applications/version-management/sourcehut/dispatch.nix b/pkgs/applications/version-management/sourcehut/dispatch.nix index a2da28404ac92..ee63199dea716 100644 --- a/pkgs/applications/version-management/sourcehut/dispatch.nix +++ b/pkgs/applications/version-management/sourcehut/dispatch.nix @@ -18,7 +18,7 @@ buildPythonPackage rec { sha256 = "sha256-bZ4ZKohMozZIyP0TUgxETOECib4XGUv29+Mg8ZsoMf8="; }; - nativeBuildInputs = srht.nativeBuildInputs; + nativeBuildInputs = srht.sharedNativeBuildInputs; propagatedBuildInputs = [ srht diff --git a/pkgs/applications/version-management/sourcehut/git.nix b/pkgs/applications/version-management/sourcehut/git.nix index 1f76e5cb65f8f..71db132f7c337 100644 --- a/pkgs/applications/version-management/sourcehut/git.nix +++ b/pkgs/applications/version-management/sourcehut/git.nix @@ -63,7 +63,7 @@ buildPythonPackage rec { --replace "all: api gitsrht-dispatch gitsrht-keys gitsrht-shell gitsrht-update-hook" "" ''; - nativeBuildInputs = srht.nativeBuildInputs; + nativeBuildInputs = srht.sharedNativeBuildInputs; propagatedBuildInputs = [ srht diff --git a/pkgs/applications/version-management/sourcehut/hg.nix b/pkgs/applications/version-management/sourcehut/hg.nix index c1470c3fc5c6d..6022530adf239 100644 --- a/pkgs/applications/version-management/sourcehut/hg.nix +++ b/pkgs/applications/version-management/sourcehut/hg.nix @@ -41,7 +41,7 @@ buildPythonPackage rec { vendorSha256 = "sha256-7ti8xCjSrxsslF7/1X/GY4FDl+69hPL4UwCDfjxmJLU="; }; - nativeBuildInputs = srht.nativeBuildInputs; + nativeBuildInputs = srht.sharedNativeBuildInputs; propagatedBuildInputs = [ srht diff --git a/pkgs/applications/version-management/sourcehut/hub.nix b/pkgs/applications/version-management/sourcehut/hub.nix index 75d9efe5bd93d..0230e6adb16a3 100644 --- a/pkgs/applications/version-management/sourcehut/hub.nix +++ b/pkgs/applications/version-management/sourcehut/hub.nix @@ -15,7 +15,7 @@ buildPythonPackage rec { sha256 = "sha256-4n6oQ+AAvdJY/5KflxAp62chjyrlSUkmt319DKZk33w="; }; - nativeBuildInputs = srht.nativeBuildInputs; + nativeBuildInputs = srht.sharedNativeBuildInputs; propagatedBuildInputs = [ srht diff --git a/pkgs/applications/version-management/sourcehut/lists.nix b/pkgs/applications/version-management/sourcehut/lists.nix index d981598a7b19a..dc9205a639e8b 100644 --- a/pkgs/applications/version-management/sourcehut/lists.nix +++ b/pkgs/applications/version-management/sourcehut/lists.nix @@ -28,14 +28,14 @@ buildPythonPackage rec { pname = "listssrht-api"; modRoot = "api"; vendorSha256 = "sha256-xnmMkRSokbhWD+kz0XQ9AinYdm6/50FRBISURPvlzD0="; - } // import ./fix-gqlgen-trimpath.nix { inherit unzip;}); + } // import ./fix-gqlgen-trimpath.nix { inherit unzip; }); postPatch = '' substituteInPlace Makefile \ --replace "all: api" "" ''; - nativeBuildInputs = srht.nativeBuildInputs; + nativeBuildInputs = srht.sharedNativeBuildInputs; propagatedBuildInputs = [ srht diff --git a/pkgs/applications/version-management/sourcehut/man.nix b/pkgs/applications/version-management/sourcehut/man.nix index 530101d573520..af418c55bd4fd 100644 --- a/pkgs/applications/version-management/sourcehut/man.nix +++ b/pkgs/applications/version-management/sourcehut/man.nix @@ -17,7 +17,7 @@ buildPythonPackage rec { sha256 = "sha256-5xZH6DrTXMdWd26OGICp7lZ/QDjACIa7zNUJHB7jzGo="; }; - nativeBuildInputs = srht.nativeBuildInputs; + nativeBuildInputs = srht.sharedNativeBuildInputs; propagatedBuildInputs = [ srht diff --git a/pkgs/applications/version-management/sourcehut/meta.nix b/pkgs/applications/version-management/sourcehut/meta.nix index 4572fc81b2889..678b23153c659 100644 --- a/pkgs/applications/version-management/sourcehut/meta.nix +++ b/pkgs/applications/version-management/sourcehut/meta.nix @@ -45,7 +45,7 @@ buildPythonPackage rec { --replace "all: api" "" ''; - nativeBuildInputs = srht.nativeBuildInputs; + nativeBuildInputs = srht.sharedNativeBuildInputs; propagatedBuildInputs = [ pgpy diff --git a/pkgs/applications/version-management/sourcehut/paste.nix b/pkgs/applications/version-management/sourcehut/paste.nix index e31473bd34361..fde07a658c78d 100644 --- a/pkgs/applications/version-management/sourcehut/paste.nix +++ b/pkgs/applications/version-management/sourcehut/paste.nix @@ -22,7 +22,7 @@ buildPythonPackage rec { --replace "all: api" "" ''; - nativeBuildInputs = srht.nativeBuildInputs; + nativeBuildInputs = srht.sharedNativeBuildInputs; propagatedBuildInputs = [ srht diff --git a/pkgs/applications/version-management/sourcehut/scm.nix b/pkgs/applications/version-management/sourcehut/scm.nix index 49eea05a7a7a2..aa63027300059 100644 --- a/pkgs/applications/version-management/sourcehut/scm.nix +++ b/pkgs/applications/version-management/sourcehut/scm.nix @@ -18,7 +18,7 @@ buildPythonPackage rec { sha256 = "sha256-iSzzyI8HZOpOb4dyt520MV/wds14fNag2+UOF09KS7w="; }; - nativeBuildInputs = srht.nativeBuildInputs; + nativeBuildInputs = srht.sharedNativeBuildInputs; propagatedBuildInputs = [ srht diff --git a/pkgs/applications/version-management/sourcehut/todo.nix b/pkgs/applications/version-management/sourcehut/todo.nix index 0278fb6bd1738..7b9b790e9f596 100644 --- a/pkgs/applications/version-management/sourcehut/todo.nix +++ b/pkgs/applications/version-management/sourcehut/todo.nix @@ -33,9 +33,9 @@ buildPythonPackage rec { pname = "todosrht-api"; modRoot = "api"; vendorSha256 = "sha256-LB1H4jwnvoEyaaYJ09NI/M6IkgZwRet/fkso6b9EPV0="; - } // import ./fix-gqlgen-trimpath.nix {inherit unzip;}); + } // import ./fix-gqlgen-trimpath.nix { inherit unzip; }); - nativeBuildInputs = srht.nativeBuildInputs; + nativeBuildInputs = srht.sharedNativeBuildInputs; propagatedBuildInputs = [ srht