about summary refs log tree commit diff
path: root/pkgs/servers/http/4store/default.nix
blob: 4854f9e18dda8b2b33bf190a435950e010317d13 (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
45
46
47
48
x@{builderDefsPackage
  , librdf_raptor, librdf_rasqal,
  glib, libxml2, pcre, avahi,
  readline, ncurses, expat,
  zlib, pkgconfig, which,
  perl, libuuid, gmp, mpfr
  , db_dir ? "/var/lib/4store"
  , ...}:
builderDefsPackage
(a :  
let 
  s = import ./src-for-default.nix;
  helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++ 
    ["db_dir"];
  buildInputs = map (n: builtins.getAttr n x)
    (builtins.attrNames (builtins.removeAttrs x helperArgNames));
in
rec {
  src = a.fetchUrlFromSrcInfo s;

  inherit (s) name;
  inherit buildInputs;

  /* doConfigure should be removed if not needed */
  phaseNames = ["doFixConfigure" "doConfigure" "doMakeInstall"
    "fixInterpreter"];

  doFixConfigure = a.fullDepEntry ''
    sed -e 's@#! */bin/bash@#! ${a.stdenv.shell}@' -i configure
    find . -name Makefile -exec sed -e "s@/usr/local@$out@g" -i '{}' ';'
    
    sed -e 's@/var/lib/4store@${db_dir}@g' -i src/common/params.h src/utilities/*
    sed -e '/FS_STORE_ROOT/d' -i src/utilities/Makefile*
  '' ["minInit" "doUnpack"];

  fixInterpreter = (a.doPatchShebangs "$out/bin");
      
  meta = {
    description = "SparQL query server (RDF storage)";
    homepage = http://4store.org/;
    maintainers = with a.lib.maintainers;
    [
      raskin
    ];
    platforms = with a.lib.platforms;
      linux;
  };
}) x