<commit_before>{ stdenv
, ant
, autoreconfHook
, fetchTritonPatch
, fetchurl
, lib

, fontconfig
, freetype
, jdk
, libaacs
, libbdplus
, libxml2
}:

let
  inherit (lib)
    boolEn
    boolWt;

  version  = "1.0.2";
in
stdenv.mkDerivation rec {
  name = "libbluray-${version}";

  src = fetchurl {
    url = "mirror://videolan/libbluray/${version}/${name}.tar.bz2";
    hashOutput = false;
    sha256 = "6d9e7c4e416f664c330d9fa5a05ad79a3fb39b95adfc3fd6910cbed503b7aeff";
  };

  nativeBuildInputs = [
    #ant
    #autoreconfHook
  ];

  buildInputs = [
    fontconfig
    freetype
    #jdk
    libxml2
  ];

  /*postPatch = ''
    # Fix search path for BDJ jarfile
    # See triton-patches "libbluray/BDJ-JARFILE-path.patch"
    sed -i configure.ac \
      -e "/\[JDK_HOME\], \[\"\$JDK_HOME\"\]/a CPPFLAGS=\"''${CPPFLAGS} -DJARDIR='\\\\\"\\\$(datadir)/java\\\\\"'\""
    sed -i src/libbluray/bdj/bdj.c \
      -e 's|/usr/share/java/" BDJ_JARFILE|JARDIR "/" BDJ_JARFILE|'
  '';*/

  configureFlags = [
    "--disable-examples"
    "--disable-bdjava-jar"  # FIXME: Fix BDJ search path
    #"--${boolEn (jdk != null)}-bdjava-jar"
    "--disable-doxygen-doc"
    "--disable-doxygen-dot"
    "--disable-doxygen-man"
    "--disable-doxygen-rtf"
    "--disable-doxygen-xml"
    "--disable-doxygen-chm"
    "--disable-doxygen-chi"
    "--disable-doxygen-html"
    "--disable-doxygen-ps"
    "--disable-doxygen-pdf"
    "--with-bdj-type=j2se"  # j2me
    #"--with-bdj-bootclasspath="
  ];

  NIX_LDFLAGS = [
    "-L${libaacs}/lib"
    "-laacs"
    "-L${libbdplus}/lib"
    "-lbdplus"
  ];

  #preConfigure = ''
  #  export JDK_HOME="${jdk.home}"
  #'';

  passthru = {
    srcVerification = fetchurl {
      inherit (src)
        outputHash
        outputHashAlgo
        urls;
      sha512Urls = map (n: "${n}.sha512") src.urls;
      failEarly = true;
    };
  };
<commit_msg>Revert "libbluray: 1.0.0 -> 1.0.2"<commit_after>{ stdenv
, ant
, autoreconfHook
, fetchTritonPatch
, fetchurl
, lib

, fontconfig
, freetype
, jdk
, libaacs
, libbdplus
, libxml2
}:

let
  inherit (lib)
    boolEn
    boolWt;

  version  = "1.0.0";
in
stdenv.mkDerivation rec {
  name = "libbluray-${version}";

  src = fetchurl {
    url = "mirror://videolan/libbluray/${version}/${name}.tar.bz2";
    hashOutput = false;
    sha256 = "f7e3add335c7bbef45824fcd2249a9bf293868598c13f8479352c44ec95374cc";
  };

  nativeBuildInputs = [
    #ant
    autoreconfHook
  ];

  buildInputs = [
    fontconfig
    freetype
    #jdk
    libaacs
    libxml2
  ];

  postPatch = ''
    # Fix search path for BDJ jarfile
    # See triton-patches "libbluray/BDJ-JARFILE-path.patch"
    sed -i configure.ac \
      -e "/\[JDK_HOME\], \[\"\$JDK_HOME\"\]/a CPPFLAGS=\"''${CPPFLAGS} -DJARDIR='\\\\\"\\\$(datadir)/java\\\\\"'\""
    sed -i src/libbluray/bdj/bdj.c \
      -e 's|/usr/share/java/" BDJ_JARFILE|JARDIR "/" BDJ_JARFILE|'
  '';

  configureFlags = [
    "--disable-werror"
    "--enable-extra-warnings"
    "--enable-optimizations"
    "--disable-examples"
    /**/"--disable-bdjava"  # FIXME: Fix BDJ search path
    #"--${boolEn (jdk != null)}-bdjava"
    "--enable-udf"
    /**/"--disable-bdjava-jar"  # FIXME: Fix BDJ search path
    #"--${boolEn (jdk != null)}-bdjava-jar"
    "--disable-doxygen-doc"
    "--disable-doxygen-dot"
    "--disable-doxygen-man"
    "--disable-doxygen-rtf"
    "--disable-doxygen-xml"
    "--disable-doxygen-chm"
    "--disable-doxygen-chi"
    "--disable-doxygen-html"
    "--disable-doxygen-ps"
    "--disable-doxygen-pdf"
    "--${boolWt (libxml2 != null)}-libxml2"
    "--${boolWt (freetype != null)}-freetype"
    "--${boolWt (fontconfig != null)}-fontconfig"
    "--with-bdj-type=j2se"  # j2me
    #"--with-bdj-bootclasspath="
  ];

  NIX_LDFLAGS = [
    "-L${libaacs}/lib"
    "-laacs"
    "-L${libbdplus}/lib"
    "-lbdplus"
  ];

  # preConfigure = ''
  #   export JDK_HOME="${jdk.home}"
  # '';

  passthru = {
    srcVerification = fetchurl {
      inherit (src)
        outputHash
        outputHashAlgo
        urls;
      sha512Urls = map (n: "${n}.sha512") src.urls;
      failEarly = true;
    };
  };

{'fraction_non_alphanumeric': 0.18794067590566496, 'fraction_numerical': 0.028203257962557744, 'mean_word_length': 2.3943894389438944, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 8}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6524252', 'n_tokens_mistral': 1789, 'n_tokens_neox': 1659, 'n_words': 252}