Skip to content

Commit

Permalink
Archimage 4.1alpha (ivan-hc#18)
Browse files Browse the repository at this point in the history
* Update obs-full-junest.sh

* Update obs-junest.sh
  • Loading branch information
ivan-hc authored Jan 1, 2025
1 parent 3475225 commit c34e588
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 49 deletions.
53 changes: 29 additions & 24 deletions obs-full-junest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -207,29 +207,34 @@ function _create_AppRun() {
[ -z "$NVIDIA_ON" ] && NVIDIA_ON=1
if [ "$NVIDIA_ON" = 1 ]; then
DATADIR="${XDG_DATA_HOME:-$HOME/.local/share}"
CONTY_DIR="${DATADIR}/Conty/overlayfs_shared"
CACHEDIR="${XDG_CACHE_HOME:-$HOME/.cache}"
[ -f /sys/module/nvidia/version ] && nvidia_driver_version="$(cat /sys/module/nvidia/version)"
[ -f "${CONTY_DIR}"/nvidia/current-nvidia-version ] && nvidia_driver_conty="$(cat "${CONTY_DIR}"/nvidia/current-nvidia-version)"
if [ "${nvidia_driver_version}" != "${nvidia_driver_conty}" ]; then
if command -v curl >/dev/null 2>&1; then
if ! curl --output /dev/null --silent --head --fail https://github.com 1>/dev/null; then
notify-send "You are offline, cannot use Nvidia drivers"
else
notify-send "Configuring Nvidia drivers for this AppImage..."
mkdir -p "${CACHEDIR}" && cd "${CACHEDIR}" || exit 1
curl -Ls "https://raw.githubusercontent.com/ivan-hc/ArchImage/main/nvidia-junest.sh" > nvidia-junest.sh
chmod a+x ./nvidia-junest.sh && ./nvidia-junest.sh
fi
else
notify-send "Missing \"curl\" command, cannot use Nvidia drivers"
echo "You need \"curl\" to download this script"
fi
fi
[ -d "${CONTY_DIR}"/up/usr/bin ] && export PATH="${PATH}":"${CONTY_DIR}"/up/usr/bin:"${PATH}"
[ -d "${CONTY_DIR}"/up/usr/lib ] && export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}":"${CONTY_DIR}"/up/usr/lib:"${LD_LIBRARY_PATH}"
[ -d "${CONTY_DIR}"/up/usr/share ] && export XDG_DATA_DIRS="${XDG_DATA_DIRS}":"${CONTY_DIR}"/up/usr/share:"${XDG_DATA_DIRS}"
DATADIR="${XDG_DATA_HOME:-$HOME/.local/share}"
CONTY_DIR="${DATADIR}/Conty/overlayfs_shared"
[ -f /sys/module/nvidia/version ] && nvidia_driver_version="$(cat /sys/module/nvidia/version)"
if [ -n "$nvidia_driver_version" ]; then
[ ! -d "${CONTY_DIR}"/up/usr/share/glvnd ] && ln -s /usr/share/glvnd "${CONTY_DIR}"/up/usr/share/ 2>/dev/null
[ ! -d "${CONTY_DIR}"/up/usr/share/nvidia ] && ln -s /usr/share/nvidia "${CONTY_DIR}"/up/usr/share/ 2>/dev/null
ln -s /usr/share/nvidia "${CONTY_DIR}"/up/usr/share/ 2>/dev/null
mkdir -p "${CONTY_DIR}"/up/usr/lib
if [ ! -f "${CONTY_DIR}"/nvidia/current-nvidia-version ]; then
mkdir -p "${CONTY_DIR}"/nvidia
echo "${nvidia_driver_version}" > "${CONTY_DIR}"/nvidia/current-nvidia-version
fi
[ -f "${CONTY_DIR}"/nvidia/current-nvidia-version ] && nvidia_driver_conty=$(cat "${CONTY_DIR}"/nvidia/current-nvidia-version)
if [ "${nvidia_driver_version}" != "${nvidia_driver_conty}" ]; then
rm -f "${CONTY_DIR}"/up/usr/lib/*
echo "${nvidia_driver_version}" > "${CONTY_DIR}"/nvidia/current-nvidia-version
fi
nvidialibs="libcuda libEGL_nvidia libGLX_nvidia libnvidia libOpenCL libvdpau_nvidia"
for n in $nvidialibs; do
nvidia_libs="$nvidia_libs $(find /usr/lib -name "$n*" -print0 | xargs -0)"
done
for n in $nvidia_libs; do
libname=$(echo "$n" | sed 's:.*/::')
[ ! -f "${CONTY_DIR}"/up/usr/lib/"$libname" ] && cp "$n" "${CONTY_DIR}"/up/usr/lib/
done
[ -d "${CONTY_DIR}"/up/usr/lib ] && export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}":"${CONTY_DIR}"/up/usr/lib:"${LD_LIBRARY_PATH}"
[ -d "${CONTY_DIR}"/up/usr/share ] && export XDG_DATA_DIRS="${XDG_DATA_DIRS}":"${CONTY_DIR}"/up/usr/share:"${XDG_DATA_DIRS}"
fi
fi
BINDS=" --dev-bind /dev /dev \
Expand Down Expand Up @@ -575,4 +580,4 @@ fi
export ARCH=x86_64
./appimagetool -n --comp zstd --mksquashfs-opt -Xcompression-level --mksquashfs-opt 20 \
-u "gh-releases-zsync|$GITHUB_REPOSITORY_OWNER|OBS-Studio-appimage|continuous-full|*-$ARCH.AppImage.zsync" \
./"$APP".AppDir ./"$(awk -F"=" '/Name=/ {print $2; exit}' ./"$APP".AppDir/*.desktop | sed 's/ /-/g')"-FULL_"$VERSION"-archimage4-"$ARCH".AppImage
./"$APP".AppDir ./"$(awk -F"=" '/Name=/ {print $2; exit}' ./"$APP".AppDir/*.desktop | sed 's/ /-/g')"-FULL_"$VERSION"-archimage4.1alpha-"$ARCH".AppImage
54 changes: 29 additions & 25 deletions obs-junest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -203,32 +203,36 @@ function _create_AppRun() {
export UNION_PRELOAD=$HERE
export JUNEST_HOME=$HERE/.junest
export PATH=$PATH:$HERE/.local/share/junest/bin
[ -z "$NVIDIA_ON" ] && NVIDIA_ON=1
if [ "$NVIDIA_ON" = 1 ]; then
DATADIR="${XDG_DATA_HOME:-$HOME/.local/share}"
CONTY_DIR="${DATADIR}/Conty/overlayfs_shared"
CACHEDIR="${XDG_CACHE_HOME:-$HOME/.cache}"
[ -f /sys/module/nvidia/version ] && nvidia_driver_version="$(cat /sys/module/nvidia/version)"
[ -f "${CONTY_DIR}"/nvidia/current-nvidia-version ] && nvidia_driver_conty="$(cat "${CONTY_DIR}"/nvidia/current-nvidia-version)"
if [ "${nvidia_driver_version}" != "${nvidia_driver_conty}" ]; then
if command -v curl >/dev/null 2>&1; then
if ! curl --output /dev/null --silent --head --fail https://github.com 1>/dev/null; then
notify-send "You are offline, cannot use Nvidia drivers"
else
notify-send "Configuring Nvidia drivers for this AppImage..."
mkdir -p "${CACHEDIR}" && cd "${CACHEDIR}" || exit 1
curl -Ls "https://raw.githubusercontent.com/ivan-hc/ArchImage/main/nvidia-junest.sh" > nvidia-junest.sh
chmod a+x ./nvidia-junest.sh && ./nvidia-junest.sh
fi
else
notify-send "Missing \"curl\" command, cannot use Nvidia drivers"
echo "You need \"curl\" to download this script"
fi
fi
[ -d "${CONTY_DIR}"/up/usr/bin ] && export PATH="${PATH}":"${CONTY_DIR}"/up/usr/bin:"${PATH}"
[ -d "${CONTY_DIR}"/up/usr/lib ] && export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}":"${CONTY_DIR}"/up/usr/lib:"${LD_LIBRARY_PATH}"
[ -d "${CONTY_DIR}"/up/usr/share ] && export XDG_DATA_DIRS="${XDG_DATA_DIRS}":"${CONTY_DIR}"/up/usr/share:"${XDG_DATA_DIRS}"
DATADIR="${XDG_DATA_HOME:-$HOME/.local/share}"
CONTY_DIR="${DATADIR}/Conty/overlayfs_shared"
[ -f /sys/module/nvidia/version ] && nvidia_driver_version="$(cat /sys/module/nvidia/version)"
if [ -n "$nvidia_driver_version" ]; then
[ ! -d "${CONTY_DIR}"/up/usr/share/glvnd ] && ln -s /usr/share/glvnd "${CONTY_DIR}"/up/usr/share/ 2>/dev/null
[ ! -d "${CONTY_DIR}"/up/usr/share/nvidia ] && ln -s /usr/share/nvidia "${CONTY_DIR}"/up/usr/share/ 2>/dev/null
ln -s /usr/share/nvidia "${CONTY_DIR}"/up/usr/share/ 2>/dev/null
mkdir -p "${CONTY_DIR}"/up/usr/lib
if [ ! -f "${CONTY_DIR}"/nvidia/current-nvidia-version ]; then
mkdir -p "${CONTY_DIR}"/nvidia
echo "${nvidia_driver_version}" > "${CONTY_DIR}"/nvidia/current-nvidia-version
fi
[ -f "${CONTY_DIR}"/nvidia/current-nvidia-version ] && nvidia_driver_conty=$(cat "${CONTY_DIR}"/nvidia/current-nvidia-version)
if [ "${nvidia_driver_version}" != "${nvidia_driver_conty}" ]; then
rm -f "${CONTY_DIR}"/up/usr/lib/*
echo "${nvidia_driver_version}" > "${CONTY_DIR}"/nvidia/current-nvidia-version
fi
nvidialibs="libcuda libEGL_nvidia libGLX_nvidia libnvidia libOpenCL libvdpau_nvidia"
for n in $nvidialibs; do
nvidia_libs="$nvidia_libs $(find /usr/lib -name "$n*" -print0 | xargs -0)"
done
for n in $nvidia_libs; do
libname=$(echo "$n" | sed 's:.*/::')
[ ! -f "${CONTY_DIR}"/up/usr/lib/"$libname" ] && cp "$n" "${CONTY_DIR}"/up/usr/lib/
done
[ -d "${CONTY_DIR}"/up/usr/lib ] && export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}":"${CONTY_DIR}"/up/usr/lib:"${LD_LIBRARY_PATH}"
[ -d "${CONTY_DIR}"/up/usr/share ] && export XDG_DATA_DIRS="${XDG_DATA_DIRS}":"${CONTY_DIR}"/up/usr/share:"${XDG_DATA_DIRS}"
fi
fi
BINDS=" --dev-bind /dev /dev \
Expand Down Expand Up @@ -574,4 +578,4 @@ fi
export ARCH=x86_64
./appimagetool -n --comp zstd --mksquashfs-opt -Xcompression-level --mksquashfs-opt 20 \
-u "gh-releases-zsync|$GITHUB_REPOSITORY_OWNER|OBS-Studio-appimage|latest|*-$ARCH.AppImage.zsync" \
./"$APP".AppDir ./"$(awk -F"=" '/Name=/ {print $2; exit}' ./"$APP".AppDir/*.desktop | sed 's/ /-/g')"_"$VERSION"-archimage4-"$ARCH".AppImage
./"$APP".AppDir ./"$(awk -F"=" '/Name=/ {print $2; exit}' ./"$APP".AppDir/*.desktop | sed 's/ /-/g')"_"$VERSION"-archimage4.1alpha-"$ARCH".AppImage

0 comments on commit c34e588

Please sign in to comment.