summaryrefslogtreecommitdiffstats
path: root/pkgs/development/libraries/librdf/redland.nix
blob: fc210c8c4f43f1cf74a552a05cfbd0336e6ef559 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
{
  lib,
  stdenv,
  fetchurl,
  pkg-config,
  openssl,
  libxslt,
  perl,
  curl,
  libxml2,
  librdf_rasqal,
  gmp,
  libmysqlclient,
  withMysql ? false,
  libpq,
  withPostgresql ? false,
  sqlite,
  withSqlite ? true,
  db,
  withBdb ? false,
}:

stdenv.mkDerivation rec {
  pname = "redland";
  version = "1.0.17";

  src = fetchurl {
    url = "https://download.librdf.org/source/redland-${version}.tar.gz";
    sha256 = "de1847f7b59021c16bdc72abb4d8e2d9187cd6124d69156f3326dd34ee043681";
  };

  nativeBuildInputs = [
    perl
    pkg-config
  ]
  ++ lib.optional withPostgresql libpq.pg_config;

  buildInputs = [
    openssl
    libxslt
    curl
    libxml2
    gmp
  ]
  ++ lib.optional withMysql libmysqlclient
  ++ lib.optional withSqlite sqlite
  ++ lib.optional withPostgresql libpq
  ++ lib.optional withBdb db;

  propagatedBuildInputs = [ librdf_rasqal ];

  postInstall = "rm -rvf $out/share/gtk-doc";

  configureFlags = [
    "--with-threads"
  ]
  ++ lib.optionals withBdb [
    "--with-bdb-include=${db.dev}/include"
    "--with-bdb-lib=${db.out}/lib"
  ];

  # Fix broken DT_NEEDED in lib/redland/librdf_storage_sqlite.so.
  env.NIX_CFLAGS_LINK = "-lraptor2";

  doCheck = false; # fails 1 out of 17 tests with a segmentation fault

  meta = {
    description = "C libraries that provide support for the Resource Description Framework (RDF)";
    homepage = "https://librdf.org/";
    platforms = lib.platforms.unix;
    license = lib.licenses.asl20;
  };
}