libfakeXinerama: refactor build/installPhase, fix cross compilation

This commit is contained in:
Nick Cao 2024-05-25 11:04:13 -04:00
parent e47684628d
commit 255fd98d68
No known key found for this signature in database

View File

@ -12,15 +12,22 @@ stdenv.mkDerivation rec {
buildInputs = [ libX11 libXinerama ]; buildInputs = [ libX11 libXinerama ];
buildPhase = '' buildPhase = ''
gcc -O2 -Wall fakeXinerama.c -fPIC -o libfakeXinerama.so.1.0 -shared runHook preBuild
$CC -O2 -Wall fakeXinerama.c -fPIC -o libfakeXinerama.so.1.0 -shared
runHook postBuild
''; '';
installPhase = '' installPhase = ''
mkdir -p $out/lib runHook preInstall
cp libfakeXinerama.so.1.0 $out/lib
ln -s libfakeXinerama.so.1.0 $out/lib/libXinerama.so.1.0 install -Dm555 libfakeXinerama.so.1.0 -t "$out/lib"
ln -s libXinerama.so.1.0 $out/lib/libXinerama.so.1 ln -s libfakeXinerama.so.1.0 "$out/lib/libXinerama.so.1.0"
ln -s libXinerama.so.1 $out/lib/libXinerama.so ln -s libXinerama.so.1.0 "$out/lib/libXinerama.so.1"
ln -s libXinerama.so.1 "$out/lib/libXinerama.so"
runHook postInstall
''; '';
meta = with lib; { meta = with lib; {