{ lib, stdenv, fetchFromGitHub, cmake, libtxc_dxtn , libGLU, fakegl }: let gl = if stdenv.isDarwin then fakegl else libGLU; in stdenv.mkDerivation rec { pname = "VTFLib"; version = "2022-10-08"; src = fetchFromGitHub { owner = "panzi"; repo = pname; rev = "eaca22de46dc62ccfbac6720a68ae3a82b86907e"; hash = "sha256-Q2puLqOZSJ2ZO06U8M8Khs4uRzh1vdPptRlzmfi874M="; }; nativeBuildInputs = [ cmake ]; buildInputs = [ libtxc_dxtn gl ]; postPatch = '' substituteInPlace VTFLib.pc.in --replace \ "''${exec_prefix}/@CMAKE_INSTALL_LIBDIR@" \ "@CMAKE_INSTALL_FULL_LIBDIR" ''; meta = { homepage = src.url; description = "Linux port of Nem's VTFLib"; license = lib.licenses.lgpl21Plus; platforms = lib.platforms.unix; }; }