Skip to content

Commit e3ef1db

Browse files
committed
add ghostty test
1 parent 4a60a6d commit e3ef1db

File tree

4 files changed

+348
-0
lines changed

4 files changed

+348
-0
lines changed
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
#!/SBUILD
2+
#SELF: https://raw.githubusercontent.com/pkgforge/soarpkgs/refs/heads/main/packages/ghostty/appimage.pkgforge-dev.source.yaml
3+
_disabled: true
4+
_disabled_reason:
5+
replaced:
6+
- date: "2024-12-31"
7+
pkg_id: "github.com.pkgforge-dev.ghostty-appimage.stable"
8+
reason: "Switched to fetching prebuilt"
9+
10+
pkg: "ghostty"
11+
pkg_id: "github.com.pkgforge-dev.ghostty-appimage.source"
12+
pkg_type: "appimage"
13+
category:
14+
- "TerminalEmulator"
15+
description: "Fast, native, feature-rich terminal emulator pushing modern features"
16+
distro_pkg:
17+
archlinux:
18+
aur:
19+
- "ghostty-git"
20+
extra:
21+
- "ghostty"
22+
homebrew:
23+
- "ghostty"
24+
nixpkgs:
25+
- "ghostty"
26+
homepage:
27+
- "https://ghostty.org"
28+
- "https://github.com/ghostty-org/ghostty"
29+
maintainer:
30+
- "psadi (https://github.com/psadi)"
31+
note:
32+
- "[DO NOT RUN] (Meant for pkgforge CI Only)"
33+
- "Built From Source using a Community Provided Script. Check/Report @ https://github.com/pkgforge-dev/ghostty-appimage"
34+
- "[PORTABLE] (Works on AnyLinux)"
35+
license:
36+
- id: "MIT"
37+
url: "https://github.com/ghostty-org/ghostty/raw/918ccdba5cc65ccd1fb48a54c71306d869299441/LICENSE"
38+
provides:
39+
- "ghostty"
40+
repology:
41+
- "ghostty"
42+
src_url:
43+
- "https://github.com/pkgforge-dev/ghostty-appimage"
44+
tag:
45+
- "terminal"
46+
x_exec:
47+
host:
48+
- "aarch64-Linux"
49+
- "x86_64-Linux"
50+
shell: "bash"
51+
pkgver: |
52+
curl -qfsSL "https://raw.githubusercontent.com/pkgforge-dev/ghostty-appimage/main/build.sh" | grep -oP 'GHOSTTY_VERSION\s*=\s*"\K[^"]*(?=")' | tr -d '[:space:]'
53+
run: |
54+
#Build
55+
docker stop "ubuntu-builder" &>/dev/null ; docker rm "ubuntu-builder" &>/dev/null
56+
docker run --privileged --device "/dev/fuse" --net="host" --name "ubuntu-builder" --pull="always" "ghcr.io/pkgforge/devscripts/ubuntu-builder:latest" \
57+
bash -l -c '
58+
#Setup ENV
59+
set -x ; mkdir -p "/build-bins" && pushd "$(mktemp -d)" &>/dev/null
60+
#Build
61+
git clone --depth="1" --filter "blob:none" --quiet "https://github.com/pkgforge-dev/ghostty-appimage" "./TEMPREPO" && cd "./TEMPREPO"
62+
chmod +x "./setup.sh" "./build.sh"
63+
"./setup.sh" && "./build.sh"
64+
#Copy
65+
find "/tmp/ghostty-build/" -maxdepth 1 -type f -iname "*mage*" -exec file -i "{}" \; | grep -Ei "application/.*executable|inode/symlink|text/x-perl|text/.*script" | cut -d":" -f1 | xargs realpath --no-symlinks | xargs -I "{}" rsync -achvL "{}" "/build-bins/ghostty"
66+
file "/build-bins/"* && du -sh "/build-bins/"*
67+
popd &>/dev/null
68+
'
69+
#Copy & Meta
70+
docker cp "ubuntu-builder:/build-bins/." "${SBUILD_TMPDIR}/"
71+
[ -s "${SBUILD_TMPDIR}/LICENSE" ] && cp -fv "${SBUILD_TMPDIR}/LICENSE" "${SBUILD_OUTDIR}/LICENSE"
72+
find "${SBUILD_TMPDIR}" -maxdepth 1 -type f -exec file -i "{}" \; | grep -Ei "application/.*executable|inode/symlink|text/x-perl|text/.*script" | cut -d":" -f1 | xargs realpath --no-symlinks | xargs -I "{}" rsync -achvL "{}" "${SBUILD_OUTDIR}"
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
#!/SBUILD
2+
#SELF: https://raw.githubusercontent.com/pkgforge/soarpkgs/refs/heads/main/packages/ghostty/appimage.pkgforge-dev.stable-glfw.yaml
3+
_disabled: false
4+
5+
pkg: "ghostty"
6+
pkg_id: "github.com.pkgforge-dev.ghostty-appimage.stable-glfw"
7+
pkg_type: "appimage"
8+
category:
9+
- "TerminalEmulator"
10+
description: "Fast, native, feature-rich terminal emulator pushing modern features (Experimental)"
11+
distro_pkg:
12+
archlinux:
13+
aur:
14+
- "ghostty-git"
15+
extra:
16+
- "ghostty"
17+
homebrew:
18+
- "ghostty"
19+
nixpkgs:
20+
- "ghostty"
21+
homepage:
22+
- "https://ghostty.org"
23+
- "https://github.com/ghostty-org/ghostty"
24+
maintainer:
25+
- "psadi (https://github.com/psadi)"
26+
note:
27+
- "Fetched from Pre Built Community Created AppImage. Check/Report @ https://github.com/pkgforge-dev/ghostty-appimage"
28+
- "This is an Experimental Build: https://github.com/pkgforge-dev/ghostty-appimage#-experimental-builds-glfw"
29+
- "[PORTABLE] (Works on AnyLinux)"
30+
license:
31+
- id: "MIT"
32+
url: "https://github.com/ghostty-org/ghostty/raw/918ccdba5cc65ccd1fb48a54c71306d869299441/LICENSE"
33+
provides:
34+
- "ghostty"
35+
repology:
36+
- "ghostty"
37+
src_url:
38+
- "https://github.com/pkgforge-dev/ghostty-appimage"
39+
tag:
40+
- "terminal"
41+
x_exec:
42+
bsys: "host://soar-dl"
43+
host:
44+
- "aarch64-Linux"
45+
- "x86_64-Linux"
46+
shell: "bash"
47+
pkgver: |
48+
curl -qfsSL "https://api.gh.pkgforge.dev/repos/pkgforge-dev/ghostty-appimage/releases/latest?per_page=100" | jq -r '.tag_name' | tr -d '"'\''[:space:]'
49+
run: |
50+
#Download
51+
case "$(uname -m)" in
52+
aarch64)
53+
soar dl "https://github.com/pkgforge-dev/ghostty-appimage@${PKGVER}" --match "appimage,aarch64,glfw" --exclude "x64,x86,zsync" -o "./${PKG}" --yes
54+
;;
55+
x86_64)
56+
soar dl "https://github.com/pkgforge-dev/ghostty-appimage@${PKGVER}" --match "appimage,x86_64,glfw" --exclude "aarch64,arm,zsync" -o "./${PKG}" --yes
57+
;;
58+
esac
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#!/SBUILD
2+
#SELF: https://raw.githubusercontent.com/pkgforge/soarpkgs/refs/heads/main/packages/ghostty/appimage.pkgforge-dev.stable.yaml
3+
_disabled: false
4+
5+
pkg: "ghostty"
6+
pkg_id: "github.com.pkgforge-dev.ghostty-appimage.stable"
7+
pkg_type: "appimage"
8+
category:
9+
- "TerminalEmulator"
10+
description: "Fast, native, feature-rich terminal emulator pushing modern features"
11+
distro_pkg:
12+
archlinux:
13+
aur:
14+
- "ghostty-git"
15+
extra:
16+
- "ghostty"
17+
homebrew:
18+
- "ghostty"
19+
nixpkgs:
20+
- "ghostty"
21+
homepage:
22+
- "https://ghostty.org"
23+
- "https://github.com/ghostty-org/ghostty"
24+
maintainer:
25+
- "psadi (https://github.com/psadi)"
26+
note:
27+
- "Fetched from Pre Built Community Created AppImage. Check/Report @ https://github.com/pkgforge-dev/ghostty-appimage"
28+
- "[PORTABLE] (Works on AnyLinux)"
29+
license:
30+
- id: "MIT"
31+
url: "https://github.com/ghostty-org/ghostty/raw/918ccdba5cc65ccd1fb48a54c71306d869299441/LICENSE"
32+
provides:
33+
- "ghostty"
34+
repology:
35+
- "ghostty"
36+
src_url:
37+
- "https://github.com/pkgforge-dev/ghostty-appimage"
38+
tag:
39+
- "terminal"
40+
x_exec:
41+
bsys: "host://soar-dl"
42+
host:
43+
- "aarch64-Linux"
44+
- "x86_64-Linux"
45+
shell: "bash"
46+
pkgver: |
47+
curl -qfsSL "https://api.gh.pkgforge.dev/repos/pkgforge-dev/ghostty-appimage/releases/latest?per_page=100" | jq -r '.tag_name' | tr -d '"'\''[:space:]'
48+
run: |
49+
#Download
50+
case "$(uname -m)" in
51+
aarch64)
52+
soar dl "https://github.com/pkgforge-dev/ghostty-appimage@${PKGVER}" --match "appimage,aarch64" --exclude "x64,x86,zsync" -o "./${PKG}" --yes
53+
;;
54+
x86_64)
55+
soar dl "https://github.com/pkgforge-dev/ghostty-appimage@${PKGVER}" --match "appimage,x86_64" --exclude "aarch64,arm,zsync" -o "./${PKG}" --yes
56+
;;
57+
esac
Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
#!/SBUILD ver @v1.0.0
2+
#SELF: https://raw.githubusercontent.com/pkgforge/soarpkgs/main/packages/ghostty/nixappimage.nixpkgs.stable.yaml
3+
_disabled: true
4+
_disabled_reason:
5+
broken:
6+
- date: "2025-01-14"
7+
reason: "Fails to create EGL Display" #https://github.com/NixOS/nixpkgs/issues/9415
8+
9+
pkg: "ghostty"
10+
pkg_id: "nixpkgs.ghostty"
11+
pkg_type: "nixappimage"
12+
app_id: "com.mitchellh.ghostty"
13+
category:
14+
- "TerminalEmulator"
15+
description: "Fast, native, feature-rich terminal emulator pushing modern features"
16+
desktop:
17+
url: "https://raw.githubusercontent.com/ghostty-org/ghostty/main/dist/linux/app.desktop"
18+
distro_pkg:
19+
archlinux:
20+
aur:
21+
- "ghostty-git"
22+
extra:
23+
- "ghostty"
24+
homebrew:
25+
- "ghostty"
26+
nixpkgs:
27+
- "ghostty"
28+
homepage:
29+
- "https://ghostty.org"
30+
- "https://github.com/ghostty-org/ghostty"
31+
icon:
32+
url: "https://raw.githubusercontent.com/ghostty-org/ghostty/main/images/icons/icon_256.png"
33+
license:
34+
- id: "MIT"
35+
url: "https://github.com/ghostty-org/ghostty/raw/918ccdba5cc65ccd1fb48a54c71306d869299441/LICENSE"
36+
maintainer:
37+
- "Azathothas (https://github.com/Azathothas)"
38+
note:
39+
- "[DO NOT RUN] (Meant for pkgforge CI Only)"
40+
- "Built Using Nixpkgs. Check/Report @ https://github.com/NixOS/nixpkgs"
41+
- "Packed Using NixAppImage. Check/Report @ https://github.com/pkgforge/nix-appimage"
42+
- "Learn more @ https://docs.pkgforge.dev/formats/packages/nixappimage"
43+
- "[PORTABLE] (Works on AnyLinux)"
44+
provides:
45+
- "ghostty"
46+
repology:
47+
- "ghostty"
48+
src_url:
49+
- "https://github.com/ghostty-org/ghostty"
50+
tag:
51+
- "terminal"
52+
x_exec:
53+
bsys: "host://nix"
54+
host:
55+
- "aarch64-Linux"
56+
- "x86_64-Linux"
57+
shell: "bash"
58+
pkgver: |
59+
nix derivation show "nixpkgs#ghostty" --impure --refresh --quiet 1>&1 2>/dev/null | sed -n '/^[[:space:]]*{/,$p' | jq -r '.. | objects | (select(has("version")).version, (select(has("env")) | select(.env.__json != null) | .env.__json | fromjson | select(has("version")).version) | select(.))' | tr -d '"'\''[:space:]'
60+
run: |
61+
#Build
62+
echo -e "\n" ; nix-instantiate --eval --expr "builtins.toJSON (with import <nixpkgs> {}; ${PKG}.meta)" --quiet 2>/dev/null | jq -r fromjson 2>/dev/null ; echo -e "\n"
63+
nix bundle --impure --bundler "github:pkgforge/nix-appimage?ref=main" "nixpkgs#ghostty" --cores "$(($(nproc)+1))" --max-jobs "$(($(nproc)+1))" --log-format bar-with-logs --out-link "${SBUILD_TMPDIR}/nixappimage"
64+
sudo rsync -achLv --no-relative "${SBUILD_TMPDIR}/nixappimage" "${SBUILD_TMPDIR}/${PKG}.nixappimage.tmp"
65+
sudo chown -R "$(whoami):$(whoami)" "${SBUILD_TMPDIR}" && chmod -R 755 "${SBUILD_TMPDIR}"
66+
chmod +x "${SBUILD_TMPDIR}/${PKG}.nixappimage.tmp"
67+
#Debloat & Fix things
68+
pushd "${SBUILD_TMPDIR}" &>/dev/null && \
69+
"./${PKG}.nixappimage.tmp" --appimage-extract >/dev/null && rm -rvf "./${PKG}.nixappimage.tmp"
70+
if [ ! -d "./squashfs-root" ] || [ "$(du -s "./squashfs-root" | cut -f1)" -le 100 ]; then
71+
echo -e "\n [X] FATAL: Building/Extraction probably Failed\n"
72+
exit 1
73+
fi
74+
#De-Nix
75+
pushd "${SBUILD_TMPDIR}" &>/dev/null || exit 1
76+
mkdir -pv "./squashfs-root/usr/share/applications" && mkdir -pv "./squashfs-root/usr/share/metainfo"
77+
ENTRYPOINT_DIR="$(readlink -f "./squashfs-root/entrypoint" | sed -E 's|^(/nix/store/[^/]+).*|\1|' | tr -d '[:space:]')"
78+
ENTRYPOINT_DIR="$(echo "${SBUILD_TMPDIR}/squashfs-root/${ENTRYPOINT_DIR}" | sed 's|//|/|g')" && export ENTRYPOINT_DIR="${ENTRYPOINT_DIR}"
79+
[ -d "${ENTRYPOINT_DIR}" ] && [[ "${ENTRYPOINT_DIR}" == "/tmp/"*"/nix/store/"* ]] || exit 1
80+
#Copy License
81+
[[ -s "${SBUILD_OUTDIR}/LICENSE" ]] || ( askalono --format "json" crawl --follow "${SBUILD_TMPDIR}/squashfs-root" | jq -r ".. | objects | .path? // empty" | head -n 1 | xargs -I "{}" cp -fv "{}" "${SBUILD_OUTDIR}/LICENSE" ) 2>/dev/null
82+
#Fix Symlinks
83+
rm -rvf "./squashfs-root/usr" 2>/dev/null
84+
find -L "./squashfs-root" -xtype f,l -name "*LC_MESSAGES*" -exec rm -rvf "{}" \;
85+
find -L "./squashfs-root" -xtype l | awk '{
86+
link=$0;
87+
cmd="readlink \""link"\"";
88+
cmd | getline target;
89+
close(cmd);
90+
cmd="readlink -f \""link"\" 2>/dev/null";
91+
if((cmd | getline resolved) <= 0 || system("test -e \""resolved"\"") != 0) {
92+
system("rm -rfv \""link"\" 2>/dev/null");
93+
} else {
94+
if(target == link || target == "."target ||
95+
index(resolved, link) > 0 || index(link, resolved) > 0 ||
96+
system("test \""resolved"\" -ef \"$(dirname \""link"\")\" || test \""resolved"\" -ef \"$(dirname $(dirname \""link"\"))\"") == 0) {
97+
system("rm -rfv \""link"\" 2>/dev/null");
98+
}
99+
}
100+
close(cmd);
101+
}'
102+
ln -sfn "$(realpath --relative-to="$(dirname "./squashfs-root/usr")" "${ENTRYPOINT_DIR}")" "./squashfs-root/usr"
103+
find "./squashfs-root" -maxdepth 1 -type l ! -name '*entrypoint*' -exec test -f "{}" \; -exec rsync -achvL --remove-source-files "{}" "{}.tmp" \; -exec mv "{}.tmp" "{}" \;
104+
#Icon
105+
if [[ ! -s "${SBUILD_OUTDIR}/${PKG}.png" && ! -s "${SBUILD_OUTDIR}/${PKG}.svg" ]]; then
106+
find -L "./squashfs-root/usr" -type f,l -regex '.*\.\(png\|svg\)' \
107+
-not -regex '.*\(favicon\|/\(16x16\|22x22\|24x24\|32x32\|36x36\|48x48\|64x64\|72x72\|96x96\)/\).*' \
108+
| awk '{print length, $0}' | sort -n | awk 'NR==1 {print $2}' | xargs -I "{}" cp -fv "{}" "./squashfs-root/${PKG}.png"
109+
if [[ ! -f "./squashfs-root/${PKG}.png" || $(stat -c%s "./squashfs-root/${PKG}.png") -le 3 ]]; then
110+
find -L "./squashfs-root/usr" -regex ".*\(128x128/apps\|256x256\)/.*${PKG}.*\.\(png\|svg\)" -printf "%s %p\n" -quit | sort -n | awk 'NR==1 {print $2}' | xargs -I "{}" cp -fv "{}" "./squashfs-root/${PKG}.png"
111+
fi
112+
cp -fv "./squashfs-root/${PKG}.png" "./squashfs-root/.DirIcon"
113+
else
114+
cp -fv "${SBUILD_OUTDIR}/${PKG}.png" "./squashfs-root/${PKG}.png" || cp -fv "${SBUILD_OUTDIR}/${PKG}.svg" "./squashfs-root/${PKG}.svg"
115+
cp "./squashfs-root/${PKG}.png" "./squashfs-root/.DirIcon" || cp "./squashfs-root/${PKG}.svg" "./squashfs-root/.DirIcon"
116+
fi
117+
#Desktop
118+
if [[ ! -s "${SBUILD_OUTDIR}/${PKG}.desktop" ]]; then
119+
find -L "./squashfs-root/usr" -name "*.desktop" -printf "%s %p\n" -quit | sort -n | awk 'NR==1 {print $2}' | xargs -I "{}" sh -c 'cp -fv "{}" "./squashfs-root/${PKG}.desktop"'
120+
else
121+
cp -fv "${SBUILD_OUTDIR}/${PKG}.desktop" "./squashfs-root/${PKG}.desktop"
122+
fi
123+
sed '/.*DBusActivatable.*/I d' -i "./squashfs-root/${PKG}.desktop"
124+
sed -E 's/\s+setup\s+/ /Ig' -i "./squashfs-root/${PKG}.desktop"
125+
sed "s/Icon=[^ ]*/Icon=${PKG}/" -i "./squashfs-root/${PKG}.desktop"
126+
#Perms
127+
find "./squashfs-root" -maxdepth 1 -type f -exec chmod "u=rx,go=rx" "{}" +
128+
#Purge Bloatware
129+
echo -e "\n[+] Purging Bloatware...\n"
130+
O_SIZE="$(du -sh "./squashfs-root" 2>/dev/null | awk '{print $1}' 2>/dev/null)" && export "O_SIZE=${O_SIZE}"
131+
#Locale/fonts/man
132+
find "./squashfs-root" -type d -regex '.*share/\(locale\(s\)?\|font\(s\)?\|man\).*' -print0 | xargs -0 -I "{}" sh -c 'rm -rvf "{}" 2>/dev/null && ln -s "/usr/share/locale" "{}" 2>/dev/null'
133+
mkdir -pv "./squashfs-root/usr/share"
134+
for dir in font fonts locale man; do
135+
rm -rvf "./squashfs-root/usr/share/${dir}" 2>/dev/null
136+
ln -sfv "/usr/share/${dir}" "./squashfs-root/usr/share/${dir}" 2>/dev/null
137+
done
138+
#Static Files
139+
find "./squashfs-root" -type f -regex ".*\.\(a\|cmake\|jmod\|gz\|md\|mk\|prf\|rar\|tar\|xz\|zip\)$" -print0 -exec sh -c 'rm -rvf "$1" 2>/dev/null' _ "{}" \;
140+
find "./squashfs-root" -type f -regex '.*\(LICENSE\|LICENSE\.md\|Makefile\)' -print0 -exec sh -c 'rm -rvf "$1" 2>/dev/null' _ "{}" \;
141+
#Static Dirs
142+
find "./squashfs-root" -type d -regex ".*\(doc/share\|/include\|/nix-support\|share/docs\|share/locale\|share/locales\|share/man\).*" ! -name "*${PKG%%-*}*" -print -exec rm -rvf "{}" + 2>/dev/null
143+
find "./squashfs-root" -type d -regex '.*/\(ensurepip\|example\|examples\|gcc\|i18n\|mkspecs\|__pycache__\|__pyinstaller\|test\|tests\|translation\|translations\|unit_test\|unit_tests\)' -print0 -exec sh -c 'rm -rvf "$1" 2>/dev/null' _ "{}" \;
144+
#llvm (need .so)
145+
find "./squashfs-root" -type d -name "*llvm*" -exec find "{}" -type f ! -name "*.so*" -delete \;
146+
#perl (need .so)
147+
find "./squashfs-root" -type d -name "*perl*" -exec find "{}" -type f ! -name "*.so*" -delete \;
148+
#systemd (need .so)
149+
find "./squashfs-root" -type d -name "*systemd*" -exec find "{}" -type f ! -name "*.so*" -delete \;
150+
P_SIZE="$(du -sh "./squashfs-root" 2>/dev/null | awk '{print $1}' 2>/dev/null)" && export "P_SIZE=${P_SIZE}"
151+
echo -e "\n[+] Shaved off ${O_SIZE} --> ${P_SIZE}\n"
152+
#Repack
153+
unset SOURCE_DATE_EPOCH
154+
cd "${SBUILD_OUTDIR}" && ARCH="$(uname -m)" appimagetool --comp "zstd" \
155+
--mksquashfs-opt -root-owned \
156+
--mksquashfs-opt -no-xattrs \
157+
--mksquashfs-opt -noappend \
158+
--mksquashfs-opt -b --mksquashfs-opt "1M" \
159+
--mksquashfs-opt -mkfs-time --mksquashfs-opt "0" \
160+
--mksquashfs-opt -Xcompression-level --mksquashfs-opt "22" \
161+
--no-appstream "${SBUILD_TMPDIR}/squashfs-root" "${SBUILD_OUTDIR}/${PKG}"

0 commit comments

Comments
 (0)