pkgsStatic.lm_sensors: fix build

This commit is contained in:
Dmitry Bogatov
2023-01-01 10:28:42 -05:00
committed by Yt
parent 511f9544cc
commit 26969c3a81
@@ -24,6 +24,13 @@ stdenv.mkDerivation rec {
hash = "sha256-9lfHCcODlS7sZMjQhK0yQcCBEoGyZOChx/oM0CU37sY=";
};
# Upstream build system have knob to enable and disable building of static
# library, shared library is built unconditionally.
postPatch = lib.optionalString stdenv.hostPlatform.isStatic ''
sed -i 'lib/Module.mk' -e '/LIBTARGETS :=/,+1d; /-m 755/ d'
substituteInPlace prog/sensors/Module.mk --replace 'lib/$(LIBSHBASENAME)' ""
'';
nativeBuildInputs = [ bison flex which ];
# bash is required for correctly replacing the shebangs in all tools for cross-compilation.
buildInputs = [ bash perl ]
@@ -39,6 +46,12 @@ stdenv.mkDerivation rec {
"ETCDIR=${placeholder "out"}/etc"
];
# Making regexp to patch-out installing of .so symlinks from Makefile is
# complicated, it is easier to remove them post-install.
postInstall = lib.optionalString stdenv.hostPlatform.isStatic ''
rm $out/lib/*.so*
'';
meta = with lib; {
homepage = "https://hwmon.wiki.kernel.org/lm_sensors";
changelog = "https://raw.githubusercontent.com/lm-sensors/lm-sensors/V${dashedVersion}/CHANGES";