about summary refs log tree commit diff
path: root/pkgs/development/libraries/libdvdnav/4.2.1.nix
blob: 852ab2ea730998b8fe6f5f9b9d74d0401b47463b (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
49
50
{lib, stdenv, fetchurl, pkg-config, libdvdread}:

stdenv.mkDerivation rec {
  pname = "libdvdnav";
  version = "4.2.1";

  src = fetchurl {
    url = "http://dvdnav.mplayerhq.hu/releases/libdvdnav-${version}.tar.xz";
    sha256 = "7fca272ecc3241b6de41bbbf7ac9a303ba25cb9e0c82aa23901d3104887f2372";
  };

  nativeBuildInputs = [ pkg-config ];
  buildInputs = [libdvdread];

  # The upstream supports two configuration workflow:
  # one is to generate ./configure via `autoconf`,
  # the other is to run ./configure2.
  # ./configure2 is a configureation script included in the upstream source
  # that supports common "--<name>" flags and generates config.mak and config.h.
  # See INSTALL inside the upstream source for detail.
  configureScript = "./configure2";

  configureFlags = [
    "--cc=${stdenv.cc.targetPrefix}cc"
    # Let's strip the binaries ourselves,
    # as unprefixed `strip` command is not available during cross compilation.
    "--disable-strip"
  ];

  preConfigure = ''
    mkdir -p $out
  '';

  makeFlags = [
    "AR=${stdenv.cc.targetPrefix}ar"
    "LD=${stdenv.cc.targetPrefix}ld"
    "RANLIB=${stdenv.cc.targetPrefix}ranlib"
  ];

  meta = {
    homepage = "http://dvdnav.mplayerhq.hu/";
    description = "Library that implements DVD navigation features such as DVD menus";
    mainProgram = "dvdnav-config";
    license = lib.licenses.gpl2;
    maintainers = [ lib.maintainers.wmertens ];
    platforms = lib.platforms.linux;
  };

  passthru = { inherit libdvdread; };
}