1{
2 lib,
3 stdenv,
4 fetchurl,
5 pkg-config,
6 libdvdread,
7}:
8
9stdenv.mkDerivation rec {
10 pname = "libdvdnav";
11 version = "4.2.1";
12
13 src = fetchurl {
14 url = "http://dvdnav.mplayerhq.hu/releases/libdvdnav-${version}.tar.xz";
15 sha256 = "7fca272ecc3241b6de41bbbf7ac9a303ba25cb9e0c82aa23901d3104887f2372";
16 };
17
18 nativeBuildInputs = [ pkg-config ];
19 buildInputs = [ libdvdread ];
20
21 # The upstream supports two configuration workflow:
22 # one is to generate ./configure via `autoconf`,
23 # the other is to run ./configure2.
24 # ./configure2 is a configuration script included in the upstream source
25 # that supports common "--<name>" flags and generates config.mak and config.h.
26 # See INSTALL inside the upstream source for detail.
27 configureScript = "./configure2";
28
29 configureFlags = [
30 "--cc=${stdenv.cc.targetPrefix}cc"
31 # Let's strip the binaries ourselves,
32 # as unprefixed `strip` command is not available during cross compilation.
33 "--disable-strip"
34 ];
35
36 preConfigure = ''
37 mkdir -p $out
38 '';
39
40 makeFlags = [
41 "AR=${stdenv.cc.targetPrefix}ar"
42 "LD=${stdenv.cc.targetPrefix}ld"
43 "RANLIB=${stdenv.cc.targetPrefix}ranlib"
44 ];
45
46 meta = {
47 homepage = "http://dvdnav.mplayerhq.hu/";
48 description = "Library that implements DVD navigation features such as DVD menus";
49 mainProgram = "dvdnav-config";
50 license = lib.licenses.gpl2;
51 maintainers = [ lib.maintainers.wmertens ];
52 platforms = lib.platforms.linux;
53 };
54
55 passthru = { inherit libdvdread; };
56}