about summary refs log tree commit diff
path: root/pkgs/applications
diff options
context:
space:
mode:
authorYueh-Shun Li <shamrocklee@posteo.net>2024-03-09 01:04:40 +0800
committerYueh-Shun Li <shamrocklee@posteo.net>2024-03-09 07:53:25 +0800
commit91b3db13093b1aecdba07041eb44b7103c235d94 (patch)
treeee602af3a19fea3d77135eaf8c1818f2ec261706 /pkgs/applications
parent89d56ddd5bf9d731f6d723aa4b4f374ecc4b80e4 (diff)
treewide: fix sourceRoot for fetchgit-based src
According to Nixpkgs manual[1] and NixOS 23.11 Release Note[2], the
`sourceRoot` attribute passed to `stdenv.mkDerivation` should be
specified as `"${src.name}"` or `"${src.name}/subdir"` when `src` is
produced using `fetchgit`-based fetchers.

`sourceRoot = "source"` or `sourceRoot = "source/subdir"` is based on
the assumption that the `name` attribute of these pre-unpacked fetchers
are always `"source"`, which is not the case. Expecting constant `name`
also makes the source FODs prone to irrelevent hashes during version
bumps.

[1]: https://nixos.org/manual/nixpkgs/unstable/#var-stdenv-sourceRoot
[2]: https://nixos.org/manual/nixos/stable/release-notes#sec-release-23.11
Diffstat (limited to 'pkgs/applications')
-rw-r--r--pkgs/applications/editors/vim/plugins/overrides.nix2
-rw-r--r--pkgs/applications/graphics/awesomebump/default.nix2
-rw-r--r--pkgs/applications/networking/geph/default.nix4
-rw-r--r--pkgs/applications/networking/localsend/default.nix10
-rw-r--r--pkgs/applications/science/chemistry/autodock-vina/default.nix8
-rw-r--r--pkgs/applications/science/misc/openrefine/default.nix2
-rw-r--r--pkgs/applications/video/anilibria-winmaclinux/default.nix2
7 files changed, 15 insertions, 15 deletions
diff --git a/pkgs/applications/editors/vim/plugins/overrides.nix b/pkgs/applications/editors/vim/plugins/overrides.nix
index f278070e45507..546f1f6f2ccae 100644
--- a/pkgs/applications/editors/vim/plugins/overrides.nix
+++ b/pkgs/applications/editors/vim/plugins/overrides.nix
@@ -996,7 +996,7 @@
       spectre_oxi = rustPlatform.buildRustPackage {
         pname = "spectre_oxi";
         inherit (old) version src;
-        sourceRoot = "source/spectre_oxi";
+        sourceRoot = "${old.src.name}/spectre_oxi";
 
         cargoHash = "sha256-gCGuD5kipgfR0Le8npNmyBxNsUq0PavXvKkxkiPx13E=";
 
diff --git a/pkgs/applications/graphics/awesomebump/default.nix b/pkgs/applications/graphics/awesomebump/default.nix
index a5debbc21b02d..ef9a2f7c77665 100644
--- a/pkgs/applications/graphics/awesomebump/default.nix
+++ b/pkgs/applications/graphics/awesomebump/default.nix
@@ -14,7 +14,7 @@ let
   qtnproperty = mkDerivation {
     name = "qtnproperty";
     inherit src;
-    sourceRoot = "AwesomeBump/Sources/utils/QtnProperty";
+    sourceRoot = "${src.name}/Sources/utils/QtnProperty";
     patches = [ ./qtnproperty-parallel-building.patch ];
     buildInputs = [ qtscript qtbase qtdeclarative ];
     nativeBuildInputs = [ qmake flex bison ];
diff --git a/pkgs/applications/networking/geph/default.nix b/pkgs/applications/networking/geph/default.nix
index 1b839d748477c..45e3b1ae373b5 100644
--- a/pkgs/applications/networking/geph/default.nix
+++ b/pkgs/applications/networking/geph/default.nix
@@ -64,7 +64,7 @@ in
       pname = "${pname}-pnpm-deps";
       inherit src version;
 
-      sourceRoot = "source/gephgui-wry/gephgui";
+      sourceRoot = "${src.name}/gephgui-wry/gephgui";
 
       nativeBuildInputs = [
         jq
@@ -95,7 +95,7 @@ in
       pname = "gephgui-wry";
       inherit version src;
 
-      sourceRoot = "source/gephgui-wry";
+      sourceRoot = "${src.name}/gephgui-wry";
 
       cargoLock = {
         lockFile = ./Cargo.lock;
diff --git a/pkgs/applications/networking/localsend/default.nix b/pkgs/applications/networking/localsend/default.nix
index 95506e98dc9a0..6bff0e0fbc6cd 100644
--- a/pkgs/applications/networking/localsend/default.nix
+++ b/pkgs/applications/networking/localsend/default.nix
@@ -13,7 +13,7 @@ let
   pname = "localsend";
   version = "1.14.0";
 
-  linux = flutter313.buildFlutterApplication {
+  linux = flutter313.buildFlutterApplication rec {
     inherit pname version;
 
     src = fetchFromGitHub {
@@ -23,7 +23,7 @@ let
       hash = "sha256-CO0uFcZnOfE31EZxRUpgtod3+1lyXPpbytHB45DEM98=";
     };
 
-    sourceRoot = "source/app";
+    sourceRoot = "${src.name}/app";
 
     pubspecLock = lib.importJSON ./pubspec.lock.json;
 
@@ -59,7 +59,7 @@ let
 
     passthru.updateScript = ./update.sh;
 
-    meta = meta // {
+    meta = metaCommon // {
       mainProgram = "localsend_app";
     };
   };
@@ -81,13 +81,13 @@ let
       cp -r *.app $out/Applications
     '';
 
-    meta = meta // {
+    meta = metaCommon // {
       sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
       platforms = [ "x86_64-darwin" "aarch64-darwin" ];
     };
   };
 
-  meta = with lib; {
+  metaCommon = with lib; {
     description = "An open source cross-platform alternative to AirDrop";
     homepage = "https://localsend.org/";
     license = licenses.mit;
diff --git a/pkgs/applications/science/chemistry/autodock-vina/default.nix b/pkgs/applications/science/chemistry/autodock-vina/default.nix
index 499bedb929ff0..d56b8a02a20d0 100644
--- a/pkgs/applications/science/chemistry/autodock-vina/default.nix
+++ b/pkgs/applications/science/chemistry/autodock-vina/default.nix
@@ -20,10 +20,10 @@ stdenv.mkDerivation (finalAttrs: {
     hash = "sha256-yguUMEX0tn75wKrPKyqlCYbBFaEwC5b1s3k9xept1Fw=";
   };
 
-  sourceRoot =
-    if stdenv.isDarwin
-    then "source/build/mac/release"
-    else "source/build/linux/release";
+  sourceRoot = "${finalAttrs.src.name}/build/${
+    if stdenv.hostPlatform.isDarwin then "mac"
+    else "linux"
+  }/release";
 
   buildInputs = [
     boost'
diff --git a/pkgs/applications/science/misc/openrefine/default.nix b/pkgs/applications/science/misc/openrefine/default.nix
index 2ad67027ade4c..9f2ef0f29b31f 100644
--- a/pkgs/applications/science/misc/openrefine/default.nix
+++ b/pkgs/applications/science/misc/openrefine/default.nix
@@ -27,7 +27,7 @@ let
     inherit src version;
 
     pname = "openrefine-npm";
-    sourceRoot = "source/main/webapp";
+    sourceRoot = "${src.name}/main/webapp";
 
     npmDepsHash = "sha256-8GhcL4tohQ5u2HeYN6JyTMMobUOqAL8ETCLiP1SoDSk=";
 
diff --git a/pkgs/applications/video/anilibria-winmaclinux/default.nix b/pkgs/applications/video/anilibria-winmaclinux/default.nix
index ee6c34965200b..32872e98bebf7 100644
--- a/pkgs/applications/video/anilibria-winmaclinux/default.nix
+++ b/pkgs/applications/video/anilibria-winmaclinux/default.nix
@@ -25,7 +25,7 @@ mkDerivation rec {
     sha256 = "sha256-G4KlYAjOT1UV29vcX7Q8dMTj0BX0rsJcLtK2MQag5nU=";
   };
 
-  sourceRoot = "source/src";
+  sourceRoot = "${src.name}/src";
 
   qmakeFlags = [ "PREFIX=${placeholder "out"}" "CONFIG+=unixvlc" ];