Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{
2 lib,
3 stdenv,
4 fetchurl,
5 static ? stdenv.hostPlatform.isStatic,
6}:
7
8stdenv.mkDerivation rec {
9 pname = "bibutils";
10 version = "7.2";
11
12 src = fetchurl {
13 url = "mirror://sourceforge/bibutils/bibutils_${version}_src.tgz";
14 sha256 = "sha256-bgKK7x6Kaz5azvCYWEp7tocI81z+dAEbNBwR/qXktcM=";
15 };
16
17 preConfigure = lib.optionalString stdenv.hostPlatform.isDarwin ''
18 substituteInPlace lib/Makefile.dynamic \
19 --replace '-Wl,-soname,$(SONAME)' ""
20 '';
21
22 # the configure script is not generated by autoconf
23 # and do not recognize --build/--host cross compilation flags
24 configurePlatforms = [ ];
25
26 configureFlags = [
27 (if static then "--static" else "--dynamic")
28 "--install-dir"
29 "$(out)/bin"
30 "--install-lib"
31 "$(out)/lib"
32 ];
33
34 dontAddPrefix = true;
35
36 makeFlags = [
37 "CC:=$(CC)"
38 ];
39
40 doCheck = true;
41 checkTarget = "test";
42 preCheck = lib.optionalString stdenv.hostPlatform.isDarwin ''
43 export DYLD_LIBRARY_PATH=`pwd`/lib
44 '';
45
46 meta = with lib; {
47 description = "Bibliography format interconversion";
48 longDescription = "The bibutils program set interconverts between various bibliography formats using a common MODS-format XML intermediate. For example, one can convert RIS-format files to Bibtex by doing two transformations: RIS->MODS->Bibtex. By using a common intermediate for N formats, only 2N programs are required and not N²-N. These programs operate on the command line and are styled after standard UNIX-like filters.";
49 homepage = "https://sourceforge.net/p/bibutils/home/Bibutils/";
50 license = licenses.gpl2Only;
51 maintainers = [ maintainers.garrison ];
52 platforms = platforms.unix;
53 };
54}