about summary refs log tree commit diff
path: root/pkgs/servers/http/4store/default.nix
blob: 18cfe488f83f0efdab83f1d3329ef4ce8b28caa8 (plain) (blame)
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
{ stdenv, fetchFromGitHub, librdf_raptor
, librdf_rasqal, glib, libxml2, pcre
, avahi, readline, ncurses, expat, autoreconfHook
, zlib, pkgconfig, which, perl, libuuid
, gmp, mpfr
, db_dir ? "/var/lib/4store" }:


stdenv.mkDerivation rec {
  name = "4store-${version}";
  version = "1.1.6";

  src = fetchFromGitHub {
    owner = "garlik";
    repo = "4store";
    rev = "v${version}";
    sha256 = "1kzdfmwpzy64cgqlkcz5v4klwx99w0jk7afckyf7yqbqb4rydmpk";
  };

  buildInputs = [ librdf_raptor librdf_rasqal glib libxml2 pcre
    avahi readline ncurses expat zlib pkgconfig which perl libuuid
    gmp mpfr autoreconfHook ];

  # needed for ./autogen.sh
  prePatch = ''
    echo "${version}" > .version
  '';

  preConfigure =  ''
    sed -e 's@#! */bin/bash@#! ${stdenv.shell}@' -i configure
    find . -name Makefile -exec sed -e "s@/usr/local@$out@g" -i '{}' ';'
    
    rm src/utilities/4s-backend 
    sed -e 's@/var/lib/4store@${db_dir}@g' -i configure.ac src/utilities/*
    sed -e '/FS_STORE_ROOT/d' -i src/utilities/Makefile*
  '';

  meta = with stdenv.lib; {
    description = "SparQL query server (RDF storage)";
    homepage = http://4store.org/;
    maintainers = with maintainers; [ raskin ];
    platforms = platforms.linux;
  };
}