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