2021-01-21 17:00:13 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, cmake, fetchpatch }:
|
2014-06-18 21:17:43 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "nvidia-texture-tools";
|
2022-10-12 18:02:11 +00:00
|
|
|
version = "unstable-2020-12-21";
|
2016-11-03 13:42:39 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "castano";
|
|
|
|
repo = "nvidia-texture-tools";
|
2022-10-12 18:02:11 +00:00
|
|
|
rev = "aeddd65f81d36d8cb7b169b469ef25156666077e";
|
|
|
|
sha256 = "sha256-BYNm8CxPQbfmnnzNmOQ2Dc8HSyO8mkqzYsBZ5T80398=";
|
2014-06-18 21:17:43 +00:00
|
|
|
};
|
|
|
|
|
2016-11-03 13:42:39 +00:00
|
|
|
nativeBuildInputs = [ cmake ];
|
2014-06-18 21:17:43 +00:00
|
|
|
|
2016-11-03 13:42:39 +00:00
|
|
|
outputs = [ "out" "dev" "lib" ];
|
2014-06-18 21:17:43 +00:00
|
|
|
|
2016-11-03 13:42:39 +00:00
|
|
|
postPatch = ''
|
2014-06-18 21:17:43 +00:00
|
|
|
# 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
|
2022-10-12 18:02:11 +00:00
|
|
|
'' + 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
|
2014-06-18 21:17:43 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DNVTT_SHARED=TRUE"
|
|
|
|
];
|
|
|
|
|
2016-11-03 13:42:39 +00:00
|
|
|
postInstall = ''
|
|
|
|
moveToOutput include "$dev"
|
|
|
|
moveToOutput lib "$lib"
|
|
|
|
'';
|
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
meta = with lib; {
|
2014-06-18 21:17:43 +00:00
|
|
|
description = "A set of cuda-enabled texture tools and compressors";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://github.com/castano/nvidia-texture-tools";
|
2016-11-03 13:42:39 +00:00
|
|
|
license = licenses.mit;
|
2018-05-21 04:07:32 +00:00
|
|
|
platforms = platforms.unix;
|
2022-10-12 18:02:11 +00:00
|
|
|
maintainers = with maintainers; [ wegank ];
|
2014-06-18 21:17:43 +00:00
|
|
|
};
|
|
|
|
}
|