Merge pull request #122563 from stephank/fix-communi-darwin
communi: fix darwin build
This commit is contained in:
commit
55301e2cb3
@ -1,4 +1,4 @@
|
|||||||
{ fetchgit, libcommuni, qtbase, qmake, lib, stdenv }:
|
{ fetchgit, libcommuni, qtbase, qmake, lib, stdenv, wrapQtAppsHook }:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "communi";
|
pname = "communi";
|
||||||
@ -11,7 +11,8 @@ stdenv.mkDerivation rec {
|
|||||||
fetchSubmodules = true;
|
fetchSubmodules = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [ qmake ];
|
nativeBuildInputs = [ qmake ]
|
||||||
|
++ lib.optional stdenv.isDarwin wrapQtAppsHook;
|
||||||
|
|
||||||
buildInputs = [ libcommuni qtbase ];
|
buildInputs = [ libcommuni qtbase ];
|
||||||
|
|
||||||
@ -25,14 +26,23 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
qmakeFlags = [
|
qmakeFlags = [
|
||||||
"COMMUNI_INSTALL_PREFIX=${placeholder "out"}"
|
"COMMUNI_INSTALL_PREFIX=${placeholder "out"}"
|
||||||
"COMMUNI_INSTALL_BINS=${placeholder "out"}/bin"
|
|
||||||
"COMMUNI_INSTALL_PLUGINS=${placeholder "out"}/lib/communi/plugins"
|
"COMMUNI_INSTALL_PLUGINS=${placeholder "out"}/lib/communi/plugins"
|
||||||
"COMMUNI_INSTALL_ICONS=${placeholder "out"}/share/icons/hicolor"
|
"COMMUNI_INSTALL_ICONS=${placeholder "out"}/share/icons/hicolor"
|
||||||
"COMMUNI_INSTALL_DESKTOP=${placeholder "out"}/share/applications"
|
"COMMUNI_INSTALL_DESKTOP=${placeholder "out"}/share/applications"
|
||||||
"COMMUNI_INSTALL_THEMES=${placeholder "out"}/share/communi/themes"
|
"COMMUNI_INSTALL_THEMES=${placeholder "out"}/share/communi/themes"
|
||||||
|
(if stdenv.isDarwin
|
||||||
|
then [ "COMMUNI_INSTALL_BINS=${placeholder "out"}/Applications" ]
|
||||||
|
else [ "COMMUNI_INSTALL_BINS=${placeholder "out"}/bin" ])
|
||||||
];
|
];
|
||||||
|
|
||||||
postInstall = lib.optionalString stdenv.isLinux ''
|
postInstall = if stdenv.isDarwin then ''
|
||||||
|
# Nix qmake does not add the bundle rpath by default.
|
||||||
|
install_name_tool \
|
||||||
|
-add_rpath @executable_path/../Frameworks \
|
||||||
|
$out/Applications/Communi.app/Contents/MacOS/Communi
|
||||||
|
|
||||||
|
wrapQtApp $out/Applications/Communi.app/Contents/MacOS/Communi
|
||||||
|
'' else ''
|
||||||
substituteInPlace "$out/share/applications/communi.desktop" \
|
substituteInPlace "$out/share/applications/communi.desktop" \
|
||||||
--replace "/usr/bin" "$out/bin"
|
--replace "/usr/bin" "$out/bin"
|
||||||
'';
|
'';
|
||||||
|
@ -19,7 +19,9 @@ stdenv.mkDerivation rec {
|
|||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
dontUseQmakeConfigure = true;
|
dontUseQmakeConfigure = true;
|
||||||
configureFlags = [ "-config" "release" ];
|
configureFlags = [ "-config" "release" ]
|
||||||
|
# Build mixes up dylibs/frameworks if one is not explicitely specified.
|
||||||
|
++ lib.optionals stdenv.isDarwin [ "-config" "qt_framework" ];
|
||||||
|
|
||||||
dontWrapQtApps = true;
|
dontWrapQtApps = true;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user