From d532dbefb98521a1bf56d7b6d8796ee9b1b4e875 Mon Sep 17 00:00:00 2001 From: Randy Eckenrode Date: Tue, 11 Jul 2023 11:09:20 -0600 Subject: [PATCH] dxvk: add an update script --- pkgs/misc/dxvk/dxvk.nix | 15 +++++++++++---- pkgs/top-level/all-packages.nix | 2 +- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/pkgs/misc/dxvk/dxvk.nix b/pkgs/misc/dxvk/dxvk.nix index e0aa7105bb35..fccdf38a0d28 100644 --- a/pkgs/misc/dxvk/dxvk.nix +++ b/pkgs/misc/dxvk/dxvk.nix @@ -5,12 +5,13 @@ , meson , ninja , windows -, dxvkVersion +, dxvkVersion ? "default" , spirv-headers , vulkan-headers , SDL2 , glfw , pkgsBuildHost +, gitUpdater , sdl2Support ? true , glfwSupport ? false }: @@ -43,7 +44,7 @@ let ./darwin-thread-primitives.patch ]; }; - "2.1" = rec { + "default" = rec { version = "2.1"; src = fetchFromGitHub { owner = "doitsujin"; @@ -59,7 +60,7 @@ let isWindows = stdenv.targetPlatform.uname.system == "Windows"; isCross = stdenv.hostPlatform != stdenv.targetPlatform; in -stdenv.mkDerivation { +stdenv.mkDerivation (finalAttrs: { pname = "dxvk"; inherit (srcs.${dxvkVersion}) version src patches; @@ -95,6 +96,12 @@ stdenv.mkDerivation { doCheck = isDxvk2 && !isCross; + passthru = lib.optionalAttrs (lib.versionAtLeast finalAttrs.version "2.0") { + updateScript = gitUpdater { + rev-prefix = "v"; + }; + }; + meta = { description = "A Vulkan-based translation layer for Direct3D 9/10/11"; homepage = "https://github.com/doitsujin/dxvk"; @@ -103,4 +110,4 @@ stdenv.mkDerivation { license = lib.licenses.zlib; platforms = lib.platforms.windows ++ lib.optionals isDxvk2 lib.platforms.linux; }; -} +}) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c9847af05129..e222bc6c3ecb 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -39521,7 +39521,7 @@ with pkgs; dxvk = callPackage ../misc/dxvk { }; dxvk_1 = callPackage ../misc/dxvk/dxvk.nix { dxvkVersion = "1.10"; }; - dxvk_2 = callPackage ../misc/dxvk/dxvk.nix { dxvkVersion = "2.1"; }; + dxvk_2 = callPackage ../misc/dxvk/dxvk.nix { }; ec2stepshell = callPackage ../tools/security/ec2stepshell { };