Skip to content

Commit

Permalink
amdvlk: Add i686-linux platform
Browse files Browse the repository at this point in the history
  • Loading branch information
Flakebi committed Sep 14, 2020
1 parent f73b109 commit 13beb43
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
25 changes: 19 additions & 6 deletions pkgs/development/libraries/amdvlk/default.nix
Expand Up @@ -15,8 +15,11 @@
, xorg
, zlib
}:
let

stdenv.mkDerivation rec {
suffix = if stdenv.system == "x86_64-linux" then "64" else "32";

in stdenv.mkDerivation rec {
pname = "amdvlk";
version = "2020.Q3.4";

Expand Down Expand Up @@ -62,14 +65,24 @@ stdenv.mkDerivation rec {

cmakeDir = "../drivers/xgl";

# LTO is disabled in gcc for i686 as of #66528
cmakeFlags = stdenv.lib.optionals stdenv.is32bit ["-DXGL_ENABLE_LTO=OFF"];

postPatch = stdenv.lib.optionalString stdenv.is32bit ''
substituteInPlace drivers/pal/cmake/PalCompilerOptions.cmake \
--replace "pal_setup_gcc_ipo()" ""
'';

installPhase = ''
install -Dm755 -t $out/lib icd/amdvlk64.so
install -Dm644 -t $out/share/vulkan/icd.d ../drivers/AMDVLK/json/Redhat/amd_icd64.json
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
substituteInPlace $out/share/vulkan/icd.d/amd_icd64.json --replace \
substituteInPlace $out/share/vulkan/icd.d/amd_icd${suffix}.json --replace \
"/usr/lib64" "$out/lib"
substituteInPlace $out/share/vulkan/icd.d/amd_icd${suffix}.json --replace \
"/usr/lib" "$out/lib"
patchelf --set-rpath "$rpath" $out/lib/amdvlk64.so
patchelf --set-rpath "$rpath" $out/lib/amdvlk${suffix}.so
'';

# Keep the rpath, otherwise vulkaninfo and vkcube segfault
Expand All @@ -80,7 +93,7 @@ stdenv.mkDerivation rec {
homepage = "https://github.com/GPUOpen-Drivers/AMDVLK";
changelog = "https://github.com/GPUOpen-Drivers/AMDVLK/releases/tag/v-${version}";
license = licenses.mit;
platforms = [ "x86_64-linux" ];
platforms = [ "x86_64-linux" "i686-linux" ];
maintainers = with maintainers; [ danieldk Flakebi ];
};
}
1 change: 1 addition & 0 deletions pkgs/top-level/all-packages.nix
Expand Up @@ -12159,6 +12159,7 @@ in
# Multi-arch "drivers" which we want to build for i686.
driversi686Linux = recurseIntoAttrs {
inherit (pkgsi686Linux)
amdvlk
mesa
vaapiIntel
libvdpau-va-gl
Expand Down

0 comments on commit 13beb43

Please sign in to comment.