diff --git a/pkgs/by-name/ue/ueberzugpp/package.nix b/pkgs/by-name/ue/ueberzugpp/package.nix index 3e25c1ad7b1c..231e2dc9cec3 100644 --- a/pkgs/by-name/ue/ueberzugpp/package.nix +++ b/pkgs/by-name/ue/ueberzugpp/package.nix @@ -1,6 +1,7 @@ { lib, stdenv, + config, fetchFromGitHub, cmake, pkg-config, @@ -28,16 +29,18 @@ wayland-scanner, enableX11 ? stdenv.hostPlatform.isLinux, xorg, + cudaSupport ? config.cudaSupport, + cudaPackages, }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "ueberzugpp"; version = "2.9.8"; src = fetchFromGitHub { owner = "jstkdng"; repo = "ueberzugpp"; - rev = "v${version}"; + tag = "v${finalAttrs.version}"; hash = "sha256-BTOuOS0zCdYTTc47UHaGI6wqFEv6e71cD2XBZtnKGLU="; }; @@ -49,6 +52,10 @@ stdenv.mkDerivation rec { ] ++ lib.optionals enableWayland [ wayland-scanner + ] + # Required by opencv when cudaSupport is enabled + ++ lib.optionals cudaSupport [ + (lib.getBin cudaPackages.cuda_nvcc) ]; buildInputs = [ @@ -79,27 +86,27 @@ stdenv.mkDerivation rec { ++ lib.optionals enableX11 [ xorg.libX11 xorg.xcbutilimage + ] + # Required by opencv when cudaSupport is enabled + ++ lib.optionals cudaSupport [ + cudaPackages.cuda_cudart ]; - cmakeFlags = - lib.optionals (!enableOpencv) [ - "-DENABLE_OPENCV=OFF" - ] - ++ lib.optionals enableWayland [ - "-DENABLE_WAYLAND=ON" - ] - ++ lib.optionals (!enableX11) [ - "-DENABLE_X11=OFF" - ]; + cmakeFlags = [ + (lib.cmakeBool "ENABLE_OPENCV" enableOpencv) + (lib.cmakeBool "ENABLE_WAYLAND" enableWayland) + (lib.cmakeBool "ENABLE_X11" enableX11) + ]; - meta = with lib; { + meta = { description = "Drop in replacement for ueberzug written in C++"; homepage = "https://github.com/jstkdng/ueberzugpp"; - license = licenses.gpl3Plus; - maintainers = with maintainers; [ + changelog = "https://github.com/jstkdng/ueberzugpp/releases/tag/v${finalAttrs.version}"; + license = lib.licenses.gpl3Plus; + maintainers = with lib.maintainers; [ aleksana wegank ]; - platforms = platforms.unix; + platforms = lib.platforms.unix; }; -} +})