bemenu: add darwin platform (#397591)

authored by Thiago Kenji Okada and committed by GitHub 6cddb753 60d1922d

+23 -7
+23 -7
pkgs/by-name/be/bemenu/package.nix
··· 9 9 harfbuzz, 10 10 pkg-config, 11 11 scdoc, 12 + makeWrapper, 12 13 ncursesSupport ? true, 13 14 ncurses, 14 - waylandSupport ? true, 15 + waylandSupport ? stdenv.hostPlatform.isLinux, 15 16 wayland, 16 17 wayland-protocols, 17 18 wayland-scanner, 18 - x11Support ? true, 19 + x11Support ? stdenv.hostPlatform.isLinux, 19 20 xorg, 20 21 }: 21 22 ··· 30 31 hash = "sha256-0vpqJ2jydTt6aVni0ma0g+80PFz+C4xJ5M77sMODkSg="; 31 32 }; 32 33 34 + postPatch = lib.optionalString stdenv.hostPlatform.isDarwin '' 35 + substituteInPlace GNUmakefile --replace '-soname' '-install_name' 36 + ''; 37 + 33 38 strictDeps = true; 34 - nativeBuildInputs = [ 35 - pkg-config 36 - scdoc 37 - ] ++ lib.optionals waylandSupport [ wayland-scanner ]; 39 + nativeBuildInputs = 40 + [ 41 + pkg-config 42 + scdoc 43 + ] 44 + ++ lib.optional stdenv.hostPlatform.isDarwin makeWrapper 45 + ++ lib.optional waylandSupport wayland-scanner; 38 46 39 47 buildInputs = 40 48 [ ··· 66 74 ++ lib.optional waylandSupport "wayland" 67 75 ++ lib.optional x11Support "x11"; 68 76 77 + postInstall = lib.optionalString stdenv.hostPlatform.isDarwin '' 78 + so="$(find "$out/lib" -name "libbemenu.so.[0-9]" -print -quit)" 79 + for f in "$out/bin/"*; do 80 + install_name_tool -change "$(basename $so)" "$so" $f 81 + wrapProgram $f --set BEMENU_BACKEND curses 82 + done 83 + ''; 84 + 69 85 meta = with lib; { 70 86 homepage = "https://github.com/Cloudef/bemenu"; 71 87 description = "Dynamic menu library and client program inspired by dmenu"; 72 88 license = licenses.gpl3Plus; 73 89 maintainers = with maintainers; [ crertel ]; 74 90 mainProgram = "bemenu"; 75 - platforms = with platforms; linux; 91 + platforms = with platforms; linux ++ darwin; 76 92 }; 77 93 })