2020-08-12 13:34:20 -07:00
|
|
|
{ stdenv, fetchFromGitHub, cmake, fetchpatch }:
|
2014-06-18 14:17:43 -07:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 05:41:18 -07:00
|
|
|
pname = "nvidia-texture-tools";
|
2019-10-27 06:07:06 -07:00
|
|
|
version = "unstable-2019-10-27";
|
2016-11-03 06:42:39 -07:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "castano";
|
|
|
|
repo = "nvidia-texture-tools";
|
2019-10-27 06:07:06 -07:00
|
|
|
rev = "a131e4c6b0b7c9c73ccc3c9e6f1c7e165be86bcc";
|
|
|
|
sha256 = "1qzyr3ib5dpxyq1y33lq02qv4cww075sm9bm4f651d34q5x38sk3";
|
2014-06-18 14:17:43 -07:00
|
|
|
};
|
|
|
|
|
2020-08-12 13:34:20 -07:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/castano/nvidia-texture-tools/commit/6474f2593428d89ec152da2502aa136ababe66ca.patch";
|
|
|
|
sha256 = "0akbkvm55hiv58jx71h9hj173rbnqlb5a430y9azjiix7zga42vd";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2016-11-03 06:42:39 -07:00
|
|
|
nativeBuildInputs = [ cmake ];
|
2014-06-18 14:17:43 -07:00
|
|
|
|
2016-11-03 06:42:39 -07:00
|
|
|
outputs = [ "out" "dev" "lib" ];
|
2014-06-18 14:17:43 -07:00
|
|
|
|
2016-11-03 06:42:39 -07:00
|
|
|
postPatch = ''
|
2014-06-18 14:17:43 -07: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
|
|
|
|
'';
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DNVTT_SHARED=TRUE"
|
|
|
|
];
|
|
|
|
|
2016-11-03 06:42:39 -07:00
|
|
|
postInstall = ''
|
|
|
|
moveToOutput include "$dev"
|
|
|
|
moveToOutput lib "$lib"
|
|
|
|
'';
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
2014-06-18 14:17:43 -07:00
|
|
|
description = "A set of cuda-enabled texture tools and compressors";
|
2020-03-31 18:11:51 -07:00
|
|
|
homepage = "https://github.com/castano/nvidia-texture-tools";
|
2016-11-03 06:42:39 -07:00
|
|
|
license = licenses.mit;
|
2018-05-20 21:07:32 -07:00
|
|
|
platforms = platforms.unix;
|
2019-10-27 06:08:10 -07:00
|
|
|
broken = stdenv.isAarch64;
|
2014-06-18 14:17:43 -07:00
|
|
|
};
|
|
|
|
}
|