Skip to content

Commit 280c2bf

Browse files
committed
libqglviewer: fix NixOS#348484
remove use of absolute path on darwin
1 parent 4dcb305 commit 280c2bf

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

pkgs/development/libraries/libqglviewer/default.nix

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{ lib, stdenv, fetchFromGitHub, qmake, qtbase, libGLU, AGL }:
1+
{ lib, stdenv, fetchFromGitHub, qmake, qtbase, libGLU }:
22

33
stdenv.mkDerivation (finalAttrs: {
44
pname = "libqglviewer";
@@ -12,12 +12,22 @@ stdenv.mkDerivation (finalAttrs: {
1212
};
1313

1414
nativeBuildInputs = [ qmake ];
15-
buildInputs = [ qtbase libGLU ]
16-
++ lib.optional stdenv.hostPlatform.isDarwin AGL;
15+
buildInputs = [ qtbase libGLU ];
1716

1817
dontWrapQtApps = true;
1918

20-
postPatch = ''
19+
# Fix build on darwin, and install dylib instead of framework
20+
postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
21+
substituteInPlace QGLViewer/QGLViewer.pro \
22+
--replace-fail \
23+
"LIB_DIR_ = /Library/Frameworks" \
24+
"LIB_DIR_ = \$\$""{PREFIX_}/lib" \
25+
--replace-fail \
26+
"!staticlib: CONFIG *= lib_bundle" \
27+
""
28+
'';
29+
30+
preConfigure = ''
2131
cd QGLViewer
2232
'';
2333

pkgs/top-level/qt5-packages.nix

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,7 @@ in (noExtraAttrs (kdeFrameworks // plasmaMobileGear // plasma5 // plasma5.thirdP
164164
inherit (pkgs.darwin.apple_sdk.frameworks) Accelerate AGL Cocoa Foundation;
165165
};
166166

167-
libqglviewer = callPackage ../development/libraries/libqglviewer {
168-
inherit (pkgs.darwin.apple_sdk.frameworks) AGL;
169-
};
167+
libqglviewer = callPackage ../development/libraries/libqglviewer { };
170168

171169
libqofono = callPackage ../development/libraries/libqofono { };
172170

0 commit comments

Comments
 (0)