2018-07-20 17:44:44 -07:00
|
|
|
{ stdenv, fetchurl, file, openssl, mlton
|
2017-09-27 07:44:35 -07:00
|
|
|
, mysql, postgresql, sqlite, gcc
|
2015-09-09 05:32:23 -07:00
|
|
|
}:
|
2010-08-24 01:25:07 -07:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2015-09-09 05:32:23 -07:00
|
|
|
name = "urweb-${version}";
|
2018-11-23 00:42:23 -08:00
|
|
|
version = "20180616";
|
2010-08-24 01:25:07 -07:00
|
|
|
|
|
|
|
src = fetchurl {
|
2018-11-23 00:42:23 -08:00
|
|
|
url = "https://github.com/urweb/urweb/releases/download/${version}/${name}.tar.gz";
|
|
|
|
sha256 = "04iy2ky78q6w0d2xyfz2a1k26g2yrwsh1hw1bgs5ia9v3ih965r1";
|
2010-08-24 01:25:07 -07:00
|
|
|
};
|
|
|
|
|
2017-11-01 15:07:33 -07:00
|
|
|
buildInputs = [ openssl mlton mysql.connector-c postgresql sqlite ];
|
2010-08-24 01:25:07 -07:00
|
|
|
|
2011-07-15 11:54:43 -07:00
|
|
|
prePatch = ''
|
2010-08-24 01:25:07 -07:00
|
|
|
sed -e 's@/usr/bin/file@${file}/bin/file@g' -i configure
|
2015-09-09 05:32:23 -07:00
|
|
|
'';
|
2010-08-24 01:25:07 -07:00
|
|
|
|
2018-07-25 14:44:21 -07:00
|
|
|
configureFlags = [ "--with-openssl=${openssl.dev}" ];
|
2015-09-21 01:45:22 -07:00
|
|
|
|
2015-09-09 05:32:23 -07:00
|
|
|
preConfigure = ''
|
2017-09-27 20:59:18 -07:00
|
|
|
export PGHEADER="${postgresql}/include/libpq-fe.h";
|
2017-11-01 15:07:33 -07:00
|
|
|
export MSHEADER="${mysql.connector-c}/include/mysql/mysql.h";
|
2015-10-13 13:30:30 -07:00
|
|
|
export SQHEADER="${sqlite.dev}/include/sqlite3.h";
|
2011-07-15 11:54:43 -07:00
|
|
|
|
2017-09-27 07:44:35 -07:00
|
|
|
export CC="${gcc}/bin/gcc";
|
2015-09-09 05:32:23 -07:00
|
|
|
export CCARGS="-I$out/include \
|
2017-09-27 07:44:35 -07:00
|
|
|
-L${openssl.out}/lib \
|
2017-11-01 15:07:33 -07:00
|
|
|
-L${mysql.connector-c}/lib \
|
2015-10-13 20:47:54 -07:00
|
|
|
-L${postgresql.lib}/lib \
|
2015-10-13 13:30:30 -07:00
|
|
|
-L${sqlite.out}/lib";
|
2015-09-09 05:32:23 -07:00
|
|
|
'';
|
2011-01-24 07:27:07 -08:00
|
|
|
|
2015-09-09 05:32:23 -07:00
|
|
|
# Be sure to keep the statically linked libraries
|
2010-11-15 09:47:36 -08:00
|
|
|
dontDisableStatic = true;
|
|
|
|
|
2010-08-24 01:25:07 -07:00
|
|
|
meta = {
|
2015-09-09 05:32:23 -07:00
|
|
|
description = "Advanced purely-functional web programming language";
|
|
|
|
homepage = "http://www.impredicative.com/ur/";
|
|
|
|
license = stdenv.lib.licenses.bsd3;
|
2017-09-27 07:44:35 -07:00
|
|
|
platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin;
|
2017-05-16 11:43:23 -07:00
|
|
|
maintainers = [ stdenv.lib.maintainers.thoughtpolice stdenv.lib.maintainers.sheganinans ];
|
2010-08-24 01:25:07 -07:00
|
|
|
};
|
|
|
|
}
|