summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorluigoalma2019-02-09 02:24:54 +0000
committerluigoalma2019-02-09 02:31:59 +0000
commit8ca0661f400864b2deced7b564e64c365db5b094 (patch)
tree95c0454b3e544dfa8da84e59fc524cce3fc40b76 /PKGBUILD
downloadaur-8ca0661f400864b2deced7b564e64c365db5b094.tar.gz
Version 1.1.99
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD81
1 files changed, 81 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..da9c9ad3870b
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,81 @@
+# Contributor: luigoalma <at gmail>
+# Contributor: PedroHLC <root@pedrohlc.com>
+# Contributor: J. Peter Mugaas <jpmugaas@suddenlink.net>
+# Contributor: wirx6 <wirx654@gmail.com>
+# based of https://git.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/vulkan-icd-loader @ 837304b
+
+pkgname=mingw-w64-vulkan-icd-loader
+_pkgname=Vulkan-Loader
+pkgver=1.1.99
+pkgrel=1
+pkgdesc="Vulkan Installable Client Driver (ICD) Loader (mingw-w64)"
+arch=(any)
+url="https://www.khronos.org/vulkan/"
+groups=("mingw-w64-vulkan-devel")
+license=('APACHE')
+makedepends=(mingw-w64-cmake mingw-w64-vulkan-headers python-lxml)
+depends=(mingw-w64-crt)
+options=(!buildflags staticlibs !strip !emptydirs)
+source=("${_pkgname}-${pkgver}.tar.gz::https://github.com/KhronosGroup/${_pkgname}/archive/v${pkgver}.tar.gz"
+ "001-build-fix.patch")
+sha256sums=('27fd5e52506d2b53cc9806c05cb956d9a551525f3ad830e50cf5c59e329579d0'
+ '64ef57d8551a0b33f63aa98a06c276d5e8e24d9b4ff27347baa8fcb2a39c1295')
+
+_architectures="i686-w64-mingw32 x86_64-w64-mingw32"
+
+prepare() {
+ cd "${srcdir}/${_pkgname}-${pkgver}/loader"
+ # From the PedroHLC's aur package mingw-w64-vulkan-loader
+ # which is based of https://github.com/Alexpux/MINGW-packages/blob/master/mingw-w64-vulkan-loader/PKGBUILD
+ sed -i'' -E 's/#include <([^>]+)>/#include <\L\1>/g' *.h *.c
+ sed -i'' -E 's/target_link_libraries\(([^\)]+)\)/target_link_libraries\(\L\1\)/g' CMakeLists.txt
+ patch -p2 -i "${srcdir}/001-build-fix.patch"
+
+ # Added also this because __declspec(thread) was being ultimately ignored,
+ # making a non-tls variable of a tls variable.
+ # Replaced with __thread instead, of which at least works mingw-w64-gcc with thread model of "posix".
+ # Links libwinpthread in this case as effect but doesn't lose the tls properties of the variable.
+ # Untested on gcc compiled with a thread model of "win32".
+ sed -i'' -E 's/#define THREAD_LOCAL_DECL __declspec\(thread\)/#define THREAD_LOCAL_DECL __thread/g' vk_loader_platform.h
+}
+
+build() {
+ cd "${srcdir}/${_pkgname}-${pkgver}"
+
+ export LDFLAGS="-static-libgcc -static" # to staticly apply libssp and libwinpthread
+ export CFLAGS="-Wno-unused-function"
+ export CXXFLAGS=$CFLAGS
+ export CPPFLAGS=$CFLAGS
+ for _arch in ${_architectures}; do
+ mkdir build-${_arch} && pushd build-${_arch}
+ ${_arch}-cmake \
+ -DCMAKE_SHARED_LIBRARY_PREFIX_C="" \
+ -DCMAKE_SHARED_LIBRARY_PREFIX_CXX="" \
+ -DBUILD_TESTS=Off \
+ -DCMAKE_BUILD_TYPE=Release \
+ ..
+ make
+ popd
+ done
+}
+
+package() {
+ cd "${srcdir}/${_pkgname}-${pkgver}"
+
+ for _arch in ${_architectures}; do
+ pushd build-${_arch}
+ make DESTDIR="${pkgdir}" install
+ popd
+ install -Dm644 "LICENSE.txt" "${pkgdir}/usr/${_arch}/share/licenses/vulkan-loader/LICENSE"
+ install -d "${pkgdir}/usr/${_arch}/lib/pkgconfig"
+ sed -e "s/@CMAKE_INSTALL_PREFIX@/\/usr\/${_arch}/g" \
+ -e "s/@CMAKE_INSTALL_LIBDIR@/lib/g" \
+ -e "s/@CMAKE_PROJECT_NAME@/Vulkan-Loader/g" \
+ -e "s/@VK_API_VERSION@/${pkgver}/g" \
+ -e "s/-lvulkan/-lvulkan-1/g" \
+ -e "s/@PRIVATE_LIBS@/-ladvapi32 -lcfgmgr32/g" \
+ loader/vulkan.pc.in > "${pkgdir}/usr/${_arch}/lib/pkgconfig/vulkan.pc"
+ ${_arch}-strip --strip-unneeded "${pkgdir}/usr/${_arch}/bin/"*.dll
+ ${_arch}-strip -g "${pkgdir}/usr/${_arch}/lib/"*.a
+ done
+}