%?mingw_package_header %global snapshot_stamp 20170119 %global snapshot_rev 9f09037b073a7481bc5d94984a26b7c9d3427b16 %global snapshot_rev_short %(echo %snapshot_rev | cut -c1-6) %global headers_rev 7a8f394fabc9ec5a53986521097267e143bf2b1f %global headers_folder additional-mingw-header-%{headers_rev} Summary: Almost Native Graphics Layer Engine Name: mingw-angleproject Version: 0 Release: 0.17.git.%{snapshot_rev_short}.%{snapshot_stamp}%{?dist} License: BSD Group: System Environment/Libraries URL: http://code.google.com/p/angleproject/ # Upstream hasn't done any official releases yet # To generate snapshot: # git clone https://chromium.googlesource.com/angle/angle # tar --exclude-vcs -cjvpf angle-git-$(cd angle; git rev-parse HEAD | cut -c1-6).tar.bz2 angle Source0: https://github.com/google/angle/archive/%{snapshot_rev}/angle-%{snapshot_rev}.tar.gz Source1: https://github.com/Martchus/additional-mingw-header/archive/%{headers_rev}/additional-headers-%{headers_rev}.tar.gz BuildRequires: mingw32-filesystem >= 95 BuildRequires: mingw64-filesystem >= 95 BuildRequires: mingw32-gcc-c++ BuildRequires: mingw64-gcc-c++ BuildRequires: git BuildRequires: gyp BuildRequires: ninja-build BuildArch: noarch # Patches taken from Archlinux (who claim to have taken them from Fedora) Patch1: 0001-Provide-workaround-for-building-static-libs.patch Patch2: 0002-Provide-Windows-XP-support.patch Patch3: 0003-Fix-dynamic-libraries.patch Patch4: 0004-Link-against-dxguid-d3d9-and-gdi32.patch Patch5: 0005-Export-shader-API-via-libGLESv2.dll.patch Patch6: 0006-Make-GLintptr-and-GLsizeiptr-match-those-from-Qt-5.patch Patch7: 0007-Remove-copy_scripts-target.patch Patch8: 0008-Fix-generation-of-commit_id.h.patch Patch9: 0009-Ensure-dependencies-of-samples-are-found.patch Patch10: 0010-Win32_system_utils.cpp-Make-implicit-cast-explicit.patch %description ANGLE is a conformant implementation of the OpenGL ES 2.0 specification that is hardware‐accelerated via Direct3D. ANGLE v1.0.772 was certified compliant by passing the ES 2.0.3 conformance tests in October 2011. ANGLE also provides an implementation of the EGL 1.4 specification. ANGLE is used as the default WebGL backend for both Google Chrome and Mozilla Firefox on Windows platforms. Chrome uses ANGLE for all graphics rendering on Windows, including the accelerated Canvas2D implementation and the Native Client sandbox environment. Portions of the ANGLE shader compiler are used as a shader validator and translator by WebGL implementations across multiple platforms. It is used on Mac OS X, Linux, and in mobile variants of the browsers. Having one shader validator helps to ensure that a consistent set of GLSL ES shaders are accepted across browsers and platforms. The shader translator can be used to translate shaders to other shading languages, and to optionally apply shader modifications to work around bugs or quirks in the native graphics drivers. The translator targets Desktop GLSL, Direct3D HLSL, and even ESSL for native GLES2 platforms. %?mingw_debug_package # Win32 %package -n mingw32-angleproject Summary: Almost Native Graphics Layer Engine for Win32 Group: Development/Libraries %description -n mingw32-angleproject ANGLE is a conformant implementation of the OpenGL ES 2.0 specification that is hardware‐accelerated via Direct3D. ANGLE v1.0.772 was certified compliant by passing the ES 2.0.3 conformance tests in October 2011. ANGLE also provides an implementation of the EGL 1.4 specification. ANGLE is used as the default WebGL backend for both Google Chrome and Mozilla Firefox on Windows platforms. Chrome uses ANGLE for all graphics rendering on Windows, including the accelerated Canvas2D implementation and the Native Client sandbox environment. Portions of the ANGLE shader compiler are used as a shader validator and translator by WebGL implementations across multiple platforms. It is used on Mac OS X, Linux, and in mobile variants of the browsers. Having one shader validator helps to ensure that a consistent set of GLSL ES shaders are accepted across browsers and platforms. The shader translator can be used to translate shaders to other shading languages, and to optionally apply shader modifications to work around bugs or quirks in the native graphics drivers. The translator targets Desktop GLSL, Direct3D HLSL, and even ESSL for native GLES2 platforms. %package -n mingw32-angleproject-static Summary: Static version of the mingw32-angleproject library Requires: mingw32-angleproject = %{version}-%{release} BuildArch: noarch %description -n mingw32-angleproject-static Static version of the mingw32-angleproject library. # Win64 %package -n mingw64-angleproject Summary: Almost Native Graphics Layer Engine for Win64 Group: Development/Libraries %description -n mingw64-angleproject ANGLE is a conformant implementation of the OpenGL ES 2.0 specification that is hardware‐accelerated via Direct3D. ANGLE v1.0.772 was certified compliant by passing the ES 2.0.3 conformance tests in October 2011. ANGLE also provides an implementation of the EGL 1.4 specification. ANGLE is used as the default WebGL backend for both Google Chrome and Mozilla Firefox on Windows platforms. Chrome uses ANGLE for all graphics rendering on Windows, including the accelerated Canvas2D implementation and the Native Client sandbox environment. Portions of the ANGLE shader compiler are used as a shader validator and translator by WebGL implementations across multiple platforms. It is used on Mac OS X, Linux, and in mobile variants of the browsers. Having one shader validator helps to ensure that a consistent set of GLSL ES shaders are accepted across browsers and platforms. The shader translator can be used to translate shaders to other shading languages, and to optionally apply shader modifications to work around bugs or quirks in the native graphics drivers. The translator targets Desktop GLSL, Direct3D HLSL, and even ESSL for native GLES2 platforms. %package -n mingw64-angleproject-static Summary: Static version of the mingw32-angleproject library Requires: mingw64-angleproject = %{version}-%{release} BuildArch: noarch %description -n mingw64-angleproject-static Static version of the mingw64-angleproject library. %prep %setup -q -n angle-%{snapshot_rev} -a1 # Install additional .def files mkdir -p sysinclude cp %{headers_folder}/* sysinclude/ cp sysinclude/versionhelpers.h sysinclude/VersionHelpers.h mkdir -p %{buildroot}/tmp/gsutil export DEPOT_TOOLS_GSUTIL_BIN_DIR=%{buildroot}/tmp/gsutil #python2 scripts/bootstrap.py # first attempt fails for some reason #gclient sync --deps=all || true #gclient sync --deps=all %global _default_patch_fuzz 3 %patch1 -p1 %patch2 -p1 %patch3 -p1 %patch4 -p1 %patch5 -p1 %patch6 -p1 %patch7 -p1 %patch8 -p1 %patch9 -p1 %patch10 -p1 # Executing .bat scripts on Linux is a no-go so make this a no-op echo "" > src/copy_compiler_dll.bat chmod +x src/copy_compiler_dll.bat %build # This project uses the gyp build system and various # hacks are required to get this project built. # Therefore the regular Fedora MinGW RPM macros # can't be used for this package # The gyp build system always uses the environment variable RPM_OPT_FLAGS when it's set # For MinGW we don't want this, so unset this environment variable unset RPM_OPT_FLAGS export CXXFLAGS_COMMON="-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 -std=c++1z -msse2 -DUNICODE -D_UNICODE -DANGLE_WINDOWS_XP_SUPPORT -D_USE_MATH_DEFINES -I`pwd`/include -I`pwd`/sysinclude -I`pwd`/src -I`pwd`/src/common/third_party/numerics" export GYP_GENERATORS=ninja for target in win32 win64 ; do if [ "$target" = "win32" ] ; then export CXX=%{mingw32_cxx} export CC=%{mingw32_cc} export AS=%{mingw32_as} export RANLIB=%{mingw32_ranlib} export AR=%{mingw32_ar} export CXXFLAGS="$CXXFLAGS_COMMON -march=i686" else export CXX=%{mingw64_cxx} export CC=%{mingw64_cc} export AS=%{mingw64_as} export RANLIB=%{mingw64_ranlib} export AR=%{mingw64_ar} export CXXFLAGS="$CXXFLAGS_COMMON -march=x86-64" fi mkdir -p build_$target-shared pushd build_$target-shared unset LDFLAGS gyp -D angle_enable_vulkan=0 -D use_ozone=0 -D use_x11=0 -D OS=win -D TARGET=$target -D MSVS_VERSION='' --depth . -I ../gyp/common.gypi ../src/angle.gyp ../samples/samples.gyp ninja-build -C out/Release %{_smp_mflags} popd mkdir -p build_$target-static pushd build_$target-static unset LDFLAGS gyp -D angle_enable_vulkan=0 -D use_ozone=0 -D use_x11=0 -D OS=win -D TARGET=$target -D MSVS_VERSION='' --depth . -I ../gyp/common.gypi ../src/angle.gyp -D angle_gl_library_type=static_library ninja-build -C out/Release %{_smp_mflags} for lib in out/Release/src/lib*.a; do $AR -t $lib | xargs $AR rvs $lib.new && mv $lib.new $lib; $RANLIB $lib done popd done %install # The gyp build system doesn't know how to install files # and gives libraries invalid filenames.. *sigh* mkdir -p $RPM_BUILD_ROOT%{mingw32_bindir} $RPM_BUILD_ROOT%{mingw32_libdir} $RPM_BUILD_ROOT%{mingw32_includedir} mkdir -p $RPM_BUILD_ROOT%{mingw64_bindir} $RPM_BUILD_ROOT%{mingw64_libdir} $RPM_BUILD_ROOT%{mingw64_includedir} install build_win32-shared/out/Release/lib/libGLESv2.so $RPM_BUILD_ROOT%{mingw32_bindir}/libGLESv2.dll install build_win64-shared/out/Release/lib/libGLESv2.so $RPM_BUILD_ROOT%{mingw64_bindir}/libGLESv2.dll install build_win32-shared/out/Release/lib/libEGL.so $RPM_BUILD_ROOT%{mingw32_bindir}/libEGL.dll install build_win64-shared/out/Release/lib/libEGL.so $RPM_BUILD_ROOT%{mingw64_bindir}/libEGL.dll install -m0644 build_win32-shared/out/Release/libGLESv2.dll.a build_win32-static/out/Release/src/libGLESv2.a $RPM_BUILD_ROOT%{mingw32_libdir} install -m0644 build_win64-shared/out/Release/libGLESv2.dll.a build_win64-static/out/Release/src/libGLESv2.a $RPM_BUILD_ROOT%{mingw64_libdir} install -m0644 build_win32-shared/out/Release/libEGL.dll.a build_win32-static/out/Release/src/libEGL.a $RPM_BUILD_ROOT%{mingw32_libdir} install -m0644 build_win64-shared/out/Release/libEGL.dll.a build_win64-static/out/Release/src/libEGL.a $RPM_BUILD_ROOT%{mingw64_libdir} cp -Rv include/* $RPM_BUILD_ROOT%{mingw32_includedir} cp -Rv include/* $RPM_BUILD_ROOT%{mingw64_includedir} rm $RPM_BUILD_ROOT%{mingw32_includedir}/export.h rm -fr $RPM_BUILD_ROOT%{mingw32_includedir}/platform rm $RPM_BUILD_ROOT%{mingw64_includedir}/export.h rm -fr $RPM_BUILD_ROOT%{mingw64_includedir}/platform %files -n mingw32-angleproject %doc LICENSE %{mingw32_bindir}/libEGL.dll %{mingw32_bindir}/libGLESv2.dll %{mingw32_includedir}/EGL %{mingw32_includedir}/GLES2 %{mingw32_includedir}/GLES3 %{mingw32_includedir}/GLSLANG %{mingw32_includedir}/KHR %{mingw32_includedir}/angle_gl.h %{mingw32_includedir}/angle_windowsstore.h %{mingw32_libdir}/libEGL.dll.a %{mingw32_libdir}/libGLESv2.dll.a %files -n mingw32-angleproject-static %{mingw32_libdir}/libEGL.a %{mingw32_libdir}/libGLESv2.a %files -n mingw64-angleproject %doc LICENSE %{mingw64_bindir}/libEGL.dll %{mingw64_bindir}/libGLESv2.dll %{mingw64_includedir}/EGL %{mingw64_includedir}/GLES2 %{mingw64_includedir}/GLES3 %{mingw64_includedir}/GLSLANG %{mingw64_includedir}/KHR %{mingw64_includedir}/angle_gl.h %{mingw64_includedir}/angle_windowsstore.h %{mingw64_libdir}/libEGL.dll.a %{mingw64_libdir}/libGLESv2.dll.a %files -n mingw64-angleproject-static %{mingw64_libdir}/libEGL.a %{mingw64_libdir}/libGLESv2.a %changelog * Sat May 07 2016 Erik van Pienbroek - 0-0.15.git.30d6c2.20141113 - Fix FTBFS against GCC 6 * Thu Feb 04 2016 Fedora Release Engineering - 0-0.14.git.30d6c2.20141113 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild * Wed Dec 30 2015 Erik van Pienbroek - 0-0.13.git.30d6c2.20141113 - Use GCC constructors instead of DllMain to avoid conflicts in the static library (RHBZ #1257630) * Wed Jun 17 2015 Fedora Release Engineering - 0-0.12.git.30d6c2.20141113 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild * Mon Dec 29 2014 Erik van Pienbroek - 0-0.11.git.30d6c2.20141113 - Update to 20141113 snapshot (git revision 30d6c2) - Include all patches which were used by the Qt5 fork - Reverted some recent commits as they break mingw-qt5-qtwebkit 5.4 * Sat Jun 07 2014 Fedora Release Engineering - 0-0.10.svn2215.20130517 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild * Tue Feb 4 2014 Erik van Pienbroek - 0-0.9.svn2215.20130517 - Automatically LoadLibrary("d3dcompiler_43.dll") when no other D3D compiler is already loaded yet. Fixes RHBZ #1057983 - Make sure the libraries are built with debugging symbols - Rebuild against latest mingw-w64 (fixes Windows XP compatibility, RHBZ #1054481) * Fri Jan 24 2014 Erik van Pienbroek - 0-0.8.svn2215.20130517 - Rebuilt against latest mingw-w64 to fix Windows XP compatibility (RHBZ #1054481) * Sat Aug 03 2013 Fedora Release Engineering - 0-0.7.svn2215.20130517 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild * Sat May 18 2013 Erik van Pienbroek - 0-0.6.svn2215.20130517 - Export various symbols from the hlsl translator static library in the libGLESv2.dll shared library as they are needed by mingw-qt5-qtwebkit. The symbols in question are marked as NONAME (hidden) * Fri May 17 2013 Erik van Pienbroek - 0-0.5.svn2215.20130517 - Update to 20130517 snapshot (r2215) * Thu Apr 4 2013 Erik van Pienbroek - 0-0.4.svn1561.20121214 - Added another workaround due to the fact that the gyp build system doesn't properly support cross-compilation Fixes FTBFS against latest gyp * Fri Jan 25 2013 Erik van Pienbroek - 0-0.3.svn1561.20121214 - Added license - Resolved various rpmlint warnings - Prefix the release tag with '0.' * Mon Dec 24 2012 Erik van Pienbroek - 0-0.2.svn1561.20121214 - Added -static subpackages * Fri Dec 21 2012 Erik van Pienbroek - 0-0.1.svn1561.20121214 - Initial release