summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a19ac09e1ed9e93942cb47688b1af6d06d0f3302 (plain)
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
# Maintainer: moonshadow565 <moonshadow565@hotmail.com>
# Maintainer: Kuan-Yen Chou <kuanyenchou@gmail.com>

pkgname=wine-lol-staging
pkgver=8.21
_winever=8.21
pkgrel=2
pkgdesc='A compatibility layer for running Windows programs (staging branch) with LoL patches'
arch=('x86_64')
url='https://wiki.winehq.org/Wine-Staging'
license=('LGPL')
provides=('wine-lol')

options=('staticlibs' '!lto' '!strip')

source=("git+https://gitlab.winehq.org/wine/wine-staging.git#tag=v${_winever}"
        "git+https://gitlab.winehq.org/wine/wine.git#tag=wine-${_winever}"
        "0004-LoL-broken-client-update-fix.patch"
        "0008-ntdll-nopguard-call_vectored_handlers.patch"
        "0011-ntdll-signal_set_full_context-amd64.patch"
        "0012-ntdll-implement-ntcontinueex.patch"
        "0013-server-error-on-connect-to-zero.patch"
        )

sha256sums=('SKIP'
            'SKIP'
            '7607a84fd357a86bc8fb59d2cf002a3e471bd8ec78ecdb844b0b77b1ae6d11a0'
            '2075ddc417ddd11954f76be753c88e04db28f0b3937e60508f178630dd5763eb'
            '8dfef7fdbeb4bf503f72c2b3a15033849f67197d6d9571135369b4b0183ea213'
            '8bb15743e589f7505817309122e04af8cb99e12459a9b4ef05b14eeef10ccc83'
            '1c58cd6efaf0c74c83b8a887fc79d3d23f427e14edd08eeef3bfc568b281caaa'
            )

depends=(
    'attr'                  'lib32-attr'
    'fontconfig'            'lib32-fontconfig'
    'libxcursor'            'lib32-libxcursor'
    'libxrandr'             'lib32-libxrandr'
    'libxi'                 'lib32-libxi'
    'gettext'               'lib32-gettext'
    'freetype2'             'lib32-freetype2'
    'gcc-libs'              'lib32-gcc-libs'
    'libpcap'               'lib32-libpcap'
    'desktop-file-utils'
)

makedepends=('git' 'autoconf' 'bison' 'perl' 'fontforge' 'flex' 'mingw-w64-gcc'
    'giflib'                'lib32-giflib'
    'gnutls'                'lib32-gnutls'
    'libxinerama'           'lib32-libxinerama'
    'libxcomposite'         'lib32-libxcomposite'
    'libxxf86vm'            'lib32-libxxf86vm'
    'v4l-utils'             'lib32-v4l-utils'
    'alsa-lib'              'lib32-alsa-lib'
    'libxcomposite'         'lib32-libxcomposite'
    'mesa'                  'lib32-mesa'
    'libgl'                 'lib32-libgl'
    'opencl-icd-loader'     'lib32-opencl-icd-loader'
    'libpulse'              'lib32-libpulse'
    'libva'                 'lib32-libva'
    'gtk3'                  'lib32-gtk3'
    'gst-plugins-base-libs' 'lib32-gst-plugins-base-libs'
    'vulkan-icd-loader'     'lib32-vulkan-icd-loader'
    'sdl2'                  'lib32-sdl2'
    'libcups'               'lib32-libcups'
    'sane'
    'libgphoto2'
    'ffmpeg'
    'samba'
    'opencl-headers'
    'vulkan-headers'
)

optdepends=(
    'giflib'                'lib32-giflib'
    'gnutls'                'lib32-gnutls'
    'v4l-utils'             'lib32-v4l-utils'
    'libpulse'              'lib32-libpulse'
    'alsa-plugins'          'lib32-alsa-plugins'
    'alsa-lib'              'lib32-alsa-lib'
    'libxcomposite'         'lib32-libxcomposite'
    'libxinerama'           'lib32-libxinerama'
    'opencl-icd-loader'     'lib32-opencl-icd-loader'
    'libva'                 'lib32-libva'
    'gtk3'                  'lib32-gtk3'
    'gst-plugins-base-libs' 'lib32-gst-plugins-base-libs'
    'vulkan-icd-loader'     'lib32-vulkan-icd-loader'
    'sdl2'                  'lib32-sdl2'
    'sane'
    'libgphoto2'
    'ffmpeg'
    'cups'
    'samba'
    'dosbox'
)

prepare() {
    # restore the wine tree to its git origin state, without wine-staging patches
    echo '  -> Cleaning wine source code tree...'
    git -C wine reset --hard HEAD  # restore tracked files
    git -C wine clean -xdf         # delete untracked files

    # change back to the wine upstream commit that this version of wine-staging is based in
    echo '  -> Changing wine HEAD to the wine-staging base commit...'
    git -C wine config --local advice.detachedHead false
    git -C wine checkout wine-${_winever}

    echo '  -> Re-enable wine-staging ntdll-Syscall_Emulation patchset...'
    sed -i -e '/Disabled/d' "${srcdir}/wine-staging/patches/ntdll-Syscall_Emulation/definition"

    # RCS Launcher Optional, not necessary since 64bit update as only thing useful there is missing fonts patch
    echo '  -> Applying wine-staging patches...'
    cd "${srcdir}/wine"
    "${srcdir}/wine-staging/staging/patchinstall.py" --all

    cd "${srcdir}/wine"

    # RCS Launcher, Something with resolving long paths and symlinks, needed confirmed 8.5
    echo 'Apply 0004-LoL-broken-client-update-fix'
    patch -Np1 < "${srcdir}/0004-LoL-broken-client-update-fix.patch"

    # Game, Add some nops around exception dispatch for pacman/stub.dll to be able to hook
    echo 'Apply 0008-ntdll-nopguard-call_vectored_handlers.patch'
    patch -Np1 < "${srcdir}/0008-ntdll-nopguard-call_vectored_handlers.patch"

    # Fix NtSetContextThread syscall
    echo 'Apply 00011-ntdll-signal_set_full_context-amd64.patch'
    patch -Np1 < "${srcdir}/0011-ntdll-signal_set_full_context-amd64.patch"

    # Missing syscall introduced in windows 10
    echo 'Apply 0012-ntdll-implement-ntcontinueex.patch'
    patch -Np1 < "${srcdir}/0012-ntdll-implement-ntcontinueex.patch"

    # RCS, LCU hang because linux allows connect(0.0.0.0).
    echo 'Apply 0013-server-error-on-connect-to-zero.patch'
    patch -Np1 < "${srcdir}/0013-server-error-on-connect-to-zero.patch"

    # Clean up .orig files
    echo "Clean up .orig files"
    find ./ -name '*.orig' -delete
}

build() {
    cd "${srcdir}/wine"
    autoreconf -f

    printf '%s\n' '  -> Building wine-lol-staging-64...'
    mkdir -p "${srcdir}/build-64"
    cd "${srcdir}/build-64"
    ../wine/configure \
        --prefix='/opt/wine-lol-staging' \
        --libdir='/opt/wine-lol-staging/lib' \
        --with-x \
        --with-gstreamer \
        --with-xattr \
        --with-mingw \
        --enable-win64 \
        --disable-tests \
        --disable-winemenubuilder
    make

    printf '%s\n' '  -> Building wine-lol-staging-32...'
    mkdir -p "${srcdir}/build-32"
    cd "${srcdir}/build-32"
    export PKG_CONFIG_PATH='/usr/lib32/pkgconfig'
    ../wine/configure \
        --prefix='/opt/wine-lol-staging' \
        --libdir='/opt/wine-lol-staging/lib32' \
        --with-x \
        --with-gstreamer \
        --with-xattr \
        --with-mingw \
        --with-wine64="${srcdir}/build-64" \
        --disable-tests \
        --disable-winemenubuilder
    make
}

package() {
    printf '%s\n' '  -> Packaging wine-staging-32...'
    cd "${srcdir}/build-32"
    make prefix="${pkgdir}/opt/wine-lol-staging" \
         libdir="${pkgdir}/opt/wine-lol-staging/lib32" \
         dlldir="${pkgdir}/opt/wine-lol-staging/lib32/wine" \
         install

    printf '%s\n' '  -> Packaging wine-staging-64...'
    cd "${srcdir}/build-64"
    make prefix="${pkgdir}/opt/wine-lol-staging" \
         libdir="${pkgdir}/opt/wine-lol-staging/lib" \
         dlldir="${pkgdir}/opt/wine-lol-staging/lib/wine" \
         install

    find "$pkgdir"/opt/wine-lol-staging/lib32/wine -iname "*.a" -delete
    find "$pkgdir"/opt/wine-lol-staging/lib32/wine -iname "*.def" -delete
    find "$pkgdir"/opt/wine-lol-staging/lib/wine -iname "*.a" -delete
    find "$pkgdir"/opt/wine-lol-staging/lib/wine -iname "*.def" -delete
}