glsl-optimizer: Update to latest. Build from aras-p repository. Add patches
This commit is contained in:
20
mingw-w64-glsl-optimizer/0003-fix-tests-compile.patch
Normal file
20
mingw-w64-glsl-optimizer/0003-fix-tests-compile.patch
Normal file
@@ -0,0 +1,20 @@
|
||||
--- glsl-optimizer/tests/glsl_optimizer_tests.cpp.orig 2014-01-18 16:35:25.459600000 +0400
|
||||
+++ glsl-optimizer/tests/glsl_optimizer_tests.cpp 2014-01-18 17:05:21.662000000 +0400
|
||||
@@ -14,7 +14,7 @@
|
||||
#if GOT_GFX
|
||||
|
||||
// ---- Windows GL bits
|
||||
-#ifdef _MSC_VER
|
||||
+#ifdef _WIN32
|
||||
#define GOT_MORE_THAN_GLSL_120 1
|
||||
#include <windows.h>
|
||||
#include <gl/GL.h>
|
||||
@@ -311,7 +311,7 @@
|
||||
{
|
||||
StringVector res;
|
||||
|
||||
- #ifdef _MSC_VER
|
||||
+ #ifdef _WIN32
|
||||
WIN32_FIND_DATAA FindFileData;
|
||||
HANDLE hFind = FindFirstFileA ((folder+"/*"+endsWith).c_str(), &FindFileData);
|
||||
if (hFind == INVALID_HANDLE_VALUE)
|
||||
@@ -0,0 +1,20 @@
|
||||
--- glsl-optimizer/src/glsl/ir_print_glsl_visitor.cpp.orig 2014-01-18 16:35:24.773200000 +0400
|
||||
+++ glsl-optimizer/src/glsl/ir_print_glsl_visitor.cpp 2014-01-18 17:11:06.406600000 +0400
|
||||
@@ -302,7 +302,7 @@
|
||||
|
||||
void ir_print_glsl_visitor::print_var_name (ir_variable* v)
|
||||
{
|
||||
- long id = (long)hash_table_find (globals->var_hash, v);
|
||||
+ intptr_t id = (intptr_t)hash_table_find (globals->var_hash, v);
|
||||
if (!id && v->mode == ir_var_temporary)
|
||||
{
|
||||
id = ++globals->var_counter;
|
||||
@@ -406,7 +406,7 @@
|
||||
// give an id to any variable defined in a function that is not an uniform
|
||||
if ((this->mode == kPrintGlslNone && ir->mode != ir_var_uniform))
|
||||
{
|
||||
- long id = (long)hash_table_find (globals->var_hash, ir);
|
||||
+ intptr_t id = (intptr_t)hash_table_find (globals->var_hash, ir);
|
||||
if (id == 0)
|
||||
{
|
||||
id = ++globals->var_counter;
|
||||
@@ -3,12 +3,11 @@
|
||||
_realname=glsl-optimizer
|
||||
_mingw_suff=mingw-w64-${CARCH}
|
||||
pkgname="${_mingw_suff}-${_realname}-git"
|
||||
_basever=0.1.0
|
||||
pkgver=0.1.0.60329.fe8a93f
|
||||
pkgver=r60842.9b2a2d2
|
||||
pkgrel=1
|
||||
pkgdesc="C++ library that takes GLSL shaders, does some GPU-independent optimizations on them and outputs GLSL back"
|
||||
pkgdesc="C++ library that takes GLSL shaders, does some GPU-independent optimizations on them and outputs GLSL back (mingw-w64)"
|
||||
arch=('any')
|
||||
url='http://mingw-w64.sourceforge.net'
|
||||
url='https://github.com/aras-p/glsl-optimizer'
|
||||
license=('MIT')
|
||||
depends=("")
|
||||
makedepends=("git" "${_mingw_suff}-cmake" "${_mingw_suff}-gcc")
|
||||
@@ -18,39 +17,52 @@ conflicts=("${_mingw_suff}-${_realname}")
|
||||
replaces=()
|
||||
backup=()
|
||||
options=('!strip' 'staticlibs' '!emptydirs')
|
||||
source=("${_realname}"::"git+https://github.com/mingwandroid/glsl-optimizer.git"
|
||||
0001-cmake-Link-OpenGL-with-glsl_test.patch
|
||||
0002-Fix-glslopt-compile-failure.patch)
|
||||
source=("${_realname}"::"git+https://github.com/aras-p/glsl-optimizer.git"
|
||||
0001-cmake-Link-OpenGL-with-glsl_test.patch
|
||||
0002-Fix-glslopt-compile-failure.patch
|
||||
0003-fix-tests-compile.patch
|
||||
0004-Fix-incorrect-Windows-64-hash_table_find-cast.patch
|
||||
)
|
||||
md5sums=('SKIP'
|
||||
'a69f07671525c48ac0a9a0321fda2b42'
|
||||
'42190f0e6a8f434885e8347831f5d407')
|
||||
|
||||
'42190f0e6a8f434885e8347831f5d407'
|
||||
'2b647ac196a91e08bd7e5aa35c851cdd'
|
||||
'4223ad35f51d21a77b0b89c1cb8a26c0')
|
||||
|
||||
pkgver() {
|
||||
cd "$srcdir/${_realname}"
|
||||
printf "%s.%s.%s" "${_basever}" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
|
||||
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
|
||||
}
|
||||
|
||||
prepare() {
|
||||
cd "$srcdir/${_realname}"
|
||||
patch -p1 -i ${srcdir}/0001-cmake-Link-OpenGL-with-glsl_test.patch
|
||||
patch -p1 -i ${srcdir}/0002-Fix-glslopt-compile-failure.patch
|
||||
patch -p1 -i ${srcdir}/0003-fix-tests-compile.patch
|
||||
patch -p1 -i ${srcdir}/0004-Fix-incorrect-Windows-64-hash_table_find-cast.patch
|
||||
}
|
||||
|
||||
build() {
|
||||
cd ${srcdir}/${_realname}
|
||||
mkdir -p ${pkgdir}${MINGW_PREFIX}
|
||||
pushd ${pkgdir}${MINGW_PREFIX} > /dev/null
|
||||
export PREFIX_WIN=`pwd -W`
|
||||
popd > /dev/null
|
||||
|
||||
mkdir ${srcdir}/build-${MINGW_CHOST} && cd ${srcdir}/build-${MINGW_CHOST}
|
||||
|
||||
${MINGW_PREFIX}/bin/cmake \
|
||||
-G"MSYS Makefiles"
|
||||
-G"MSYS Makefiles" \
|
||||
-DCMAKE_INSTALL_PREFIX:PATH=${PREFIX_WIN} \
|
||||
../${_realname}
|
||||
|
||||
make
|
||||
}
|
||||
|
||||
package() {
|
||||
cd ${srcdir}/${_realname}
|
||||
cd ${srcdir}/build-${MINGW_CHOST}
|
||||
mkdir -p ${pkgdir}${MINGW_PREFIX}/{bin,include,lib}
|
||||
cp *.exe ${pkgdir}${MINGW_PREFIX}/bin/
|
||||
cp src/glsl/glsl_optimizer.h ${pkgdir}${MINGW_PREFIX}/include/
|
||||
cp $srcdir/${_realname}/src/glsl/glsl_optimizer.h ${pkgdir}${MINGW_PREFIX}/include/
|
||||
cp libglsl_optimizer.a ${pkgdir}${MINGW_PREFIX}/lib/
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user