Skip to content

Commit 5757120

Browse files
authored
libqglviewer: fix on darwin + add to qt6Packages (NixOS#348549)
2 parents 10d412d + 280c2bf commit 5757120

File tree

3 files changed

+28
-16
lines changed

3 files changed

+28
-16
lines changed
Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,40 @@
1-
{ lib, stdenv, fetchurl, qmake, qtbase, libGLU, AGL }:
1+
{ lib, stdenv, fetchFromGitHub, qmake, qtbase, libGLU }:
22

3-
stdenv.mkDerivation rec {
3+
stdenv.mkDerivation (finalAttrs: {
44
pname = "libqglviewer";
55
version = "2.9.1";
66

7-
src = fetchurl {
8-
url = "http://www.libqglviewer.com/src/libQGLViewer-${version}.tar.gz";
9-
sha256 = "sha256-J4+DKgstPvvg1pUhGd+8YFh5C3oPGHaQmDfLZzzkP/M=";
7+
src = fetchFromGitHub {
8+
owner = "GillesDebunne";
9+
repo = "libQGLViewer";
10+
tag = "v${finalAttrs.version}";
11+
hash = "sha256-T8KAcw3cXbp0FZm53OjlQBnUvLRFdoj80dIQzQY0/yw=";
1012
};
1113

1214
nativeBuildInputs = [ qmake ];
13-
buildInputs = [ qtbase libGLU ]
14-
++ lib.optional stdenv.hostPlatform.isDarwin AGL;
15+
buildInputs = [ qtbase libGLU ];
1516

1617
dontWrapQtApps = true;
1718

18-
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 = ''
1931
cd QGLViewer
2032
'';
2133

22-
meta = with lib; {
34+
meta = {
2335
description = "C++ library based on Qt that eases the creation of OpenGL 3D viewers";
24-
homepage = "http://libqglviewer.com";
25-
license = licenses.gpl2;
26-
platforms = platforms.all;
36+
homepage = "https://github.com/GillesDebunne/libQGLViewer";
37+
license = lib.licenses.gpl2;
38+
platforms = lib.platforms.all;
2739
};
28-
}
40+
})

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

pkgs/top-level/qt6-packages.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ makeScopeWithSplicing' {
5656
kquickimageedit = callPackage ../development/libraries/kquickimageedit { };
5757
libqaccessibilityclient = callPackage ../development/libraries/libqaccessibilityclient { };
5858

59+
libqglviewer = callPackage ../development/libraries/libqglviewer { };
60+
5961
libqtpas = callPackage ../development/compilers/fpc/libqtpas.nix { };
6062

6163
libquotient = callPackage ../development/libraries/libquotient { };

0 commit comments

Comments
 (0)