Build ANGLE samples and use extra dir for static build

BTW: Update version
This commit is contained in:
Martchus 2016-12-02 12:44:23 +01:00
parent f092f455cb
commit b2c33b6411
11 changed files with 229 additions and 58 deletions

View File

@ -1,7 +1,7 @@
From 17a753984f0385f1d54133b7809bfa6b37c3aa32 Mon Sep 17 00:00:00 2001
From ff82c98d45686bdd081c51e3e32b5d88cea33780 Mon Sep 17 00:00:00 2001
From: Martchus <martchus@gmx.net>
Date: Tue, 9 Aug 2016 18:35:55 +0200
Subject: [PATCH 1/8] Provide workaround for building static libs
Subject: [PATCH 01/10] Provide workaround for building static libs
See: https://bugs.chromium.org/p/angleproject/issues/detail?id=1251

View File

@ -1,7 +1,7 @@
From 9d67527bab497a3c0030ddc4b2f7467f58bf3a85 Mon Sep 17 00:00:00 2001
From 8e25f3d25b3a3817e0e5b3aab5968a21e64b8c7e Mon Sep 17 00:00:00 2001
From: Martchus <martchus@gmx.net>
Date: Tue, 9 Aug 2016 19:15:20 +0200
Subject: [PATCH 2/8] Provide Windows XP support
Subject: [PATCH 02/10] Provide Windows XP support
---
src/common/string_utils.cpp | 2 +-

View File

@ -1,7 +1,7 @@
From 5cb25e912901941875d7a4498d6a3e668b6069c3 Mon Sep 17 00:00:00 2001
From 788c799af2c1e8e8e9aa0ddb51341c5f0eb94eaa Mon Sep 17 00:00:00 2001
From: Martchus <martchus@gmx.net>
Date: Sun, 25 Sep 2016 23:03:18 +0200
Subject: [PATCH 3/8] Fix dynamic libraries
Subject: [PATCH 03/10] Fix dynamic libraries
- Create import libs
- Use correct *.def file
@ -15,7 +15,7 @@ Subject: [PATCH 3/8] Fix dynamic libraries
create mode 100644 src/libGLESv2/libGLESv2_mingw32.def
diff --git a/src/libEGL.gypi b/src/libEGL.gypi
index 813b006..1176136 100644
index 86158a6..05a2c24 100644
--- a/src/libEGL.gypi
+++ b/src/libEGL.gypi
@@ -34,6 +34,12 @@
@ -91,10 +91,10 @@ index 0000000..6cecc64
+ eglCreatePlatformPixmapSurface@16 @46
+ eglWaitSync@12 @47
diff --git a/src/libGLESv2.gypi b/src/libGLESv2.gypi
index 39600c6..dac2dae 100644
index d0dc945..325ffc8 100644
--- a/src/libGLESv2.gypi
+++ b/src/libGLESv2.gypi
@@ -1052,6 +1052,12 @@
@@ -1067,6 +1067,12 @@
{
'msvs_requires_importlibrary' : 'true',
}],

View File

@ -1,15 +1,16 @@
From d3d4fba06e0e8f0c80a1573b1a002ac76bbe9c5b Mon Sep 17 00:00:00 2001
From 1d4cb8b14bb7d52ccec0828bcd489e683afb2aa7 Mon Sep 17 00:00:00 2001
From: Martchus <martchus@gmx.net>
Date: Sun, 25 Sep 2016 23:05:02 +0200
Subject: [PATCH 4/8] Link against dxguid, d3d9 and gdi32
Subject: [PATCH 04/10] Link against dxguid, d3d9 and gdi32
---
src/libEGL.gypi | 3 +++
src/libGLESv2.gypi | 3 +++
2 files changed, 6 insertions(+)
util/util.gyp | 7 +++++++
3 files changed, 13 insertions(+)
diff --git a/src/libEGL.gypi b/src/libEGL.gypi
index 1176136..03fb651 100644
index 05a2c24..aaa8bbf 100644
--- a/src/libEGL.gypi
+++ b/src/libEGL.gypi
@@ -41,6 +41,9 @@
@ -23,10 +24,10 @@ index 1176136..03fb651 100644
],
}
diff --git a/src/libGLESv2.gypi b/src/libGLESv2.gypi
index dac2dae..1267cc2 100644
index 325ffc8..cd69e44 100644
--- a/src/libGLESv2.gypi
+++ b/src/libGLESv2.gypi
@@ -1059,6 +1059,9 @@
@@ -1074,6 +1074,9 @@
'ldflags': [ '-Wl,--out-implib,libGLESv2.dll.a ../../../src/libGLESv2/libGLESv2.def' ],
}],
],
@ -36,6 +37,24 @@ index dac2dae..1267cc2 100644
},
],
}
diff --git a/util/util.gyp b/util/util.gyp
index 08d4951..b8e08c1 100644
--- a/util/util.gyp
+++ b/util/util.gyp
@@ -144,6 +144,13 @@
[
'<@(util_win32_sources)',
],
+ 'link_settings':
+ {
+ 'libraries':
+ [
+ '-lgdi32',
+ ]
+ },
}],
['OS=="win" and angle_build_winrt==1',
{
--
2.10.2

View File

@ -1,7 +1,7 @@
From ccff4861fa86aa66aedc680f65c00aa0b190e7a9 Mon Sep 17 00:00:00 2001
From 7b0e3346df5a0c8a6b5dd2215a4ecbb659082f5a Mon Sep 17 00:00:00 2001
From: Martchus <martchus@gmx.net>
Date: Sun, 25 Sep 2016 23:07:03 +0200
Subject: [PATCH 5/8] Export shader API via libGLESv2.dll
Subject: [PATCH 05/10] Export shader API via libGLESv2.dll
Required by Qt WebKit
---
@ -10,7 +10,7 @@ Required by Qt WebKit
2 files changed, 22 insertions(+)
diff --git a/src/compiler/translator/ShaderLang.cpp b/src/compiler/translator/ShaderLang.cpp
index 37b1114..c9397b4 100644
index b776ca5..15918be 100644
--- a/src/compiler/translator/ShaderLang.cpp
+++ b/src/compiler/translator/ShaderLang.cpp
@@ -9,6 +9,17 @@

View File

@ -1,7 +1,7 @@
From b8ed09b39d8ce1d846a48bafc15490277bbedb2f Mon Sep 17 00:00:00 2001
From a870a46b2058f7c966533edd726269a6ddd6ce5a Mon Sep 17 00:00:00 2001
From: Jose Santiago <jsantiago@haivision.com>
Date: Thu, 3 Nov 2016 09:38:19 -0500
Subject: [PATCH 6/8] Make GLintptr and GLsizeiptr match those from Qt 5
Subject: [PATCH 06/10] Make GLintptr and GLsizeiptr match those from Qt 5
Fix compiling mingw-w64-qt5-base-dynamic and mingw-w64-qt5-webkit
---

View File

@ -1,7 +1,7 @@
From 1ea025fac01f94d61d254309418ef470c36cbd4c Mon Sep 17 00:00:00 2001
From 09d3f7afd742870db9e177f43b8962043bd972ff Mon Sep 17 00:00:00 2001
From: Martchus <martchus@gmx.net>
Date: Sun, 6 Nov 2016 17:57:18 +0100
Subject: [PATCH 7/8] Remove copy_scripts target
Subject: [PATCH 07/10] Remove copy_scripts target
Executing .bat scripts on Linux is a no-go
---
@ -11,7 +11,7 @@ Executing .bat scripts on Linux is a no-go
3 files changed, 85 deletions(-)
diff --git a/BUILD.gn b/BUILD.gn
index 3ade282..8842d96 100644
index 4232008..f3ecf89 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -60,17 +60,6 @@ config("extra_warnings") {
@ -31,8 +31,8 @@ index 3ade282..8842d96 100644
-
angle_undefine_configs = [ "//build/config/compiler:default_include_dirs" ]
static_library("translator") {
@@ -421,12 +410,6 @@ static_library("libANGLE") {
# Holds the shared includes so we only need to list them once.
@@ -396,12 +385,6 @@ static_library("libANGLE") {
":libANGLE_config",
":internal_config",
]
@ -46,7 +46,7 @@ index 3ade282..8842d96 100644
config("shared_library_public_config") {
diff --git a/src/angle.gyp b/src/angle.gyp
index 578f0f3..083c760 100644
index e4e8ba9..7a4061d 100644
--- a/src/angle.gyp
+++ b/src/angle.gyp
@@ -169,27 +169,6 @@
@ -57,7 +57,7 @@ index 578f0f3..083c760 100644
- {
- 'target_name': 'copy_scripts',
- 'type': 'none',
- 'includes': [ '../build/common_defines.gypi', ],
- 'includes': [ '../gyp/common_defines.gypi', ],
- 'hard_dependency': 1,
- 'copies':
- [
@ -80,7 +80,7 @@ index 578f0f3..083c760 100644
@@ -201,7 +180,6 @@
'target_name': 'commit_id',
'type': 'none',
'includes': [ '../build/common_defines.gypi', ],
'includes': [ '../gyp/common_defines.gypi', ],
- 'dependencies': [ 'copy_scripts', ],
'hard_dependency': 1,
'actions':
@ -97,7 +97,7 @@ index 578f0f3..083c760 100644
- 'target_name': 'copy_compiler_dll',
- 'type': 'none',
- 'dependencies': [ 'copy_scripts', ],
- 'includes': [ '../build/common_defines.gypi', ],
- 'includes': [ '../gyp/common_defines.gypi', ],
- 'conditions':
- [
- ['angle_build_winrt==0',
@ -131,10 +131,10 @@ index 578f0f3..083c760 100644
] # conditions
}
diff --git a/src/libGLESv2.gypi b/src/libGLESv2.gypi
index 1267cc2..56c3e99 100644
index cd69e44..506147e 100644
--- a/src/libGLESv2.gypi
+++ b/src/libGLESv2.gypi
@@ -1020,13 +1020,6 @@
@@ -1035,13 +1035,6 @@
'ANGLE_ENABLE_NULL',
],
}],

View File

@ -1,7 +1,7 @@
From 0232cb7cec579dae6ecb8d1b4c7d7d66b3771adf Mon Sep 17 00:00:00 2001
From d4a2be49fbffa30f026ae9cbadfda2f882fc9ad9 Mon Sep 17 00:00:00 2001
From: Martchus <martchus@gmx.net>
Date: Sun, 6 Nov 2016 18:46:15 +0100
Subject: [PATCH 8/8] Fix generation of commit_id.h
Subject: [PATCH 08/10] Fix generation of commit_id.h
This might break compiling when not
executing ninja in subdir of source tee
@ -10,7 +10,7 @@ executing ninja in subdir of source tee
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/angle.gyp b/src/angle.gyp
index 083c760..0c149f3 100644
index 7a4061d..090b391 100644
--- a/src/angle.gyp
+++ b/src/angle.gyp
@@ -8,7 +8,7 @@

View File

@ -0,0 +1,80 @@
From 4c6bc08c7b66806b4284275a25d5ffa3aa72c666 Mon Sep 17 00:00:00 2001
From: Martchus <martchus@gmx.net>
Date: Fri, 2 Dec 2016 23:55:03 +0100
Subject: [PATCH 09/10] Ensure dependencies of samples are found
---
samples/samples.gyp | 10 +++++-----
util/util.gyp | 16 ++++++++--------
2 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/samples/samples.gyp b/samples/samples.gyp
index 66bda6d..3bcd2d5 100644
--- a/samples/samples.gyp
+++ b/samples/samples.gyp
@@ -19,17 +19,17 @@
'includes': [ '../gyp/common_defines.gypi', ],
'dependencies':
[
- '<(angle_path)/src/angle.gyp:libEGL',
- '<(angle_path)/src/angle.gyp:libGLESv2',
- '<(angle_path)/util/util.gyp:angle_util',
+ '../src/angle.gyp:libEGL',
+ '../src/angle.gyp:libGLESv2',
+ '../util/util.gyp:angle_util',
],
'export_dependent_settings':
[
- '<(angle_path)/util/util.gyp:angle_util',
+ '../util/util.gyp:angle_util',
],
'include_dirs':
[
- '<(angle_path)/include',
+ '../include',
'sample_util',
],
'sources':
diff --git a/util/util.gyp b/util/util.gyp
index b8e08c1..9c8c0af 100644
--- a/util/util.gyp
+++ b/util/util.gyp
@@ -100,18 +100,18 @@
'includes': [ '../gyp/common_defines.gypi', ],
'dependencies':
[
- '<(angle_path)/src/angle.gyp:angle_common',
- '<(angle_path)/src/angle.gyp:libEGL',
- '<(angle_path)/src/angle.gyp:libGLESv2',
+ '../src/angle.gyp:angle_common',
+ '../src/angle.gyp:libEGL',
+ '../src/angle.gyp:libGLESv2',
],
'export_dependent_settings':
[
- '<(angle_path)/src/angle.gyp:angle_common',
+ '../src/angle.gyp:angle_common',
],
'include_dirs':
[
- '<(angle_path)/include',
- '<(angle_path)/util',
+ '../include',
+ '../util',
],
'sources':
[
@@ -127,8 +127,8 @@
{
'include_dirs':
[
- '<(angle_path)/include',
- '<(angle_path)/util',
+ '../include',
+ '../util',
],
'defines':
[
--
2.10.2

View File

@ -0,0 +1,26 @@
From fafa411904d7f8814298c5b82d107a7aeccf5ed7 Mon Sep 17 00:00:00 2001
From: Martchus <martchus@gmx.net>
Date: Fri, 2 Dec 2016 23:58:32 +0100
Subject: [PATCH 10/10] Win32_system_utils.cpp: Make implicit cast explicit
Required to build with mingw-w64
---
util/windows/win32/Win32_system_utils.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/util/windows/win32/Win32_system_utils.cpp b/util/windows/win32/Win32_system_utils.cpp
index a9fd97f..83eb626 100644
--- a/util/windows/win32/Win32_system_utils.cpp
+++ b/util/windows/win32/Win32_system_utils.cpp
@@ -52,7 +52,7 @@ void *Win32Library::getSymbol(const std::string &symbolName)
return nullptr;
}
- return GetProcAddress(mModule, symbolName.c_str());
+ return reinterpret_cast<void *>(GetProcAddress(mModule, symbolName.c_str()));
}
Library *loadLibrary(const std::string &libraryName)
--
2.10.2

View File

@ -7,8 +7,8 @@
# All my PKGBUILDs are managed at https://github.com/Martchus/PKGBUILDs where
# you also find the URL of a binary repository.
pkgname=mingw-w64-angleproject
pkgver=2.1.r6289.f097e23
pkgname=(mingw-w64-angleproject{,-samples})
pkgver=2.1.r6381.9f09037
pkgrel=1
pkgdesc='ANGLE project (mingw-w64)'
arch=('any')
@ -17,7 +17,8 @@ license=('BSD')
depends=('mingw-w64-crt')
makedepends=('mingw-w64-gcc' 'git' 'gyp-git' 'depot-tools-git' 'python' 'python2')
options=('!strip' '!buildflags' 'staticlibs')
source=('angleproject::git+https://chromium.googlesource.com/angle/angle#commit=f097e23'
source=('angleproject::git+https://chromium.googlesource.com/angle/anglecommit=f097e23'
'additional-mingw-header::git+https://github.com/Martchus/additional-mingw-header.git'
'additional-mingw-header::git+https://github.com/Martchus/additional-mingw-header.git#commit=7a8f394'
'0001-Provide-workaround-for-building-static-libs.patch'
'0002-Provide-Windows-XP-support.patch'
@ -26,17 +27,22 @@ source=('angleproject::git+https://chromium.googlesource.com/angle/angle#commit=
'0005-Export-shader-API-via-libGLESv2.dll.patch'
'0006-Make-GLintptr-and-GLsizeiptr-match-those-from-Qt-5.patch'
'0007-Remove-copy_scripts-target.patch'
'0008-Fix-generation-of-commit_id.h.patch')
'0008-Fix-generation-of-commit_id.h.patch'
'0009-Ensure-dependencies-of-samples-are-found.patch'
'0010-Win32_system_utils.cpp-Make-implicit-cast-explicit.patch')
sha256sums=('SKIP'
'SKIP'
'b90c65737137d3e4f146fcd7fcb7c1893f071888046c8125c41470a800b4ac72'
'e79008c38c429937985812e525c71292bd612f6a3844abb328d2837fd69ce763'
'08e47bb775a032a470f9fc995f1a06721b0431c30c2b7a79ca083ea06d0a9622'
'd7a0c9de5c91aa9d5364fa453240309d30c0a17ea85dde979c85b836916ae11e'
'50db99bc4f7fc8d68fc1ae5d5826f1938714b9f5a06d62ece718a02d1b0d4a2d'
'7dc50ef89e3af1b99d41ba25e1ad7acb62a0abd4008a23b298aa3c224751934a'
'66852b4499763955f27906599567a0a4712218d5e739feb550a8a13eaa2d43f0'
'521251e4ffd280f4344de1ece6393820b57517c457dbb695a673d865d71b5ed2')
'SKIP'
'59bc63ccf6d46db725bac5e259941677586315553cb545c51c2fb339e7c586c6'
'595d5f807b69947d55d4b6285b5dc687cc16d15b6a8c56ec79f496001bbd1f2e'
'2c5de1623d3ee2a8818063edaea287d1d684785a3443b4f7a2db482c45c59194'
'd2ed2cf0518fc09b472b17db857d979189b660135347b4c19be8e7352c032ed4'
'a214c2bb6a1472843227b27cf6963113e4e42e5051dfa4ba9dbdfd353da887b5'
'34e363820e24df349b5798526bd7040aaf5224086310d92901b71b2e5285cd96'
'8098e5f6999ffb15761a4bea668e14fbe9af9af94c2ec504fd6b6421198a938a'
'9a17c871dfcef1bde47d54a12ba1d3ad88c2349d3bede4b12fa9c9453f0a1129'
'106e5607986669bba430d1b021e180f27c595d31d3ba239cad26583f423eccd2'
'2b195f1238b433fb68564f9c53adfc0d715cc4908c4ab0b9dd5977c88b763620')
_architectures='i686-w64-mingw32 x86_64-w64-mingw32'
#pkgver() {
@ -76,7 +82,7 @@ build() {
# Set common build flags and make sure all header files are found
local CXXFLAGS_COMMON="\
-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 -std=c++11 -msse2\
-DUNICODE -D_UNICODE -DANGLE_WINDOWS_XP_SUPPORT\
-DUNICODE -D_UNICODE -DANGLE_WINDOWS_XP_SUPPORT -D_USE_MATH_DEFINES\
-I${srcdir}/angleproject/include\
-I${srcdir}/angleproject/sysinclude\
-I${srcdir}/angleproject/src\
@ -86,7 +92,7 @@ build() {
export GYP_GENERATORS=ninja
for _arch in ${_architectures}; do
mkdir -p build-${_arch} && pushd build-${_arch}
mkdir -p build-${_arch}-shared && pushd build-${_arch}-shared
# Set ar/compiler and architecture specific compiler flags
export CC="${_arch}-gcc"
@ -104,13 +110,16 @@ build() {
fi
# Compose args for gyp and ninja
local gyp_args="-D use_ozone=0 -D OS=win -D TARGET=$target -D MSVS_VERSION='' --depth . -I ../build/common.gypi ../src/angle.gyp"
local gyp_args="-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"
local ninja_args="-C out/Release -j $(nproc)"
# Build shared libs
gyp $gyp_args
gyp $gyp_args ../samples/samples.gyp
ninja $ninja_args
popd
mkdir -p build-${_arch}-static && pushd build-${_arch}-static
# Build static libs
gyp $gyp_args -D angle_gl_library_type=static_library
ninja $ninja_args
@ -126,20 +135,57 @@ build() {
done
}
package() {
package_mingw-w64-angleproject() {
depends=('mingw-w64-crt')
for _arch in ${_architectures}; do
cd "${srcdir}/angleproject/build-${_arch}"
mkdir -p "${pkgdir}/usr/${_arch}/"{bin,lib,include}
install out/Release/lib/libGLESv2.so "${pkgdir}/usr/${_arch}/bin/libGLESv2.dll"
install out/Release/lib/libEGL.so "${pkgdir}/usr/${_arch}/bin/libEGL.dll"
# shared build
cd "${srcdir}/angleproject/build-${_arch}-shared/out/Release"
install \
out/Release/libGLESv2.dll.a \
out/Release/libEGL.dll.a \
out/Release/src/lib*.a \
lib/libGLESv2.so \
"${pkgdir}/usr/${_arch}/bin/libGLESv2.dll"
install \
lib/libEGL.so \
"${pkgdir}/usr/${_arch}/bin/libEGL.dll"
install \
libGLESv2.dll.a \
libEGL.dll.a \
src/lib*.a \
"${pkgdir}/usr/${_arch}/lib/"
cp -Rv \
../../../include/* \
"${pkgdir}/usr/${_arch}/include/"
# static build
cd "${srcdir}/angleproject/build-${_arch}-static/out/Release"
install \
src/lib*.a \
"${pkgdir}/usr/${_arch}/lib/"
cp -Rv ../include/* "${pkgdir}/usr/${_arch}/include/"
${_arch}-strip --strip-unneeded "${pkgdir}/usr/${_arch}/bin/"*.dll
${_arch}-strip -g "${pkgdir}/usr/${_arch}/lib/"*.a
done
}
package_mingw-w64-angleproject-samples() {
pkgdesc='ANGLE project samples (mingw-w64)'
depends=('mingw-w64-angleproject')
for _arch in ${_architectures}; do
mkdir -p "${pkgdir}/usr/${_arch}/"{bin,share/angleproject}
cd "${srcdir}/angleproject/build-${_arch}-shared/out/Release"
for sample in $(find . -maxdepth 1 -type f -not -iname '*.*'); do
install "$sample" "${pkgdir}/usr/${_arch}/bin/$sample.exe"
done
install \
*.tga \
*.glsl \
"${pkgdir}/usr/${_arch}/share/angleproject"
${_arch}-strip --strip-all "${pkgdir}/usr/${_arch}/bin/"*.exe
done
}