diff options
author | Mario Rodas <marsam@users.noreply.github.com> | 2023-11-17 04:20:00 +0000 |
---|---|---|
committer | Jörg Thalheim <Mic92@users.noreply.github.com> | 2023-11-18 15:41:30 +0100 |
commit | 87c6a971de5f190405c62946fd3cef768ca518f2 (patch) | |
tree | 7ae8dc6e21e9a1c91a5f54aee796a69401be7b0b /pkgs | |
parent | f81ef747b110bdd6e9074c7270fc7ea76edc33b1 (diff) | |
download | nixpkgs-87c6a971de5f190405c62946fd3cef768ca518f2.tar nixpkgs-87c6a971de5f190405c62946fd3cef768ca518f2.tar.gz nixpkgs-87c6a971de5f190405c62946fd3cef768ca518f2.tar.bz2 nixpkgs-87c6a971de5f190405c62946fd3cef768ca518f2.tar.lz nixpkgs-87c6a971de5f190405c62946fd3cef768ca518f2.tar.xz nixpkgs-87c6a971de5f190405c62946fd3cef768ca518f2.tar.zst nixpkgs-87c6a971de5f190405c62946fd3cef768ca518f2.zip |
rio: fix build on darwin
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/applications/terminal-emulators/rio/default.nix | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/pkgs/applications/terminal-emulators/rio/default.nix b/pkgs/applications/terminal-emulators/rio/default.nix index afd3205343e..950d2f8f401 100644 --- a/pkgs/applications/terminal-emulators/rio/default.nix +++ b/pkgs/applications/terminal-emulators/rio/default.nix @@ -1,4 +1,6 @@ { lib +, stdenv +, darwin , fetchFromGitHub , rustPlatform , nixosTests @@ -14,18 +16,21 @@ , vulkan-loader , libxkbcommon -, withX11 ? true +, withX11 ? !stdenv.isDarwin , libX11 , libXcursor , libXi , libXrandr , libxcb -, withWayland ? true +, withWayland ? !stdenv.isDarwin , wayland }: let - rlinkLibs = [ + rlinkLibs = if stdenv.isDarwin then [ + darwin.libobjc + darwin.apple_sdk.frameworks.AppKit + ] else [ (lib.getLib gcc-unwrapped) fontconfig libGL @@ -55,9 +60,10 @@ rustPlatform.buildRustPackage rec { cargoHash = "sha256-XD+/DaaJEJ9jHZITTUma/wfsbduPUTc/SralPOx46Yo="; nativeBuildInputs = [ - autoPatchelfHook ncurses + ] ++ lib.optionals stdenv.isLinux [ pkg-config + autoPatchelfHook ]; runtimeDependencies = rlinkLibs; @@ -67,10 +73,9 @@ rustPlatform.buildRustPackage rec { outputs = [ "out" "terminfo" ]; buildNoDefaultFeatures = true; - buildFeatures = [ - (lib.optionalString withX11 "x11") - (lib.optionalString withWayland "wayland") - ]; + buildFeatures = [ ] + ++ lib.optional withX11 "x11" + ++ lib.optional withWayland "wayland"; checkFlags = [ # Fail to run in sandbox environment. @@ -86,6 +91,11 @@ rustPlatform.buildRustPackage rec { tic -xe rio,rio-direct -o "$terminfo/share/terminfo" misc/rio.terminfo mkdir -p $out/nix-support echo "$terminfo" >> $out/nix-support/propagated-user-env-packages + '' + lib.optionalString stdenv.isDarwin '' + mkdir $out/Applications/ + mv misc/osx/Rio.app/ $out/Applications/ + mkdir $out/Applications/Rio.app/Contents/MacOS/ + ln -s $out/bin/rio $out/Applications/Rio.app/Contents/MacOS/ ''; passthru = { |