Compare commits

...
1 Commits
Author SHA1 Message Date
Jean-André Santoni d08f30d9ef Add glsl shaders package 2015-01-22 18:55:20 +01:00
4 changed files with 169 additions and 0 deletions

No files matched your search

@@ -0,0 +1,48 @@
################################################################################
# This file is part of OpenELEC - http://www.openelec.tv
# Copyright (C) 2009-2012 Stephan Raue ([email protected])
#
# This Program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This Program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenELEC.tv; see the file COPYING. If not, write to
# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA.
# http://www.gnu.org/copyleft/gpl.html
################################################################################
PKG_NAME="common-shaders"
PKG_VERSION="09885ea"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="GPL"
PKG_SITE="https://github.com/libretro/common-shaders"
PKG_URL="$LAKKA_MIRROR/$PKG_NAME-$PKG_VERSION.tar.xz"
PKG_DEPENDS_TARGET="toolchain Python:host retroarch:host"
PKG_PRIORITY="optional"
PKG_SECTION="RetroArch"
PKG_SHORTDESC="Collection of commonly used Cg shaders."
PKG_LONGDESC="Collection of commonly used Cg shaders. These shaders are usable by either HLSL and/or Cg runtime compilers. The cg2glsl script will translate most of these into GLSL shaders."
PKG_IS_ADDON="no"
PKG_AUTORECONF="no"
make_target() {
mkdir -p .cg-shaders
mv * .cg-shaders
mkdir -p .glsl-shaders
$ROOT/$TOOLCHAIN/bin/python $SYSROOT_PREFIX/usr/bin/cg2glsl.py .cg-shaders .glsl-shaders
}
makeinstall_target() {
mkdir -p $INSTALL/usr/share/shaders
cp -r .glsl-shaders/* $INSTALL/usr/share/shaders
}
+12
View File
@@ -48,6 +48,18 @@ if [ "$OPENGLES_SUPPORT" = yes ]; then
PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET $OPENGLES"
fi
configure_host() {
:
}
make_host() {
:
}
makeinstall_host() {
cp $ROOT/$PKG_BUILD/tools/cg2glsl.py $SYSROOT_PREFIX/usr/bin/
}
pre_configure_target() {
# workaround for https://github.com/libretro/RetroArch/issues/1078
strip_lto
@@ -0,0 +1,65 @@
diff --git a/tools/cg2glsl.py b/tools/cg2glsl.py
index 1db1a47..73f6e8d 100755
--- a/tools/cg2glsl.py
+++ b/tools/cg2glsl.py
@@ -15,7 +15,7 @@ batch_mode = False
def log(*arg):
if not batch_mode:
- print(*arg)
+ print arg
def remove_comments(source_lines):
ret = []
@@ -703,7 +703,7 @@ def main():
for source in filter(lambda path: path_ext(path) == '.cg', [os.path.join(dirname, filename) for filename in filenames]):
dest = convert_path(source, sys.argv[1], sys.argv[2], ('.cg', '.glsl'))
dirpath = os.path.split(dest)[0]
- print('Dirpath:', dirpath)
+ print 'Dirpath:', dirpath
if not os.path.isdir(dirpath):
try:
os.makedirs(dirpath)
@@ -713,7 +713,7 @@ def main():
try:
ret = convert(source, dest)
- print(source, '->', dest, '...', 'succeeded!' if ret == 0 else 'failed!')
+ print source, '->', dest, '...', 'succeeded!' if ret == 0 else 'failed!'
if ret == 0:
success_cnt += 1
@@ -721,14 +721,14 @@ def main():
failed_cnt += 1
failed_files.append(source)
except Exception as e:
- print(e)
+ print e
failed_files.append(source)
failed_cnt += 1
for source in filter(lambda path: path_ext(path) == '.cgp', [os.path.join(dirname, filename) for filename in filenames]):
dest = convert_path(source, sys.argv[1], sys.argv[2], ('.cgp', '.glslp'))
dirpath = os.path.split(dest)[0]
- print('Dirpath:', dirpath)
+ print 'Dirpath:', dirpath
if not os.path.isdir(dirpath):
try:
os.makedirs(dirpath)
@@ -744,12 +744,12 @@ def main():
failed_files.append(source)
failed_cnt += 1
- print(success_cnt, 'shaders converted successfully.')
- print(failed_cnt, 'shaders failed.')
+ print success_cnt, 'shaders converted successfully.'
+ print failed_cnt, 'shaders failed.'
if failed_cnt > 0:
- print('Failed shaders:')
+ print 'Failed shaders:'
for path in failed_files:
- print(path)
+ print path
else:
source = sys.argv[1]
+44
View File
@@ -0,0 +1,44 @@
#!/bin/sh
################################################################################
# This file is part of OpenELEC - http://www.openelec.tv
# Copyright (C) 2009-2012 Stephan Raue ([email protected])
#
# This Program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This Program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenELEC.tv; see the file COPYING. If not, write to
# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA.
# http://www.gnu.org/copyleft/gpl.html
################################################################################
echo "getting sources..."
if [ ! -d common-shaders.git ]; then
git clone https://github.com/libretro/common-shaders.git common-shaders.git
fi
cd common-shaders.git
git pull
GIT_REV=`git log -n1 --format=%h`
cd ..
echo "copying sources..."
rm -rf common-shaders-$GIT_REV
cp -R common-shaders.git common-shaders-$GIT_REV
echo "cleaning sources..."
rm -rf common-shaders-$GIT_REV/.git
rm common-shaders-$GIT_REV/.gitignore
echo "packing sources..."
tar cvJf common-shaders-$GIT_REV.tar.xz common-shaders-$GIT_REV
echo "remove temporary sourcedir..."
rm -rf common-shaders-$GIT_REV