2016-11-03 13:42:39 +00:00
|
|
|
{ stdenv, fetchFromGitHub, cmake }:
|
2014-06-18 21:17:43 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2016-11-03 13:42:39 +00:00
|
|
|
name = "nvidia-texture-tools-${version}";
|
|
|
|
version = "2.1.0";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "castano";
|
|
|
|
repo = "nvidia-texture-tools";
|
|
|
|
rev = version;
|
|
|
|
sha256 = "0p8ja0k323nkgm07z0qlslg6743vimy9rf3wad2968az0vwzjjyx";
|
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
|
|
|
|
'';
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DNVTT_SHARED=TRUE"
|
|
|
|
];
|
|
|
|
|
2016-11-03 13:42:39 +00:00
|
|
|
postInstall = ''
|
|
|
|
moveToOutput include "$dev"
|
|
|
|
moveToOutput lib "$lib"
|
|
|
|
'';
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
2014-06-18 21:17:43 +00:00
|
|
|
description = "A set of cuda-enabled texture tools and compressors";
|
2017-08-01 20:03:30 +00:00
|
|
|
homepage = https://github.com/castano/nvidia-texture-tools;
|
2016-11-03 13:42:39 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.linux;
|
2014-06-18 21:17:43 +00:00
|
|
|
};
|
|
|
|
}
|