aboutsummaryrefslogtreecommitdiff
path: root/pkgs/development/libraries/amdvlk
diff options
context:
space:
mode:
authorSebastian Neubauer <sebastian.neubauer@amd.com>2020-03-11 07:57:33 +0100
committerSebastian Neubauer <sebastian.neubauer@amd.com>2020-06-25 13:44:45 +0200
commit3ff2165d4d43a42b2b9dec7a8366e49bf2db1f26 (patch)
treeb14e56a2ebf1edc95d415c9dbdee6b757048440c /pkgs/development/libraries/amdvlk
parentc56e688d4bdb8ab419bd67dda4eac4b6c1e5ad04 (diff)
amdvlk: init at 2020.Q2.5
Diffstat (limited to 'pkgs/development/libraries/amdvlk')
-rw-r--r--pkgs/development/libraries/amdvlk/default.nix85
1 files changed, 85 insertions, 0 deletions
diff --git a/pkgs/development/libraries/amdvlk/default.nix b/pkgs/development/libraries/amdvlk/default.nix
new file mode 100644
index 000000000000..84b4d53bc56f
--- /dev/null
+++ b/pkgs/development/libraries/amdvlk/default.nix
@@ -0,0 +1,85 @@
+{ stdenv
+, lib
+, fetchpatch
+, fetchRepoProject
+, cmake
+, ninja
+, patchelf
+, perl
+, pkgconfig
+, python3
+, expat
+, libdrm
+, ncurses
+, openssl
+, wayland
+, xorg
+, zlib
+}:
+
+stdenv.mkDerivation rec {
+ pname = "amdvlk";
+ version = "2020.Q2.5";
+
+ src = fetchRepoProject {
+ name = "${pname}-src";
+ manifest = "https://github.com/GPUOpen-Drivers/AMDVLK.git";
+ rev = "refs/tags/v-${version}";
+ sha256 = "008adby8vx12ma155x64n7aj9vp9ygqgij3mm3q20i187db7d1ab";
+ };
+
+ buildInputs = [
+ expat
+ ncurses
+ openssl
+ wayland
+ xorg.libX11
+ xorg.libxcb
+ xorg.xcbproto
+ xorg.libXext
+ xorg.libXrandr
+ xorg.libXft
+ xorg.libxshmfence
+ zlib
+ ];
+
+ nativeBuildInputs = [
+ cmake
+ ninja
+ patchelf
+ perl
+ pkgconfig
+ python3
+ ];
+
+ rpath = lib.makeLibraryPath [
+ libdrm
+ stdenv.cc.cc.lib
+ xorg.libX11
+ xorg.libxcb
+ xorg.libxshmfence
+ ];
+
+ cmakeDir = "../drivers/xgl";
+
+ installPhase = ''
+ install -Dm755 -t $out/lib icd/amdvlk64.so
+ install -Dm644 -t $out/share/vulkan/icd.d ../drivers/AMDVLK/json/Redhat/amd_icd64.json
+
+ substituteInPlace $out/share/vulkan/icd.d/amd_icd64.json --replace \
+ "/usr/lib64" "$out/lib"
+
+ patchelf --set-rpath "$rpath" $out/lib/amdvlk64.so
+ '';
+
+ # Keep the rpath, otherwise vulkaninfo and vkcube segfault
+ dontPatchELF = true;
+
+ meta = with stdenv.lib; {
+ description = "AMD Open Source Driver For Vulkan";
+ homepage = "https://github.com/GPUOpen-Drivers/AMDVLK";
+ license = licenses.mit;
+ platforms = [ "x86_64-linux" ];
+ maintainers = with maintainers; [ Flakebi ];
+ };
+}