nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at python-updates 62 lines 1.6 kB view raw
1{ 2 lib, 3 stdenv, 4 fetchFromGitHub, 5 cmake, 6}: 7 8stdenv.mkDerivation { 9 pname = "nvidia-texture-tools"; 10 version = "2.1.2-unstable-2020-12-21"; 11 12 src = fetchFromGitHub { 13 owner = "castano"; 14 repo = "nvidia-texture-tools"; 15 rev = "aeddd65f81d36d8cb7b169b469ef25156666077e"; 16 hash = "sha256-BYNm8CxPQbfmnnzNmOQ2Dc8HSyO8mkqzYsBZ5T80398="; 17 }; 18 19 postPatch = '' 20 # Make a recently added pure virtual function just virtual, 21 # to keep compatibility. 22 sed -i 's/virtual void endImage() = 0;/virtual void endImage() {}/' src/nvtt/nvtt.h 23 24 # Fix build with CMake 4 25 substituteInPlace CMakeLists.txt --replace-fail \ 26 "CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0)" "CMAKE_MINIMUM_REQUIRED(VERSION 3.10)" 27 substituteInPlace extern/libsquish-1.15/CMakeLists.txt --replace-fail \ 28 "CMAKE_MINIMUM_REQUIRED(VERSION 2.8.3)" "CMAKE_MINIMUM_REQUIRED(VERSION 3.10)" 29 '' 30 + lib.optionalString stdenv.hostPlatform.isAarch64 '' 31 # remove x86_64-only libraries 32 sed -i '/bc1enc/d' src/nvtt/tests/CMakeLists.txt 33 sed -i '/libsquish/d;/CMP_Core/d' extern/CMakeLists.txt 34 ''; 35 36 outputs = [ 37 "out" 38 "dev" 39 "lib" 40 ]; 41 42 nativeBuildInputs = [ 43 cmake 44 ]; 45 46 cmakeFlags = [ 47 (lib.cmakeBool "NVTT_SHARED" true) 48 ]; 49 50 postInstall = '' 51 moveToOutput include "$dev" 52 moveToOutput lib "$lib" 53 ''; 54 55 meta = { 56 description = "Set of cuda-enabled texture tools and compressors"; 57 homepage = "https://github.com/castano/nvidia-texture-tools"; 58 license = lib.licenses.mit; 59 maintainers = with lib.maintainers; [ wegank ]; 60 platforms = lib.platforms.unix; 61 }; 62}