Redo wine script to match others and reorg

This commit is contained in:
Phantop 2021-12-31 14:37:50 -05:00
parent 9a41bff158
commit 85337d120e
15 changed files with 56 additions and 354 deletions

2
.gitignore vendored
View File

@ -1,2 +0,0 @@
java
wine/wine

View File

@ -1,9 +1,5 @@
<<<<<<< HEAD
# wine-portable-executable
Wine builds packed into a portable executables
appdwarf
=======
## Description
These scripts automatically fetch the latest version of their respective program and compress them into a portable image using [dwarfs](https://github.com/mhx/dwarfs) in a similar format to an [AppImage.](https://appimage.org/)
The titular `appdwarf` utility supports both converting an AppDir or an existing AppImage file, either as a local file or from a URL, and is used similarly to how 'appimagetool' is.
@ -34,4 +30,3 @@ Keep in mind that this project is new and it has not been thoroughly tested. Ple
[dwarfs](https://github.com/mhx/dwarfs) by [mhx](https://github.com/mhx)
Java builds from [AdoptOpenJDK](https://adoptopenjdk.net/)
>>>>>>> fe54f14 (dwarfs, latest builds, add java)

View File

@ -1 +0,0 @@
theme: jekyll-theme-cayman

View File

@ -51,12 +51,8 @@ do
echo Maintained by phantop.
exit 0
;;
--appimage | -a)
appimage "${@:2}"
exit 0
;;
--folder | -f)
header_folder $2
header_folder $(realpath $2)
shift 2
;;
--lookback | -b)
@ -67,6 +63,11 @@ do
header_separate
shift
;;
--appimage | -a)
appimage "${@:2}"
exit 0
;;
--url | -u)
file=$(basename "$2")
wget "$2" -O "$file" || exit 1

View File

@ -1,8 +1,9 @@
#!/bin/bash
PATH=$(dirname $(readlink -f "${0}")):$PATH
PATH=$(dirname $(readlink -f "${0}"))/..:$PATH
DIR=/tmp/dwarf-portable-executable
mkdir -p $DIR
curl -L https://golang.org/$(curl -sL https://golang.org/dl | grep -wo dl/go.\*linux-amd64.tar.gz | head -n1) | tar xz -C$DIR
LINK=$(curl -sL https://golang.org/dl | grep -wo dl/go.\*linux-amd64.tar.gz | head -n1)
curl -L https://golang.org/$LINK | tar xz -C$DIR
cat > $DIR/go/AppRun << 'EOF'
#!/bin/sh

View File

@ -1,5 +1,5 @@
#!/bin/bash
PATH=$(dirname $(readlink -f "${0}")):$PATH
PATH=$(dirname $(readlink -f "${0}"))/..:$PATH
DIR=/tmp/dwarf-portable-executable/java
JRE=$DIR/jre
VER=$1

40
apps/mkwine Executable file
View File

@ -0,0 +1,40 @@
#!/bin/bash
PATH=$(dirname $(readlink -f "${0}"))/..:$PATH
DIR=/tmp/dwarf-portable-executable/wine
mkdir -p $DIR
LINK="$(curl https://api.github.com/repos/Kron4ek/Wine-Builds/releases | grep -wo http.\*-staging-tkg-amd64.tar.xz | head -n1)"
curl -L $LINK | tar xJ -C$DIR
mv $DIR/wine*/* $DIR
rmdir $DIR/wine*/
wget -O$DIR/winetricks https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks
chmod +x $DIR/winetricks
cat > $DIR/AppRun << 'EOF'
#!/bin/bash
HERE="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
export WINE="${HERE}"/bin/wine
export WINE64="${HERE}"/bin/wine64
export WINESERVER="${HERE}"/bin/wineserver
export WINETRICKS="${HERE}"/winetricks
export DXVK_STATE_CACHE_PATH=~/.cache DXVK_LOG_PATH=none
if [ "$1" = "winetricks" ]; then
if [ $# -ge 2 ]; then
shift
"${WINETRICKS}" "$@"
else
"${WINETRICKS}" --help
fi
else
"${WINE}" "$@"
"${WINESERVER}" -w
fi
EOF
chmod +x $DIR/AppRun
appdwarf $DIR $@
rm -r $DIR
mv wine.sh wine

9
headers Normal file → Executable file
View File

@ -5,10 +5,11 @@ header_separate() {
#!/bin/sh
DIR="$(mktemp -td dwarf_$(basename "$0")XXXXX)"
ARG="-o offset=auto -o tidy_strategy=swap -o workers=4"
dwarfs $ARG "$0" "$DIR" 2>/dev/null
export APPDWARF_CMD=$(basename "$0")
dwarfs $ARG "$0" "$DIR" 2>/dev/null
"$DIR/AppRun" "$@"
fusermount -u "$DIR"
fusermount -uz "$DIR"
rmdir "$DIR"
exit
EOF
@ -19,13 +20,13 @@ header() {
#!/bin/sh
DIR="/tmp/dwarf_$(basename "$0")$(echo "$0" | md5sum | head -c5)"
export APPDWARF_CMD=$(basename "$0")
if [[ ! -d $DIR ]]; then
mkdir "$DIR"
ARG="-o offset=auto -o tidy_strategy=swap -o workers=4"
dwarfs $ARG "$0" "$DIR" 2>/dev/null
fi
"$DIR/AppRun" "$@"
"$DIR/AppRun" "$@"
fusermount -qu "$DIR"
rmdir "$DIR" 2> /dev/null
exit

View File

@ -1,25 +0,0 @@
#!/usr/bin/env bash
script_dir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
if [ -z "$DISABLE_RUNTIME" ]; then
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${script_dir}/wine-runtime/lib:${script_dir}/wine-runtime/lib32"
fi
export WINE="${script_dir}"/wine/bin/wine
export WINE64="${script_dir}"/wine/bin/wine64
export WINESERVER="${script_dir}"/wine/bin/wineserver
export WINETRICKS="${script_dir}"/winetricks
export DXVK_STATE_CACHE_PATH=~/.cache DXVK_LOG_PATH=none
if [ "$1" = "winetricks" ]; then
if [ $# -ge 2 ]; then
shift
"${WINETRICKS}" "$@"
else
"${WINETRICKS}" --help
fi
else
"${WINE}" "$@"
"${WINESERVER}" -w
fi

View File

@ -1,21 +0,0 @@
MIT License
Copyright (c) 2019 Kron
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -1,108 +0,0 @@
## Deprecated
The project is deprecated in favor of another my project [**Conty**](https://github.com/Kron4ek/Conty), which is basically a much improved and extended version of this project.
Conty not only allows to run Wine without any dependecies installed, but also allows to run anything else. Take a look, if you are interested.
https://github.com/Kron4ek/Conty
## Description
This project allows you to pack Wine and almost all of its required libraries into a single portable executable that should work on most Linux distributions. This project uses SquashFS as the container for Wine and its libraries (similar to what AppImage does).
What are the benefits compared to regular Wine builds? The main benefit is that fewer libraries need to be installed. Another benefit is that SquashFS supports fast compression algorithms (such as lz4 or zstd), so Wine can launch faster and use less disk space.
This is the structure of the portable executables generated (from the beginning to the end of the file):
1. A script that mounts the bundled squashfs image and runs Wine
2. The squashfuse binary and its libraries, in case squashfuse isn't installed
3. The squashfs image that contains Wine, its required libraries (wine-runtime)
and a custom launch script
---
## Requirements
First of all, **FUSE** is required.
Despite that most required libraries are included into the squashfs image, some libraries still need to be installed. This is the list of libraries that need to be installed:
* libc6 (glibc)
* libstdc++6 (gcc-libs)
* libgcc1 (gcc-libs)
* libfreetype6 (freetype2)
* libasound2 (alsa-lib; required for sound to work)
* libgl1 (required for running OpenGL applications and for using WineD3D)
* vulkan-driver (required for running Vulkan applications and for using DXVK)
Here are optional libraries that may be required for some applications:
* libgnutls30 (gnutls)
* libldap-2.4-2 (libldap)
* libgmp10 (gmp)
It's important to install both the 32-bit and 64-bit versions of these libraries.
**GLIBC 2.27** or newer is required as the runtime is from Ubuntu 18.04.
---
## How to use portable Wine executables
You can download ready-to-use portable Wine/Proton executables from the [releases](https://github.com/Kron4ek/wine-portable-executable/releases) page.
Root rights are **not required**!
Make the script executable and run it. For example:
chmod +x wine-portable-5.x-staging-amd64.sh
./wine-portable-5.x-staging-amd64.sh application.exe
To run winecfg (you can run regedit the same way):
./wine-portable-5.x-staging-amd64.sh winecfg
You can also use the built-in winetricks to install dlls and other components. For example, the command below will install dxvk and d3dcompiler_47:
./wine-portable-5.x-staging-amd64.sh winetricks dxvk d3dcompiler_47
For testing purposes or if installing libraries is not a problem for you (but you like SquashFS and the idea of a single Wine executable), you can disable the included libraries (runtime), in which case Wine will use only system libraries:
export DISABLE_RUNTIME=1
./wine-portable-5.x-staging-amd64.sh application.exe
---
## How to create portable Wine executables
Use **create_wine_portable.sh**.
This script will use ready-to-use binaries to create portable Wine executable.
If you want to create a runtime, squashfuse and Wine build from the scratch, then read the next section below.
---
## From the scratch / Sources
All components used in this project (the runtime, the squashfuse and the Wine builds) were created using the official sources.
For my and your convenience i regularly upload ready-to-use runtime, squashfuse and Wine builds.
If you want, you can create everything yourself using the available scripts.
Available scripts:
* **create_ubuntu_chroots.sh** creates two Ubuntu chroots (32-bit and 64-bit).
* **build_wine.sh** compiles Wine builds using two Ubuntu chroots (32-bit and 64-bit).
* **create_wine_runtime.sh** creates runtime by copying libraries from two Ubuntu chroots (32-bit and 64-bit).
* **build_squashfuse.sh** compiles squashfuse, lz4 and zstd in 64-bit Ubuntu chroot and creates squashfuse.tar with them included.
The first two scripts are available in another my project: https://github.com/Kron4ek/Wine-Builds
---
### Notes
Keep in mind that this project is new and it has not been thoroughly tested. Please report any problems you find.

View File

@ -1,53 +0,0 @@
#!/usr/bin/env bash
## This script creates runtime for Wine by using two Ubuntu chroots
scriptdir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
CHROOT_X64="${HOME}/chroots/bionic64_chroot"
CHROOT_X32="${HOME}/chroots/bionic32_chroot"
if [ ! -d "${CHROOT_X64}" ] || [ ! -d "${CHROOT_X32}" ]; then
echo "Chroots are required for the runtime creation!"
exit 1
fi
if [ ! -f "${scriptdir}"/runtime_libs_list.txt ]; then
echo "runtime_libs_list.txt is required!"
exit 1
fi
rm -rf "${scriptdir}"/wine-runtime
mkdir -p "${scriptdir}"/wine-runtime/lib32
mkdir -p "${scriptdir}"/wine-runtime/lib
echo "Copying libraries..."
while read lib; do
if [ -f "${CHROOT_X32}"/usr/local/lib/"${lib}" ]; then
cp "${CHROOT_X32}"/usr/local/lib/"${lib}" "${scriptdir}"/wine-runtime/lib32 2>/dev/null
else
cp "${CHROOT_X32}"/lib/i386-linux-gnu/"${lib}" "${scriptdir}"/wine-runtime/lib32 2>/dev/null
cp "${CHROOT_X32}"/usr/lib/i386-linux-gnu/"${lib}" "${scriptdir}"/wine-runtime/lib32 2>/dev/null
fi
if [ -f "${CHROOT_X64}"/usr/local/lib/"${lib}" ]; then
cp "${CHROOT_X64}"/usr/local/lib/"${lib}" "${scriptdir}"/wine-runtime/lib 2>/dev/null
else
cp "${CHROOT_X64}"/lib/x86_64-linux-gnu/"${lib}" "${scriptdir}"/wine-runtime/lib 2>/dev/null
cp "${CHROOT_X64}"/usr/lib/x86_64-linux-gnu/"${lib}" "${scriptdir}"/wine-runtime/lib 2>/dev/null
fi
done < "${scriptdir}"/runtime_libs_list.txt
cd "${scriptdir}" || exit 1
find wine-runtime -type f -exec strip --strip-unneeded {} \;
echo "Creating and compressing archive..."
tar -cf wine-runtime.tar wine-runtime
xz -9 wine-runtime.tar
rm -r wine-runtime
if [ -d binaries ]; then ln -sfr wine-runtime.tar.xz binaries; fi
echo "Done"

View File

@ -1,62 +0,0 @@
#!/usr/bin/env bash
start="$PWD"
winedir=/tmp/dwarf-portable-executable/wine
script_dir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
PATH=$script_dir/..:$PATH
# You can change the url below if you want to use a different Wine build
# You can also put your directory (named wine) containing Wine build near the script
# If the script will see the directory named wine, then this URL will not be used
wine_url="$(curl https://api.github.com/repos/Kron4ek/Wine-Builds/releases | grep -wo http.\*-staging-tkg-amd64.tar.xz | head -n1)"
# If there is no wine directory, then download Wine build from the URL
mkdir -p $winedir && cd $winedir
if [ ! -d wine ]; then
wget -nv -O wine.tar.xz "${wine_url}" -q --show-progress
if [ $? -ne 0 ]; then
echo "URL for downloading Wine is incorrect!"
echo "Please set wine_url variable to correct URL"
exit 1
fi
tar xf wine.tar.xz
rm wine.tar.xz
mv wine* wine
fi
if [ ! -d wine-runtime ]; then
if [ ! -f "${script_dir}"/wine-runtime.tar.xz ]; then
echo "wine-runtime.tar.xz is required!"
exit 1
elif [ "$(stat -c%s "${script_dir}"/wine-runtime.tar.xz)" -lt 10000 ]; then
echo "Seems like wine-runtime.tar.xz is corrupted!"
exit 1
else
tar xf "${script_dir}"/wine-runtime.tar.xz
fi
fi
if [ ! -f AppRun ]; then
if [ ! -f "${script_dir}"/AppRun ]; then
echo "AppRun is required!"
exit 1
else
cp "${script_dir}"/AppRun .
fi
chmod +x AppRun
fi
if [ ! -f winetricks ]; then
if [ ! -f "${script_dir}"/winetricks ]; then
wget -nv -O winetricks "https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks" -q --show-progress
fi
chmod +x winetricks
fi
cd "$start"
appdwarf $winedir
rm -r $winedir
mv wine.sh wine

View File

@ -1,64 +0,0 @@
libasn1.so.8
libasyncns.so.0
libbsd.so.0
libcapi20.so.3
libcom_err.so.2
libexif.so.12
libexpat.so.1
libFAudio.so.0
libFLAC.so.8
libgcrypt.so.20
libgpg-error.so.0
libgphoto2_port.so.12
libgphoto2.so.6
libgsm.so.1
libhcrypto.so.4
libheimbase.so.1
libheimntlm.so.0
libhx509.so.5
libicudata.so.60
libicuuc.so.60
libjbig.so.0
libjpeg.so.8
libkrb5.so.26
liblber-2.4.so.2
liblcms2.so.2
libltdl.so.7
liblz4.so.1
liblzma.so.5
libmpg123.so.0
libodbc.so.2
libogg.so.0
libopenal.so.1
libpcap.so.0.8
libpng16.so.16
libroken.so.18
libSDL2-2.0.so.0
libsndfile.so.1
libsndio.so.6.1
libsqlite3.so.0
libtiff.so.5
libudev.so.1
libvkd3d-shader.so.1
libvkd3d.so.1
libvorbisenc.so.2
libvorbis.so.0
libvulkan.so.1
libwind.so.0
libwrap.so.0
libX11.so.6
libXau.so.6
libxcb.so.1
libXcomposite.so.1
libXcursor.so.1
libXdmcp.so.6
libXext.so.6
libXfixes.so.3
libXinerama.so.1
libXi.so.6
libxml2.so.2
libXrandr.so.2
libXrender.so.1
libxslt.so.1
libXxf86vm.so.1
libz.so.1