From 734323872a7271625e4948d9732f8ad0d59e9332 Mon Sep 17 00:00:00 2001 From: Peter Hoeg Date: Mon, 19 Mar 2018 09:03:18 +0800 Subject: [PATCH] qscintilla: fix build on darwin --- .../libraries/qscintilla/default.nix | 36 +++++++++---------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/pkgs/development/libraries/qscintilla/default.nix b/pkgs/development/libraries/qscintilla/default.nix index f5c5a667418..d6bd90fa47d 100644 --- a/pkgs/development/libraries/qscintilla/default.nix +++ b/pkgs/development/libraries/qscintilla/default.nix @@ -1,6 +1,6 @@ -{ stdenv, fetchurl, unzip +{ stdenv, lib, fetchurl, unzip , qt4 ? null, qmake4Hook ? null -, withQt5 ? false, qtbase ? null, qmake ? null +, withQt5 ? false, qtbase ? null, qtmacextras ? null, qmake ? null }: stdenv.mkDerivation rec { @@ -14,29 +14,25 @@ stdenv.mkDerivation rec { sha256 = "04678skipydx68zf52vznsfmll2v9aahr66g50lcqbr6xsmgr1yi"; }; - buildInputs = if withQt5 then [ qtbase ] else [ qt4 ]; - nativeBuildInputs = [ unzip ] ++ (if withQt5 then [ qmake ] else [ qmake4Hook ]); + buildInputs = [ (if withQt5 then qtbase else qt4) ] + ++ lib.optional (withQt5 && stdenv.isDarwin) qtmacextras; + nativeBuildInputs = [ unzip ] + ++ (if withQt5 then [ qmake ] else [ qmake4Hook ]); enableParallelBuilding = true; preConfigure = '' cd Qt4Qt5 - ${if withQt5 - then '' - sed -i -e "s,\$\$\\[QT_INSTALL_LIBS\\],$out/lib," \ - -e "s,\$\$\\[QT_INSTALL_HEADERS\\],$out/include/," \ - -e "s,\$\$\\[QT_INSTALL_TRANSLATIONS\\],$out/translations," \ - -e "s,\$\$\\[QT_HOST_DATA\\]/mkspecs,$out/mkspecs," \ - -e "s,\$\$\\[QT_INSTALL_DATA\\]/mkspecs,$out/mkspecs," \ - -e "s,\$\$\\[QT_INSTALL_DATA\\],$out/share," \ - qscintilla.pro - '' - else '' - sed -i -e "s,\$\$\\[QT_INSTALL_LIBS\\],$out/lib," \ - -e "s,\$\$\\[QT_INSTALL_HEADERS\\],$out/include/," \ - -e "s,\$\$\\[QT_INSTALL_TRANSLATIONS\\],$out/share/qt/translations," \ - -e "s,\$\$\\[QT_INSTALL_DATA\\],$out/share/qt," \ - qscintilla.pro + sed -i qscintilla.pro \ + -e "s,\$\$\\[QT_INSTALL_LIBS\\],$out/lib," \ + -e "s,\$\$\\[QT_INSTALL_HEADERS\\],$out/include/," \ + -e "s,\$\$\\[QT_INSTALL_TRANSLATIONS\\],$out/translations," \ + ${if withQt5 then '' + -e "s,\$\$\\[QT_HOST_DATA\\]/mkspecs,$out/mkspecs," \ + -e "s,\$\$\\[QT_INSTALL_DATA\\]/mkspecs,$out/mkspecs," \ + -e "s,\$\$\\[QT_INSTALL_DATA\\],$out/share," + '' else '' + -e "s,\$\$\\[QT_INSTALL_DATA\\],$out/share/qt," ''} '';