1 { lib, stdenv, fetchFromGitHub, cmake, fetchpatch }:
3 stdenv.mkDerivation rec {
4 pname = "nvidia-texture-tools";
5 version = "unstable-2020-12-21";
7 src = fetchFromGitHub {
9 repo = "nvidia-texture-tools";
10 rev = "aeddd65f81d36d8cb7b169b469ef25156666077e";
11 sha256 = "sha256-BYNm8CxPQbfmnnzNmOQ2Dc8HSyO8mkqzYsBZ5T80398=";
14 nativeBuildInputs = [ cmake ];
16 outputs = [ "out" "dev" "lib" ];
19 # Make a recently added pure virtual function just virtual,
20 # to keep compatibility.
21 sed -i 's/virtual void endImage() = 0;/virtual void endImage() {}/' src/nvtt/nvtt.h
22 '' + lib.optionalString stdenv.isAarch64 ''
23 # remove x86_64-only libraries
24 sed -i '/bc1enc/d' src/nvtt/tests/CMakeLists.txt
25 sed -i '/libsquish/d;/CMP_Core/d' extern/CMakeLists.txt
33 moveToOutput include "$dev"
34 moveToOutput lib "$lib"
38 description = "A set of cuda-enabled texture tools and compressors";
39 homepage = "https://github.com/castano/nvidia-texture-tools";
40 license = licenses.mit;
41 platforms = platforms.unix;
42 maintainers = with maintainers; [ wegank ];