1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-23 05:12:40 +03:00

First pass at building an AppImage (#125)

refs: https://github.com/wez/wezterm/issues/124
This commit is contained in:
Wez Furlong 2020-01-20 23:11:38 -08:00 committed by GitHub
parent d84e8531a3
commit cb89ec73e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 79 additions and 11 deletions

View File

@ -47,5 +47,5 @@ jobs:
with: with:
release-tag: nightly release-tag: nightly
# allows semicolon-separated list of case sensitive globs # allows semicolon-separated list of case sensitive globs
files: "wezterm-*.deb;WezTerm-*.zip;wezterm-*.xz;wezterm-*.rpm;wezterm-*.tar.gz" files: "wezterm-*.deb;WezTerm-*.AppImage;WezTerm-*.zip;wezterm-*.xz;wezterm-*.rpm;wezterm-*.tar.gz"
repo-token: ${{ secrets.GITHUB_TOKEN }} repo-token: ${{ secrets.GITHUB_TOKEN }}

View File

@ -65,6 +65,7 @@ jobs:
mkdir pkg_ mkdir pkg_
mv *.deb pkg_ mv *.deb pkg_
mv *.xz pkg_ mv *.xz pkg_
mv *.AppImage pkg_
- uses: actions/upload-artifact@master - uses: actions/upload-artifact@master
if: contains(matrix.os, 'macos') if: contains(matrix.os, 'macos')
with: with:

View File

@ -49,6 +49,7 @@ jobs:
wezterm-*.rpm wezterm-*.rpm
wezterm-*.deb wezterm-*.deb
WezTerm-*.zip WezTerm-*.zip
WezTerm-*.AppImage
wezterm-*.xz wezterm-*.xz
wezterm-*.tar.gz wezterm-*.tar.gz
env: env:

3
.gitignore vendored
View File

@ -10,3 +10,6 @@
**/*.rs.bk **/*.rs.bk
.*.sw* .*.sw*
/esctest.log /esctest.log
/AppDir
/WezTerm*.AppImage
/wezterm*-src.tar.gz

View File

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<id>org.wezfurlong.wezterm.desktop</id>
<metadata_license>MIT</metadata_license>
<project_license>MIT</project_license>
<name>Wez's Terminal Emulator</name>
<summary>A GPU-accelerated cross-platform terminal emulator and multiplexer</summary>
<description>
<p>
wezterm is a terminal emulator with support for modern features
such as fonts with ligatures, hyperlinks, tabs and multiple
windows.
</p>
</description>
<launchable type="desktop-id">org.wezfurlong.wezterm.desktop</launchable>
<url type="homepage">https://wezfurlong.org/wezterm/</url>
<screenshots>
<screenshot type="default">
<caption>Ligatures in VIM</caption>
<image>https://wezfurlong.org/wezterm/screenshots/two.png</image>
</screenshot>
</screenshots>
<developer_name>Wez Furlong</developer_name>
</component>

View File

@ -1,7 +1,10 @@
[Desktop Entry] [Desktop Entry]
Name=WezTerm Name=WezTerm
Comment=Wez's Terminal Emulator Comment=Wez's Terminal Emulator
Icon=/usr/share/wezterm/terminal.png Keywords=shell;prompt;command;commandline;cmd;
Icon=org.wezfurlong.wezterm
TryExec=wezterm
Exec=wezterm Exec=wezterm
Type=Application Type=Application
Categories=Terminal Categories=System;TerminalEmulator;Utility;
Terminal=false

19
ci/appimage.sh Executable file
View File

@ -0,0 +1,19 @@
#!/bin/bash
rm -rf AppDir *.AppImage
mkdir AppDir
install -Dsm755 -t AppDir/usr/bin target/release/wezterm
install -Dm644 assets/icon/terminal.png AppDir/usr/share/icons/hicolor/128x128/apps/org.wezfurlong.wezterm.png
install -Dm644 -t AppDir/usr/share/wezterm/colors assets/colors/*
install -Dm644 assets/wezterm.desktop AppDir/usr/share/applications/org.wezfurlong.wezterm.desktop
# [appimage/stderr] /usr/bin/appstream-util: symbol lookup error: /lib64/libsoup-2.4.so.1: undefined symbol: g_file_info_get_modification_date_time
# install -Dm644 assets/wezterm.appdata.xml AppDir/usr/share/metainfo/wezterm.appdata.xml
[ -x /tmp/linuxdeploy ] || ( curl -L 'https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage' -o /tmp/linuxdeploy && chmod +x /tmp/linuxdeploy )
/tmp/linuxdeploy \
--appdir AppDir \
--output appimage \
--desktop-file assets/wezterm.desktop

View File

@ -83,15 +83,17 @@ echo "Doing the build bit here"
set -x set -x
mkdir -p %{buildroot}/usr/bin %{buildroot}/usr/share/wezterm %{buildroot}/usr/share/applications mkdir -p %{buildroot}/usr/bin %{buildroot}/usr/share/wezterm %{buildroot}/usr/share/applications
install -Dsm755 target/release/wezterm %{buildroot}/usr/bin install -Dsm755 target/release/wezterm %{buildroot}/usr/bin
install -Dm644 assets/icon/terminal.png %{buildroot}/usr/share/wezterm/terminal.png install -Dm644 assets/icon/terminal.png %{buildroot}/usr/share/icons/hicolor/128x128/apps/org.wezfurlong.wezterm.png
install -Dm644 -t %{buildroot}/usr/share/wezterm/colors assets/colors/* install -Dm644 -t %{buildroot}/usr/share/wezterm/colors assets/colors/*
install -Dm644 assets/wezterm.desktop %{buildroot}/usr/share/applications/wezterm.desktop install -Dm644 assets/wezterm.desktop %{buildroot}/usr/share/applications/org.wezfurlong.wezterm.desktop
install -Dm644 assets/wezterm.appdata.xml %{buildroot}/usr/share/metainfo/wezterm.appdata.xml
%files %files
/usr/bin/wezterm /usr/bin/wezterm
/usr/share/wezterm/terminal.png /usr/share/icons/hicolor/128x128/apps/org.wezfurlong.wezterm.png
/usr/share/wezterm/colors/* /usr/share/wezterm/colors/*
/usr/share/applications/wezterm.desktop /usr/share/applications/org.wezfurlong.wezterm.desktop
/usr/share/metainfo/wezterm.appdata.xml
EOF EOF
rpmbuild --build-in-place -bb --rmspec wezterm.spec --verbose rpmbuild --build-in-place -bb --rmspec wezterm.spec --verbose
@ -114,10 +116,11 @@ Description: Wez's Terminal Emulator.
windows. windows.
Depends: libc6, libegl-mesa0, libxcb-icccm4, libxcb-ewmh2, libxcb-keysyms1, libxcb-xkb1, libxkbcommon0, libxkbcommon-x11-0, libfontconfig1, xdg-utils, libxcb-render0, libxcb-shape0, libx11-6, libegl1 Depends: libc6, libegl-mesa0, libxcb-icccm4, libxcb-ewmh2, libxcb-keysyms1, libxcb-xkb1, libxkbcommon0, libxkbcommon-x11-0, libfontconfig1, xdg-utils, libxcb-render0, libxcb-shape0, libx11-6, libegl1
EOF EOF
install -Dsm755 target/release/wezterm pkg/debian/usr/bin install -Dsm755 -t pkg/debian/usr/bin target/release/wezterm
install -Dm644 assets/icon/terminal.png pkg/debian/usr/share/wezterm/terminal.png install -Dm644 assets/icon/terminal.png pkg/debian/usr/share/icons/hicolor/128x128/apps/org.wezfurlong.wezterm.png
install -Dm644 -t pkg/debian/usr/share/wezterm/colors assets/colors/* install -Dm644 -t pkg/debian/usr/share/wezterm/colors assets/colors/*
install -Dm644 assets/wezterm.desktop pkg/debian/usr/share/applications/wezterm.desktop install -Dm644 assets/wezterm.desktop pkg/debian/usr/share/applications/org.wezfurlong.wezterm.desktop
install -Dm644 assets/wezterm.appdata.xml pkg/debian/usr/share/metainfo/wezterm.appdata.xml
if [[ "$BUILD_REASON" == "Schedule" ]] ; then if [[ "$BUILD_REASON" == "Schedule" ]] ; then
debname=wezterm-nightly debname=wezterm-nightly
else else
@ -126,7 +129,7 @@ EOF
fakeroot dpkg-deb --build pkg/debian $debname.deb fakeroot dpkg-deb --build pkg/debian $debname.deb
tar cJf $debname.tar.xz -C pkg/debian/usr/bin wezterm tar cJf $debname.tar.xz -C pkg/debian/usr/bin wezterm
rm -rf pkg rm -rf pkg
./ci/appimage.sh
;; ;;
esac esac
./ci/source-archive.sh ./ci/source-archive.sh

View File

@ -672,6 +672,17 @@ impl Config {
{ {
paths.push(colors_dir); paths.push(colors_dir);
} }
// If running out of an AppImage, resolve our installed colors
// path relative to our binary location:
// `/usr/bin/wezterm` -> `/usr/share/wezterm/colors`
if let Some(colors_dir) = exe_name
.parent()
.and_then(|bin| bin.parent())
.map(|usr| usr.join("share").join("wezterm").join("colors"))
{
paths.push(colors_dir);
}
} }
if cfg!(target_os = "macos") { if cfg!(target_os = "macos") {