libqglviewer: fix #348484

remove use of absolute path on darwin
This commit is contained in:
Guilhem Saurel 2024-10-14 14:40:17 +02:00
parent 4dcb3055bc
commit 280c2bf8b6
2 changed files with 15 additions and 7 deletions

View File

@ -1,4 +1,4 @@
{ lib, stdenv, fetchFromGitHub, qmake, qtbase, libGLU, AGL }:
{ lib, stdenv, fetchFromGitHub, qmake, qtbase, libGLU }:
stdenv.mkDerivation (finalAttrs: {
pname = "libqglviewer";
@ -12,12 +12,22 @@ stdenv.mkDerivation (finalAttrs: {
};
nativeBuildInputs = [ qmake ];
buildInputs = [ qtbase libGLU ]
++ lib.optional stdenv.hostPlatform.isDarwin AGL;
buildInputs = [ qtbase libGLU ];
dontWrapQtApps = true;
postPatch = ''
# Fix build on darwin, and install dylib instead of framework
postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
substituteInPlace QGLViewer/QGLViewer.pro \
--replace-fail \
"LIB_DIR_ = /Library/Frameworks" \
"LIB_DIR_ = \$\$""{PREFIX_}/lib" \
--replace-fail \
"!staticlib: CONFIG *= lib_bundle" \
""
'';
preConfigure = ''
cd QGLViewer
'';

View File

@ -164,9 +164,7 @@ in (noExtraAttrs (kdeFrameworks // plasmaMobileGear // plasma5 // plasma5.thirdP
inherit (pkgs.darwin.apple_sdk.frameworks) Accelerate AGL Cocoa Foundation;
};
libqglviewer = callPackage ../development/libraries/libqglviewer {
inherit (pkgs.darwin.apple_sdk.frameworks) AGL;
};
libqglviewer = callPackage ../development/libraries/libqglviewer { };
libqofono = callPackage ../development/libraries/libqofono { };