2020-03-11 06:57:33 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchRepoProject
|
|
|
|
, cmake
|
|
|
|
, ninja
|
|
|
|
, patchelf
|
|
|
|
, perl
|
2021-01-19 06:50:56 +00:00
|
|
|
, pkg-config
|
2020-03-11 06:57:33 +00:00
|
|
|
, python3
|
|
|
|
, expat
|
|
|
|
, libdrm
|
|
|
|
, ncurses
|
|
|
|
, openssl
|
|
|
|
, wayland
|
|
|
|
, xorg
|
|
|
|
, zlib
|
|
|
|
}:
|
2020-07-21 15:58:30 +01:00
|
|
|
let
|
2020-03-11 06:57:33 +00:00
|
|
|
|
2020-07-21 15:58:30 +01:00
|
|
|
suffix = if stdenv.system == "x86_64-linux" then "64" else "32";
|
|
|
|
|
|
|
|
in stdenv.mkDerivation rec {
|
2020-03-11 06:57:33 +00:00
|
|
|
pname = "amdvlk";
|
2021-03-23 09:48:15 +00:00
|
|
|
version = "2021.Q1.6";
|
2020-03-11 06:57:33 +00:00
|
|
|
|
|
|
|
src = fetchRepoProject {
|
|
|
|
name = "${pname}-src";
|
|
|
|
manifest = "https://github.com/GPUOpen-Drivers/AMDVLK.git";
|
|
|
|
rev = "refs/tags/v-${version}";
|
2021-03-23 09:48:15 +00:00
|
|
|
sha256 = "FSQ/bYlvdw0Ih3Yl329o8Gizw0YcZTLtiI222Ju4M8w=";
|
2020-03-11 06:57:33 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
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
|
2021-01-19 06:50:56 +00:00
|
|
|
pkg-config
|
2020-03-11 06:57:33 +00:00
|
|
|
python3
|
|
|
|
];
|
|
|
|
|
|
|
|
rpath = lib.makeLibraryPath [
|
|
|
|
libdrm
|
2020-07-23 12:12:24 +01:00
|
|
|
openssl
|
2020-03-11 06:57:33 +00:00
|
|
|
stdenv.cc.cc.lib
|
|
|
|
xorg.libX11
|
|
|
|
xorg.libxcb
|
|
|
|
xorg.libxshmfence
|
|
|
|
];
|
|
|
|
|
|
|
|
cmakeDir = "../drivers/xgl";
|
|
|
|
|
2020-07-21 15:58:30 +01:00
|
|
|
# LTO is disabled in gcc for i686 as of #66528
|
2021-01-21 17:00:13 +00:00
|
|
|
cmakeFlags = lib.optionals stdenv.is32bit ["-DXGL_ENABLE_LTO=OFF"];
|
2020-07-21 15:58:30 +01:00
|
|
|
|
2020-03-11 06:57:33 +00:00
|
|
|
installPhase = ''
|
2020-07-21 15:58:30 +01:00
|
|
|
install -Dm755 -t $out/lib icd/amdvlk${suffix}.so
|
|
|
|
install -Dm644 -t $out/share/vulkan/icd.d ../drivers/AMDVLK/json/Redhat/amd_icd${suffix}.json
|
2020-03-11 06:57:33 +00:00
|
|
|
|
2020-07-21 15:58:30 +01:00
|
|
|
substituteInPlace $out/share/vulkan/icd.d/amd_icd${suffix}.json --replace \
|
2020-03-11 06:57:33 +00:00
|
|
|
"/usr/lib64" "$out/lib"
|
2020-07-21 15:58:30 +01:00
|
|
|
substituteInPlace $out/share/vulkan/icd.d/amd_icd${suffix}.json --replace \
|
|
|
|
"/usr/lib" "$out/lib"
|
2020-03-11 06:57:33 +00:00
|
|
|
|
2020-07-21 15:58:30 +01:00
|
|
|
patchelf --set-rpath "$rpath" $out/lib/amdvlk${suffix}.so
|
2020-03-11 06:57:33 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
# Keep the rpath, otherwise vulkaninfo and vkcube segfault
|
|
|
|
dontPatchELF = true;
|
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
meta = with lib; {
|
2020-03-11 06:57:33 +00:00
|
|
|
description = "AMD Open Source Driver For Vulkan";
|
|
|
|
homepage = "https://github.com/GPUOpen-Drivers/AMDVLK";
|
2020-08-08 11:18:21 +01:00
|
|
|
changelog = "https://github.com/GPUOpen-Drivers/AMDVLK/releases/tag/v-${version}";
|
2020-03-11 06:57:33 +00:00
|
|
|
license = licenses.mit;
|
2020-07-21 15:58:30 +01:00
|
|
|
platforms = [ "x86_64-linux" "i686-linux" ];
|
2020-08-08 11:44:58 +01:00
|
|
|
maintainers = with maintainers; [ danieldk Flakebi ];
|
2020-03-11 06:57:33 +00:00
|
|
|
};
|
|
|
|
}
|