about summary refs log tree commit diff
path: root/pkgs/by-name/li/libaribcaption/package.nix
blob: 936991ef6a875abd9f517b750cb9b29b6f3e1ebb (plain) (blame)
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

, fontconfig
, freetype

, ApplicationServices
, CoreFoundation
, CoreGraphics
, CoreText
}:

stdenv.mkDerivation rec {
  pname = "libaribcaption";
  version = "1.1.1";

  src = fetchFromGitHub {
    owner = "xqq";
    repo = "libaribcaption";
    rev = "v${version}";
    hash = "sha256-x6l0ZrTktSsqfDLVRXpQtUOruhfc8RF3yT991UVZiKA=";
  };

  nativeBuildInputs = [ cmake ];

  cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" ];

  buildInputs = lib.optionals (!stdenv.hostPlatform.isDarwin) [
    fontconfig
    freetype
  ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
    ApplicationServices
    CoreFoundation
    CoreGraphics
    CoreText
  ];

  meta = with lib; {
    description = "Portable ARIB STD-B24 Caption Decoder/Renderer";
    homepage = "https://github.com/xqq/libaribcaption";
    changelog = "https://github.com/xqq/libaribcaption/releases/tag/${src.rev}";
    license = licenses.mit;
    maintainers = with maintainers; [ chayleaf ];
    platforms = platforms.all;
  };
}