Merge pull request #248683 from oxij/tree/source-root-continues-3

treewide: cleanup `sourceRoot` and `setSourceRoot` usage
This commit is contained in:
Pol Dellaiera 2023-08-15 05:53:52 +02:00 committed by GitHub
commit 3eb7f7a63b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
38 changed files with 42 additions and 56 deletions

View file

@ -11,7 +11,7 @@ stdenv.mkDerivation {
nativeBuildInputs = [ autoPatchelfHook ];
setSourceRoot = "sourceRoot=$PWD";
sourceRoot = ".";
dontBuild = true;

View file

@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ cmake pkg-config copyDesktopItems ];
buildInputs = [ bluez dbus glew glfw imgui ];
sourceRoot = "./${src.name}/Client";
sourceRoot = "${src.name}/Client";
cmakeFlags = [ "-Wno-dev" ];

View file

@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
sha256 = "1qc58l3rkr37cj6vhf8c7bnwbz93nscyraz7jxqwjq6k4gj0cjw3";
};
sourceRoot = "./howl-${version}/src";
sourceRoot = "howl-${version}/src";
# The Makefile uses "/usr/local" if not explicitly overridden
installFlags = [ "PREFIX=$(out)" ];

View file

@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
buildInputs = [ libmediainfo wxGTK32 desktop-file-utils libSM imagemagick ]
++ lib.optionals stdenv.isDarwin [ Cocoa ];
sourceRoot = "./MediaInfo/Project/GNU/GUI/";
sourceRoot = "MediaInfo/Project/GNU/GUI";
enableParallelBuilding = true;

View file

@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ autoreconfHook pkg-config ];
buildInputs = [ libzen libmediainfo zlib ];
sourceRoot = "./MediaInfo/Project/GNU/CLI/";
sourceRoot = "MediaInfo/Project/GNU/CLI";
configureFlags = [ "--with-libmediainfo=${libmediainfo}" ];

View file

@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
sha256 = "1hxwxmqc5jinr14ya1idigqigc8qhy1vimzcwy2vmwdjay2sqik2";
};
setSourceRoot = "sourceRoot=`pwd`";
sourceRoot = ".";
nativeBuildInputs = [ pkg-config ];
buildInputs = [ gtk2 fftw ];

View file

@ -40,7 +40,7 @@ stdenv.mkDerivation rec {
stdenv.cc.cc.lib
];
sourceRoot = "./sratoolkit.${version}-ubuntu64/bin";
sourceRoot = "sratoolkit.${version}-ubuntu64/bin";
installPhase = ''
find -L . -executable -type f -! -name "*remote-fuser*" -exec install -m755 -D {} $out/bin/{} \;

View file

@ -56,7 +56,7 @@ stdenv.mkDerivation rec {
srcs = [ xyce_src regression_src ];
sourceRoot = "./${xyce_src.name}";
sourceRoot = xyce_src.name;
preConfigure = "./bootstrap";

View file

@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
strictDeps = true;
nativeBuildInputs = [ ocaml perl ];
setSourceRoot = "export sourceRoot=$(echo */ekrh/src/)";
setSourceRoot = "export sourceRoot=$(echo */ekrh/src)";
preInstall = "export INSTALLDIR=$out";
postInstall = ''for i in "$out/casc"/*; do ln -s "$i" "$out/bin/ekrh-casc-$(basename $i)"; done '';

View file

@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
];
setSourceRoot = ''
sourceRoot=$(echo */gui-wx/)
sourceRoot=$(echo */gui-wx)
'';
postPatch = ''

View file

@ -109,9 +109,7 @@ let
'';
# The unpack phase won't generate a directory
setSourceRoot = ''
sourceRoot=$PWD
'';
sourceRoot = ".";
installPhase = ''
runHook preInstall

View file

@ -5,10 +5,9 @@
}:
let
maple-font = { pname, sha256, desc }: stdenv.mkDerivation
rec{
inherit pname desc;
maple-font = { pname, sha256, desc }:
stdenv.mkDerivation rec{
inherit pname;
version = "6.4";
src = fetchurl {
url = "https://github.com/subframe7536/Maple-font/releases/download/v${version}/${pname}.zip";
@ -17,7 +16,7 @@ let
# Work around the "unpacker appears to have produced no directories"
# case that happens when the archive doesn't have a subdirectory.
setSourceRoot = "sourceRoot=`pwd`";
sourceRoot = ".";
nativeBuildInputs = [ unzip ];
installPhase = ''
find . -name '*.ttf' -exec install -Dt $out/share/fonts/truetype {} \;

View file

@ -51,7 +51,7 @@ stdenv.mkDerivation {
})
];
sourceRoot = "./";
sourceRoot = ".";
unpackCmd = ''
ttfName=$(basename $(stripHash $curSrc))

View file

@ -66,7 +66,7 @@ stdenv.mkDerivation {
})
];
sourceRoot = "./";
sourceRoot = ".";
unpackCmd = ''
ttfName=$(basename $(stripHash $curSrc))

View file

@ -16,9 +16,7 @@ stdenv.mkDerivation rec {
unzip
];
setSourceRoot = ''
sourceRoot=$PWD
'';
sourceRoot = ".";
installPhase = ''
runHook preInstall

View file

@ -16,9 +16,7 @@ stdenv.mkDerivation rec {
unzip
];
setSourceRoot = ''
sourceRoot=$PWD
'';
sourceRoot = ".";
installPhase = ''
runHook preInstall

View file

@ -38,7 +38,7 @@ stdenv.mkDerivation rec {
];
# go to the source directory after unpacking the sources
setSourceRoot = "export sourceRoot=rox-filer-${version}/ROX-Filer/";
sourceRoot = "rox-filer-${version}/ROX-Filer";
# account for 'setSourceRoot' offset
patchFlags = [ "-p2" ];

View file

@ -191,7 +191,7 @@ let
hash = (if artifactDirectory == null then hashes else hashes.${artifactDirectory}).${archive};
});
setSourceRoot = if overrideUnpackCmd then "sourceRoot=`pwd`" else null;
sourceRoot = if overrideUnpackCmd then "." else null;
unpackCmd = if overrideUnpackCmd then "unzip -o $src -d $out" else null;
installPhase =

View file

@ -13,7 +13,7 @@ stdenv.mkDerivation (finalAttrs: {
hash = "sha256-KSkOg0a5iq+13kClQqj+TaEP/PsLUrm8bMmiJEAZ+C4=";
};
sourceRoot = "${finalAttrs.src.name}/library/";
sourceRoot = "${finalAttrs.src.name}/library";
nativeBuildInputs = [ cmake pkg-config ];
buildInputs = [ faad2 fftwFloat zlib ];

View file

@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
};
# Work around the "unpacker appears to have produced no directories"
setSourceRoot = "sourceRoot=`pwd`";
sourceRoot = ".";
installPhase = ''
runHook preInstall

View file

@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ autoreconfHook ];
configureFlags = [ "--enable-shared" ];
sourceRoot = "./ZenLib/Project/GNU/Library/";
sourceRoot = "ZenLib/Project/GNU/Library";
preConfigure = "sh autogen.sh";

View file

@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ cmake ];
buildInputs = [ libGLU libGL libX11 libXi ];
sourceRoot = "liquidfun/Box2D/";
sourceRoot = "liquidfun/Box2D";
preConfigurePhases = "preConfigure";

View file

@ -524,9 +524,7 @@ with prev;
tar xf *.tar.gz
'';
# Without this, source root is wrongly set to ./readline-2.6/doc
setSourceRoot = ''
sourceRoot=./readline-${lib.versions.majorMinor oa.version}
'';
sourceRoot = "readline-${lib.versions.majorMinor oa.version}";
});
sqlite = prev.sqlite.overrideAttrs (drv: {

View file

@ -76,7 +76,7 @@ stdenv.mkDerivation (finalAttrs: {
autoPatchelfHook
];
setSourceRoot = "sourceRoot=`pwd`";
sourceRoot = ".";
dontUnpack = true;

View file

@ -20,7 +20,7 @@ stdenv.mkDerivation {
# Work around the "unpacker appears to have produced no directories"
# case that happens when the archive doesn't have a subdirectory.
setSourceRoot = "sourceRoot=`pwd`";
sourceRoot = ".";
nativeBuildInputs = [ unzip ];

View file

@ -14,7 +14,7 @@ stdenvNoCC.mkDerivation rec {
nativeBuildInputs = [ cabextract ];
sourceRoot = "./.";
sourceRoot = ".";
unpackCmd = ''
cabextract -F FW_ACC_00U.bin ${src}

View file

@ -20,9 +20,7 @@ stdenv.mkDerivation rec {
})
];
setSourceRoot = ''
export sourceRoot=$(pwd)/source
'';
sourceRoot = src.name;
nativeBuildInputs = kernel.moduleBuildDependencies;

View file

@ -17,9 +17,7 @@ stdenv.mkDerivation (finalAttrs: {
sha256 = "sha256-rT2Mq40fE055FemDG7PBjt+cxgIHJG9tTjtw2nW6B98=";
};
setSourceRoot = ''
export sourceRoot=$(pwd)/source/hid-xpadneo/src
'';
sourceRoot = "${finalAttrs.src.name}/hid-xpadneo/src";
nativeBuildInputs = kernel.moduleBuildDependencies;
buildInputs = [ bluez ];

View file

@ -11,7 +11,7 @@ buildPythonPackage rec {
sha256 = "sha256-/vnojWLpu/fktqPUhAdL1QTESxDwFrBVYAkyF79Fj9w=";
};
sourceRoot = "./${src.name}/synapse_antispam";
sourceRoot = "${src.name}/synapse_antispam";
buildInputs = [ matrix-synapse-unwrapped ];

View file

@ -21,7 +21,7 @@ let
dontUnpack = true;
# Work around the "unpacker appears to have produced no directories"
# case that happens when the archive doesn't have a subdirectory.
setSourceRoot = "sourceRoot=$(pwd)";
sourceRoot = ".";
nativeBuildInputs = [ unzip ];
meta = a.meta // {
platforms = elasticsearch.meta.platforms;

View file

@ -67,7 +67,7 @@ stdenv.mkDerivation rec {
dontConfigure = true;
sourceRoot = "./${src.name}/XADMaster";
sourceRoot = "${src.name}/XADMaster";
installPhase = ''
runHook preInstall

View file

@ -8,7 +8,8 @@ stdenv.mkDerivation rec {
url = "https://github.com/coqui-ai/STT/releases/download/v${version}/native_client.tflite.Linux.tar.xz";
hash = "sha256-RVYc64pLYumQoVUEFZdxfUUaBMozaqgD0h/yiMaWN90=";
};
setSourceRoot = "sourceRoot=`pwd`";
sourceRoot = ".";
nativeBuildInputs = [
autoPatchelfHook

View file

@ -11,7 +11,7 @@ stdenv.mkDerivation {
# Work around the "unpacker appears to have produced no directories"
# case that happens when the archive doesn't have a subdirectory.
setSourceRoot = "sourceRoot=`pwd`";
sourceRoot = ".";
nativeBuildInputs = [ unzip ];

View file

@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
sha256 = "sha256-CEGUXJXqXmD8uT93T9dg49Lf5vTpAzQjdnhYmbR5zTI=";
};
sourceRoot = "${src.name}/src/";
sourceRoot = "${src.name}/src";
nativeBuildInputs = [ pkg-config wrapGAppsHook ];
buildInputs = lib.optionals withUdisks [ udisks glib ]

View file

@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
enableParallelBuilding = true;
sourceRoot = "./${src.name}/src";
sourceRoot = "${src.name}/src";
installPhase = ''
install -Dm555 -t $out/bin bully

View file

@ -34,9 +34,7 @@ stdenv.mkDerivation rec {
src = srcs.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
setSourceRoot = ''
sourceRoot=$PWD
'';
sourceRoot = ".";
dontBuild = true;
dontConfigure = true;

View file

@ -15,7 +15,7 @@ in stdenv.mkDerivation rec {
inherit rev;
};
sourceRoot = "./${src.name}/platform-independent/c/cli";
sourceRoot = "${src.name}/platform-independent/c/cli";
postPatch = ''
rm build

View file

@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
popt
];
sourceRoot = "${src.name}/xmlroff/";
sourceRoot = "${src.name}/xmlroff";
enableParallelBuilding = true;