summary refs log tree commit diff
path: root/pkgs/development/libraries/libbluray/default.nix
diff options
context:
space:
mode:
authorVladimír Čunát <vcunat@gmail.com>2015-04-18 11:00:58 +0200
committerVladimír Čunát <vcunat@gmail.com>2015-04-18 11:22:20 +0200
commitbf414c9d4f892fd4e392a5f42016b57e84402a8b (patch)
tree08c000d609ed8e608ca542fa78360e4217f3fc36 /pkgs/development/libraries/libbluray/default.nix
parent29901451700a7382f3f9d5a0a23cd55b187e5585 (diff)
parent9de9669496a05f64ea436c01f9b66c057cd74f90 (diff)
downloadnixpkgs-bf414c9d4f892fd4e392a5f42016b57e84402a8b.tar
nixpkgs-bf414c9d4f892fd4e392a5f42016b57e84402a8b.tar.gz
nixpkgs-bf414c9d4f892fd4e392a5f42016b57e84402a8b.tar.bz2
nixpkgs-bf414c9d4f892fd4e392a5f42016b57e84402a8b.tar.lz
nixpkgs-bf414c9d4f892fd4e392a5f42016b57e84402a8b.tar.xz
nixpkgs-bf414c9d4f892fd4e392a5f42016b57e84402a8b.tar.zst
nixpkgs-bf414c9d4f892fd4e392a5f42016b57e84402a8b.zip
Merge 'staging' into closure-size
- there were many easy merge conflicts
- cc-wrapper needed nontrivial changes

Many other problems might've been created by interaction of the branches,
but stdenv and a few other packages build fine now.
Diffstat (limited to 'pkgs/development/libraries/libbluray/default.nix')
-rw-r--r--pkgs/development/libraries/libbluray/default.nix67
1 files changed, 45 insertions, 22 deletions
diff --git a/pkgs/development/libraries/libbluray/default.nix b/pkgs/development/libraries/libbluray/default.nix
index f0eea80e89d..170c4e46188 100644
--- a/pkgs/development/libraries/libbluray/default.nix
+++ b/pkgs/development/libraries/libbluray/default.nix
@@ -1,37 +1,60 @@
-{stdenv, fetchgit, autoconf, automake, libtool, libaacs ? null, jdk ? null, ant ? null, withAACS ? false}:
-
-assert withAACS -> jdk != null && ant != null && libaacs != null;
+{ stdenv, fetchurl, pkgconfig, fontconfig
+, withAACS ? false, libaacs ? null, jdk ? null, ant ? null
+, withMetadata ? true, libxml2 ? null
+, withFonts ? true, freetype ? null
+# Need to run autoreconf hook after BDJ jarfile patch
+, autoreconfHook ? null
+}:
+
+assert withAACS -> jdk != null && ant != null && libaacs != null && autoreconfHook != null;
+assert withMetadata -> libxml2 != null;
+assert withFonts -> freetype != null;
 
 # Info on how to use:
 # https://wiki.archlinux.org/index.php/BluRay
 
-let baseName = "libbluray";
-    version  = "0.2.1";
+stdenv.mkDerivation rec {
+  baseName = "libbluray";
+  version  = "0.7.0";
+  name = "${baseName}-${version}";
+
+  src = fetchurl {
+    url = "ftp://ftp.videolan.org/pub/videolan/${baseName}/${version}/${name}.tar.bz2";
+    sha256 = "13dngs4b4cv29f6b825dq14n77mfhvk1kjb42axpq494pfgyp6zp";
+  };
 
-in
+  nativeBuildInputs = with stdenv.lib;
+                      [pkgconfig]
+                      ++ optional withAACS ant
+                      ;
 
-stdenv.mkDerivation {
-  name = "${baseName}-${version}p1";
+  buildInputs =  with stdenv.lib;
+                 [fontconfig]
+              ++ optionals withAACS [ jdk autoreconfHook ]
+              ++ optional withMetadata libxml2
+              ++ optional withFonts freetype
+              ;
 
-  src = fetchgit {
-    url = git://git.videolan.org/libbluray.git;
-    rev = "3b9a9f044644a6abe9cb09377f714ded9fdd6c87";
-    sha256 = "551b623e76c2dba44b5490fb42ccdc491b28cd42841de28237b8edbed0f0711c";
-  };
+  propagatedBuildInputs = stdenv.lib.optional withAACS libaacs;
 
-  nativeBuildInputs = [autoconf automake libtool];
-  buildInputs = stdenv.lib.optionals withAACS [jdk ant libaacs];
-  NIX_LDFLAGS = stdenv.lib.optionalString withAACS "-laacs";
+  preConfigure = stdenv.lib.optionalString withAACS ''
+    export JDK_HOME=${jdk.home}
+    export LIBS="$LIBS -L${libaacs} -laacs"
+  '';
 
-  preConfigure = "./bootstrap";
-  configureFlags = ["--disable-static"] ++ stdenv.lib.optionals withAACS ["--enable-bdjava" "--with-jdk=${jdk}"];
+  configureFlags =  with stdenv.lib;
+                    optional withAACS "--enable-bdjava"
+                 ++ optional (! withMetadata) "--without-libxml2"
+                 ++ optional (! withFonts) "--without-freetype"
+                 ;
 
-  # From Handbrake
-  patches = [ ./A01-filter-dup.patch ];
+  # Fix search path for BDJ jarfile
+  patches = stdenv.lib.optional withAACS ./BDJ-JARFILE-path.patch;
 
-  meta = {
+  meta = with stdenv.lib; {
     homepage = http://www.videolan.org/developers/libbluray.html;
     description = "Library to access Blu-Ray disks for video playback";
-    license = stdenv.lib.licenses.lgpl21;
+    license = licenses.lgpl21;
+    maintainers = [ maintainers.abbradar ];
   };
 }