1{ stdenv, fetchurl, file, openssl, mlton
2, mysql, postgresql, sqlite
3}:
4
5stdenv.mkDerivation rec {
6 name = "urweb-${version}";
7 version = "20150819";
8
9 src = fetchurl {
10 url = "http://www.impredicative.com/ur/${name}.tgz";
11 sha256 = "0gpdlq3aazx121k3ia94qfa4dyv04q7478x2p6hvcjamn18vk56n";
12 };
13
14 buildInputs = [ openssl mlton mysql postgresql sqlite ];
15
16 prePatch = ''
17 sed -e 's@/usr/bin/file@${file}/bin/file@g' -i configure
18 '';
19
20 configureFlags = "--with-openssl=${openssl}";
21
22 preConfigure = ''
23 export PGHEADER="${postgresql}/include/libpq-fe.h";
24 export MSHEADER="${mysql.lib}/include/mysql/mysql.h";
25 export SQHEADER="${sqlite}/include/sqlite3.h";
26
27 export CCARGS="-I$out/include \
28 -L${mysql.lib}/lib/mysql \
29 -L${postgresql}/lib \
30 -L${sqlite}/lib";
31 '';
32
33 # Be sure to keep the statically linked libraries
34 dontDisableStatic = true;
35
36 meta = {
37 description = "Advanced purely-functional web programming language";
38 homepage = "http://www.impredicative.com/ur/";
39 license = stdenv.lib.licenses.bsd3;
40 platforms = stdenv.lib.platforms.linux;
41 maintainers = [ stdenv.lib.maintainers.thoughtpolice ];
42 };
43}