1{ stdenv, lib, fetchurl, file, openssl, mlton
2, mysql, postgresql, sqlite, gcc
3}:
4
5stdenv.mkDerivation rec {
6 name = "urweb-${version}";
7 version = "20170720";
8
9 src = fetchurl {
10 url = "http://www.impredicative.com/ur/${name}.tgz";
11 sha256 = "17qh9mcmlhbv6r52yij8l9ik7j7x6x7c09lf6pznnbdh4sf8p5wb";
12 };
13
14 buildInputs = [ openssl mlton mysql.connector-c 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.dev}";
21
22 preConfigure = ''
23 export PGHEADER="${postgresql}/include/libpq-fe.h";
24 export MSHEADER="${mysql.connector-c}/include/mysql/mysql.h";
25 export SQHEADER="${sqlite.dev}/include/sqlite3.h";
26
27 export CC="${gcc}/bin/gcc";
28 export CCARGS="-I$out/include \
29 -L${openssl.out}/lib \
30 -L${mysql.connector-c}/lib \
31 -L${postgresql.lib}/lib \
32 -L${sqlite.out}/lib";
33 '';
34
35 # Be sure to keep the statically linked libraries
36 dontDisableStatic = true;
37
38 meta = {
39 description = "Advanced purely-functional web programming language";
40 homepage = "http://www.impredicative.com/ur/";
41 license = stdenv.lib.licenses.bsd3;
42 platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin;
43 maintainers = [ stdenv.lib.maintainers.thoughtpolice stdenv.lib.maintainers.sheganinans ];
44 };
45}