-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcelestia-junest.sh
More file actions
153 lines (118 loc) · 6.86 KB
/
Copy pathcelestia-junest.sh
File metadata and controls
153 lines (118 loc) · 6.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
#!/usr/bin/env bash
APP=celestia
BIN="$APP" #CHANGE THIS IF THE NAME OF THE BINARY IS DIFFERENT FROM "$APP" (for example, the binary of "obs-studio" is "obs")
DEPENDENCES="gtkglext kvantum kwindowsystem mesa qt6-base qt6ct" #SYNTAX: "APP1 APP2 APP3 APP4...", LEAVE BLANK IF NO OTHER DEPENDENCIES ARE NEEDED
BASICSTUFF="binutils debugedit gzip"
COMPILERS="base-devel"
# Set keywords to searchan include in names of directories and files in /usr/bin (BINSAVED), /usr/share (SHARESAVED) and /usr/lib (LIBSAVED)
BINSAVED="SAVEBINSPLEASE"
SHARESAVED="SAVESHAREPLEASE"
LIBSAVED="SAVELIBSPLEASE"
# Set the items you want to manually REMOVE. Complete the path in /etc/, /usr/bin/, /usr/lib/, /usr/lib/python*/ and /usr/share/ respectively.
# The "rm" command will take into account the listed object/path and add an asterisk at the end, completing the path to be removed.
# Some keywords and paths are already set. Remove them if you consider them necessary for the AppImage to function properly.
ETC_REMOVED="makepkg.conf pacman"
BIN_REMOVED="gcc qt.conf"
LIB_REMOVED="gcc"
PYTHON_REMOVED="__pycache__/"
SHARE_REMOVED="gcc icons/AdwaitaLegacy icons/Adwaita/cursors/ terminfo Kvantum/"
# Set mountpoints, they are ment to be set into the AppRun.
# Default mounted files are /etc/resolv.conf, /etc/hosts, /etc/nsswitch.conf, /etc/passwd, /etc/group, /etc/machine-id, /etc/asound.conf and /etc/localtime
# Default mounted directories are /media, /mnt, /opt, /run/media, /usr/lib/locale, /usr/share/fonts, /usr/share/themes, /var, and Nvidia-related directories
# Do not touch this if you are not sure.
mountpoint_files=""
mountpoint_dirs=""
# Post-installation processes (add whatever you want)
_post_installation_processes() {
printf "\n◆ User's processes: \n\n"
# Remove the integrated probes and spaceships
rm -Rf AppDir/.junest/usr/share/celestia/extras-standard/*
# Download and add the enancements
if ! test -d ./Celestia-appimage; then
git clone https://github.com/ivan-hc/Celestia-appimage.git
fi
rsync -av Celestia-appimage/textures/hires/* AppDir/.junest/usr/share/celestia/textures/hires/
# Remove unnecessary textures and force the custom ones
cd AppDir/.junest/usr/share/celestia/textures/
rm -Rf ./medres ./lores
for a in ./hires/*.png; do
if ! echo "$a" | grep -qi "clouds.png\|rings.png"; then
rm -f "$a"
fi
done
ln -s hires lores
ln -s hires medres
cd -
}
##########################################################################################################################################################
# SETUP THE ENVIRONMENT
##########################################################################################################################################################
# Download archimage-builder.sh
if [ ! -f ./archimage-builder.sh ]; then
ARCHIMAGE_BUILDER="https://raw.githubusercontent.com/ivan-hc/ArchImage/refs/heads/main/core/archimage-builder.sh"
wget --retry-connrefused --tries=30 "$ARCHIMAGE_BUILDER" -O ./archimage-builder.sh || exit 0
fi
# Create and enter the AppDir
mkdir -p AppDir archlinux && cd archlinux || exit 1
_JUNEST_CMD() {
./.local/share/junest/bin/junest "$@"
}
# Set archlinux as a temporary $HOME directory
HOME="$(dirname "$(readlink -f "$0")")"
##########################################################################################################################################################
# DOWNLOAD, INSTALL AND CONFIGURE JUNEST
##########################################################################################################################################################
_enable_archlinuxcn() { ARCHLINUXCN_ON="1"; }
_enable_chaoticaur() { CHAOTICAUR_ON="1"; }
_enable_multilib() { MULTILIB_ON="1"; }
_enable_archlinuxcn
#_enable_chaoticaur
#_enable_multilib
[ -f ../archimage-builder.sh ] && source ../archimage-builder.sh junest-setup "$@"
##########################################################################################################################################################
# INSTALL PROGRAMS USING YAY
##########################################################################################################################################################
[ -f ../archimage-builder.sh ] && source ../archimage-builder.sh install "$@"
cd ..
##########################################################################################################################################################
# APPDIR
##########################################################################################################################################################
[ -f ./archimage-builder.sh ] && source ./archimage-builder.sh appdir "$@"
##########################################################################################################################################################
# APPRUN
##########################################################################################################################################################
rm -f AppDir/AppRun
# Set to "1" if you want to add Nvidia drivers manager in the AppRun
export NVIDIA_ON=1
[ -f ./archimage-builder.sh ] && source ./archimage-builder.sh apprun "$@"
# AppRun footer, here you can add options and change the way the AppImage interacts with its internal structure
cat <<-'HEREDOC' >> AppDir/AppRun
EXEC=$(grep -e '^Exec=.*' "${HERE}"/*.desktop | head -n 1 | cut -d "=" -f 2- | sed -e 's|%.||g')
if ! echo "$EXEC" | grep -q "/usr/bin"; then EXEC="/usr/bin/$EXEC"; fi
_JUNEST_CMD -- $EXEC "$@"
HEREDOC
chmod a+x AppDir/AppRun
##########################################################################################################################################################
# COMPILE
##########################################################################################################################################################
[ -f ./archimage-builder.sh ] && source ./archimage-builder.sh compile "$@"
##########################################################################################################################################################
# CREATE THE APPIMAGE
##########################################################################################################################################################
if test -f ./*.AppImage; then rm -Rf ./*archimage*.AppImage; fi
APPNAME="Celestia-Enanced"
REPO="Celestia-appimage"
TAG="latest"
UPINFO="gh-releases-zsync|$GITHUB_REPOSITORY_OWNER|$REPO|$TAG|*x86_64.AppImage.zsync"
echo "$VERSION" > ./version
_appimagetool() {
if ! command -v appimagetool 1>/dev/null; then
if [ ! -f ./appimagetool ]; then
echo " Downloading appimagetool..." && curl -#Lo appimagetool https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-"$ARCH".AppImage && chmod a+x ./appimagetool || exit 1
fi
./appimagetool "$@"
else
appimagetool "$@"
fi
}
ARCH=x86_64 _appimagetool -u "$UPINFO" AppDir "$APPNAME"_"$VERSION"-"$ARCHIMAGE_VERSION"-x86_64.AppImage