nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 cmake,
3 doxygen,
4 fetchFromGitHub,
5 getopt,
6 ninja,
7 lib,
8 pkg-config,
9 stdenv,
10}:
11stdenv.mkDerivation rec {
12 pname = "ktx-tools";
13 version = "4.4.0";
14
15 src = fetchFromGitHub {
16 owner = "KhronosGroup";
17 repo = "KTX-Software";
18 rev = "v${version}";
19 hash = "sha256-bDdRdVFbVmN8fEGRLnPLOXsV6lfYU9Lg4nW0GuCj6AU=";
20 };
21
22 nativeBuildInputs = [
23 cmake
24 doxygen
25 getopt
26 ninja
27 pkg-config
28 ];
29
30 cmakeBuildType = "RelWithDebInfo";
31
32 cmakeFlags = [ "-DKTX_FEATURE_DOC=ON" ];
33
34 postPatch = ''
35 patchShebangs .
36 '';
37
38 meta = with lib; {
39 description = "KTX (Khronos Texture) Library and Tools";
40 longDescription = ''
41 KTX (Khronos Texture) is a lightweight container for textures for OpenGL®,
42 Vulkan® and other GPU APIs. KTX files contain all the parameters needed
43 for texture loading. A single file can contain anything from a simple
44 base-level 2D texture through to a cubemap array texture with mipmaps.
45
46 This software package contains:
47 - libktx: a small library of functions for writing and reading KTX
48 files, and instantiating OpenGL®, OpenGL ES™️ and Vulkan® textures
49 from them.
50 - ktx2check: a tool for validating KTX Version 2 format files.
51 - ktx2ktx2: a tool for converting a KTX Version 1 file to a KTX Version
52 2 file.
53 - ktxinfo: a tool to display information about a KTX file in human
54 readable form.
55 - ktxsc: a tool to supercompress a KTX Version 2 file that contains
56 uncompressed images.
57 - toktx: a tool to create KTX files from PNG, Netpbm or JPEG format
58 images. It supports mipmap generation, encoding to Basis Universal
59 formats and Zstd supercompression.
60 '';
61 homepage = "https://github.com/KhronosGroup/KTX-Software";
62 license = licenses.asl20;
63 maintainers = with maintainers; [ bonsairobo ];
64 platforms = platforms.linux;
65 };
66}