wezterm: build as macOS app
This commit is contained in:
parent
ab64e82e32
commit
b9f0b2885b
@ -30,12 +30,11 @@
|
|||||||
, zlib
|
, zlib
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
commonRuntimeDeps = [
|
runtimeDeps = [
|
||||||
zlib
|
zlib
|
||||||
fontconfig
|
fontconfig
|
||||||
freetype
|
freetype
|
||||||
];
|
] ++ stdenv.lib.optionals (stdenv.isLinux) [
|
||||||
linuxRuntimeDeps = [
|
|
||||||
libX11
|
libX11
|
||||||
xcbutil
|
xcbutil
|
||||||
libxcb
|
libxcb
|
||||||
@ -48,10 +47,11 @@ let
|
|||||||
wayland
|
wayland
|
||||||
libGLU
|
libGLU
|
||||||
libGL
|
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";
|
pname = "wezterm";
|
||||||
in
|
in
|
||||||
|
|
||||||
@ -78,12 +78,21 @@ rustPlatform.buildRustPackage {
|
|||||||
buildInputs = runtimeDeps;
|
buildInputs = runtimeDeps;
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
for artifact in wezterm wezterm-gui wezterm-mux-server strip-ansi-escapes; do
|
|
||||||
'' + stdenv.lib.optionalString stdenv.isLinux ''
|
'' + 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
|
patchelf --set-rpath "${lib.makeLibraryPath runtimeDeps}" $releaseDir/$artifact
|
||||||
'' + ''
|
|
||||||
install -D $releaseDir/$artifact -t $out/bin
|
install -D $releaseDir/$artifact -t $out/bin
|
||||||
done
|
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
|
# prevent further changes to the RPATH
|
||||||
|
Loading…
x
Reference in New Issue
Block a user