lvm2: don't use targetPlatform

targetPlatform is the platform the current package's programs will
produce binaries for — only relevant for compilers and
similar. hostPlatform is the platform the current package's programs
will run on.

The incorrect use of targetPlatform meant that anything that tried to
link to it (like cryptsetup) would fail to build when it was used as a
native build input for a cross-compiled Musl derivation.

Fixes: 2cc29125a7 ("lvm2: package 2.02.x for musl")
This commit is contained in:
Alyssa Ross 2022-03-29 10:27:31 +00:00
parent e7da834115
commit 05a6c124e6
2 changed files with 6 additions and 6 deletions

View file

@ -9,8 +9,8 @@
, libaio
, enableCmdlib ? false
, enableDmeventd ? false
, udevSupport ? !stdenv.targetPlatform.isStatic, udev ? null
, onlyLib ? stdenv.targetPlatform.isStatic
, udevSupport ? !stdenv.hostPlatform.isStatic, udev ? null
, onlyLib ? stdenv.hostPlatform.isStatic
, nixosTests
}:
@ -56,7 +56,7 @@ stdenv.mkDerivation rec {
] ++ lib.optionals udevSupport [
"--enable-udev_rules"
"--enable-udev_sync"
] ++ lib.optionals stdenv.targetPlatform.isStatic [
] ++ lib.optionals stdenv.hostPlatform.isStatic [
"--enable-static_link"
];
@ -91,7 +91,7 @@ stdenv.mkDerivation rec {
url = "https://git.alpinelinux.org/aports/plain/main/lvm2/mallinfo.patch?h=3.7-stable&id=31bd4a8c2dc00ae79a821f6fe0ad2f23e1534f50";
sha256 = "0g6wlqi215i5s30bnbkn8w7axrs27y3bnygbpbnf64wwx7rxxlj0";
})
] ++ lib.optionals stdenv.targetPlatform.isStatic [
] ++ lib.optionals stdenv.hostPlatform.isStatic [
./no-shared.diff
];
@ -114,7 +114,7 @@ stdenv.mkDerivation rec {
];
installPhase = lib.optionalString onlyLib ''
install -D -t $out/lib libdm/ioctl/libdevmapper.${if stdenv.targetPlatform.isStatic then "a" else "so"}
install -D -t $out/lib libdm/ioctl/libdevmapper.${if stdenv.hostPlatform.isStatic then "a" else "so"}
make -C libdm install_include
make -C libdm install_pkgconfig
'';

View file

@ -22984,7 +22984,7 @@ with pkgs;
lvm2-2_02 = callPackage ../os-specific/linux/lvm2/2_02.nix {
udev = systemdMinimal;
};
lvm2 = if stdenv.targetPlatform.isMusl then lvm2-2_02 else lvm2-2_03;
lvm2 = if stdenv.hostPlatform.isMusl then lvm2-2_02 else lvm2-2_03;
lvm2_dmeventd = lvm2.override {
enableDmeventd = true;