diff options
author | Weijia Wang <9713184+wegank@users.noreply.github.com> | 2023-12-23 00:35:52 +0100 |
---|---|---|
committer | Weijia Wang <9713184+wegank@users.noreply.github.com> | 2023-12-23 00:35:52 +0100 |
commit | 96e6782e874deb25afddb6f92ba2e6e9ab60f09c (patch) | |
tree | d21a1fd72362cae372304ea9f8bdfb3bb3c8b9aa /pkgs/by-name/nv | |
parent | c41ccd9ea58fbd42f94b210fffdd6133da49070b (diff) |
nvidia-texture-tools: migrate to by-name
Diffstat (limited to 'pkgs/by-name/nv')
-rw-r--r-- | pkgs/by-name/nv/nvidia-texture-tools/package.nix | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/pkgs/by-name/nv/nvidia-texture-tools/package.nix b/pkgs/by-name/nv/nvidia-texture-tools/package.nix new file mode 100644 index 0000000000000..0caa6277b5a9a --- /dev/null +++ b/pkgs/by-name/nv/nvidia-texture-tools/package.nix @@ -0,0 +1,50 @@ +{ lib +, stdenv +, fetchFromGitHub +, cmake +}: + +stdenv.mkDerivation { + pname = "nvidia-texture-tools"; + version = "2.1.2-unstable-2020-12-21"; + + src = fetchFromGitHub { + owner = "castano"; + repo = "nvidia-texture-tools"; + rev = "aeddd65f81d36d8cb7b169b469ef25156666077e"; + hash = "sha256-BYNm8CxPQbfmnnzNmOQ2Dc8HSyO8mkqzYsBZ5T80398="; + }; + + postPatch = '' + # Make a recently added pure virtual function just virtual, + # to keep compatibility. + sed -i 's/virtual void endImage() = 0;/virtual void endImage() {}/' src/nvtt/nvtt.h + '' + lib.optionalString stdenv.isAarch64 '' + # remove x86_64-only libraries + sed -i '/bc1enc/d' src/nvtt/tests/CMakeLists.txt + sed -i '/libsquish/d;/CMP_Core/d' extern/CMakeLists.txt + ''; + + outputs = [ "out" "dev" "lib" ]; + + nativeBuildInputs = [ + cmake + ]; + + cmakeFlags = [ + (lib.cmakeBool "NVTT_SHARED" true) + ]; + + postInstall = '' + moveToOutput include "$dev" + moveToOutput lib "$lib" + ''; + + meta = with lib; { + description = "A set of cuda-enabled texture tools and compressors"; + homepage = "https://github.com/castano/nvidia-texture-tools"; + license = licenses.mit; + maintainers = with maintainers; [ wegank ]; + platforms = platforms.unix; + }; +} |