aboutsummaryrefslogtreecommitdiff
path: root/srcds-pkgs/vtex2.nix
diff options
context:
space:
mode:
authoryuuko <yuuko@partyvan.io>2024-12-15 06:12:40 -0800
committeryuuko <yuuko@partyvan.io>2024-12-15 06:12:40 -0800
commit0a08e401d26785638c09ce378c282924e3ddbaf9 (patch)
treeca79cf4a9de71a186f89ac3502c71ae81143bfa1 /srcds-pkgs/vtex2.nix
parent0d7306a1ed22896a4d213a8c8057d488a9912702 (diff)
pkgs: add some texture authoring tools
Diffstat (limited to 'srcds-pkgs/vtex2.nix')
-rw-r--r--srcds-pkgs/vtex2.nix42
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;
+ };
+}