nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ fetchurl, stdenv, libtool, gettext, zlib, bzip2, flac, libvorbis
2, exiv2, libgsf, rpm, pkgconfig
3, gtkSupport ? true, glib ? null, gtk3 ? null
4, videoSupport ? true, ffmpeg ? null, libmpeg2 ? null}:
5
6assert gtkSupport -> glib != null && gtk3 != null;
7assert videoSupport -> ffmpeg != null && libmpeg2 != null;
8
9stdenv.mkDerivation rec {
10 name = "libextractor-1.8";
11
12 src = fetchurl {
13 url = "mirror://gnu/libextractor/${name}.tar.gz";
14 sha256 = "1z1cb35griqzvshqdv5ck98dy0sgpsswn7fgiy7lbzi34sma8dg2";
15 };
16
17 preConfigure =
18 '' echo "patching installation directory in \`extractor.c'..."
19 sed -i "src/main/extractor.c" \
20 -e "s|pexe[[:blank:]]*=.*$|pexe = strdup(\"$out/lib/\");|g"
21 '';
22
23 buildInputs =
24 [ libtool gettext zlib bzip2 flac libvorbis exiv2
25 libgsf rpm
26 pkgconfig
27 ] ++ stdenv.lib.optionals gtkSupport [ glib gtk3 ]
28 ++ stdenv.lib.optionals videoSupport [ ffmpeg libmpeg2 ];
29
30 configureFlags = [
31 "--disable-ltdl-install"
32 "--with-ltdl-include=${libtool}/include"
33 "--with-ltdl-lib=${libtool.lib}/lib"
34 "--enable-xpdf"
35 ];
36
37 # Checks need to be run after "make install", otherwise plug-ins are not in
38 # the search path, etc.
39 # FIXME: Tests currently fail and the test framework appears to be deeply
40 # broken anyway.
41 doCheck = false;
42 #postInstall = "make check";
43
44 meta = {
45 description = "Simple library for keyword extraction";
46
47 longDescription =
48 '' GNU libextractor is a library used to extract meta-data from files
49 of arbitrary type. It is designed to use helper-libraries to perform
50 the actual extraction, and to be trivially extendable by linking
51 against external extractors for additional file types.
52
53 The goal is to provide developers of file-sharing networks or
54 WWW-indexing bots with a universal library to obtain simple keywords
55 to match against queries. libextractor contains a shell-command
56 extract that, similar to the well-known file command, can extract
57 meta-data from a file an print the results to stdout.
58
59 Currently, libextractor supports the following formats: HTML, PDF,
60 PS, OLE2 (DOC, XLS, PPT), OpenOffice (sxw), StarOffice (sdw), DVI,
61 MAN, FLAC, MP3 (ID3v1 and ID3v2), NSF(E) (NES music), SID (C64
62 music), OGG, WAV, EXIV2, JPEG, GIF, PNG, TIFF, DEB, RPM, TAR(.GZ),
63 ZIP, ELF, S3M (Scream Tracker 3), XM (eXtended Module), IT (Impulse
64 Tracker), FLV, REAL, RIFF (AVI), MPEG, QT and ASF. Also, various
65 additional MIME types are detected.
66 '';
67
68 license = stdenv.lib.licenses.gpl2Plus;
69
70 maintainers = [ ];
71 platforms = stdenv.lib.platforms.linux;
72 };
73}