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 }: 2 3 stdenv.mkDerivation rec { 4 pname = "communi"; ··· 15 fetchSubmodules = true; 16 }; 17 18 - nativeBuildInputs = [ qmake ] 19 - ++ lib.optional stdenv.isDarwin wrapQtAppsHook; 20 21 - buildInputs = [ libcommuni qtbase ]; 22 23 - dontWrapQtApps = true; 24 25 preConfigure = '' 26 export QMAKEFEATURES=${libcommuni}/features ··· 32 "COMMUNI_INSTALL_ICONS=${placeholder "out"}/share/icons/hicolor" 33 "COMMUNI_INSTALL_DESKTOP=${placeholder "out"}/share/applications" 34 "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" ]) 38 ]; 39 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 - ''; 49 50 preFixup = '' 51 rm -rf lib ··· 56 homepage = "https://github.com/communi/communi-desktop"; 57 license = licenses.bsd3; 58 maintainers = with maintainers; [ hrdinka ]; 59 - platforms = platforms.linux; 60 }; 61 }
··· 1 + { stdenv 2 + , lib 3 + , fetchFromGitHub 4 + , libcommuni 5 + , qmake 6 + , qtbase 7 + , wrapQtAppsHook 8 + }: 9 10 stdenv.mkDerivation rec { 11 pname = "communi"; ··· 22 fetchSubmodules = true; 23 }; 24 25 + nativeBuildInputs = [ 26 + qmake 27 + wrapQtAppsHook 28 + ]; 29 30 + buildInputs = [ 31 + libcommuni 32 + qtbase 33 + ]; 34 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; 39 40 preConfigure = '' 41 export QMAKEFEATURES=${libcommuni}/features ··· 47 "COMMUNI_INSTALL_ICONS=${placeholder "out"}/share/icons/hicolor" 48 "COMMUNI_INSTALL_DESKTOP=${placeholder "out"}/share/applications" 49 "COMMUNI_INSTALL_THEMES=${placeholder "out"}/share/communi/themes" 50 + "COMMUNI_INSTALL_BINS=${placeholder "out"}/${if stdenv.isDarwin then "Applications" else "bin"}" 51 ]; 52 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 + ''; 66 67 preFixup = '' 68 rm -rf lib ··· 73 homepage = "https://github.com/communi/communi-desktop"; 74 license = licenses.bsd3; 75 maintainers = with maintainers; [ hrdinka ]; 76 + platforms = platforms.all; 77 }; 78 }