rio: fix build on darwin

authored by Mario Rodas and committed by Jörg Thalheim 87c6a971 f81ef747

+18 -8
+18 -8
pkgs/applications/terminal-emulators/rio/default.nix
··· 1 1 { lib 2 + , stdenv 3 + , darwin 2 4 , fetchFromGitHub 3 5 , rustPlatform 4 6 , nixosTests ··· 14 16 , vulkan-loader 15 17 , libxkbcommon 16 18 17 - , withX11 ? true 19 + , withX11 ? !stdenv.isDarwin 18 20 , libX11 19 21 , libXcursor 20 22 , libXi 21 23 , libXrandr 22 24 , libxcb 23 25 24 - , withWayland ? true 26 + , withWayland ? !stdenv.isDarwin 25 27 , wayland 26 28 }: 27 29 let 28 - rlinkLibs = [ 30 + rlinkLibs = if stdenv.isDarwin then [ 31 + darwin.libobjc 32 + darwin.apple_sdk.frameworks.AppKit 33 + ] else [ 29 34 (lib.getLib gcc-unwrapped) 30 35 fontconfig 31 36 libGL ··· 55 60 cargoHash = "sha256-XD+/DaaJEJ9jHZITTUma/wfsbduPUTc/SralPOx46Yo="; 56 61 57 62 nativeBuildInputs = [ 58 - autoPatchelfHook 59 63 ncurses 64 + ] ++ lib.optionals stdenv.isLinux [ 60 65 pkg-config 66 + autoPatchelfHook 61 67 ]; 62 68 63 69 runtimeDependencies = rlinkLibs; ··· 67 73 outputs = [ "out" "terminfo" ]; 68 74 69 75 buildNoDefaultFeatures = true; 70 - buildFeatures = [ 71 - (lib.optionalString withX11 "x11") 72 - (lib.optionalString withWayland "wayland") 73 - ]; 76 + buildFeatures = [ ] 77 + ++ lib.optional withX11 "x11" 78 + ++ lib.optional withWayland "wayland"; 74 79 75 80 checkFlags = [ 76 81 # Fail to run in sandbox environment. ··· 86 91 tic -xe rio,rio-direct -o "$terminfo/share/terminfo" misc/rio.terminfo 87 92 mkdir -p $out/nix-support 88 93 echo "$terminfo" >> $out/nix-support/propagated-user-env-packages 94 + '' + lib.optionalString stdenv.isDarwin '' 95 + mkdir $out/Applications/ 96 + mv misc/osx/Rio.app/ $out/Applications/ 97 + mkdir $out/Applications/Rio.app/Contents/MacOS/ 98 + ln -s $out/bin/rio $out/Applications/Rio.app/Contents/MacOS/ 89 99 ''; 90 100 91 101 passthru = {