From 642db109a1918f9c0f342fb95b6516c27ec43346 Mon Sep 17 00:00:00 2001 From: pal1000 Date: Thu, 14 Mar 2019 00:07:55 +0200 Subject: [PATCH] Update Mesa to 19.0.0 - cleanup dependencies (mingw-w64-clang and mingw-w64-z3 are not needed, only gcc, llvm and zlib mingw packages are needed); - update build fix patch to avoid spurious crosscompilation and MSVC build break when applied openning the posibility for the patch to be upstreamed, see upstream merge request: https://gitlab.freedesktop.org/mesa/mesa/merge_requests/362; - cleanup compiler flags (-std=c++11 is passed correctly now and undefined M_PI doesn't seam to happen anymore). v2: Forgot to update source tarball checksum. v3. Replace patch call to the new patch. --- mingw-w64-mesa/PKGBUILD | 18 +++-- mingw-w64-mesa/link-ole32.patch | 74 ------------------- mingw-w64-mesa/msys2-mingw_w64-fixes.patch | 86 ++++++++++++++++++++++ 3 files changed, 96 insertions(+), 82 deletions(-) delete mode 100644 mingw-w64-mesa/link-ole32.patch create mode 100644 mingw-w64-mesa/msys2-mingw_w64-fixes.patch diff --git a/mingw-w64-mesa/PKGBUILD b/mingw-w64-mesa/PKGBUILD index cc3110da2e..6fef8502d4 100644 --- a/mingw-w64-mesa/PKGBUILD +++ b/mingw-w64-mesa/PKGBUILD @@ -3,11 +3,13 @@ _realname=mesa pkgbase=mingw-w64-${_realname} pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}" -pkgver=18.3.4 +pkgver=19.0.0 pkgrel=1 pkgdesc="Open-source implementation of the OpenGL specification (mingw-w64)" arch=('any') -makedepends=("${MINGW_PACKAGE_PREFIX}-clang" +makedepends=("${MINGW_PACKAGE_PREFIX}-llvm" + "${MINGW_PACKAGE_PREFIX}-gcc" + "${MINGW_PACKAGE_PREFIX}-zlib" "scons" "python2-mako") url="https://www.mesa3d.org/" @@ -15,12 +17,12 @@ license=('MIT') options=('staticlibs' 'strip') source=(https://mesa.freedesktop.org/archive/${_realname}-${pkgver}.tar.xz{,.sig} 001-extra-libs.patch - link-ole32.patch + msys2-mingw_w64-fixes.patch osmesa.pc) -sha256sums=('32314da4365d37f80d84f599bd9625b00161c273c39600ba63b45002d500bb07' +sha256sums=('5a549dfb40ec31e5c36c47aadac04554cb2e2a8d144a046a378fc16da57e38f8' 'SKIP' 'bc9bb5013ac80ded47ad164ae1ef58cc9a39784eb4bf61e8c7d654bb273b05a9' - '65991de6edd2614a4bedb23a9419966473b3c705c3d3dad3176924ad2e4b86a5' + '4b3e4d409afe5bd00a3513d37dda9daa33c0b5e8b9a646750a1ed28dcd91af2b' 'fdf26548336cc7e5700560c6636a87ffa63daa3048fa94cf4a4a0b50890c9327') validpgpkeys=('8703B6700E7EE06D7A39B8D6EDAE37B02CEB490D') # Emil Velikov validpgpkeys+=('946D09B5E4C9845E63075FF1D961C596A7203456') # Andres Gomez @@ -62,14 +64,14 @@ prepare() { # values and we probably don't need to call it anyway. # patch -p1 -i ${srcdir}/001-extra-libs.patch - apply_patch_with_msg link-ole32.patch + apply_patch_with_msg msys2-mingw_w64-fixes.patch } build() { cd ${srcdir}/${_realname}-${pkgver} LLVM=${MINGW_PREFIX} \ - CFLAGS="-march=core2 -pipe -D_USE_MATH_DEFINES" \ - CXXFLAGS="-march=core2 -pipe -std=c++11 -D_USE_MATH_DEFINES" \ + CFLAGS="-march=core2 -pipe" \ + CXXFLAGS="-march=core2 -pipe" \ LDFLAGS="-static -s" \ PROCESSOR_ARCHITECTURE="${CARCH}" \ scons build=release platform=windows toolchain=mingw machine=${_mach} diff --git a/mingw-w64-mesa/link-ole32.patch b/mingw-w64-mesa/link-ole32.patch deleted file mode 100644 index 3ef09d25dd..0000000000 --- a/mingw-w64-mesa/link-ole32.patch +++ /dev/null @@ -1,74 +0,0 @@ ---- mesa-17.3.3/src/gallium/targets/libgl-gdi/SConscript.orig 2018-01-21 17:12:22.323248900 -0500 -+++ mesa-17.3.3/src/gallium/targets/libgl-gdi/SConscript 2018-01-21 17:13:45.667612200 -0500 -@@ -15,6 +15,7 @@ env.Append(LIBS = [ - 'gdi32', - 'user32', - 'kernel32', -+ 'ole32', - 'ws2_32', - ]) - ---- mesa-17.3.3/src/gallium/targets/graw-gdi/SConscript.orig 2018-01-21 17:36:04.571024700 -0500 -+++ mesa-17.3.3/src/gallium/targets/graw-gdi/SConscript 2018-01-21 17:41:15.236917600 -0500 -@@ -14,6 +14,7 @@ env.Prepend(LIBS = [ - gallium, - 'gdi32', - 'user32', -+ 'ole32', - 'ws2_32', - ]) - ---- mesa-17.3.3/src/glx/Makefile.am.orig 2018-01-21 18:20:29.452763400 -0500 -+++ mesa-17.3.3/src/glx/Makefile.am 2018-01-21 18:21:49.227439400 -0500 -@@ -196,7 +196,7 @@ lib@GL_LIB@_la_LIBADD = $(GL_LIBS) - lib@GL_LIB@_la_LDFLAGS = $(GL_LDFLAGS) - - if HAVE_WINDOWSDRI --lib@GL_LIB@_la_LDFLAGS += -lgdi32 -lopengl32 -Wl,--disable-stdcall-fixup -+lib@GL_LIB@_la_LDFLAGS += -lgdi32 -lole32 -lopengl32 -Wl,--disable-stdcall-fixup - endif - - SUBDIRS += . tests ---- mesa-17.3.3/src/glx/Makefile.in.orig 2018-01-21 18:22:19.530664000 -0500 -+++ mesa-17.3.3/src/glx/Makefile.in 2018-01-21 18:23:57.362006800 -0500 -@@ -167,7 +167,7 @@ target_triplet = @target@ - @USE_LIBGLVND_FALSE@am__append_14 = \ - @USE_LIBGLVND_FALSE@ -DGL_LIB_NAME=\"lib@GL_LIB@.so.1\" - --@HAVE_WINDOWSDRI_TRUE@am__append_15 = -lgdi32 -lopengl32 -Wl,--disable-stdcall-fixup -+@HAVE_WINDOWSDRI_TRUE@am__append_15 = -lgdi32 -lole32 -lopengl32 -Wl,--disable-stdcall-fixup - subdir = src/glx - ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 - am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_compile_flag.m4 \ ---- mesa-17.3.3/scons/llvm.py.orig 2018-01-18 16:30:28.000000000 -0500 -+++ mesa-17.3.3/scons/llvm.py 2018-01-22 07:16:54.450780000 -0500 -@@ -126,7 +126,7 @@ - if env['platform'] == 'windows' and env['crosscompile']: - # LLVM 5.0 requires MinGW w/ pthreads due to use of std::thread and friends. - assert env['gcc'] -- env['CXX'] = env['CXX'] + '-posix' -+ env['CXX'] = env['CXX'] + ' -posix' - elif llvm_version >= distutils.version.LooseVersion('4.0'): - env.Prepend(LIBS = [ - 'LLVMX86Disassembler', 'LLVMX86AsmParser', -@@ -208,6 +208,10 @@ def generate(env): - 'LLVMSupport', 'LLVMRuntimeDyld', 'LLVMObject' - ]) - env.Append(LIBS = [ -+ 'z', -+ 'ole32', -+ 'version', -+ 'uuid', - 'imagehlp', - 'psapi', - 'shell32', ---- mesa-17.3.3/scons/gallium.py.orig 2018-01-22 01:38:20.096999500 -0500 -+++ mesa-17.3.3/scons/gallium.py 2018-01-22 01:42:28.231168700 -0500 -@@ -659,6 +659,7 @@ def generate(env): - - env.Tool('yacc') - if host_platform.system() == 'Windows': -+ libs += ['shell32', 'version', 'uuid', 'ole32'] - if check_prog(env, 'win_bison'): - env["YACC"] = 'win_bison' - diff --git a/mingw-w64-mesa/msys2-mingw_w64-fixes.patch b/mingw-w64-mesa/msys2-mingw_w64-fixes.patch new file mode 100644 index 0000000000..ce82324f4d --- /dev/null +++ b/mingw-w64-mesa/msys2-mingw_w64-fixes.patch @@ -0,0 +1,86 @@ +diff --git a/scons/gallium.py b/scons/gallium.py +index 61bbeb2399fbf1cd4694b12938455587b764ef6e..aacea24f4c587273b8402248361065b15a741bb4 100755 +--- a/scons/gallium.py ++++ b/scons/gallium.py +@@ -237,6 +237,8 @@ def generate(env): + hosthost_platform = host_platform.system().lower() + if hosthost_platform.startswith('cygwin'): + hosthost_platform = 'cygwin' ++ if hosthost_platform.startswith('mingw'): ++ hosthost_platform = 'windows' + host_machine = os.environ.get('PROCESSOR_ARCHITEW6432', os.environ.get('PROCESSOR_ARCHITECTURE', host_platform.machine())) + host_machine = { + 'x86': 'x86', +@@ -671,6 +673,8 @@ def generate(env): + + env.Tool('yacc') + if host_platform.system() == 'Windows': ++ if not env['msvc']: ++ libs += ['shell32', 'version', 'uuid', 'ole32'] + if check_prog(env, 'win_bison'): + env["YACC"] = 'win_bison' + +diff --git a/scons/llvm.py b/scons/llvm.py +index a84ad51d97a7d06af1079dbc0ad4ff89524ac91f..b1fb9d662f0637c771c71de2c855fb033c193ea7 100644 +--- a/scons/llvm.py ++++ b/scons/llvm.py +@@ -216,6 +216,11 @@ def generate(env): + 'ole32', + 'uuid', + ]) ++ if not env['msvc']: ++ env.Append(LIBS = [ ++ 'z', ++ 'version', ++ ]) + + if env['msvc']: + # Some of the LLVM C headers use the inline keyword without +diff --git a/src/gallium/targets/graw-gdi/SConscript b/src/gallium/targets/graw-gdi/SConscript +index e59127cc25ed71ed50667a36498ea4887963ff64..0a52bb5a7fc3bc6ca7664811b6d1b7e3086581b5 100644 +--- a/src/gallium/targets/graw-gdi/SConscript ++++ b/src/gallium/targets/graw-gdi/SConscript +@@ -14,6 +14,7 @@ env.Prepend(LIBS = [ + gallium, + 'gdi32', + 'user32', ++ 'ole32', + 'ws2_32', + ]) + +diff --git a/src/gallium/targets/libgl-gdi/SConscript b/src/gallium/targets/libgl-gdi/SConscript +index 94feca24ef30e30d97591f8e96c81f2d93433862..4b0b5621b29d405168b769307bab68f206f6ec71 100644 +--- a/src/gallium/targets/libgl-gdi/SConscript ++++ b/src/gallium/targets/libgl-gdi/SConscript +@@ -15,6 +15,7 @@ env.Append(LIBS = [ + 'gdi32', + 'user32', + 'kernel32', ++ 'ole32', + 'ws2_32', + 'advapi32', + ]) +diff --git a/src/glx/Makefile.am b/src/glx/Makefile.am +index a66957d609bf3c498fd2cdfac03e9ad4dc55df60..c93cffdb2b0b873c454f7303e5552606fa64e115 100644 +--- a/src/glx/Makefile.am ++++ b/src/glx/Makefile.am +@@ -187,7 +187,7 @@ lib@GL_LIB@_la_LIBADD = $(GL_LIBS) + lib@GL_LIB@_la_LDFLAGS = $(GL_LDFLAGS) + + if HAVE_WINDOWSDRI +-lib@GL_LIB@_la_LDFLAGS += -lgdi32 -lopengl32 -Wl,--disable-stdcall-fixup ++lib@GL_LIB@_la_LDFLAGS += -lgdi32 -lole32 -lopengl32 -Wl,--disable-stdcall-fixup + endif + + SUBDIRS += . tests +--- mesa-17.3.3/src/glx/Makefile.in.orig 2018-01-21 18:22:19.530664000 -0500 ++++ mesa-17.3.3/src/glx/Makefile.in 2018-01-21 18:23:57.362006800 -0500 +@@ -167,7 +167,7 @@ target_triplet = @target@ + @USE_LIBGLVND_FALSE@am__append_14 = \ + @USE_LIBGLVND_FALSE@ -DGL_LIB_NAME=\"lib@GL_LIB@.so.1\" + +-@HAVE_WINDOWSDRI_TRUE@am__append_15 = -lgdi32 -lopengl32 -Wl,--disable-stdcall-fixup ++@HAVE_WINDOWSDRI_TRUE@am__append_15 = -lgdi32 -lole32 -lopengl32 -Wl,--disable-stdcall-fixup + subdir = src/glx + ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 + am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_compile_flag.m4 \