2016-02-22 18:33:53 +01:00
|
|
|
# Maintainer: Martchus <martchus@gmx.net>
|
|
|
|
# Contributor: ant32 <antreimer@gmail.com>
|
|
|
|
# Contributor: Filip Brcic <brcha@gna.org>
|
|
|
|
# Contributor: xantares
|
|
|
|
# Contributor: jellysheep <max DOT mail AT dameweb DOT de>
|
|
|
|
|
2016-03-25 21:43:59 +01:00
|
|
|
# All my PKGBUILDs are managed at https://github.com/Martchus/PKGBUILDs where
|
|
|
|
# you also find the URL of a binary repository.
|
|
|
|
|
2016-12-03 23:05:09 +01:00
|
|
|
# Patches are managed under https://github.com/Martchus/angle/tree/mingw-w64
|
|
|
|
|
|
|
|
_latest_git=
|
|
|
|
|
2016-12-02 12:44:23 +01:00
|
|
|
pkgver=2.1.r6381.9f09037
|
2016-12-03 23:05:09 +01:00
|
|
|
if [[ $_latest_git ]]; then
|
|
|
|
pkgname=(mingw-w64-angleproject{,-samples}-git)
|
|
|
|
pkgdesc='ANGLE project (mingw-w64, git version)'
|
|
|
|
_angle_commit=
|
|
|
|
_header_commit=
|
|
|
|
else
|
|
|
|
pkgname=(mingw-w64-angleproject{,-samples})
|
|
|
|
pkgdesc='ANGLE project (mingw-w64)'
|
|
|
|
_angle_commit="#commit=${pkgver##*.}"
|
|
|
|
_header_commit='#commit=7a8f394'
|
|
|
|
fi
|
2016-08-09 20:29:33 +02:00
|
|
|
pkgrel=1
|
2016-02-22 18:33:53 +01:00
|
|
|
arch=('any')
|
|
|
|
url='https://chromium.googlesource.com/angle/angle/+/master/README.md'
|
|
|
|
license=('BSD')
|
|
|
|
depends=('mingw-w64-crt')
|
2016-08-09 20:29:33 +02:00
|
|
|
makedepends=('mingw-w64-gcc' 'git' 'gyp-git' 'depot-tools-git' 'python' 'python2')
|
2016-02-22 18:33:53 +01:00
|
|
|
options=('!strip' '!buildflags' 'staticlibs')
|
2016-12-03 23:05:09 +01:00
|
|
|
source=("angleproject::git+https://chromium.googlesource.com/angle/angle$_angle_commit"
|
|
|
|
"additional-mingw-header::git+https://github.com/Martchus/additional-mingw-header.git$_header_commit"
|
2016-08-09 20:29:33 +02:00
|
|
|
'0001-Provide-workaround-for-building-static-libs.patch'
|
|
|
|
'0002-Provide-Windows-XP-support.patch'
|
|
|
|
'0003-Fix-dynamic-libraries.patch'
|
|
|
|
'0004-Link-against-dxguid-d3d9-and-gdi32.patch'
|
|
|
|
'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'
|
2016-12-02 12:44:23 +01:00
|
|
|
'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')
|
2016-02-27 21:08:28 +01:00
|
|
|
sha256sums=('SKIP'
|
2016-12-02 12:44:23 +01:00
|
|
|
'SKIP'
|
|
|
|
'59bc63ccf6d46db725bac5e259941677586315553cb545c51c2fb339e7c586c6'
|
|
|
|
'595d5f807b69947d55d4b6285b5dc687cc16d15b6a8c56ec79f496001bbd1f2e'
|
|
|
|
'2c5de1623d3ee2a8818063edaea287d1d684785a3443b4f7a2db482c45c59194'
|
|
|
|
'd2ed2cf0518fc09b472b17db857d979189b660135347b4c19be8e7352c032ed4'
|
2016-12-03 23:05:09 +01:00
|
|
|
'd017726a8953ef409dc614f87b2b99d91725c3d9f1c6bc7d4043301cfb1ce032'
|
|
|
|
'8e17fd1b3bfa95c1f8f82a05b3697dfbd26a9c87ba5c3f8e3b5c8dfdccddbaa2'
|
|
|
|
'26add1c1ce33db65a102d63926d429e4cc3c61e505a622ef0e1faa0ed1867c40'
|
|
|
|
'5239b6bcd38a282adc38a45a7e420752b6f79310553fba19b9a5ae8b70eec31f'
|
|
|
|
'd665d266cb4d9b00f70d97df6859b455476beed4af5566a5fc0b4d75ddaaf5cc'
|
|
|
|
'cab5b50139148c882a409ddb38df80019648151beb4735e115e92f2fc5677326')
|
2016-08-09 20:29:33 +02:00
|
|
|
_architectures='i686-w64-mingw32 x86_64-w64-mingw32'
|
2016-02-22 18:33:53 +01:00
|
|
|
|
2016-12-03 23:05:09 +01:00
|
|
|
if [[ $_latest_git ]]; then
|
|
|
|
pkgver() {
|
|
|
|
cd "$srcdir/angleproject"
|
|
|
|
grep -E "^#define ANGLE_M..OR_VERSION [0-9]+$" src/common/version.h | sed 's/#define ANGLE_M..OR_VERSION //' | tr '\n' '.'
|
|
|
|
printf "r%s.%s\n" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
|
|
|
|
}
|
|
|
|
fi
|
2016-02-22 18:33:53 +01:00
|
|
|
|
|
|
|
prepare() {
|
|
|
|
cd "${srcdir}/angleproject"
|
|
|
|
|
2016-08-09 20:29:33 +02:00
|
|
|
# Ensure depot-tools are in PATH
|
|
|
|
source /etc/profile.d/depot_tools.sh
|
|
|
|
|
|
|
|
# Provide recent versions of some Windows header files
|
2016-04-17 23:45:54 +02:00
|
|
|
mkdir -p sysinclude
|
2016-02-22 18:33:53 +01:00
|
|
|
cp ../additional-mingw-header/{d3d11sdklayers,dxgi1_2,versionhelpers,d3d10_1,sdkddkver,d3d11,dcomp,dcomptypes,dcompanimation}.h sysinclude/
|
|
|
|
cp sysinclude/{versionhelpers,VersionHelpers}.h
|
|
|
|
|
2016-08-09 20:29:33 +02:00
|
|
|
# Set cache dir for gsutil
|
|
|
|
mkdir -p /tmp/gsutil
|
|
|
|
export DEPOT_TOOLS_GSUTIL_BIN_DIR=/tmp/gsutil
|
2016-02-22 18:33:53 +01:00
|
|
|
|
2016-08-09 20:29:33 +02:00
|
|
|
# Execute bootstrap scripts
|
|
|
|
python2 scripts/bootstrap.py
|
|
|
|
gclient sync --deps=all
|
2016-03-24 15:29:53 +01:00
|
|
|
|
2016-08-09 20:29:33 +02:00
|
|
|
# Apply patches; further descriptions can be found in patch files itself
|
|
|
|
for patch in "$srcdir/"*.patch; do
|
|
|
|
patch -p1 -i "$patch"
|
|
|
|
done
|
2016-02-22 18:33:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
build() {
|
|
|
|
cd "${srcdir}/angleproject"
|
|
|
|
|
2016-08-09 20:29:33 +02:00
|
|
|
# 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\
|
2016-12-02 12:44:23 +01:00
|
|
|
-DUNICODE -D_UNICODE -DANGLE_WINDOWS_XP_SUPPORT -D_USE_MATH_DEFINES\
|
2016-08-09 20:29:33 +02:00
|
|
|
-I${srcdir}/angleproject/include\
|
|
|
|
-I${srcdir}/angleproject/sysinclude\
|
|
|
|
-I${srcdir}/angleproject/src\
|
|
|
|
-I${srcdir}/angleproject/src/common/third_party/numerics"
|
|
|
|
|
|
|
|
# Use ninja
|
|
|
|
export GYP_GENERATORS=ninja
|
2016-02-22 18:33:53 +01:00
|
|
|
|
|
|
|
for _arch in ${_architectures}; do
|
2016-12-02 12:44:23 +01:00
|
|
|
mkdir -p build-${_arch}-shared && pushd build-${_arch}-shared
|
2016-02-22 18:33:53 +01:00
|
|
|
|
2016-08-09 20:29:33 +02:00
|
|
|
# Set ar/compiler and architecture specific compiler flags
|
|
|
|
export CC="${_arch}-gcc"
|
2016-02-22 18:33:53 +01:00
|
|
|
export CXX="${_arch}-g++"
|
|
|
|
export AR="${_arch}-ar"
|
2016-08-09 20:29:33 +02:00
|
|
|
export AS="${_arch}-as"
|
|
|
|
export RANLIB="${_arch}-ranlib"
|
|
|
|
unset LDFLAGS
|
2016-02-22 18:33:53 +01:00
|
|
|
if [[ ${_arch} == i686-w64-mingw32 ]]; then
|
2016-08-09 20:29:33 +02:00
|
|
|
local target='win32'
|
|
|
|
export CXXFLAGS="${CXXFLAGS_COMMON} -march=i686"
|
2016-02-22 18:33:53 +01:00
|
|
|
else
|
2016-08-09 20:29:33 +02:00
|
|
|
local target='win64'
|
|
|
|
export CXXFLAGS="${CXXFLAGS_COMMON} -march=x86-64"
|
2016-02-22 18:33:53 +01:00
|
|
|
fi
|
|
|
|
|
2016-08-09 20:29:33 +02:00
|
|
|
# Compose args for gyp and ninja
|
2016-12-02 12:44:23 +01:00
|
|
|
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"
|
2016-08-09 20:29:33 +02:00
|
|
|
local ninja_args="-C out/Release -j $(nproc)"
|
2016-02-22 18:33:53 +01:00
|
|
|
|
2016-08-09 20:29:33 +02:00
|
|
|
# Build shared libs
|
2016-12-02 12:44:23 +01:00
|
|
|
gyp $gyp_args ../samples/samples.gyp
|
2016-08-09 20:29:33 +02:00
|
|
|
ninja $ninja_args
|
2016-02-22 18:33:53 +01:00
|
|
|
|
2016-12-02 12:44:23 +01:00
|
|
|
popd
|
|
|
|
mkdir -p build-${_arch}-static && pushd build-${_arch}-static
|
|
|
|
|
2016-08-09 20:29:33 +02:00
|
|
|
# Build static libs
|
|
|
|
gyp $gyp_args -D angle_gl_library_type=static_library
|
|
|
|
ninja $ninja_args
|
2016-02-22 18:33:53 +01:00
|
|
|
|
2016-08-09 20:29:33 +02:00
|
|
|
# Static libs produced by the build script are just thin archives so they don't contain any objects themselves
|
|
|
|
# -> Repackage them to actually contain the object files
|
|
|
|
for lib in out/Release/src/lib*.a; do
|
|
|
|
$AR -t $lib | xargs ${_arch}-ar rvs $lib.new && mv $lib.new $lib;
|
|
|
|
$RANLIB $lib
|
2016-03-13 19:03:32 +01:00
|
|
|
done
|
|
|
|
|
2016-02-22 18:33:53 +01:00
|
|
|
popd
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2016-12-02 12:44:23 +01:00
|
|
|
package_mingw-w64-angleproject() {
|
|
|
|
depends=('mingw-w64-crt')
|
2016-12-03 23:05:09 +01:00
|
|
|
if [[ $_latest_git ]]; then
|
|
|
|
provides=('mingw-w64-angleproject')
|
|
|
|
conflicts=('mingw-w64-angleproject')
|
|
|
|
fi
|
2016-12-02 12:44:23 +01:00
|
|
|
|
2016-02-22 18:33:53 +01:00
|
|
|
for _arch in ${_architectures}; do
|
|
|
|
mkdir -p "${pkgdir}/usr/${_arch}/"{bin,lib,include}
|
2016-12-02 12:44:23 +01:00
|
|
|
|
|
|
|
# shared build
|
|
|
|
cd "${srcdir}/angleproject/build-${_arch}-shared/out/Release"
|
|
|
|
install \
|
|
|
|
lib/libGLESv2.so \
|
|
|
|
"${pkgdir}/usr/${_arch}/bin/libGLESv2.dll"
|
|
|
|
install \
|
|
|
|
lib/libEGL.so \
|
|
|
|
"${pkgdir}/usr/${_arch}/bin/libEGL.dll"
|
2016-12-03 23:05:09 +01:00
|
|
|
install \
|
|
|
|
lib/libangle_util.so \
|
|
|
|
"${pkgdir}/usr/${_arch}/bin/libangle_util.dll"
|
2016-12-02 12:44:23 +01:00
|
|
|
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"
|
2016-08-09 20:29:33 +02:00
|
|
|
install \
|
2016-12-02 12:44:23 +01:00
|
|
|
src/lib*.a \
|
2016-08-09 20:29:33 +02:00
|
|
|
"${pkgdir}/usr/${_arch}/lib/"
|
2016-02-22 18:33:53 +01:00
|
|
|
|
|
|
|
${_arch}-strip --strip-unneeded "${pkgdir}/usr/${_arch}/bin/"*.dll
|
2016-03-13 19:03:32 +01:00
|
|
|
${_arch}-strip -g "${pkgdir}/usr/${_arch}/lib/"*.a
|
2016-02-22 18:33:53 +01:00
|
|
|
done
|
|
|
|
}
|
2016-12-02 12:44:23 +01:00
|
|
|
|
|
|
|
package_mingw-w64-angleproject-samples() {
|
2016-12-03 23:05:09 +01:00
|
|
|
if [[ $_latest_git ]]; then
|
|
|
|
pkgdesc='ANGLE project samples (mingw-w64, git version)'
|
|
|
|
depends=('mingw-w64-angleproject-git')
|
|
|
|
provides=('mingw-w64-angleproject-samples')
|
|
|
|
conflicts=('mingw-w64-angleproject-samples')
|
|
|
|
else
|
|
|
|
pkgdesc='ANGLE project samples (mingw-w64)'
|
|
|
|
depends=('mingw-w64-angleproject')
|
|
|
|
fi
|
2016-12-02 12:44:23 +01:00
|
|
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
2016-12-03 23:05:09 +01:00
|
|
|
if [[ $_latest_git ]]; then
|
|
|
|
package_mingw-w64-angleproject-git() {
|
|
|
|
package_mingw-w64-angleproject
|
|
|
|
}
|
|
|
|
package_mingw-w64-angleproject-samples-git() {
|
|
|
|
package_mingw-w64-angleproject-samples
|
|
|
|
}
|
|
|
|
fi
|