From 280c2bf8b6236d0790ec24c2394d643aab5b09ae Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Mon, 14 Oct 2024 14:40:17 +0200 Subject: [PATCH] libqglviewer: fix #348484 remove use of absolute path on darwin --- .../libraries/libqglviewer/default.nix | 18 ++++++++++++++---- pkgs/top-level/qt5-packages.nix | 4 +--- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/pkgs/development/libraries/libqglviewer/default.nix b/pkgs/development/libraries/libqglviewer/default.nix index 6b8457f2a60c..92446cf8a138 100644 --- a/pkgs/development/libraries/libqglviewer/default.nix +++ b/pkgs/development/libraries/libqglviewer/default.nix @@ -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 ''; diff --git a/pkgs/top-level/qt5-packages.nix b/pkgs/top-level/qt5-packages.nix index 0c80734993fb..38b63a2a9683 100644 --- a/pkgs/top-level/qt5-packages.nix +++ b/pkgs/top-level/qt5-packages.nix @@ -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 { };