summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugo "ThePooN" Denizart2018-06-15 00:45:43 +0200
committerHugo "ThePooN" Denizart2018-06-15 00:46:51 +0200
commit9d692c2b080285e1d3ba6386b384d0f30778400f (patch)
tree40de613cd4f6db5483358f53ff7597439223a6f4
downloadaur-9d692c2b080285e1d3ba6386b384d0f30778400f.tar.gz
Initial commit
-rw-r--r--.SRCINFO154
-rw-r--r--PKGBUILD178
-rw-r--r--harmony-fix.diff63
-rw-r--r--winealsa_latency.patch15
-rw-r--r--winepulse_latency.patch52
5 files changed, 462 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..88c51213bdc
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,154 @@
+pkgbase = wine-osu
+ pkgdesc = A compatibility layer for running Windows programs - Staging branch, optimized for audio low latency on osu!
+ pkgver = 3.10
+ pkgrel = 1
+ url = http://www.wine-staging.com
+ arch = x86_64
+ license = LGPL
+ makedepends = autoconf
+ makedepends = ncurses
+ makedepends = bison
+ makedepends = perl
+ makedepends = fontforge
+ makedepends = flex
+ makedepends = gcc>=4.5.0-2
+ makedepends = giflib
+ makedepends = lib32-giflib
+ makedepends = libpng
+ makedepends = lib32-libpng
+ makedepends = gnutls
+ makedepends = lib32-gnutls
+ makedepends = libxinerama
+ makedepends = lib32-libxinerama
+ makedepends = libxcomposite
+ makedepends = lib32-libxcomposite
+ makedepends = libxmu
+ makedepends = lib32-libxmu
+ makedepends = libxxf86vm
+ makedepends = lib32-libxxf86vm
+ makedepends = libldap
+ makedepends = lib32-libldap
+ makedepends = mpg123
+ makedepends = lib32-mpg123
+ makedepends = openal
+ makedepends = lib32-openal
+ makedepends = v4l-utils
+ makedepends = lib32-v4l-utils
+ makedepends = alsa-lib
+ makedepends = lib32-alsa-lib
+ makedepends = libxcomposite
+ makedepends = lib32-libxcomposite
+ makedepends = mesa
+ makedepends = lib32-mesa
+ makedepends = mesa-libgl
+ makedepends = lib32-mesa-libgl
+ makedepends = opencl-icd-loader
+ makedepends = lib32-opencl-icd-loader
+ makedepends = libxslt
+ makedepends = lib32-libxslt
+ makedepends = libpulse
+ makedepends = lib32-libpulse
+ makedepends = libva
+ makedepends = lib32-libva
+ makedepends = gtk3
+ makedepends = lib32-gtk3
+ makedepends = gst-plugins-base-libs
+ makedepends = lib32-gst-plugins-base-libs
+ makedepends = vulkan-icd-loader
+ makedepends = lib32-vulkan-icd-loader
+ makedepends = sdl2
+ makedepends = lib32-sdl2
+ makedepends = samba
+ makedepends = opencl-headers
+ depends = attr
+ depends = lib32-attr
+ depends = fontconfig
+ depends = lib32-fontconfig
+ depends = lcms2
+ depends = lib32-lcms2
+ depends = libxml2
+ depends = lib32-libxml2
+ depends = libxcursor
+ depends = lib32-libxcursor
+ depends = libxrandr
+ depends = lib32-libxrandr
+ depends = libxdamage
+ depends = lib32-libxdamage
+ depends = libxi
+ depends = lib32-libxi
+ depends = gettext
+ depends = lib32-gettext
+ depends = freetype2
+ depends = lib32-freetype2
+ depends = glu
+ depends = lib32-glu
+ depends = libsm
+ depends = lib32-libsm
+ depends = gcc-libs
+ depends = lib32-gcc-libs
+ depends = libpcap
+ depends = lib32-libpcap
+ depends = desktop-file-utils
+ optdepends = giflib
+ optdepends = lib32-giflib
+ optdepends = libpng
+ optdepends = lib32-libpng
+ optdepends = libldap
+ optdepends = lib32-libldap
+ optdepends = gnutls
+ optdepends = lib32-gnutls
+ optdepends = mpg123
+ optdepends = lib32-mpg123
+ optdepends = openal
+ optdepends = lib32-openal
+ optdepends = v4l-utils
+ optdepends = lib32-v4l-utils
+ optdepends = libpulse
+ optdepends = lib32-libpulse
+ optdepends = alsa-plugins
+ optdepends = lib32-alsa-plugins
+ optdepends = alsa-lib
+ optdepends = lib32-alsa-lib
+ optdepends = libjpeg-turbo
+ optdepends = lib32-libjpeg-turbo
+ optdepends = libxcomposite
+ optdepends = lib32-libxcomposite
+ optdepends = libxinerama
+ optdepends = lib32-libxinerama
+ optdepends = ncurses
+ optdepends = lib32-ncurses
+ optdepends = opencl-icd-loader
+ optdepends = lib32-opencl-icd-loader
+ optdepends = libxslt
+ optdepends = lib32-libxslt
+ optdepends = libva
+ optdepends = lib32-libva
+ optdepends = gtk3
+ optdepends = lib32-gtk3
+ optdepends = gst-plugins-base-libs
+ optdepends = lib32-gst-plugins-base-libs
+ optdepends = vulkan-icd-loader
+ optdepends = lib32-vulkan-icd-loader
+ optdepends = sdl2
+ optdepends = lib32-sdl2
+ optdepends = cups
+ optdepends = samba
+ optdepends = dosbox
+ options = staticlibs
+ source = https://dl.winehq.org/wine/source/3.x/wine-3.10.tar.xz
+ source = https://dl.winehq.org/wine/source/3.x/wine-3.10.tar.xz.sign
+ source = wine-staging-v3.10.tar.gz::https://github.com/wine-staging/wine-staging/archive/v3.10.tar.gz
+ source = harmony-fix.diff
+ source = winealsa_latency.patch
+ source = winepulse_latency.patch
+ validpgpkeys = 5AC1A08B03BD7A313E0A955AF5E6E9EEB9461DD7
+ validpgpkeys = DA23579A74D4AD9AF9D3F945CEFAC8EAAF17519D
+ sha512sums = bb1a1d8e8ad7f48d9fcf48ebbf0ebbb8e3b45ea211736bd7837144ea34b373f74955d3c0ccc4cdc44020eea23c8af8e67252e1c5cd6115e11419ad5f6ef24843
+ sha512sums = SKIP
+ sha512sums = baae31ce569c06f8ac5ffc579d8f3bb95de55c50b83c1db13eaaeaee5c8c5b3b7fb6028d69dce6645ac697692372a65be8d60532123a94e0f5fcd0778d2082c5
+ sha512sums = b86edf07bfc560f403fdfd5a71f97930ee2a4c3f76c92cc1a0dbb2e107be9db3bed3a727a0430d8a049583c63dd11f5d4567fb7aa69b193997c6da241acc4f2e
+ sha512sums = 8212f4ec07045faa28704035ea6c8173ade503afe3bf94c4ec19e9edb788004579bb37e16c58d92ddc23e9a4de52480437f8486a32d794c5edc59d448db46874
+ sha512sums = 3c5eda2d24892ca6428138bd9f07d5c598b606f9e181533d73556b25aabe41935efb44748cdb65524d7598ceac1bc81d9c9d507b76a15c51f32e34b3cdc3969a
+
+pkgname = wine-osu
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..20dbc6cfd8a
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,178 @@
+# Maintainer: Hugo "ThePooN" Denizart <thepoon@cartooncraft.fr>
+# Contributor: Felix Yan <felixonmars@archlinux.org>
+# Contributor: Sven-Hendrik Haase <sh@lutzhaase.com>
+# Contributor: Jan "heftig" Steffens <jan.steffens@gmail.com>
+# Contributor: Eduardo Romero <eduardo@archlinux.org>
+# Contributor: Giovanni Scafora <giovanni@archlinux.org>
+
+pkgname=wine-osu
+pkgver=3.10
+pkgrel=1
+
+_pkgbasever=${pkgver/rc/-rc}
+
+source=(https://dl.winehq.org/wine/source/3.x/wine-$_pkgbasever.tar.xz{,.sign}
+ "wine-staging-v$_pkgbasever.tar.gz::https://github.com/wine-staging/wine-staging/archive/v$_pkgbasever.tar.gz"
+ harmony-fix.diff
+ winealsa_latency.patch
+ winepulse_latency.patch)
+sha512sums=('bb1a1d8e8ad7f48d9fcf48ebbf0ebbb8e3b45ea211736bd7837144ea34b373f74955d3c0ccc4cdc44020eea23c8af8e67252e1c5cd6115e11419ad5f6ef24843'
+ 'SKIP'
+ 'baae31ce569c06f8ac5ffc579d8f3bb95de55c50b83c1db13eaaeaee5c8c5b3b7fb6028d69dce6645ac697692372a65be8d60532123a94e0f5fcd0778d2082c5'
+ 'b86edf07bfc560f403fdfd5a71f97930ee2a4c3f76c92cc1a0dbb2e107be9db3bed3a727a0430d8a049583c63dd11f5d4567fb7aa69b193997c6da241acc4f2e'
+ '8212f4ec07045faa28704035ea6c8173ade503afe3bf94c4ec19e9edb788004579bb37e16c58d92ddc23e9a4de52480437f8486a32d794c5edc59d448db46874'
+ '3c5eda2d24892ca6428138bd9f07d5c598b606f9e181533d73556b25aabe41935efb44748cdb65524d7598ceac1bc81d9c9d507b76a15c51f32e34b3cdc3969a')
+validpgpkeys=(5AC1A08B03BD7A313E0A955AF5E6E9EEB9461DD7
+ DA23579A74D4AD9AF9D3F945CEFAC8EAAF17519D)
+
+pkgdesc="A compatibility layer for running Windows programs - Staging branch, optimized for audio low latency on osu!"
+url="http://www.wine-staging.com"
+arch=(x86_64)
+options=(staticlibs)
+license=(LGPL)
+
+depends=(
+ attr lib32-attr
+ fontconfig lib32-fontconfig
+ lcms2 lib32-lcms2
+ libxml2 lib32-libxml2
+ libxcursor lib32-libxcursor
+ libxrandr lib32-libxrandr
+ libxdamage lib32-libxdamage
+ libxi lib32-libxi
+ gettext lib32-gettext
+ freetype2 lib32-freetype2
+ glu lib32-glu
+ libsm lib32-libsm
+ gcc-libs lib32-gcc-libs
+ libpcap lib32-libpcap
+ desktop-file-utils
+)
+
+makedepends=(autoconf ncurses bison perl fontforge flex
+ 'gcc>=4.5.0-2'
+ giflib lib32-giflib
+ libpng lib32-libpng
+ gnutls lib32-gnutls
+ libxinerama lib32-libxinerama
+ libxcomposite lib32-libxcomposite
+ libxmu lib32-libxmu
+ libxxf86vm lib32-libxxf86vm
+ libldap lib32-libldap
+ mpg123 lib32-mpg123
+ openal lib32-openal
+ v4l-utils lib32-v4l-utils
+ alsa-lib lib32-alsa-lib
+ libxcomposite lib32-libxcomposite
+ mesa lib32-mesa
+ mesa-libgl lib32-mesa-libgl
+ opencl-icd-loader lib32-opencl-icd-loader
+ libxslt lib32-libxslt
+ 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
+ samba
+ opencl-headers
+)
+
+optdepends=(
+ giflib lib32-giflib
+ libpng lib32-libpng
+ libldap lib32-libldap
+ gnutls lib32-gnutls
+ mpg123 lib32-mpg123
+ openal lib32-openal
+ v4l-utils lib32-v4l-utils
+ libpulse lib32-libpulse
+ alsa-plugins lib32-alsa-plugins
+ alsa-lib lib32-alsa-lib
+ libjpeg-turbo lib32-libjpeg-turbo
+ libxcomposite lib32-libxcomposite
+ libxinerama lib32-libxinerama
+ ncurses lib32-ncurses
+ opencl-icd-loader lib32-opencl-icd-loader
+ libxslt lib32-libxslt
+ 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
+ cups
+ samba dosbox
+)
+
+prepare() {
+ # Allow ccache to work
+ mv wine-$_pkgbasever $pkgname
+
+ # apply wine-staging patchset
+ pushd wine-staging-$_pkgbasever/patches
+ ./patchinstall.sh DESTDIR="$srcdir/$pkgname" --all
+ popd
+
+ # https://bugs.winehq.org/show_bug.cgi?id=43530
+ export CFLAGS="${CFLAGS/-fno-plt/}"
+ export LDFLAGS="${LDFLAGS/,-z,now/}"
+
+ patch -d $pkgname -Np1 < harmony-fix.diff
+
+ patch -d $pkgname -Np1 < winealsa_latency.patch
+ patch -d $pkgname -Np1 < winepulse_latency.patch
+
+ sed 's|OpenCL/opencl.h|CL/opencl.h|g' -i $pkgname/configure*
+
+ # Get rid of old build dirs
+ rm -rf $pkgname-{32,64}-build
+ mkdir $pkgname-{32,64}-build
+}
+
+build() {
+ cd "$srcdir"
+
+ msg2 "Building Wine-64..."
+
+ cd "$srcdir/$pkgname-64-build"
+ ../$pkgname/configure \
+ --prefix=/opt/wine-osu \
+ --libdir=/opt/wine-osu/lib \
+ --with-x \
+ --with-gstreamer \
+ --enable-win64 \
+ --with-xattr
+
+ make
+
+ msg2 "Building Wine-32..."
+
+ export PKG_CONFIG_PATH="/usr/lib32/pkgconfig"
+ cd "$srcdir/$pkgname-32-build"
+ ../$pkgname/configure \
+ --prefix=/opt/wine-osu \
+ --with-x \
+ --with-gstreamer \
+ --with-xattr \
+ --libdir=/opt/wine-osu/lib32 \
+ --with-wine64="$srcdir/$pkgname-64-build"
+
+ make
+}
+
+package() {
+ msg2 "Packaging Wine-32..."
+ cd "$srcdir/$pkgname-32-build"
+
+ make prefix="$pkgdir/opt/wine-osu" \
+ libdir="$pkgdir/opt/wine-osu/lib32" \
+ dlldir="$pkgdir/opt/wine-osu/lib32/wine" install
+
+ msg2 "Packaging Wine-64..."
+ cd "$srcdir/$pkgname-64-build"
+ make prefix="$pkgdir/opt/wine-osu" \
+ libdir="$pkgdir/opt/wine-osu/lib" \
+ dlldir="$pkgdir/opt/wine-osu/lib/wine" install
+}
+
+# vim:set ts=8 sts=2 sw=2 et:
diff --git a/harmony-fix.diff b/harmony-fix.diff
new file mode 100644
index 00000000000..fe0c8c929d4
--- /dev/null
+++ b/harmony-fix.diff
@@ -0,0 +1,63 @@
+diff -u -r wine/dlls/gdi32/freetype.c wine-ft281/dlls/gdi32/freetype.c
+--- wine/dlls/gdi32/freetype.c 2017-10-04 18:01:36.000000000 +0200
++++ wine-ft281/dlls/gdi32/freetype.c 2017-10-10 10:29:17.506632615 +0200
+@@ -996,18 +996,23 @@
+
+ static BOOL is_subpixel_rendering_enabled( void )
+ {
+-#ifdef FT_LCD_FILTER_H
+ static int enabled = -1;
+ if (enabled == -1)
+ {
+- enabled = (pFT_Library_SetLcdFilter &&
+- pFT_Library_SetLcdFilter( NULL, 0 ) != FT_Err_Unimplemented_Feature);
++ /* >= 2.8.1 provides LCD rendering without filters */
++ if (FT_Version.major > 2 ||
++ FT_Version.major == 2 && FT_Version.minor > 8 ||
++ FT_Version.major == 2 && FT_Version.minor == 8 && FT_Version.patch >= 1)
++ enabled = TRUE;
++#ifdef FT_LCD_FILTER_H
++ else if (pFT_Library_SetLcdFilter &&
++ pFT_Library_SetLcdFilter( NULL, 0 ) != FT_Err_Unimplemented_Feature)
++ enabled = TRUE;
++#endif
++ else enabled = FALSE;
+ TRACE("subpixel rendering is %senabled\n", enabled ? "" : "NOT ");
+ }
+ return enabled;
+-#else
+- return FALSE;
+-#endif
+ }
+
+
+@@ -7271,7 +7276,6 @@
+ case WINE_GGO_HBGR_BITMAP:
+ case WINE_GGO_VRGB_BITMAP:
+ case WINE_GGO_VBGR_BITMAP:
+-#ifdef FT_LCD_FILTER_H
+ {
+ switch (ft_face->glyph->format)
+ {
+@@ -7357,8 +7361,11 @@
+ if ( needsTransform )
+ pFT_Outline_Transform (&ft_face->glyph->outline, &transMatTategaki);
+
++#ifdef FT_LCD_FILTER_H
+ if ( pFT_Library_SetLcdFilter )
+ pFT_Library_SetLcdFilter( library, FT_LCD_FILTER_DEFAULT );
++#endif
++
+ pFT_Render_Glyph (ft_face->glyph, render_mode);
+
+ src = ft_face->glyph->bitmap.buffer;
+@@ -7439,9 +7446,6 @@
+
+ break;
+ }
+-#else
+- return GDI_ERROR;
+-#endif
+
+ case GGO_NATIVE:
+ {
diff --git a/winealsa_latency.patch b/winealsa_latency.patch
new file mode 100644
index 00000000000..08e81cd2900
--- /dev/null
+++ b/winealsa_latency.patch
@@ -0,0 +1,15 @@
+--- wine-staging-osu-3.7/dlls/winealsa.drv/mmdevdrv.c.old 2018-05-09 17:25:19.908329171 +0200
++++ wine-staging-osu-3.7/dlls/winealsa.drv/mmdevdrv.c 2018-05-09 17:25:40.811577308 +0200
+@@ -53,9 +53,9 @@
+
+ #define NULL_PTR_ERR MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, RPC_X_NULL_REF_POINTER)
+
+-static const REFERENCE_TIME DefaultPeriod = 100000;
+-static const REFERENCE_TIME MinimumPeriod = 50000;
+-#define EXTRA_SAFE_RT 40000
++static const REFERENCE_TIME DefaultPeriod = 4000;
++static const REFERENCE_TIME MinimumPeriod = 2000;
++#define EXTRA_SAFE_RT 1000
+
+ struct ACImpl;
+ typedef struct ACImpl ACImpl;
diff --git a/winepulse_latency.patch b/winepulse_latency.patch
new file mode 100644
index 00000000000..f000a7a42f5
--- /dev/null
+++ b/winepulse_latency.patch
@@ -0,0 +1,52 @@
+--- wine-osu/dlls/winepulse.drv/mmdevdrv.c.orig.old
++++ wine-osu/dlls/winepulse.drv/mmdevdrv.c
+@@ -69,8 +69,8 @@
+ Priority_Preferred
+ };
+
+-static const REFERENCE_TIME MinimumPeriod = 30000;
+-static const REFERENCE_TIME DefaultPeriod = 100000;
++static const REFERENCE_TIME MinimumPeriod = 1000;
++static const REFERENCE_TIME DefaultPeriod = 2000;
+
+ static pa_context *pulse_ctx;
+ static pa_mainloop *pulse_ml;
+@@ -406,9 +406,9 @@
+ ss.channels = map.channels;
+
+ attr.maxlength = -1;
+- attr.tlength = -1;
+- attr.minreq = attr.fragsize = pa_frame_size(&ss);
+- attr.prebuf = 0;
++ attr.minreq = -1;
++ attr.tlength = attr.fragsize = pa_usec_to_bytes(1000, &ss);
++ attr.prebuf = -1;
+
+ stream = pa_stream_new(ctx, "format test stream", &ss, &map);
+ if (stream)
+@@ -417,9 +417,9 @@
+ ret = -1;
+ else if (render)
+ ret = pa_stream_connect_playback(stream, NULL, &attr,
+- PA_STREAM_START_CORKED|PA_STREAM_FIX_RATE|PA_STREAM_FIX_CHANNELS|PA_STREAM_EARLY_REQUESTS, NULL, NULL);
++ PA_STREAM_START_CORKED|PA_STREAM_FIX_RATE|PA_STREAM_FIX_CHANNELS|PA_STREAM_EARLY_REQUESTS|PA_STREAM_ADJUST_LATENCY, NULL, NULL);
+ else
+- ret = pa_stream_connect_record(stream, NULL, &attr, PA_STREAM_START_CORKED|PA_STREAM_FIX_RATE|PA_STREAM_FIX_CHANNELS|PA_STREAM_EARLY_REQUESTS);
++ ret = pa_stream_connect_record(stream, NULL, &attr, PA_STREAM_START_CORKED|PA_STREAM_FIX_RATE|PA_STREAM_FIX_CHANNELS|PA_STREAM_EARLY_REQUESTS|PA_STREAM_ADJUST_LATENCY);
+ if (ret >= 0) {
+ while (pa_mainloop_iterate(ml, 1, &ret) >= 0 &&
+ pa_stream_get_state(stream) == PA_STREAM_CREATING)
+@@ -1767,6 +1767,13 @@
+ /* Uh oh, really low latency requested.. */
+ if (duration <= 2 * period)
+ period /= 2;
++
++ const char *env = getenv("STAGING_AUDIO_DURATION");
++ if(env) {
++ int val = atoi(env);
++ duration = val;
++ printf("Set audio duration to %d (STAGING_AUDIO_DURATION).\n", val);
++ }
+
+ period_bytes = pa_frame_size(&This->ss) * MulDiv(period, This->ss.rate, 10000000);
+