Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

Merge pull request #186425 from OPNA2608/fix/communi-wrapping

authored by

Sandro and committed by
GitHub
e6d39fcc 45ece7b5

+35 -18
+35 -18
pkgs/applications/networking/irc/communi/default.nix
··· 1 - { fetchFromGitHub, libcommuni, qtbase, qmake, lib, stdenv, wrapQtAppsHook }: 1 + { stdenv 2 + , lib 3 + , fetchFromGitHub 4 + , libcommuni 5 + , qmake 6 + , qtbase 7 + , wrapQtAppsHook 8 + }: 2 9 3 10 stdenv.mkDerivation rec { 4 11 pname = "communi"; ··· 15 22 fetchSubmodules = true; 16 23 }; 17 24 18 - nativeBuildInputs = [ qmake ] 19 - ++ lib.optional stdenv.isDarwin wrapQtAppsHook; 25 + nativeBuildInputs = [ 26 + qmake 27 + wrapQtAppsHook 28 + ]; 20 29 21 - buildInputs = [ libcommuni qtbase ]; 30 + buildInputs = [ 31 + libcommuni 32 + qtbase 33 + ]; 22 34 23 - dontWrapQtApps = true; 35 + # libCommuni.dylib is installed in $out/Applications/Communi.app/Contents/Frameworks/ on Darwin 36 + # Wrapper hook thinks it's a binary because it's in $out/Applications, wraps it with a shell script 37 + # So we manually call the wrapper script on just the binary 38 + dontWrapQtApps = stdenv.isDarwin; 24 39 25 40 preConfigure = '' 26 41 export QMAKEFEATURES=${libcommuni}/features ··· 32 47 "COMMUNI_INSTALL_ICONS=${placeholder "out"}/share/icons/hicolor" 33 48 "COMMUNI_INSTALL_DESKTOP=${placeholder "out"}/share/applications" 34 49 "COMMUNI_INSTALL_THEMES=${placeholder "out"}/share/communi/themes" 35 - (if stdenv.isDarwin 36 - then [ "COMMUNI_INSTALL_BINS=${placeholder "out"}/Applications" ] 37 - else [ "COMMUNI_INSTALL_BINS=${placeholder "out"}/bin" ]) 50 + "COMMUNI_INSTALL_BINS=${placeholder "out"}/${if stdenv.isDarwin then "Applications" else "bin"}" 38 51 ]; 39 52 40 - postInstall = if stdenv.isDarwin then '' 41 - # Nix qmake does not add the bundle rpath by default. 42 - install_name_tool \ 43 - -add_rpath @executable_path/../Frameworks \ 44 - $out/Applications/Communi.app/Contents/MacOS/Communi 45 - '' else '' 46 - substituteInPlace "$out/share/applications/communi.desktop" \ 47 - --replace "/usr/bin" "$out/bin" 48 - ''; 53 + postInstall = 54 + if stdenv.isDarwin then '' 55 + # Nix qmake does not add the bundle rpath by default. 56 + install_name_tool \ 57 + -add_rpath @executable_path/../Frameworks \ 58 + $out/Applications/Communi.app/Contents/MacOS/Communi 59 + 60 + # Do not remove until wrapQtAppsHook doesn't wrap dylibs in app bundles anymore 61 + wrapQtApp $out/Applications/Communi.app/Contents/MacOS/Communi 62 + '' else '' 63 + substituteInPlace "$out/share/applications/communi.desktop" \ 64 + --replace "/usr/bin" "$out/bin" 65 + ''; 49 66 50 67 preFixup = '' 51 68 rm -rf lib ··· 56 73 homepage = "https://github.com/communi/communi-desktop"; 57 74 license = licenses.bsd3; 58 75 maintainers = with maintainers; [ hrdinka ]; 59 - platforms = platforms.linux; 76 + platforms = platforms.all; 60 77 }; 61 78 }