urweb: support darwin, depend on gcc, fix paths.

1. Add support for the darwing platform.
2. Depend on gcc, since the urweb executable will
   call gcc when it compiles an urweb-project.
3. Fix include path and link path for the dependencies.
This commit is contained in:
Peter Brottveit Bock 2017-09-27 14:44:35 +00:00 committed by Peter Bock
parent 9824ca6975
commit 76245e0b9d

View File

@ -1,5 +1,5 @@
{ stdenv, lib, fetchurl, file, openssl, mlton
, mysql, postgresql, sqlite
, mysql, postgresql, sqlite, gcc
}:
stdenv.mkDerivation rec {
@ -20,12 +20,14 @@ stdenv.mkDerivation rec {
configureFlags = "--with-openssl=${openssl.dev}";
preConfigure = ''
export PGHEADER="${postgresql}/include/libpq-fe.h";
export PGHEADER="${postgresql.dev}/include/libpq-fe.h";
export MSHEADER="${lib.getDev mysql.client}/include/mysql/mysql.h";
export SQHEADER="${sqlite.dev}/include/sqlite3.h";
export CC="${gcc}/bin/gcc";
export CCARGS="-I$out/include \
-L${lib.getLib mysql.client}/lib/mysql \
-L${openssl.out}/lib \
-L${lib.getLib mysql.client}/lib \
-L${postgresql.lib}/lib \
-L${sqlite.out}/lib";
'';
@ -37,7 +39,7 @@ stdenv.mkDerivation rec {
description = "Advanced purely-functional web programming language";
homepage = "http://www.impredicative.com/ur/";
license = stdenv.lib.licenses.bsd3;
platforms = stdenv.lib.platforms.linux;
platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin;
maintainers = [ stdenv.lib.maintainers.thoughtpolice stdenv.lib.maintainers.sheganinans ];
};
}