From 255fd98d68432909dd5ca97f062762956342a6ad Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Sat, 25 May 2024 11:04:13 -0400 Subject: [PATCH] libfakeXinerama: refactor build/installPhase, fix cross compilation --- pkgs/tools/X11/xpra/libfakeXinerama.nix | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/pkgs/tools/X11/xpra/libfakeXinerama.nix b/pkgs/tools/X11/xpra/libfakeXinerama.nix index ca665259c8f3..5d899cb06b2e 100644 --- a/pkgs/tools/X11/xpra/libfakeXinerama.nix +++ b/pkgs/tools/X11/xpra/libfakeXinerama.nix @@ -12,15 +12,22 @@ stdenv.mkDerivation rec { buildInputs = [ libX11 libXinerama ]; 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 = '' - mkdir -p $out/lib - cp libfakeXinerama.so.1.0 $out/lib - ln -s libfakeXinerama.so.1.0 $out/lib/libXinerama.so.1.0 - ln -s libXinerama.so.1.0 $out/lib/libXinerama.so.1 - ln -s libXinerama.so.1 $out/lib/libXinerama.so + runHook preInstall + + install -Dm555 libfakeXinerama.so.1.0 -t "$out/lib" + ln -s libfakeXinerama.so.1.0 "$out/lib/libXinerama.so.1.0" + 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; {