diff options
Diffstat (limited to 'srcds-pkgs/vtex2.nix')
-rw-r--r-- | srcds-pkgs/vtex2.nix | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/srcds-pkgs/vtex2.nix b/srcds-pkgs/vtex2.nix new file mode 100644 index 0000000..bbc16d5 --- /dev/null +++ b/srcds-pkgs/vtex2.nix @@ -0,0 +1,42 @@ +{ lib, stdenv, fetchFromGitHub, cmake, compressonator-sdk }: +let + cmplibs = "CMP_Compressonator" + lib.optionalString (!stdenv.isAarch64) + " CMP_Core CMP_Core_SSE CMP_Core_AVX CMP_Core_AVX512"; +in +stdenv.mkDerivation rec { + pname = "vtex2"; + version = "0.2.0"; + + src = fetchFromGitHub { + owner = "StrataSource"; + repo = pname; + rev = "v${version}"; + fetchSubmodules = true; + hash = "sha256-LcrRGOOYJB2d/NhlfK5jFXcLNwVA0hcrX7zEquna3LA="; + }; + + cmakeFlags = [ "-DBUILD_GUI=OFF" ]; + + postPatch = '' + sed -E -i 's/_?stricmp/strcasecmp/g' \ + external/vtflib/VTFLib/VMT{Wrapper,GroupNode}.cpp + + sed -i 's/--no-undefined/-undefined,error/' \ + external/vtflib/CMakeLists.txt + sed -i 's/CMP_Compressonator/${cmplibs}/' \ + external/vtflib/CMakeLists.txt + cp ${compressonator-sdk}/lib/libCMP_*.a \ + external/vtflib/thirdparty/lib/x64/ + cp ${compressonator-sdk}/include/compressonator.h \ + external/vtflib/thirdparty/include/Compressonator.h + ''; + + nativeBuildInputs = [ cmake ]; + + meta = { + homepage = src.url; + description = "VTF converter and editor"; + license = lib.licenses.mit; + platforms = lib.platforms.unix; + }; +} |