diff options
author | Zeyi Fan <zeyi@fb.com> | 2021-01-06 20:48:25 -0800 |
---|---|---|
committer | Zeyi Fan <zeyi@fb.com> | 2021-01-06 20:48:30 -0800 |
commit | b9f0b2885b1986b12a1fe1e527b12d5c58e936dd (patch) | |
tree | cac885fea9e7a01c76f44469853a746ee202d4ba /pkgs/applications/terminal-emulators | |
parent | ab64e82e32626f6c8d484a123428f8d5f7e65fee (diff) |
wezterm: build as macOS app
Diffstat (limited to 'pkgs/applications/terminal-emulators')
-rw-r--r-- | pkgs/applications/terminal-emulators/wezterm/default.nix | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/pkgs/applications/terminal-emulators/wezterm/default.nix b/pkgs/applications/terminal-emulators/wezterm/default.nix index 8f0c6777e375..a30afa1ce68a 100644 --- a/pkgs/applications/terminal-emulators/wezterm/default.nix +++ b/pkgs/applications/terminal-emulators/wezterm/default.nix @@ -30,12 +30,11 @@ , zlib }: let - commonRuntimeDeps = [ + runtimeDeps = [ zlib fontconfig freetype - ]; - linuxRuntimeDeps = [ + ] ++ stdenv.lib.optionals (stdenv.isLinux) [ libX11 xcbutil libxcb @@ -48,10 +47,11 @@ let wayland libGLU libGL + ] ++ stdenv.lib.optionals (stdenv.isDarwin) [ + Foundation + CoreGraphics + Cocoa ]; - runtimeDeps = commonRuntimeDeps - ++ stdenv.lib.optionals (!stdenv.isDarwin) linuxRuntimeDeps - ++ stdenv.lib.optionals (stdenv.isDarwin) [ Foundation CoreGraphics Cocoa ]; pname = "wezterm"; in @@ -78,12 +78,21 @@ rustPlatform.buildRustPackage { buildInputs = runtimeDeps; installPhase = '' - for artifact in wezterm wezterm-gui wezterm-mux-server strip-ansi-escapes; do '' + stdenv.lib.optionalString stdenv.isLinux '' + for artifact in wezterm wezterm-gui wezterm-mux-server strip-ansi-escapes; do patchelf --set-rpath "${lib.makeLibraryPath runtimeDeps}" $releaseDir/$artifact - '' + '' install -D $releaseDir/$artifact -t $out/bin done + '' + stdenv.lib.optionalString stdenv.isDarwin '' + mkdir -p "$out/Applications" + OUT_APP="$out/Applications/WezTerm.app" + cp -r assets/macos/WezTerm.app "$OUT_APP" + rm $OUT_APP/*.dylib + cp -r assets/shell-integration/* "$OUT_APP" + cp $releaseDir/wezterm "$OUT_APP" + cp $releaseDir/wezterm-mux-server "$OUT_APP" + cp $releaseDir/wezterm-gui "$OUT_APP" + cp $releaseDir/strip-ansi-escapes "$OUT_APP" ''; # prevent further changes to the RPATH |