summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO22
-rw-r--r--PKGBUILD85
-rw-r--r--optional-spirv-tools.patch52
3 files changed, 159 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..398245a309c
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,22 @@
+pkgbase = mojoshader-hg
+ pkgdesc = library to work with Direct3D shaders on alternate 3D APIs and non-Windows platforms
+ pkgver = 1242
+ pkgrel = 1
+ url = https://icculus.org/mojoshader/
+ arch = x86_64
+ license = custom:zlib
+ makedepends = mercurial
+ source = hg+https://hg.icculus.org/icculus/mojoshader
+ source = optional-spirv-tools.patch
+ md5sums = SKIP
+ md5sums = 1e2e365b39d32e3372658d2b4070df1a
+
+pkgname = mojoshader-hg
+ provides = mojoshader
+ conflicts = mojoshader
+
+pkgname = lib32-mojoshader-hg
+ depends = mojoshader-hg
+ provides = lib32-mojoshader
+ conflicts = lib32-mojoshader
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..3f6852b950f
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,85 @@
+# Maintainer: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
+
+pkgname=(mojoshader-hg lib32-mojoshader-hg)
+pkgver=1242
+pkgrel=1
+pkgdesc='library to work with Direct3D shaders on alternate 3D APIs and non-Windows platforms'
+arch=('x86_64')
+url='https://icculus.org/mojoshader/'
+license=('custom:zlib')
+makedepends=('mercurial')
+
+source=("hg+https://hg.icculus.org/icculus/mojoshader"
+ 'optional-spirv-tools.patch')
+md5sums=('SKIP'
+ '1e2e365b39d32e3372658d2b4070df1a')
+
+pkgver() {
+ cd mojoshader
+ hg identify -n
+}
+
+prepare() {
+ cd mojoshader
+ hg patch ../optional-spirv-tools.patch
+}
+
+build() {
+ cd mojoshader
+ mkdir -p build build-lib32
+
+ cd build
+ cmake .. \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DBUILD_SHARED_LIBS=ON \
+ -DPROFILE_ARB1=OFF \
+ -DPROFILE_ARB1_NV=OFF \
+ -DPROFILE_BYTECODE=OFF \
+ -DPROFILE_D3D=OFF \
+ -DPROFILE_METAL=OFF \
+ -G Ninja
+ ninja
+
+ cd ../build-lib32
+ export CC="gcc -m32"
+ export CXX="g++ -m32"
+ export PKG_CONFIG="i686-pc-linux-gnu-pkg-config"
+ cmake .. \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DBUILD_SHARED_LIBS=ON \
+ -DPROFILE_ARB1=OFF \
+ -DPROFILE_ARB1_NV=OFF \
+ -DPROFILE_BYTECODE=OFF \
+ -DPROFILE_D3D=OFF \
+ -DPROFILE_METAL=OFF \
+ -DENABLE_SPIRV_TOOLS=OFF \
+ -G Ninja
+ ninja
+}
+
+package_mojoshader-hg() {
+ provides=('mojoshader')
+ conflicts=('mojoshader')
+
+ cd mojoshader
+ mkdir -p "$pkgdir"/usr/lib/ "$pkgdir"/usr/include/ "$pkgdir"/usr/share/licenses/mojoshader-hg/
+ install -Dm755 build/libmojoshader.so "$pkgdir"/usr/lib/
+ install -Dm644 mojoshader.h "$pkgdir"/usr/include/
+ install -Dm644 mojoshader_effects.h "$pkgdir"/usr/include/
+ install -Dm644 mojoshader_version.h "$pkgdir"/usr/include/
+ install -Dm644 LICENSE.txt "$pkgdir"/usr/share/licenses/mojoshader-hg/
+}
+
+package_lib32-mojoshader-hg() {
+ depends=(mojoshader-hg)
+ provides=('lib32-mojoshader')
+ conflicts=('lib32-mojoshader')
+
+ cd mojoshader
+ mkdir -p "$pkgdir"/usr/lib32/
+ install -Dm755 build-lib32/libmojoshader.so "$pkgdir"/usr/lib32/
+}
+
+# vim:set ts=2 sts=2 sw=2 et:
diff --git a/optional-spirv-tools.patch b/optional-spirv-tools.patch
new file mode 100644
index 00000000000..343d20c6468
--- /dev/null
+++ b/optional-spirv-tools.patch
@@ -0,0 +1,52 @@
+# HG changeset patch
+# User Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
+# Date 1587252594 -7200
+# Sun Apr 19 01:29:54 2020 +0200
+# Node ID 4d79c930f9714fc8a03addf35ec1a9e1524da49f
+# Parent 01fea3855ffb0f7536ac5420d449a2adcb6f36f6
+Make Spirv-Tools optional
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -17,6 +17,7 @@ OPTION(COMPILER_SUPPORT "Build MojoShade
+ OPTION(FLIP_VIEWPORT "Build MojoShader with the ability to flip the GL viewport" OFF)
+ OPTION(DEPTH_CLIPPING "Build MojoShader with the ability to simulate [0, 1] depth clipping" OFF)
+ OPTION(XNA4_VERTEXTEXTURE "Build MojoShader with XNA4 vertex texturing behavior" OFF)
++OPTION(ENABLE_SPIRV_TOOLS "TODO" ON)
+
+ INCLUDE_DIRECTORIES(.)
+
+@@ -225,18 +226,21 @@ IF(COMPILER_SUPPORT)
+ ENDIF(SDL2)
+ ENDIF(COMPILER_SUPPORT)
+
+-FIND_PATH(SPIRV_TOOLS_INCLUDE_DIR "spirv-tools/libspirv.h" PATH_SUFFIXES "include")
+-FIND_LIBRARY(SPIRV_TOOLS_LIBRARY NAMES SPIRV-Tools-shared)
+-IF(SPIRV_TOOLS_INCLUDE_DIR AND SPIRV_TOOLS_LIBRARY)
+- INCLUDE_DIRECTORIES(${SPIRV_TOOLS_INCLUDE_DIR})
+- ADD_DEFINITIONS(-DMOJOSHADER_HAS_SPIRV_TOOLS)
+-ENDIF(SPIRV_TOOLS_INCLUDE_DIR AND SPIRV_TOOLS_LIBRARY)
++IF(ENABLE_SPIRV_TOOLS)
++ FIND_PATH(SPIRV_TOOLS_INCLUDE_DIR "spirv-tools/libspirv.h" PATH_SUFFIXES "include")
++ FIND_LIBRARY(SPIRV_TOOLS_LIBRARY NAMES SPIRV-Tools-shared)
++ IF(SPIRV_TOOLS_INCLUDE_DIR AND SPIRV_TOOLS_LIBRARY)
++ INCLUDE_DIRECTORIES(${SPIRV_TOOLS_INCLUDE_DIR})
++ ADD_DEFINITIONS(-DMOJOSHADER_HAS_SPIRV_TOOLS)
++ ENDIF(SPIRV_TOOLS_INCLUDE_DIR AND SPIRV_TOOLS_LIBRARY)
+
+-ADD_EXECUTABLE(testparse utils/testparse.c)
+-TARGET_LINK_LIBRARIES(testparse mojoshader ${LIBM} ${LOBJC} ${CARBON_FRAMEWORK})
+-IF(SPIRV_TOOLS_INCLUDE_DIR AND SPIRV_TOOLS_LIBRARY)
+- TARGET_LINK_LIBRARIES(testparse ${SPIRV_TOOLS_LIBRARY})
+-ENDIF(SPIRV_TOOLS_INCLUDE_DIR AND SPIRV_TOOLS_LIBRARY)
++ ADD_EXECUTABLE(testparse utils/testparse.c)
++ TARGET_LINK_LIBRARIES(testparse mojoshader ${LIBM} ${LOBJC} ${CARBON_FRAMEWORK})
++ IF(SPIRV_TOOLS_INCLUDE_DIR AND SPIRV_TOOLS_LIBRARY)
++ TARGET_LINK_LIBRARIES(testparse ${SPIRV_TOOLS_LIBRARY})
++ ENDIF(SPIRV_TOOLS_INCLUDE_DIR AND SPIRV_TOOLS_LIBRARY)
++ENDIF(ENABLE_SPIRV_TOOLS)
++
+ ADD_EXECUTABLE(testoutput utils/testoutput.c)
+ TARGET_LINK_LIBRARIES(testoutput mojoshader ${LIBM} ${LOBJC} ${CARBON_FRAMEWORK})
+ IF(COMPILER_SUPPORT)