From e268a141b262c7b9ef5c604e0604581b71868941 Mon Sep 17 00:00:00 2001 From: Phantop Date: Thu, 4 Jul 2024 23:22:20 -0400 Subject: [PATCH] apps: refactor appmk infrastructure into sourcing appdwarf --- .github/workflows/build.yml | 2 +- appdwarf | 108 +++++++++++++++++++++++++----------- apps/README.md | 4 +- apps/appmk | 42 -------------- apps/getapp | 6 +- apps/mkcalibre | 6 +- apps/mkdotnet | 21 +++++-- apps/mkeopkg | 10 ---- apps/mkgo | 6 +- apps/mkjava | 7 +-- apps/mkmp3tag | 9 ++- apps/mkmusikcube | 6 +- apps/mkmusl | 6 +- apps/mknode | 6 +- apps/mkpacman | 6 +- apps/mkpinta | 6 +- apps/mkpypy | 6 +- apps/mkrenpy | 9 ++- apps/mkrust | 6 +- apps/mksignal | 8 --- apps/mktex | 8 +-- apps/mkwine | 50 +++++++++-------- apps/rustsolus | 9 --- 23 files changed, 163 insertions(+), 184 deletions(-) delete mode 100755 apps/appmk delete mode 100755 apps/mkeopkg delete mode 100755 apps/mksignal delete mode 100755 apps/rustsolus diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 83b1eb3..e5f0c2b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -55,7 +55,7 @@ jobs: matrix: app: - { name: wine, pkgs: dxvk-async-git mono vkd3d-proton-mingw-git wine-gecko wine-mono wine-staging-wow64 winetricks } - - { name: emus, pkgs: ares-emu-avx-git cemu citra-canary-git ryujinx yuzu-early-access } + - { name: emus, pkgs: ares-emu-avx-git cemu citra-canary-git ryujinx suyu-dev-qt6-git } runs-on: ubuntu-latest container: archlinux:latest steps: diff --git a/appdwarf b/appdwarf index 45bad68..eba0087 100755 --- a/appdwarf +++ b/appdwarf @@ -2,17 +2,46 @@ set -e # exit on failure IFS=$(printf '\n\t') # smarter ifs +appmk() { + appdwarf "$DIR" + mv "$DIR".sh bin/"$APP" + rm -rf "$DIR" +} + apprun() { export PATH="$APPDIR"/bin:"$PATH" export LD_LIBRARY_PATH="$APPDIR"/lib64:"$APPDIR"/lib:"$LD_LIBRARY_PATH" exec "$APPDIR/$(basename "$ARGV0")" "$@" } +arun() { + outfunc apprun > "$1" + chmod +x "$1" +} + +brun() { + outfunc apprun | sed '5s#/#/bin/#' > "$1" + chmod +x "$1" +} + +appa() { arun "$DIR"/AppRun; } +appb() { brun "$DIR"/AppRun; } + +unarc() { curl -L "$LINK" | bsdtar xf - -C"$DIR"; } +unbz() { curl -L "$LINK" | tar xj -C"$DIR"; } +ungz() { curl -L "$LINK" | tar xz -C"$DIR"; } +unxz() { curl -L "$LINK" | tar xJ -C"$DIR"; } +un7z() { + aria2c "$LINK" -d "$DIR" -o "$1" + 7z x -y -o"$DIR" "$DIR"/"$1" +} + bundlehead() { - MOUNTBIN=$(mktemp) # use provided offsets to supply dwarfs binary - tail -n+"$OFF" "$0" | head -n"$LEN" | head -c-1 | zstd -cqd > "$MOUNTBIN" + mountbin=$(mktemp) # use provided offsets to supply dwarfs binary + #shellcheck disable=SC2154 + tail -n+"$off" "$0" | head -n"$len" | head -c-1 | zstd -cqd > "$mountbin" #shellcheck disable=SC2317 - dwarfs() { chmod +x "$MOUNTBIN"; "$MOUNTBIN" "$@"; rm "$MOUNTBIN"; } + dwarfs() { chmod +x "$mountbin"; "$mountbin" "$@"; rm "$mountbin"; } } header() { @@ -42,7 +71,7 @@ zzexe() { [ "$1" = "-p" ] && p="$2" && shift # save prefix if present shift; out=$(mktemp) # make tmp file to avoid io operations { outfunc - echo "OFF=$(($( (outfunc; outfunc zzexe_header) | wc -l)+2))" + echo "off=$(($( (outfunc; outfunc zzexe_header) | wc -l)+2))" outfunc zzexe_header | sed -e "3s/)$/${1##*[./]})/" -e "8s/^/$p /" zstdmt -cq19 "$@" } > "$out" @@ -53,7 +82,7 @@ zzexe() { zzexe_header() { dir="$(dirname "$0")" out=$(mktemp -t .zzXXXX.) - tail -n+"$OFF" "$0" | zstd -cd > "$out" + tail -n+"$off" "$0" | zstd -cd > "$out" chmod +x "$out" [ ! -f "$dir/$(basename "$out")" ] && ln -s "$out" "$dir" trap 'rm -f "$out" "$dir/$(basename "$out")"' 0 1 2 3 6 14 15 EXIT @@ -61,35 +90,47 @@ zzexe_header() { exit $? } +if [ "$SOURCE" ]; then + unset SOURCE + trap 'rm -rf "$DIR"' 0 1 2 3 6 14 15 EXIT + APP=$(basename "$0" | sed 's/^mk//') + DIR=/tmp/appdwarf/$APP + mkdir -p "$DIR" + return +fi + case "$1" in -a ) - outfunc apprun > "$2" - chmod +x "$2" + arun "$2" exit ;; -b ) - outfunc apprun | sed '5s#/#/bin/#' > "$2" - chmod +x "$2" + brun "$2" exit ;; --bundle ) # allow bundling dwarfs binary - BUNDLE=$(realpath "$2") + bundle=$(realpath "$2") shift 2;; -d | --decompress ) d=dwarfs-root # just to keep line shorter, extract if file is dwarfs dwarfsck -d0 -i"$2" && mkdir $d && dwarfsextract -o $d -i "$2" && exit tmp=$(mktemp) # make tmp file to avoid io operations unappimage "$2" && exit # also extract appimages cuz we can - tail -n+"$(sed -n '3s/^OFF=//p' "$2")" "$2" | zstd -cd > "$tmp" + tail -n+"$(sed -n '3s/^off=//p' "$2")" "$2" | zstd -cd > "$tmp" mv "$tmp" "$2" chmod +x "$2" exit ;; -f | --fetch ) - FETCH=1 + fetch=1 shift ;; + -g | --get ) + gh run -R phantop/appdwarf download -n "$2" + file="$(echo "$2" | sed 's/^arch-//')" + chmod +x "$file" + exit ;; -p | -z | --prefix | --zzexe ) zzexe "$@" ;; --version | -v ) printf '\e[32m' - echo 'appdwarf 2023.11.16' + echo 'appdwarf 2024.07.04' printf '\e[36m' echo Built by July 🏳️‍🌈 printf '\e[0m' @@ -102,6 +143,7 @@ case "$1" in echo echo " --bundle [path/to/dwarfs] bundle dwarfs with the appdwarf image" echo " -f, --fetch only fetch a remote AppImage" + echo " -g, --get download a prebuild appdwarf from actions" echo echo " -p, --prefix [PREFIX] zzexe a file with prefix" echo " -z, --zzexe zzexe a file" @@ -127,16 +169,16 @@ if [ ! -d "$1" ]; then # directory doesn't exist, see if this is an appimage echo "Assuming this is a GitHub repo..." app="$(echo "${1%/}"/releases | sed 's|github.com|api.github.com/repos|')" api="$(curl "$app" | jq -r .[].assets[].browser_download_url | grep 'AppImage$')" - link="$(echo "$api" | grep "$(uname -m)" || echo "$api" | grep -vEe '-(aarch|arm)(64|hf)\.AppImage')" + url="$(echo "$api" | grep "$(uname -m)" || echo "$api" | grep -vEe '-(aarch|arm)(64|hf)\.AppImage')" shift - set -- "$(echo "$link" | head -n1)" "$@" + set -- "$(echo "$url" | head -n1)" "$@" fi app=$(basename "$1") # actually try to get the appimage if aria2c -x16 -s16 "$1" -o "$app" || wget "$1" -O "$app"; then shift set -- "$app" "$@" - test "$FETCH" && chmod +x "$1" && exit + test "$fetch" && chmod +x "$1" && exit else printf '\e[31m' >&2 echo "No valid remote or local input found. Exiting..." >&2 @@ -160,22 +202,22 @@ if [ ! -d "$1" ]; then # directory doesn't exist, see if this is an appimage printf '\e[0m' zzexe -z "$@" fi -fi + fi -head="$(mktemp)" -if [ "$BUNDLE" ]; then { # behavior for bundling a dwarfs executable - ZDATA="$(mktemp)" - zstd -cq "$BUNDLE" > "$ZDATA" - outfunc - echo "OFF=$(($( (outfunc; outfunc bundlehead; outfunc header) | wc -l)+3))" - echo "LEN=$(($(wc -l < "$ZDATA")+1))" - outfunc bundlehead -} > "$head" -fi -outfunc header >> "$head" -test "$BUNDLE" && cat "$ZDATA" >> "$head" -echo >> "$head" + head="$(mktemp)" + if [ "$bundle" ]; then { # behavior for bundling a dwarfs executable + zdata="$(mktemp)" + zstd -cq "$bundle" > "$zdata" + outfunc + echo "off=$(($( (outfunc; outfunc bundlehead; outfunc header) | wc -l)+3))" + echo "len=$(($(wc -l < "$zdata")+1))" + outfunc bundlehead + } > "$head" + fi + outfunc header >> "$head" + test "$bundle" && cat "$zdata" >> "$head" + echo >> "$head" -mkdwarfs -o "$(realpath "$1").sh" -B5 --header "$head" -i "$@" --categorize=pcmaudio -C pcmaudio/waveform::flac:level=8 -rm -rf "$head" "$1" -chmod +x "$(realpath "$1").sh" + mkdwarfs -o "$(realpath "$1").sh" -B5 --header "$head" -i "$@" --categorize=pcmaudio -C pcmaudio/waveform::flac:level=8 + rm -rf "$head" "$1" + chmod +x "$(realpath "$1").sh" diff --git a/apps/README.md b/apps/README.md index 66a9da8..c48ad9c 100644 --- a/apps/README.md +++ b/apps/README.md @@ -11,18 +11,16 @@ These scripts are all targeted for use on x86_64 Linux systems with GLIBC. Script | Function | Source --- | --- | --- `mkdotnet` | Latest LTS .NET runtime -`mkeopkg` | Converts the given Solus package(s) to an appdwarf | `mkgo` | Latest official Go release | `mkjava` | Accepts an argument for Java version and obtains that build from Adoptium | `mkmp3tag` | Latest 64-bit Mp3tag release | `mkmusikcube` | Latest musikcube release | `mkmusl` | Latest musl.cc toolchain | `mknode` | Latest official NodeJS release | +`mkpacman` | Converts the given Arch package(s) to an appdwarf | `mkpypy` | Latest PyPy3 release | `mkrenpy` | Latest Ren'Py release | `mkrust` | Latest Rust nightly | -`mksignal` | Latest Signal stable from the Solus repos (requires `eopkg` and may not work on other distros) | `mktex` | Minimal/custom TeX Live image | `mkwine` | Latest `wine-staging-tkg` release | `mkwine proton` | GloriousEggroll Proton Builds | -`rustsolus` | Latest Rust stable from the Solus repos (requires `eopkg` and may not work on other distros) | diff --git a/apps/appmk b/apps/appmk deleted file mode 100755 index 4e9e76f..0000000 --- a/apps/appmk +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh -set -e # exit on failure -IFS=$(printf '\n\t') # smarter ifs -trap 'rm -rf "$DIR"' 0 1 2 3 6 14 15 EXIT -part0() { # dir setup - APP=$(basename "$0" | sed 's/^mk//') - DIR=/tmp/appdwarf/$APP - mkdir -p "$DIR" -} - - -ungz() { # default decomps - curl -L "$LINK" | tar xz -C"$DIR" -} - -unbz() { - curl -L "$LINK" | tar xj -C"$DIR" -} - -unxz() { - curl -L "$LINK" | tar xJ -C"$DIR" -} - -unarc() { - curl -L "$LINK" | bsdtar xf - -C"$DIR" -} - - -appa() { # default appruns - appdwarf -a "$DIR"/AppRun -} - -appb() { - appdwarf -b "$DIR"/AppRun -} - - -part9() { # ending bit - appdwarf "$DIR" - mv "$DIR".sh bin/"$APP" - rm -rf "$DIR" -} diff --git a/apps/getapp b/apps/getapp index 9782400..f25b911 100755 --- a/apps/getapp +++ b/apps/getapp @@ -2,7 +2,5 @@ set -e # exit on failure IFS=$(printf '\n\t') # smarter ifs -gh run download -n "$1" -file="$(echo "$1" | sed 's/^arch-//')" -chmod +x "$file" -mv "$file" "$(dirname "$(realpath "$0")")/bin" +cd "$(dirname "$(realpath "$0")")/bin" +appdwarf -g "$1" diff --git a/apps/mkcalibre b/apps/mkcalibre index 1eed9da..3f44588 100755 --- a/apps/mkcalibre +++ b/apps/mkcalibre @@ -1,10 +1,10 @@ #!/bin/sh -. "$(dirname "$0")"/appmk -part0 +# shellcheck source=../appdwarf +SOURCE=1 . "$(which appdwarf)" base=https://download.calibre-ebook.com LINK="$(curl "$base" | tail -n 1 | cut -d\" -f2)" LINK="$(curl "$base/$LINK" | tail -n 1 | cut -d\" -f4 | tr -d /)" LINK="$base/$LINK/calibre-$LINK-$(uname -m).txz" unxz appa -part9 +appmk diff --git a/apps/mkdotnet b/apps/mkdotnet index 1e4d9c6..03232e1 100755 --- a/apps/mkdotnet +++ b/apps/mkdotnet @@ -1,6 +1,6 @@ #!/bin/sh -. "$(dirname "$0")"/appmk -part0 +# shellcheck source=../appdwarf +SOURCE=1 . "$(which appdwarf)" TYPE=Runtime VER=LTS @@ -16,9 +16,20 @@ done LINK=https://dotnetcli.azureedge.net/dotnet/$TYPE -VER=$(curl $LINK/"$VER"/latest.version) TYPE=$(echo "$TYPE" | tr "[:upper:]" "[:lower:]") +VER=$(curl $LINK/"$VER"/latest.version) LINK="$LINK/$VER/dotnet-$TYPE-$VER-linux-x64.tar.gz" ungz -ln -s dotnet "$DIR"/AppRun -part9 + +apprun() { +export DOTNET_ROOT="$APPDIR" +case "$(basename "$ARGV0")" in + dotnetenv ) + exec "$@" ;; + * ) + exec "$APPDIR/$(basename "$ARGV0")" "$@" ;; +esac +} + +appa +appmk diff --git a/apps/mkeopkg b/apps/mkeopkg deleted file mode 100755 index 75b6b6b..0000000 --- a/apps/mkeopkg +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -. "$(dirname "$0")"/appmk -part0 -APP="$1" -eopkg fc -o "$DIR" "$@" -parallel "unzip -op {} install.tar.xz | tar xJf - -C$DIR" ::: "$DIR"/*.eopkg -rm "$DIR"/*.eopkg -appb -sed -i 3,5s#/bin#/usr/bin# "$DIR"/AppRun -part9 diff --git a/apps/mkgo b/apps/mkgo index 3006991..3eef737 100755 --- a/apps/mkgo +++ b/apps/mkgo @@ -1,8 +1,8 @@ #!/bin/sh -. "$(dirname "$0")"/appmk -part0 +# shellcheck source=../appdwarf +SOURCE=1 . "$(which appdwarf)" LINK=$(curl https://go.dev/dl/ | grep -m1 linux | cut -d\" -f4) curl -L https://go.dev/"$LINK" | tar xz -C"$DIR"/.. appb sed -i '5i export GOPROXY=direct' "$DIR"/AppRun -part9 +appmk diff --git a/apps/mkjava b/apps/mkjava index 2cb7399..e31e0bb 100755 --- a/apps/mkjava +++ b/apps/mkjava @@ -1,6 +1,6 @@ #!/bin/sh -. "$(dirname "$0")"/appmk -part0 +# shellcheck source=../appdwarf +SOURCE=1 . "$(which appdwarf)" TYPE=jre VER=21 @@ -15,8 +15,7 @@ while [ $# -gt 0 ]; do done LINK=https://api.adoptium.net/v3/binary/latest/$VER/ga/linux/x64/"$TYPE"/hotspot/normal/eclipse -echo $LINK ungz mv "$DIR"/jdk*/* "$DIR" appb -part9 +appmk diff --git a/apps/mkmp3tag b/apps/mkmp3tag index c141f4c..3c13b16 100755 --- a/apps/mkmp3tag +++ b/apps/mkmp3tag @@ -1,10 +1,9 @@ #!/bin/sh -. "$(dirname "$0")"/appmk -part0 +# shellcheck source=../appdwarf +SOURCE=1 . "$(which appdwarf)" LINK=$(curl -L mp3tag.de/dodownload64.html | awk -F'[="]' /URL/'{print $7}') -aria2c "$LINK" -d "$DIR" -o mp3tag -7z x -y -o"$DIR" "$DIR"/mp3tag +un7z mp3tag mv "$DIR"/Mp3tag.exe "$DIR"/mp3tag appa sed -i '5s/ / wine /' "$DIR"/AppRun -part9 +appmk diff --git a/apps/mkmusikcube b/apps/mkmusikcube index 3e1f3b5..1094cf0 100755 --- a/apps/mkmusikcube +++ b/apps/mkmusikcube @@ -1,8 +1,8 @@ #!/bin/sh -. "$(dirname "$0")"/appmk -part0 +# shellcheck source=../appdwarf +SOURCE=1 . "$(which appdwarf)" LINK=$(curl https://api.github.com/repos/clangen/musikcube/releases | grep -om1 'http.*_64.*bz2') unbz mv "$DIR"/musikcube*/* "$DIR" appa -part9 +appmk diff --git a/apps/mkmusl b/apps/mkmusl index b155255..807f4a5 100755 --- a/apps/mkmusl +++ b/apps/mkmusl @@ -1,10 +1,10 @@ #!/bin/sh -. "$(dirname "$0")"/appmk -part0 +# shellcheck source=../appdwarf +SOURCE=1 . "$(which appdwarf)" LINK=http://musl.cc/x86_64-linux-musl-native.tgz ungz mv "$DIR"/x86_64-linux-musl-native/* "$DIR" ln -s gcc "$DIR"/bin/cc appa sed -i '5d;4a exec "$@"' "$DIR"/AppRun -part9 +appmk diff --git a/apps/mknode b/apps/mknode index 6268397..4bbe311 100755 --- a/apps/mknode +++ b/apps/mknode @@ -1,9 +1,9 @@ #!/bin/sh -. "$(dirname "$0")"/appmk -part0 +# shellcheck source=../appdwarf +SOURCE=1 . "$(which appdwarf)" LINK=https://nodejs.org/dist/latest/ LINK=$LINK$(curl $LINK | grep linux-x64.tar.xz | cut -d\" -f2) unxz mv "$DIR"/node*/* "$DIR" appb -part9 +appmk diff --git a/apps/mkpacman b/apps/mkpacman index 8ce23cb..f4bd982 100755 --- a/apps/mkpacman +++ b/apps/mkpacman @@ -1,6 +1,6 @@ #!/bin/sh -. "$(dirname "$0")"/appmk -part0 +# shellcheck source=../appdwarf +SOURCE=1 . "$(which appdwarf)" APP="$1" sudo pacman -Sw --cachedir "$DIR" --noconfirm "$@" parallel "tar xf {} -C$DIR" ::: "$DIR"/*.tar.zst @@ -8,4 +8,4 @@ rm -f "$DIR"/*.tar.zst* appb sed -i 4s#/lib#/usr/lib#g "$DIR"/AppRun sed -i 3,5s#/bin#/usr/bin# "$DIR"/AppRun -part9 +appmk diff --git a/apps/mkpinta b/apps/mkpinta index ec5f4df..92fa0bc 100755 --- a/apps/mkpinta +++ b/apps/mkpinta @@ -1,6 +1,6 @@ #!/bin/sh -. "$(dirname "$0")"/appmk -part0 +# shellcheck source=../appdwarf +SOURCE=1 . "$(which appdwarf)" API=/repos/PintaProject/Pinta/actions/artifacts QUERY='.artifacts[] | select(.name == "Pinta-linux-dotnet-8.0.x.zip") | .archive_download_url' LINK=$(gh api $API -q "$QUERY" | head -n1) @@ -8,4 +8,4 @@ gh api "$LINK" | bsdtar xf - -C"$DIR" bsdtar xf "$DIR"/*.zip -C"$DIR" rm "$DIR"/*.zip appa -part9 +appmk diff --git a/apps/mkpypy b/apps/mkpypy index ef2e14f..7398912 100755 --- a/apps/mkpypy +++ b/apps/mkpypy @@ -1,10 +1,10 @@ #!/bin/sh -. "$(dirname "$0")"/appmk -part0 +# shellcheck source=../appdwarf +SOURCE=1 . "$(which appdwarf)" LINK="$(curl https://www.pypy.org/download.html | grep http.\*linux64.tar.bz2 | head -n1 | cut -d\" -f4)" unbz mv "$DIR"/pypy*/* "$DIR" "$DIR"/bin/pypy -m ensurepip "$DIR"/bin/pypy -m pip install pipx appb -part9 +appmk diff --git a/apps/mkrenpy b/apps/mkrenpy index 4974a4e..a518abf 100755 --- a/apps/mkrenpy +++ b/apps/mkrenpy @@ -1,12 +1,11 @@ #!/bin/sh -. "$(dirname "$0")"/appmk -part0 +# shellcheck source=../appdwarf +SOURCE=1 . "$(which appdwarf)" LINK=$(curl https://www.renpy.org/latest.html | grep 7z | cut -d\" -f2) -aria2c "$LINK" -d "$DIR" -o renpy.exe -7z x -y -o"$DIR" "$DIR"/renpy.exe +un7z renpy.exe mkdir "$DIR"/lib mv "$DIR"/renpy-*/lib/py3-linux-x86_64 "$DIR"/renpy-*/lib/python* "$DIR"/lib mv "$DIR"/renpy-*/renpy* "$DIR" rm -r "$DIR"/*.exe "$DIR"/renpy-* "$DIR/renpy.app" ln -s renpy.sh "$DIR/AppRun" -part9 +appmk diff --git a/apps/mkrust b/apps/mkrust index 8fd37cc..463f531 100755 --- a/apps/mkrust +++ b/apps/mkrust @@ -1,10 +1,10 @@ #!/bin/sh -. "$(dirname "$0")"/appmk -part0 +# shellcheck source=../appdwarf +SOURCE=1 . "$(which appdwarf)" ARCH=x86_64-unknown-linux-gnu LINK=https://static.rust-lang.org/dist/rust-nightly-$ARCH.tar.gz ungz "$DIR"/rust-nightly-$ARCH/install.sh --prefix="$DIR" --components=cargo,rustc,rust-std-$ARCH rm -rf "$DIR"/rust-nightly-$ARCH appb -part9 +appmk diff --git a/apps/mksignal b/apps/mksignal deleted file mode 100755 index 37e5078..0000000 --- a/apps/mksignal +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -. "$(dirname "$0")"/appmk -part0 -eopkg fc -o "$DIR" signal-desktop -parallel "unzip -op {} install.tar.xz | tar xJf - -C$DIR" ::: "$DIR"/*.eopkg -ln -s usr/share/signal-desktop/signal-desktop "$DIR"/AppRun -rm "$DIR"/*.eopkg -part9 diff --git a/apps/mktex b/apps/mktex index 7407590..21d4a0f 100755 --- a/apps/mktex +++ b/apps/mktex @@ -1,6 +1,6 @@ #!/bin/sh -. "$(dirname "$0")"/appmk -part0 +# shellcheck source=../appdwarf +SOURCE=1 . "$(which appdwarf)" LINK=https://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz ungz mv "$DIR"/install-tl-* "$DIR"/tl @@ -39,8 +39,8 @@ tlpdbopt_sys_man /usr/local/share/man tlpdbopt_w32_multi_user 1 EOF "$DIR"/tl/install-tl -profile "$DIR"/tl/prof -rm -r "$DIR"/texmf-dist/scripts/tlcockpit "$DIR"/bin/x86_64-linux/tlmgr install bookhands fontawesome5 markdown paralist titlesec titling xstring soul +rm -r "$DIR"/texmf-dist/scripts/tlcockpit appb sed -i 3,5s#/bin#/bin/x86_64-linux# "$DIR"/AppRun -part9 +appmk diff --git a/apps/mkwine b/apps/mkwine index 5bc6c2d..4b52cab 100755 --- a/apps/mkwine +++ b/apps/mkwine @@ -1,38 +1,40 @@ #!/bin/sh -. "$(dirname "$0")"/appmk -part0 +# shellcheck source=../appdwarf +SOURCE=1 . "$(which appdwarf)" + VER=Kron4ek/Wine-Builds [ "$1" = "-p" ] && PREFIX=1 && shift -[ "$1" = "proton" ] && VER=GloriousEggroll/proton-ge-custom && shift [ "$1" = "lutris" ] && VER=lutris/wine && shift +[ "$1" = "proton" ] && VER=GloriousEggroll/proton-ge-custom && shift + LINK=$(curl -L api.github.com/repos/$VER/releases | jq .[0].assets[1] | grep -om1 git.\*tar..z) unarc mv "$DIR"/wine*/* "$DIR"/GE-Proton*/files/* "$DIR"/lutris*/* "$DIR" || true -t=winetricks; wget -O"$DIR"/bin/$t github.com/$t/$t/raw/master/src/$t -chmod +x "$DIR"/bin/$t rm -r "$DIR"/lib/wine/i386* +appb +t=winetricks +wget -O"$DIR"/bin/$t github.com/$t/$t/raw/master/src/$t +chmod +x "$DIR"/bin/$t + +apprun() { + export PATH="$APPDIR"/bin:"$PATH" + export LD_LIBRARY_PATH="$APPDIR"/lib64:"$APPDIR"/lib:"$LD_LIBRARY_PATH" + + if [ ! "$WINEPREFIX" ]; then + mkdir -p "$APPDIR.prefix" ~/.wine/work + fuse-overlayfs -o "lowerdir=$APPDIR/prefix,upperdir=$HOME/.wine,workdir=$HOME/.wine/work" "$APPDIR.prefix" + export WINEPREFIX="$APPDIR.prefix" + fi + + "$APPDIR/bin/$(basename "$ARGV0")" "$@" + + fusermount -quz "$APPDIR.prefix" + rmdir "$APPDIR.prefix" +} if [ "$PREFIX" ]; then WINEPREFIX="$DIR/prefix" "$DIR/bin/wine" cmd /c exit - cat > "$DIR/AppRun" << 'EOF' -#!/bin/sh -export PATH="$APPDIR"/bin:"$PATH" -export LD_LIBRARY_PATH="$APPDIR"/lib64:"$APPDIR"/lib:"$LD_LIBRARY_PATH" - -if [ ! $WINEPREFIX ]; then - mkdir -p "$APPDIR.prefix" ~/.wine/work - fuse-overlayfs -o "lowerdir=$APPDIR/prefix,upperdir=$HOME/.wine,workdir=$HOME/.wine/work" "$APPDIR.prefix" - export WINEPREFIX="$APPDIR.prefix" -fi - -"$APPDIR/bin/$(basename "$ARGV0")" "$@" - -fusermount -quz "$APPDIR.prefix" -rmdir "$APPDIR.prefix" -EOF -chmod +x "$DIR/AppRun" -else appb fi -part9 +appmk diff --git a/apps/rustsolus b/apps/rustsolus deleted file mode 100755 index 9af6263..0000000 --- a/apps/rustsolus +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -. "$(dirname "$0")"/appmk -part0 -eopkg fc -o "$DIR" cargo rust -parallel "unzip -op {} install.tar.xz | tar xJf - -C$DIR" ::: "$DIR"/*.eopkg -rm -r "$DIR"/usr/lib64/rustlib/i686-unknown-linux-gnu "$DIR"/*.eopkg -mv "$DIR"/usr/* "$DIR" -appb -part9