Last active
August 19, 2021 01:10
-
-
Save maz-1/f3f9c30d77685299ab98dc262dc633b7 to your computer and use it in GitHub Desktop.
ogre-next
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Maintainer: Tolga Hosgor <[email protected]> | |
_pkgname=('ogre-next') | |
pkgname=("$_pkgname-git") | |
pkgver=r12810.1878563053 | |
pkgrel=1 | |
pkgdesc='Scene-oriented, flexible 3D engine written in C++' | |
arch=('i686' 'x86_64') | |
url='http://ogre3d.org' | |
license=('MIT') | |
depends=( | |
'freeimage' | |
'freetype2' | |
'glu' | |
'libxaw' | |
'libxrandr' | |
'rapidjson' | |
'tinyxml' | |
'zziplib' | |
) | |
makedepends=( | |
'cmake' | |
'git' | |
'mesa' | |
'vulkan-headers' | |
'shaderc' | |
) | |
provides=('ogre') | |
conflicts=('ogre') | |
source=("git+https://github.com/OGRECave/$_pkgname.git" | |
"git+https://github.com/OGRECave/ogre-next-deps.git" | |
"sample.sh") | |
sha512sums=('SKIP' | |
'SKIP' | |
'SKIP') | |
prepare() { | |
cd "$_pkgname" | |
} | |
pkgver() { | |
cd "$_pkgname" | |
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" | |
} | |
build_static_deps() | |
{ | |
cd "${srcdir}/ogre-next-deps/src/vulkan/shaderc/" | |
git submodule update --init --recursive | |
cmake \ | |
-B build \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DCMAKE_INSTALL_PREFIX=/usr \ | |
-DCMAKE_INSTALL_LIBDIR=lib \ | |
-DSHADERC_SKIP_TESTS=ON \ | |
-Dglslang_SOURCE_DIR=/usr/include/glslang \ | |
-GNinja \ | |
src | |
ninja -C build | |
mkdir -p "${srcdir}/${_pkgname}/Dependencies/lib" | |
cp -f "${srcdir}/ogre-next-deps/src/vulkan/shaderc/build/libshaderc/libshaderc_combined.a" "${srcdir}/${_pkgname}/Dependencies/lib/" | |
} | |
build() { | |
build_static_deps | |
cd "${srcdir}/${_pkgname}" | |
#[[ -d build ]] && rm -rf build | |
mkdir -p build && cd build | |
# Silence warnings about deprecated declarations | |
CXXFLAGS+=' -Wno-deprecated-declarations -Wno-deprecated-copy' | |
cmake .. \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DCMAKE_INSTALL_PREFIX=/usr \ | |
-DOGRE_BUILD_COMPONENT_HLMS_PBS:BOOL=TRUE \ | |
-DOGRE_BUILD_COMPONENT_HLMS_UNLIT:BOOL=TRUE \ | |
-DOGRE_BUILD_COMPONENT_MESHLODGENERATOR:BOOL=TRUE \ | |
-DOGRE_BUILD_COMPONENT_OVERLAY:BOOL=TRUE \ | |
-DOGRE_BUILD_COMPONENT_PLANAR_REFLECTIONS:BOOL=TRUE \ | |
-DOGRE_BUILD_COMPONENT_TERRAIN:BOOL=FALSE \ | |
-DOGRE_BUILD_COMPONENT_VOLUME:BOOL=FALSE \ | |
-DOGRE_BUILD_RENDERSYSTEM_GL3PLUS:BOOL=TRUE \ | |
-DOGRE_BUILD_RENDERSYSTEM_VULKAN:BOOL=TRUE \ | |
-DOGRE_BUILD_SAMPLES2:BOOL=TRUE \ | |
-DOGRE_BUILD_TESTS:BOOL=FALSE \ | |
-DOGRE_CONFIG_ENABLE_FREEIMAGE:BOOL=TRUE \ | |
-DOGRE_CONFIG_ENABLE_JSON:BOOL=TRUE \ | |
-DOGRE_CONFIG_ENABLE_ZIP:BOOL=TRUE \ | |
-DOGRE_CONFIG_THREAD_PROVIDER=std \ | |
-DOGRE_INSTALL_DOCS=0 \ | |
-DOGRE_INSTALL_SAMPLES:BOOL=TRUE \ | |
-DOGRE_INSTALL_SAMPLES_SOURCE:BOOL=TRUE \ | |
-DOGRE_INSTALL_TOOLS:BOOL=TRUE \ | |
-DOGRE_SIMD_NEON:BOOL=FALSE \ | |
-DOGRE_USE_BOOST=0 | |
make | |
} | |
package() { | |
optdepends=('cppunit: unit testing' | |
'intel-tbb: better threading support' | |
'poco: portability' | |
'boost: for developing using ogre') | |
cd "$_pkgname/build" | |
make DESTDIR="${pkgdir}/" install | |
install -Dm644 ../Docs/License.html "${pkgdir}/usr/share/licenses/${_pkgname}/license.html" | |
mkdir -p "${pkgdir}/usr/share/OGRE/Samples/" | |
cd "${pkgdir}/usr/bin" | |
find . -maxdepth 1 -type l | grep -P "(?<=Sample_)" | while read line | |
do | |
exe_link=${line#"./"} | |
exe=$(readlink -f "${exe_link}" | grep -oP "Sample_.*") | |
mv "${exe}" "${pkgdir}/usr/share/OGRE/Samples/${exe_link}" | |
install -Dm755 "${srcdir}/sample.sh" "${pkgdir}/usr/bin/${exe_link}" | |
done | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment