Merge pull request #335424 from JohnRTitor/amdvlk-update

amdvlk: apply nixfmt-rfc-style, move to finalAttrs, pkgs/by-name
This commit is contained in:
Masum Reza 2024-08-19 11:26:26 +05:30 committed by GitHub
commit 64481d023a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 87 additions and 71 deletions

View File

@ -1,56 +1,62 @@
{ stdenv
, callPackage
, lib
, fetchRepoProject
, writeScript
, cmake
, directx-shader-compiler
, glslang
, ninja
, patchelf
, perl
, pkg-config
, python3
, expat
, libdrm
, ncurses
, openssl
, wayland
, xorg
, zlib
{
stdenv,
callPackage,
lib,
fetchRepoProject,
writeScript,
cmake,
directx-shader-compiler,
glslang,
ninja,
patchelf,
perl,
pkg-config,
python3,
expat,
libdrm,
ncurses,
openssl,
wayland,
xorg,
zlib,
}:
let
suffix = if stdenv.system == "x86_64-linux" then "64" else "32";
in stdenv.mkDerivation rec {
in
stdenv.mkDerivation (finalAttrs: {
pname = "amdvlk";
version = "2024.Q3.1";
src = fetchRepoProject {
name = "${pname}-src";
name = "amdvlk-src";
manifest = "https://github.com/GPUOpen-Drivers/AMDVLK.git";
rev = "refs/tags/v-${version}";
rev = "refs/tags/v-${finalAttrs.version}";
sha256 = "IZYv9ZfpIllYUhJ3f7AOFmSl7OfWWY8doaG8pe3GE+4=";
};
buildInputs = [
buildInputs =
[
expat
libdrm
ncurses
openssl
wayland
xorg.libX11
xorg.libxcb
xorg.xcbproto
xorg.libXext
xorg.libXrandr
xorg.libXft
xorg.libxshmfence
zlib
];
]
++ (with xorg; [
libX11
libxcb
xcbproto
libXext
libXrandr
libXft
libxshmfence
]);
nativeBuildInputs = [
nativeBuildInputs =
[
cmake
directx-shader-compiler
glslang
@ -59,20 +65,25 @@ in stdenv.mkDerivation rec {
perl
pkg-config
python3
] ++ (with python3.pkgs; [
]
++ (with python3.pkgs; [
jinja2
ruamel-yaml
]);
rpath = lib.makeLibraryPath [
rpath = lib.makeLibraryPath (
[
libdrm
openssl
stdenv.cc.cc.lib
xorg.libX11
xorg.libxcb
xorg.libxshmfence
zlib
];
]
++ (with xorg; [
libX11
libxcb
libxshmfence
])
);
cmakeDir = "../drivers/xgl";
@ -95,26 +106,33 @@ in stdenv.mkDerivation rec {
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p coreutils curl gnused jq common-updater-scripts
packagePath="pkgs/by-name/am/amdvlk/package.nix"
function setHash() {
sed -i "pkgs/development/libraries/amdvlk/default.nix" -e 's,sha256 = "[^'"'"'"]*",sha256 = "'"$1"'",'
sed -i $packagePath -e 's,sha256 = "[^'"'"'"]*",sha256 = "'"$1"'",'
}
version="$(curl -sL "https://api.github.com/repos/GPUOpen-Drivers/AMDVLK/releases?per_page=1" | jq '.[0].tag_name | split("-") | .[1]' --raw-output)"
sed -i "pkgs/development/libraries/amdvlk/default.nix" -e 's/version = "[^'"'"'"]*"/version = "'"$version"'"/'
sed -i $packagePath -e 's/version = "[^'"'"'"]*"/version = "'"$version"'"/'
setHash "$(nix-instantiate --eval -A lib.fakeSha256 | xargs echo)"
hash="$(nix to-base64 $(nix-build -A amdvlk 2>&1 | tail -n3 | grep 'got:' | cut -d: -f2- | xargs echo || true))"
setHash "$hash"
'';
passthru.impureTests = { amdvlk = callPackage ./test.nix {}; };
passthru.impureTests = {
amdvlk = callPackage ./test.nix { };
};
meta = with lib; {
meta = {
description = "AMD Open Source Driver For Vulkan";
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" "i686-linux" ];
maintainers = with maintainers; [ Flakebi ];
changelog = "https://github.com/GPUOpen-Drivers/AMDVLK/releases/tag/v-${finalAttrs.version}";
license = lib.licenses.mit;
platforms = [
"x86_64-linux"
"i686-linux"
];
maintainers = with lib.maintainers; [ Flakebi ];
};
}
})

View File

@ -19421,8 +19421,6 @@ with pkgs;
allegro4 = callPackage ../development/libraries/allegro { };
allegro5 = callPackage ../development/libraries/allegro/5.nix { };
amdvlk = callPackage ../development/libraries/amdvlk { };
amf-headers = callPackage ../development/libraries/amf-headers { };
aml = callPackage ../development/libraries/aml { };