summaryrefslogtreecommitdiffstats
path: root/pkgs/by-name/li/libchdr/package.nix
blob: 453c20d9382ce115d3988ea9617c93f844ed43f4 (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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
{
  lib,
  stdenv,
  fetchFromGitHub,
  cmake,
  pkg-config,
  zlib,
  zstd,
}:

stdenv.mkDerivation {
  pname = "libchdr";
  version = "0-unstable-2025-12-27";

  src = fetchFromGitHub {
    owner = "rtissera";
    repo = "libchdr";
    rev = "07a7dad23378b001f4ab174ef51bd6553f883edd";
    hash = "sha256-FCZ442mDF/pO5sNHNcPtWxSOB8o3I0YwwNXzu1B2vVQ=";
  };

  nativeBuildInputs = [
    cmake
    pkg-config
  ];

  buildInputs = [
    zlib
    zstd
  ];

  cmakeFlags = [
    (lib.cmakeBool "BUILD_SHARED_LIBS" (!stdenv.hostPlatform.isStatic))
    (lib.cmakeBool "INSTALL_STATIC_LIBS" stdenv.hostPlatform.isStatic)
    (lib.cmakeBool "WITH_SYSTEM_ZLIB" true)
    (lib.cmakeBool "WITH_SYSTEM_ZSTD" true)
    (lib.cmakeFeature "CMAKE_INSTALL_LIBDIR" "lib")
    (lib.cmakeFeature "CMAKE_INSTALL_INCLUDEDIR" "include")
  ];

  meta = {
    description = "Standalone library for reading MAME's CHDv1-v5 formats";
    homepage = "https://github.com/rtissera/libchdr";
    license = lib.licenses.bsd3;
    maintainers = with lib.maintainers; [ aleksana ];
    platforms = lib.platforms.all;
  };
}