aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQyriad <qyriad@qyriad.me>2024-05-29 20:11:12 -0600
committerjade <lix@jade.fyi>2024-05-30 04:21:57 +0000
commit2760818f062b6810da6766639c543aeb1db45522 (patch)
tree42511e13071efc2b891d631d4b8aba8852283562
parenteac3546d502522816833d90ac5f8854259d5adff (diff)
package: fix derivation correctness when static
Change-Id: I394bb72d9f378cd78acc6cf67a9bb15e342d57c4
-rw-r--r--package.nix12
1 files changed, 9 insertions, 3 deletions
diff --git a/package.nix b/package.nix
index 22cf11cd9..cc5902a91 100644
--- a/package.nix
+++ b/package.nix
@@ -201,7 +201,7 @@ stdenv.mkDerivation (finalAttrs: {
# so we must explicitly enable or disable features that we are not passing
# dependencies for.
(lib.mesonEnable "internal-api-docs" internalApiDocs)
- (lib.mesonBool "enable-tests" finalAttrs.doCheck)
+ (lib.mesonBool "enable-tests" finalAttrs.finalPackage.doCheck)
(lib.mesonBool "enable-docs" canRunInstalled)
]
++ lib.optional (hostPlatform != buildPlatform) "--cross-file=${mesonCrossFile}";
@@ -286,7 +286,7 @@ stdenv.mkDerivation (finalAttrs: {
cp -pd ${boost}/lib/{libboost_context*,libboost_thread*,libboost_system*} $out/lib
rm -f $out/lib/*.a
''
- + lib.optionalString (!finalAttrs.dontBuild && hostPlatform.isLinux) ''
+ + lib.optionalString (!finalAttrs.dontBuild && hostPlatform.isLinux && !hostPlatform.isStatic) ''
chmod u+w $out/lib/*.so.*
patchelf --set-rpath $out/lib:${stdenv.cc.cc.lib}/lib $out/lib/libboost_thread.so.*
''
@@ -417,11 +417,17 @@ stdenv.mkDerivation (finalAttrs: {
name = "lix-shell-env";
- inputsFrom = [ finalAttrs ];
+ # finalPackage is necessary to propagate stuff that is set by mkDerivation itself,
+ # like doCheck.
+ inputsFrom = [ finalAttrs.finalPackage ];
# For Meson to find Boost.
env = finalAttrs.env;
+ # I guess this is necessary because mesonFlags to mkDerivation doesn't propagate in inputsFrom,
+ # which only propagates stuff set in hooks? idk.
+ inherit (finalAttrs) mesonFlags;
+
packages =
lib.optional (stdenv.cc.isClang && hostPlatform == buildPlatform) clang-tools_llvm
++ [