aboutsummaryrefslogtreecommitdiff
path: root/srcds-pkgs/vtflib.nix
blob: a2dd600236361d970e1669e312bfcd7917ad4f70 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
{ 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;
  };
}