Skip to content

Instantly share code, notes, and snippets.

@mmtrt
Last active June 17, 2019 05:19
Show Gist options
  • Save mmtrt/1a707b6e086cbf89e9481000664c3398 to your computer and use it in GitHub Desktop.
Save mmtrt/1a707b6e086cbf89e9481000664c3398 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Download and build League patched glibc + wine-staging deb script.
# glibc version
cver=2.27
# wine-staging version
wver=4.10
# Install build dependencies for 64-bit
sudo apt update
sudo apt install -y build-essential autotools-dev autoconf debhelper docbook-to-man docbook-utils docbook-xsl fontforge libacl1-dev libasound2-dev libavcodec-dev libcapi20-dev libcups2-dev libdbus-1-dev libfontconfig1-dev libfreetype6-dev libgl1-mesa-dev libglu1-mesa-dev libgnutls28-dev libgphoto2-dev gcc-8 libgsm1-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgtk-3-dev libice-dev libkrb5-dev liblcms2-dev libldap2-dev libldap-dev libmpg123-dev libncurses5-dev libopenal-dev libosmesa6-dev libpcap-dev libpulse-dev libsane-dev libsdl2-dev libssl-dev libudev-dev libv4l-dev libva-dev libxcomposite-dev libxcursor-dev libxi-dev libxinerama-dev libxml2-dev libxrandr-dev libxrender-dev libxslt1-dev libxt-dev prelink sharutils unixodbc-dev bison flex gawk quilt rdfind symlinks gperf systemtap-sdt-dev libaudit-dev libcap-dev libselinux-dev g++-7-multilib libvulkan-dev
mkdir -p ~/build
# Download and unpack glibc
cd ~/build
wget -nv -c http://archive.ubuntu.com/ubuntu/pool/main/g/glibc/glibc_${cver}-3ubuntu1.dsc
wget -nv -c http://archive.ubuntu.com/ubuntu/pool/main/g/glibc/glibc_${cver}.orig.tar.xz
wget -nv -c http://archive.ubuntu.com/ubuntu/pool/main/g/glibc/glibc_${cver}-3ubuntu1.debian.tar.xz
dpkg-source -x glibc_${cver}-3ubuntu1.dsc
cd glibc-${cver}
# Download and Apply league glibc patch
curl 'https://bugs.winehq.org/attachment.cgi?id=64482' | patch -p1
# Build glibc deb
DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -b -us -uc
# Download and unpack wine-staging source
cd ~/build
wget -nv -c https://dl.winehq.org/wine-builds/ubuntu/dists/bionic/main/source/wine-staging_${wver}~bionic.dsc
wget -nv -c https://dl.winehq.org/wine-builds/ubuntu/dists/bionic/main/source/wine-staging_${wver}~bionic.orig.tar.gz
wget -nv -c https://dl.winehq.org/wine-builds/ubuntu/dists/bionic/main/source/wine-staging_${wver}~bionic.diff.gz
dpkg-source -x wine-staging_${wver}~bionic.dsc
cd wine-staging-${wver}~bionic
# Download and Apply league wine patches
curl 'https://bugs.winehq.org/attachment.cgi?id=64481' | patch -p1
curl 'https://bugs.winehq.org/attachment.cgi?id=64496' | patch -p1
# Download and Apply custom wine patches
wget -qO- 'https://github.com/Tk-Glitch/PKGBUILDS/raw/master/wine-tkg-git/wine-tkg-patches/use_clock_monotonic.patch' | patch -p1
wget -qO- 'https://github.com/Tk-Glitch/PKGBUILDS/raw/master/wine-tkg-git/wine-tkg-patches/use_clock_monotonic-2.patch' | patch -p1
wget -qO- 'https://github.com/Tk-Glitch/PKGBUILDS/raw/master/wine-tkg-git/wine-tkg-patches/steam.patch' | patch -p1
wget -qO- 'https://gist.github.com/mmtrt/ce6500fb21455ef8db245ae825b41a22/raw/f5a9143bf03fc69a637df743a6de3a54e68bed3f/0006-winecfg-Toggle-upstream-CSMT-implementation.patch' | patch -p1
wget -qO- 'https://github.com/Tk-Glitch/PKGBUILDS/raw/master/wine-tkg-git/wine-tkg-patches/GLSL-toggle.patch' | patch -p1
wget -qO- 'https://github.com/Tk-Glitch/PKGBUILDS/raw/master/wine-tkg-git/wine-tkg-patches/LAA-staging.patch' | patch -p1
wget -qO- 'https://github.com/Tk-Glitch/PKGBUILDS/raw/master/wine-tkg-git/wine-tkg-patches/FS_bypass_compositor.patch' | patch -p1
wget -qO- 'https://github.com/Tk-Glitch/PKGBUILDS/raw/master/wine-tkg-git/wine-tkg-patches/enable_stg_shared_mem_def.patch' | patch -p1
# Build wine-staging amd64 deb
dpkg-buildpackage -b -us -uc
# Create 32-bit LXC container
sudo apt install -y lxc lxc-templates debootstrap
sudo lxc-create -t ubuntu -n ubuntu32 -- --bindhome $LOGNAME -a i386 -r bionic
sudo lxc-start -n ubuntu32
# Install build dependencies and build for 32-bit
sudo lxc-attach -n ubuntu32 -- apt install build-essential autotools-dev autoconf debhelper docbook-to-man docbook-utils docbook-xsl fontforge libacl1-dev libasound2-dev libavcodec-dev libcapi20-dev libcups2-dev libdbus-1-dev libfontconfig1-dev libfreetype6-dev libgl1-mesa-dev libglu1-mesa-dev libgnutls28-dev libgphoto2-dev gcc-8 libgsm1-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgtk-3-dev libice-dev libkrb5-dev liblcms2-dev libldap2-dev libldap-dev libmpg123-dev libncurses5-dev libopenal-dev libosmesa6-dev libpcap-dev libpulse-dev libsane-dev libsdl2-dev libssl-dev libudev-dev libv4l-dev libva-dev libxcomposite-dev libxcursor-dev libxi-dev libxinerama-dev libxml2-dev libxrandr-dev libxrender-dev libxslt1-dev libxt-dev prelink sharutils unixodbc-dev bison flex gawk quilt rdfind symlinks gperf systemtap-sdt-dev libaudit-dev libcap-dev libselinux-dev g++-7-multilib libvulkan-dev
# Build glibc i386 deb
sudo lxc-attach -n ubuntu32 -- sh -c "cd ~/build/glibc-${cver}; DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -b -us -uc"
# Build wine-staging i386 deb
sudo lxc-attach -n ubuntu32 -- sh -c "cd ~/build/wine-staging-${wver}~bionic; dpkg-buildpackage -b -us -uc"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment