diff options
author | Yueh-Shun Li <shamrocklee@posteo.net> | 2024-03-09 01:04:40 +0800 |
---|---|---|
committer | Yueh-Shun Li <shamrocklee@posteo.net> | 2024-03-09 07:53:25 +0800 |
commit | 91b3db13093b1aecdba07041eb44b7103c235d94 (patch) | |
tree | ee602af3a19fea3d77135eaf8c1818f2ec261706 /pkgs/applications/science/chemistry | |
parent | 89d56ddd5bf9d731f6d723aa4b4f374ecc4b80e4 (diff) | |
download | nixlib-91b3db13093b1aecdba07041eb44b7103c235d94.tar nixlib-91b3db13093b1aecdba07041eb44b7103c235d94.tar.gz nixlib-91b3db13093b1aecdba07041eb44b7103c235d94.tar.bz2 nixlib-91b3db13093b1aecdba07041eb44b7103c235d94.tar.lz nixlib-91b3db13093b1aecdba07041eb44b7103c235d94.tar.xz nixlib-91b3db13093b1aecdba07041eb44b7103c235d94.tar.zst nixlib-91b3db13093b1aecdba07041eb44b7103c235d94.zip |
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/science/chemistry')
-rw-r--r-- | pkgs/applications/science/chemistry/autodock-vina/default.nix | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/pkgs/applications/science/chemistry/autodock-vina/default.nix b/pkgs/applications/science/chemistry/autodock-vina/default.nix index 499bedb929ff..d56b8a02a20d 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' |