Unverified Commit 5757120e authored by Gaétan Lepage's avatar Gaétan Lepage Committed by GitHub
Browse files

libqglviewer: fix on darwin + add to qt6Packages (#348549)

parents 10d412d6 280c2bf8
Loading
Loading
Loading
Loading
+25 −13
Original line number Diff line number Diff line
{ lib, stdenv, fetchurl, qmake, qtbase, libGLU, AGL }:
{ lib, stdenv, fetchFromGitHub, qmake, qtbase, libGLU }:

stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
  pname = "libqglviewer";
  version = "2.9.1";

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

  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
  '';

  meta = with lib; {
  meta = {
    description = "C++ library based on Qt that eases the creation of OpenGL 3D viewers";
    homepage = "http://libqglviewer.com";
    license = licenses.gpl2;
    platforms = platforms.all;
    homepage = "https://github.com/GillesDebunne/libQGLViewer";
    license = lib.licenses.gpl2;
    platforms = lib.platforms.all;
  };
}
})
+1 −3
Original line number Diff line number Diff line
@@ -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 { };

+2 −0
Original line number Diff line number Diff line
@@ -56,6 +56,8 @@ makeScopeWithSplicing' {
  kquickimageedit = callPackage ../development/libraries/kquickimageedit { };
  libqaccessibilityclient = callPackage ../development/libraries/libqaccessibilityclient { };

  libqglviewer = callPackage ../development/libraries/libqglviewer { };

  libqtpas = callPackage ../development/compilers/fpc/libqtpas.nix { };

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