Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
mmtrt committed Dec 26, 2024
1 parent dc7ad2b commit e22e930
Show file tree
Hide file tree
Showing 3 changed files with 108 additions and 90 deletions.
27 changes: 11 additions & 16 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,11 @@ jobs:
- name: Prerequisites
run: |
sudo apt update && sudo apt install libfuse2 patchelf tree -y
wget -q "https://github.com/AppImageCrafters/appimage-builder/releases/download/v1.1.0/appimage-builder-1.1.0-x86_64.AppImage" -O appimage-builder ; chmod +x appimage-builder
wget -q "https://github.com/AppImageCrafters/appimage-builder/releases/download/Continuous/appimage-builder-1.1.1.dev32+g2709a3b-x86_64.AppImage" -O appimage-builder ; chmod +x appimage-builder ; ./appimage-builder --appimage-extract &>/dev/null
mkdir -p /usr/share/icons/hicolor/scalable/ ; cp wine.svg /usr/share/icons/hicolor/scalable/
wget -q "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage" -O appimagetool ; chmod a+x appimagetool
# devel
echo "WINE_VER=devel_9.22" >> $GITHUB_ENV
echo "UPINFO=$(grep -Eo update-info.* wine-devel.yml | awk '{print $2}')" >> $GITHUB_ENV
echo "WINE_VER=devel_$(wget -qO- https://github.com/mmtrt/Wine-Builds/releases/expanded_assets/latest | grep -Eo '[0-9].*xz"' | sed -r 's|-amd64| |' | head -1 | awk '{print $1}')" >> $GITHUB_ENV
# wineasio
git clone --recursive https://github.com/mmtrt/wineasio.git --depth=1 -b main
Expand All @@ -51,18 +50,14 @@ jobs:
# Runs a set of commands using the runners shell
- name: Build appimage
run: |
./appimage-builder --skip-appimage --recipe wine-devel.yml
find ${GITHUB_WORKSPACE}/AppDir/runtime/compat/lib/i386-linux-gnu/ -iname 'libz**' | xargs -i -t -exec cp {} ${GITHUB_WORKSPACE}/AppDir/usr/lib/i386-linux-gnu/
find ${GITHUB_WORKSPACE}/AppDir/runtime/compat/lib/x86_64-linux-gnu/ -iname 'libz**' | xargs -i -t -exec cp {} ${GITHUB_WORKSPACE}/AppDir/usr/lib/x86_64-linux-gnu/
find ${GITHUB_WORKSPACE}/AppDir/runtime/compat/usr/lib/i386-linux-gnu/ -iname 'libstdc**' | xargs -i -t -exec cp {} ${GITHUB_WORKSPACE}/AppDir/usr/lib/i386-linux-gnu/
find ${GITHUB_WORKSPACE}/AppDir/runtime/compat/usr/lib/x86_64-linux-gnu/ -iname 'libstdc**' | xargs -i -t -exec cp {} ${GITHUB_WORKSPACE}/AppDir/usr/lib/x86_64-linux-gnu/
chmod +x wine.sh
./wine.sh
cd ./AppDir/runtime/compat/lib/i386-linux-gnu/
ln -rsf ld-linux.so.2 ${GITHUB_WORKSPACE}/AppDir/runtime/default/lib/
cd ${GITHUB_WORKSPACE}
patchelf --set-interpreter 'lib/ld-linux.so.2' ./AppDir/opt/wine-devel/bin/wine
ARCH=x86_64 ./appimagetool --comp zstd -n -u ${UPINFO} AppDir/ wine-${WINE_VER}-x86_64.AppImage
# add custom mksquashfs
cp runtime/mksquashfs squashfs-root/usr/bin/mksquashfs
# force zstd format in appimagebuilder for appimages
rm appimage-builder ; sed -i 's|xz|zstd|' squashfs-root/usr/lib/python3.8/site-packages/appimagebuilder/modules/prime/appimage_primer.py
squashfs-root/AppRun --recipe wine-devel.yml
- name: release
uses: marvinpinto/action-automatic-releases@6273874b61ebc8c71f1a61b2d98e234cf389b303
with:
Expand Down
159 changes: 90 additions & 69 deletions wine-devel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ version: 1

script:
# Remove any previous build cache data
- rm -rf AppDir appimage-builder-cache/var/cache/apt/archives/*wine* || true
- rm -rf AppDir || true
- mkdir -p appimage-build/prime AppDir/winedata && cp wrapper AppDir
# Add winetricks
- wget -q "https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks" -P ./AppDir/bin && chmod +x ./AppDir/bin/winetricks
# Copy App icon to AppDir/usr/share/icons needed prior to appimage-builder ver 1.x.x
- mkdir -p AppDir/usr/share/icons ; cp wine.svg AppDir/usr/share/icons
- mkdir -p AppDir/usr/share/icons AppDir/usr/lib64 ; cp wine.svg AppDir/usr/share/icons
# Add static appimage runtime
# - cp runtime/runtime-x86_64 appimage-build/prime/runtime-x86_64
- cp runtime/runtime-x86_64 appimage-build/prime/runtime-x86_64
# Add config
- cp -R config AppDir/winedata
# Add wineaiso
Expand All @@ -27,7 +27,7 @@ AppDir:
exec_args: $APPDIR/wrapper $@

apt:
arch: [amd64, i386]
arch: [amd64]
sources:
- sourceline: 'deb http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse'
- sourceline: 'deb http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse'
Expand All @@ -41,72 +41,14 @@ AppDir:
key_url: 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0xf63f0f2b90935439'

include:
- wine-staging-i386=7.22~focal-1
- wine-staging-amd64=7.22~focal-1
- bash
- cabextract
# - cups
- dash
# - perl
- coreutils
- mesa-utils
- unionfs-fuse
- vulkan-tools
# - libcups2
# - libfuse2
# - libfuse3-3
- libmspack0
- python3-minimal
- python3.8
- python3
- python3-pyqt5
- gstreamer1.0-plugins-good:i386
- gstreamer1.0-plugins-bad:i386
- gstreamer1.0-plugins-ugly:i386
# - libnvidia-compute-520:i386
# - libnvidia-decode-520:i386
# - libnvidia-encode-520:i386
# - libnvidia-extra-520:i386
# - libnvidia-fbc1-520:i386
# - libnvidia-gl-520:i386
- libdrm2:i386
- libdrm-intel1:i386
- libdrm-nouveau2:i386
- libdrm-amdgpu1:i386
- libdrm-radeon1:i386
- libegl-mesa0:i386
- libegl1:i386
- libgbm1:i386
- libgl1:i386
- libgl1-mesa-dri:i386
- libglapi-mesa:i386
- libgles2:i386
- libglvnd0:i386
- libglx0:i386
- libglx-mesa0:i386
- mesa-vdpau-drivers:i386
- mesa-va-drivers:i386
- mesa-vulkan-drivers:i386
- libopenal1:i386
- libx11-6:i386
- libx11-xcb1:i386
- libxcb-dri2-0:i386
- libxcb-dri3-0:i386
- libxcb-glx0:i386
- libxcb-present0:i386
- libxcb-render0:i386
- libxcb-shape0:i386
- libxcb-shm0:i386
- libxcb-xfixes0:i386
- libxcb1:i386
- libxcomposite1:i386
# - winbind:i386
# - samba-common-bin:i386
# - samba-libs:i386
# - python3:i386
# - python3-samba:i386
# - python3-ldb:i386
# - python3-talloc:i386

files:
exclude:
Expand Down Expand Up @@ -172,14 +114,93 @@ AppDir:
- opt/wine-devel/lib64/wine/x86_64-unix/*.a
- opt/wine-devel/lib64/wine/x86_64-windows/*.a

runtime:
env:
PATH: '$APPDIR/bin:$APPDIR/sbin:$APPDIR/opt/wine-stable/bin:$APPDIR/usr/bin:$APPDIR/usr/sbin:$APPDIR/usr/libexec:${PATH}'
APPDIR_LIBRARY_PATH: '$APPDIR/runtime/compat/lib/i386-linux-gnu:$APPDIR/lib/i386-linux-gnu:$APPDIR/lib/x86_64-linux-gnu:$APPDIR/lib/x86_64-linux-gnu/security:$APPDIR/usr/lib/i386-linux-gnu:$APPDIR/usr/lib/i386-linux-gnu/alsa-lib:$APPDIR/usr/lib/i386-linux-gnu/caca:$APPDIR/usr/lib/i386-linux-gnu/capi:$APPDIR/usr/lib/i386-linux-gnu/dri:$APPDIR/usr/lib/i386-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders:$APPDIR/usr/lib/i386-linux-gnu/gstreamer-1.0:$APPDIR/usr/lib/i386-linux-gnu/i686/sse2:$APPDIR/usr/lib/i386-linux-gnu/krb5/plugins/preauth:$APPDIR/usr/lib/i386-linux-gnu/libgphoto2/2.5.24:$APPDIR/usr/lib/i386-linux-gnu/libgphoto2_port/0.12.0:$APPDIR/usr/lib/i386-linux-gnu/libv4l:$APPDIR/usr/lib/i386-linux-gnu/libv4l/plugins:$APPDIR/usr/lib/i386-linux-gnu/odbc:$APPDIR/usr/lib/i386-linux-gnu/pulseaudio:$APPDIR/usr/lib/i386-linux-gnu/sane:$APPDIR/usr/lib/i386-linux-gnu/sasl2:$APPDIR/usr/lib/i386-linux-gnu/sse2:$APPDIR/usr/lib/i386-linux-gnu/vdpau:$APPDIR/usr/lib/llvm-15/lib:$APPDIR/usr/lib/x86_64-linux-gnu:$APPDIR/usr/lib/x86_64-linux-gnu/dri:$APPDIR/usr/lib/x86_64-linux-gnu/gallium-pipe:$APPDIR/usr/lib/x86_64-linux-gnu/krb5/plugins/preauth:$APPDIR/usr/lib/x86_64-linux-gnu/nss:$APPDIR/usr/lib/x86_64-linux-gnu/pulseaudio:$APPDIR/usr/lib/x86_64-linux-gnu/vdpau:$APPDIR/lib/x86_64:$APPDIR/lib/i386'
LIBGL_DRIVERS_PATH: '${APPDIR}/usr/lib/i386-linux-gnu/dri:${APPDIR}/usr/lib/x86_64-linux-gnu/dri:${LIBGL_DRIVERS_PATH}'
LIBVA_DRIVERS_PATH: '${APPDIR}/usr/lib/i386-linux-gnu/dri:${APPDIR}/usr/lib/x86_64-linux-gnu/dri:${LIBVA_DRIVERS_PATH}'
APPDIR_LIBC_VERSION: '2.31'
after_bundle:
# this is executed after the packages and files are added
- |
# Patch wrapper script
sed -i 's|wine-appimage|wine-appimage-devel|' AppDir/wrapper
WINE_VER="$(wget -qO- https://github.com/mmtrt/Wine-Builds/releases/expanded_assets/latest | grep -Eo '[0-9].*xz"' | sed -r 's|-amd64| |' | head -1 | awk '{print $1}')"
wget -q "https://github.com/mmtrt/Wine-Builds/releases/download/latest/wine-${WINE_VER}-amd64.tar.xz"
mkdir -p AppDir/opt ; (cd AppDir/opt ; tar -xf ../../*.tar.xz ; mv wine-* wine-devel)
(cd AppDir/usr/bin; ln -s "../../opt/wine-devel/bin/"* .)
# Cleanup
rm -rf AppDir/usr/share/{applications,man,doc}
rm -rf AppDir/opt/wine-devel/share/{applications,man,doc}
rm -rf AppDir/opt/wine-devel/lib/wine/i386-windows/*.a
rm -rf AppDir/opt/wine-devel/lib64/wine/x86_64-unix/*.a
rm -rf AppDir/opt/wine-devel/lib64/wine/x86_64-windows/*.a
# Disable FileOpenAssociations
sed -i 's| LicenseInformation| LicenseInformation,\\\n FileOpenAssociations|g;$a \\n[FileOpenAssociations]\nHKCU,Software\\Wine\\FileOpenAssociations,"Enable",,"N"' AppDir/opt/wine-devel/share/wine/wine.inf
# Disable winemenubuilder
sed -i 's| FileOpenAssociations| FileOpenAssociations,\\\n DllOverrides|;$a \\n[DllOverrides]\nHKCU,Software\\Wine\\DllOverrides,"*winemenubuilder.exe",,""' AppDir/opt/wine-devel/share/wine/wine.inf
sed -i '/\%11\%\\winemenubuilder.exe -a -r/d' AppDir/opt/wine-devel/share/wine/wine.inf
# Pre patch CJK font replacement with Noto Sans CJK by defualt
sed -i 's| DllOverrides| DllOverrides,\\\n FontReplacement|g;$a \\n[FontReplacement]\nHKCU,Software\\Wine\\Fonts\\Replacements,"Batang",,"Noto Sans CJK KR"\nHKCU,Software\\Wine\\Fonts\\Replacements,"BatangChe",,"Noto Sans CJK KR"\nHKCU,Software\\Wine\\Fonts\\Replacements,"Dotum",,"Noto Sans CJK KR"\nHKCU,Software\\Wine\\Fonts\\Replacements,"DotumChe",,"Noto Sans CJK KR"\nHKCU,Software\\Wine\\Fonts\\Replacements,"Gulim",,"Noto Sans CJK KR"\nHKCU,Software\\Wine\\Fonts\\Replacements,"GulimChe",,"Noto Sans CJK KR"\nHKCU,Software\\Wine\\Fonts\\Replacements,"Microsoft JhengHei",,"Noto Sans CJK TC"\nHKCU,Software\\Wine\\Fonts\\Replacements,"Microsoft JhengHei Light",,"Noto Sans CJK TC Light"\nHKCU,Software\\Wine\\Fonts\\Replacements,"Microsoft JhengHei Bold",,"Noto Sans CJK TC Black"\nHKCU,Software\\Wine\\Fonts\\Replacements,"Microsoft JhengHei UI",,"Noto Sans CJK TC"\nHKCU,Software\\Wine\\Fonts\\Replacements,"Microsoft JhengHei UI Light",,"Noto Sans CJK TC Light"\nHKCU,Software\\Wine\\Fonts\\Replacements,"Microsoft JhengHei UI Bold",,"Noto Sans CJK TC Black"\nHKCU,Software\\Wine\\Fonts\\Replacements,"Microsoft YaHei",,"Noto Sans CJK SC"\nHKCU,Software\\Wine\\Fonts\\Replacements,"Microsoft YaHei Light",,"Noto Sans CJK SC Light"\nHKCU,Software\\Wine\\Fonts\\Replacements,"Microsoft YaHei Bold",,"Noto Sans CJK SC Black"\nHKCU,Software\\Wine\\Fonts\\Replacements,"Microsoft YaHei UI",,"Noto Sans CJK SC"\nHKCU,Software\\Wine\\Fonts\\Replacements,"Microsoft YaHei UI Light",,"Noto Sans CJK SC Light"\nHKCU,Software\\Wine\\Fonts\\Replacements,"Microsoft YaHei UI Bold",,"Noto Sans CJK SC Black"\nHKCU,Software\\Wine\\Fonts\\Replacements,"MingLiU",,"Noto Sans CJK TC"\nHKCU,Software\\Wine\\Fonts\\Replacements,"MingLiU-ExtB",,"Noto Sans CJK TC"\nHKCU,Software\\Wine\\Fonts\\Replacements,"MingLiU_HKSCS",,"Noto Sans CJK HK"\nHKCU,Software\\Wine\\Fonts\\Replacements,"MingLiU_HKSCS-ExtB",,"Noto Sans CJK HK"\nHKCU,Software\\Wine\\Fonts\\Replacements,"MS Gothic",,"Noto Sans CJK JP"\nHKCU,Software\\Wine\\Fonts\\Replacements,"MS PGothic",,"Noto Sans CJK JP"\nHKCU,Software\\Wine\\Fonts\\Replacements,"MS UI Gothic",,"Noto Sans CJK JP"\nHKCU,Software\\Wine\\Fonts\\Replacements,"NSimSun",,"Noto Sans CJK SC"\nHKCU,Software\\Wine\\Fonts\\Replacements,"PMingLiU",,"Noto Sans CJK TC"\nHKCU,Software\\Wine\\Fonts\\Replacements,"PMingLiU-ExtB",,"Noto Sans CJK TC"\nHKCU,Software\\Wine\\Fonts\\Replacements,"SimHei",,"Noto Sans CJK SC"\nHKCU,Software\\Wine\\Fonts\\Replacements,"SimSun",,"Noto Sans CJK SC"\nHKCU,Software\\Wine\\Fonts\\Replacements,"SimSun-ExtB",,"Noto Sans CJK SC"\nHKCU,Software\\Wine\\Fonts\\Replacements,"Yu Gothic Regular",,"Noto Sans CJK JP"\nHKCU,Software\\Wine\\Fonts\\Replacements,"Yu Gothic Medium",,"Noto Sans CJK JP Medium"\nHKCU,Software\\Wine\\Fonts\\Replacements,"Yu Gothic Light",,"Noto Sans CJK JP Light"\nHKCU,Software\\Wine\\Fonts\\Replacements,"Yu Gothic Bold",,"Noto Sans CJK JP Black"\nHKCU,Software\\Wine\\Fonts\\Replacements,"Yu Gothic UI Regular",,"Noto Sans CJK JP"\nHKCU,Software\\Wine\\Fonts\\Replacements,"Yu Gothic UI Medium",,"Noto Sans CJK JP Medium"\nHKCU,Software\\Wine\\Fonts\\Replacements,"Yu Gothic UI Semilight",,"Noto Sans CJK JP DemiLight"\nHKCU,Software\\Wine\\Fonts\\Replacements,"Yu Gothic UI Light",,"Noto Sans CJK JP Light"\nHKCU,Software\\Wine\\Fonts\\Replacements,"Yu Gothic UI Bold",,"Noto Sans CJK JP Black"' AppDir/opt/wine-devel/share/wine/wine.inf
# Deploy wine-mono wine-gecko
# For future reference setting of MONO_VER see https://github.com/wine-mirror/wine/tree/stable of wine-stable
MONO_VER=$(wget "https://raw.githubusercontent.com/wine-mirror/wine/$(wget -qO- https://github.com/wine-mirror/wine/releases/tag/wine-${WINE_VER} | grep 'commit/' | sed -r 's|/wine-mirror/wine/commit/||g' | cut -d'"' -f2 | head -1)/dlls/appwiz.cpl/addons.c" -qO- | grep -Po 'MONO_VERSION.*[0-9]"' | cut -d'"' -f2)
GECKO_VER=$(wget "https://raw.githubusercontent.com/wine-mirror/wine/$(wget -qO- https://github.com/wine-mirror/wine/releases/tag/wine-${WINE_VER} | grep 'commit/' | sed -r 's|/wine-mirror/wine/commit/||g' | cut -d'"' -f2 | head -1)/dlls/appwiz.cpl/addons.c" -qO- | grep -Po 'GECKO_VERSION.*[0-9]"' | cut -d'"' -f2)
case "$WINE_VER" in
3.0.1|3.0.2|3.0.3|3.0.4|3.0.5)
GECKO_VER="2.47"
MONO_VER="4.7.1"
;;
4.0.1|4.0.2|4.0.3|4.0.4)
GECKO_VER="2.47"
MONO_VER="4.7.5"
;;
5.0.1|5.0.2|5.0.3|5.0.4|5.0.5)
GECKO_VER="2.47.1"
MONO_VER="4.9.4"
;;
6.0.1|6.0.2|6.0.3|6.0.4)
GECKO_VER="2.47.2"
MONO_VER="5.1.1"
;;
7.0.1|7.0.2|7.0.3|7.0.4)
GECKO_VER="2.47.2"
MONO_VER="7.0.0-x86"
;;
*)
MONO_VER="$MONO_VER-x86"
;;
esac
# if [[ $(echo $GECKO_VER |sed -e 's/\.//g') -le 247 ]]; then
# GECKO=wine_gecko-${GECKO_VER}
# else
# GECKO=wine-gecko-${GECKO_VER}
# fi
MONO_URL="https://dl.winehq.org/wine/wine-mono/$(cut -d'-' -f1 <<< ${MONO_VER})/wine-mono-${MONO_VER}.msi"
# GECKO_URL_x86="https://dl.winehq.org/wine/wine-gecko/$GECKO_VER/${GECKO}-x86.msi"
# GECKO_URL_x86_64="https://dl.winehq.org/wine/wine-gecko/$GECKO_VER/${GECKO}-x86_64.msi"
# wget -q "$MONO_URL" -O AppDir/winedata/wine-mono-${MONO_VER}.msi
# wget -q "$GECKO_URL_x86" -O AppDir/winedata/${GECKO}-x86.msi
# wget -q "$GECKO_URL_x86_64" -O AppDir/winedata/${GECKO}-x86_64.msi
after_runtime:
# this is executed after the runtime is added
- |
# Remove runtime info
sed -i '/modules_dir/d' AppDir/AppRun.config
runtime:
version: v3.0.0-devel-2
path_mappings:
- /opt/wine-devel:$APPDIR/opt/wine-devel

Expand Down
12 changes: 7 additions & 5 deletions wrapper
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# WINE env
export WINEPREFIX=${WINEPREFIX:-"$HOME/.wine-appimage"}
export WINE="$APPDIR/usr/bin/wine"
export WINEDEBUG=${WINEDEBUG:-"fixme-all"}
export WINEPREFIX=${WINEPREFIX:-"$HOME/.wine-appimage"}
export WINESERVER="$APPDIR/usr/bin/wineserver"

# DXVK env
export DXVK_HUD=${DXVK_HUD:-"0"}
Expand Down Expand Up @@ -79,16 +81,16 @@ asio-register(){
)

u64=(
"$APPDIR/opt/wine-devel/lib64/wine/x86_64-unix/wineasio64.so"
"$APPDIR/opt/wine-stable/lib64/wine/x86_64-unix/wineasio64.so"
"$APPDIR/opt/wine-staging/lib64/wine/x86_64-unix/wineasio64.so"
"$APPDIR/opt/wine-devel/lib/wine/x86_64-unix/wineasio64.so"
"$APPDIR/opt/wine-stable/lib/wine/x86_64-unix/wineasio64.so"
"$APPDIR/opt/wine-staging/lib/wine/x86_64-unix/wineasio64.so"
)

# try to register 32bit DLL
for u in ${u32[@]}; do
if [ -e "${u}" ]; then
cp -v "${u}" "${WINEPREFIX}/drive_c/windows/syswow64/wineasio32.dll"
$APPDIR/usr/bin/wine regsvr32 "${u}"
regsvr32 "${u}"
break
fi
done
Expand Down

0 comments on commit e22e930

Please sign in to comment.