New package: amdvlk-2019.Q1.3

[ci skip]
This commit is contained in:
John Zimmermann 2019-01-24 14:45:10 +00:00
parent 211563c849
commit 3a965d4ced
3 changed files with 182 additions and 0 deletions

View file

@ -0,0 +1,119 @@
diff --git pal/shared/gpuopen/CMakeLists.txt pal/shared/gpuopen/CMakeLists.txt
index 592d556..8b73198 100644
--- pal/shared/gpuopen/CMakeLists.txt
+++ pal/shared/gpuopen/CMakeLists.txt
@@ -179,6 +179,10 @@ if(UNIX)
src/posix/ddPosixSocket.cpp
src/socketMsgTransport.cpp
)
+ check_symbol_exists(seed48_r stdlib.h HAVE_RAND48)
+ if(NOT HAVE_RAND48)
+ target_sources(gpuopen PRIVATE src/posix/ddRand48.c)
+ endif()
endif()
### Helper Classes ###
diff --git pal/shared/gpuopen/inc/posix/ddPosixPlatform.h pal/shared/gpuopen/inc/posix/ddPosixPlatform.h
index 2eed863..2aa57d0 100644
--- pal/shared/gpuopen/inc/posix/ddPosixPlatform.h
+++ pal/shared/gpuopen/inc/posix/ddPosixPlatform.h
@@ -53,6 +53,10 @@ static_assert(false, "Unknown platform detected")
#define DD_RESTRICT __restrict__
+#if defined(__linux__) && !defined(__GLIBC__)
+#include "ddRand48.h"
+#endif
+
namespace DevDriver
{
namespace Platform
diff --git pal/shared/gpuopen/inc/posix/ddRand48.h pal/shared/gpuopen/inc/posix/ddRand48.h
new file mode 100644
index 0000000..5c1b628
--- /dev/null
+++ pal/shared/gpuopen/inc/posix/ddRand48.h
@@ -0,0 +1,26 @@
+#ifndef RAND48_H
+#define RAND48_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <stdlib.h>
+#include <inttypes.h>
+#include <string.h>
+#include <stdint.h>
+
+struct drand48_data {
+ unsigned short __x[3];
+ unsigned short __old_x[3];
+ unsigned short __c;
+ unsigned short __init;
+ long long __a;
+};
+
+uint64_t __rand48_step(unsigned short *xi, unsigned short *lc);
+int jrand48_r(unsigned short s[3], struct drand48_data *buffer, long *result);
+int mrand48_r(struct drand48_data *buffer,long *result);
+int seed48_r(unsigned short *s, struct drand48_data *buffer);
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git pal/shared/gpuopen/src/posix/ddPosixSocket.cpp pal/shared/gpuopen/src/posix/ddPosixSocket.cpp
index d788c5f..42b2bc8 100644
--- pal/shared/gpuopen/src/posix/ddPosixSocket.cpp
+++ pal/shared/gpuopen/src/posix/ddPosixSocket.cpp
@@ -34,7 +34,7 @@
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/un.h>
-#include <sys/unistd.h>
+#include <unistd.h>
#include <sys/fcntl.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
diff --git pal/shared/gpuopen/src/posix/ddRand48.c pal/shared/gpuopen/src/posix/ddRand48.c
new file mode 100644
index 0000000..c600dce
--- /dev/null
+++ pal/shared/gpuopen/src/posix/ddRand48.c
@@ -0,0 +1,38 @@
+#include <posix/ddRand48.h>
+
+uint64_t __rand48_step(unsigned short *xi, unsigned short *lc)
+{
+ uint64_t a, x;
+ x = xi[0] | xi[1]+0U<<16 | xi[2]+0ULL<<32;
+ a = lc[0] | lc[1]+0U<<16 | lc[2]+0ULL<<32;
+ x = a*x + lc[3];
+ xi[0] = x;
+ xi[1] = x>>16;
+ xi[2] = x>>32;
+ return x & 0xffffffffffffull;
+}
+
+
+int jrand48_r(unsigned short s[3], struct drand48_data *buffer, long *result)
+{
+ *result = (int32_t)(__rand48_step(s, buffer->__x+3) >> 16);
+ return 0;
+}
+
+int mrand48_r(struct drand48_data *buffer,long *result)
+{
+ *result = jrand48_r(buffer->__x,buffer,result);
+ return 0;
+}
+
+
+int seed48_r(unsigned short *s, struct drand48_data *buffer)
+{
+ memcpy(buffer->__old_x, buffer->__x, sizeof buffer->__x);
+ memcpy(buffer->__x, s, sizeof buffer->__x);
+ buffer->__c = 0;
+ buffer->__init = 1;
+ buffer->__a = 0;
+ return 0;
+}
+

61
srcpkgs/amdvlk/template Normal file
View file

@ -0,0 +1,61 @@
# Template file for 'amdvlk'
pkgname=amdvlk
version=2019.Q1.3
revision=1
_llpc_commit=fc32df219915b72ece2007079063b3942c843630
_xgl_commit=f42a5b845ba784eb9990ed7182a8c4ff1f7cf7e3
_pal_commit=ee4e837d08ec933714df20e76abe0aebee42d457
_llvm_commit=3c7dbb214c3680803f7d3e3c3aed02fddb2f7dbb
_wsa_commit=f558403d3292039de4d17334e562bda58abfc72c
create_wrksrc=yes
build_wrksrc="xgl"
build_style=cmake
configure_args="-DBUILD_WAYLAND_SUPPORT=ON -DBUILD_WSA=ON"
hostmakedepends="pkg-config python3 perl"
makedepends="libxml2-devel xorg-server-devel libXrandr-devel"
depends="vulkan-loader"
short_desc="AMD Open Source Driver For Vulkan"
maintainer="John <johnz@posteo.net>"
license="MIT"
homepage="https://github.com/GPUOpen-Drivers/AMDVLK"
distfiles="https://github.com/GPUOpen-Drivers/AMDVLK/archive/v-${version}.tar.gz
https://github.com/GPUOpen-Drivers/llpc/archive/${_llpc_commit}.tar.gz
https://github.com/GPUOpen-Drivers/xgl/archive/${_xgl_commit}.tar.gz
https://github.com/GPUOpen-Drivers/pal/archive/${_pal_commit}.tar.gz
https://github.com/GPUOpen-Drivers/llvm/archive/${_llvm_commit}.tar.gz
https://github.com/GPUOpen-Drivers/wsa/archive/${_wsa_commit}.tar.gz"
checksum="5ad6dfbad5ade7cf26c81468b9c890c07e0d14e93edf356a349952f323dafd26
31a865fd53e1e1a07f73cdeb7413772b68d6fe973c3bc76aa1cc195eddcccc82
6bf4653d687f62ca7819b52903c20a201e59b55acb144c3a5068481f7c03de1c
c3e04b461b7410136f2c58ec7e53692a715335ec57f3aae7a7bdcf45f107edaf
9f17bbf37b92640589ba017030ca8fd569226325e6346aa1a75cceb0010c2301
b23e9453fa7b14bb13157fb645936ec74b18b12cdef301758452a92b23f27705"
case $XBPS_TARGET_MACHINE in
arm*|aarch64*) broken="https://travis-ci.com/Johnnynator/void-packages/jobs/173227514"
esac
post_extract() {
mv ${wrksrc}/AMDVLK-v-${version} ${wrksrc}/AMDVLK
mv ${wrksrc}/xgl-${_xgl_commit} ${wrksrc}/xgl
mv ${wrksrc}/pal-${_pal_commit} ${wrksrc}/pal
mv ${wrksrc}/llpc-${_llpc_commit} ${wrksrc}/llpc
mv ${wrksrc}/llvm-${_llvm_commit} ${wrksrc}/llvm
mv ${wrksrc}/wsa-${_wsa_commit} ${wrksrc}/wsa
}
do_install() {
case $XBPS_TARGET_MACHINE in
i686*|mips*|arm*|ppc|ppc-musl)
vinstall build/icd/amdvlk32.so 644 usr/lib/
vinstall ${wrksrc}/AMDVLK/json/Redhat/amd_icd32.json 644 usr/share/vulkan/icd.d/
;;
*)
vinstall build/icd/amdvlk64.so 644 usr/lib/
vinstall ${wrksrc}/AMDVLK/json/Redhat/amd_icd64.json 644 usr/share/vulkan/icd.d/
vsed -i ${DESTDIR}/usr/share/vulkan/icd.d/amd_icd64.json -e 's#/usr/lib64/#/usr/lib/#g'
;;
esac
vinstall build/wsa/wayland/libamdgpu_wsa_wayland.so 644 usr/lib/
vlicense ${wrksrc}/AMDVLK/LICENSE.txt
}

2
srcpkgs/amdvlk/update Normal file
View file

@ -0,0 +1,2 @@
homepage="https://github.com/GPUOpen-Drivers/AMDVLK/tags"
pattern='/archive/(v-?|AMDVLK-)?\K[\d\.Q]+(?=\.tar\.gz")'