Commit 280c2bf8 authored by Guilhem Saurel's avatar Guilhem Saurel
Browse files

libqglviewer: fix #348484

remove use of absolute path on darwin
parent 4dcb3055
Loading
Loading
Loading
Loading
+14 −4
Original line number Diff line number Diff line
{ 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
  '';

+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 { };