forked from AndreRH/hangover
-
Notifications
You must be signed in to change notification settings - Fork 3
/
build_wine_termux.sh
39 lines (29 loc) · 1.61 KB
/
build_wine_termux.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
# Script based on https://blog.joshumax.me/general/2018/01/19/building-wine-3-0-on-android.html
# and https://github.com/AndreRH/hangover/blob/8b38d20d5f5f1a5a546ee8e62a6623d2a9bec1bf/build.android.sh
SRCDIR=/home/$USER/wine-hangover-8.19
cd $SRCDIR
# Patch Wine source to fix build
git apply -v /home/$USER/Fix_build.patch
# Path to NDK bin and llvm-mingw
export PATH=/home/$USER/android-ndk-r23c/toolchains/llvm/prebuilt/linux-x86_64/bin:/home/$USER/llvm-mingw/bin:$PATH
# Path to NDK sysroot
export NDK_SYSROOT=/home/$USER/android-ndk-r23c/toolchains/llvm/prebuilt/linux-x86_64/sysroot
# Path to Android SDK
export ANDROID_HOME=/home/$USER/Android/Sdk
export CFLAGS="-O2"
# Termux headers and libs (Freetype, Pulseaudio, gnutls)
export FREETYPE_CFLAGS="-I /home/$USER/termux/include/freetype2"
export FREETYPE_LIBS="-L /home/$USER/termux/lib"
export PULSE_CFLAGS="-I /home/$USER/termux/include"
export PULSE_LIBS="-L /home/$USER/termux/lib"
export GNUTLS_CFLAGS="-I /home/$USER/termux/include"
export GNUTLS_LIBS="-L /home/$USER/termux/lib"
# Configure with X11 headers and libs from Termux
./configure --host=aarch64-linux-android --with-wine-tools=/home/$USER/wine-native \
CXX=aarch64-linux-android28-clang++ CC=aarch64-linux-android28-clang \
--disable-tests --with-mingw --enable-archs=i386,aarch64 --with-gnutls \
--with-opengl --with-osmesa --with-pulse --with-x --with-xcomposite \
--with-xcursor --with-xfixes --with-xrandr --with-xrender --with-xinerama \
--x-includes="/home/$USER/termux/include" --x-libraries="/home/$USER/termux/lib"
make -j`nproc` && make DESTDIR=~/wine_build install