Merge pull request #119126 from fabaff/pycomfoconnect
[NixPkgs.git] / pkgs / development / compilers / urweb / default.nix
blobe2d9d1f226e73c7e1efd13c986fb65b129701ee2
1 { lib, stdenv, fetchurl, file, openssl, mlton
2 , libmysqlclient, postgresql, sqlite, gcc, icu
3 }:
5 stdenv.mkDerivation rec {
6   pname = "urweb";
7   version = "20200209";
9   src = fetchurl {
10     url = "https://github.com/urweb/urweb/releases/download/${version}/${pname}-${version}.tar.gz";
11     sha256 = "0qh6wcxfk5kf735i5gqwnkdirnnmqhnnpkfz96gz144dgz2i0c5c";
12   };
14   buildInputs = [ openssl mlton libmysqlclient postgresql sqlite icu ];
16   prePatch = ''
17     sed -e 's@/usr/bin/file@${file}/bin/file@g' -i configure
18   '';
20   configureFlags = [ "--with-openssl=${openssl.dev}" ];
22   preConfigure = ''
23     export PGHEADER="${postgresql}/include/libpq-fe.h";
24     export MSHEADER="${libmysqlclient}/include/mysql/mysql.h";
25     export SQHEADER="${sqlite.dev}/include/sqlite3.h";
26     export ICU_INCLUDES="-I${icu.dev}/include";
28     export CC="${gcc}/bin/gcc";
29     export CCARGS="-I$out/include \
30                    -L${openssl.out}/lib \
31                    -L${libmysqlclient}/lib \
32                    -L${postgresql.lib}/lib \
33                    -L${sqlite.out}/lib";
34   '';
36   # Be sure to keep the statically linked libraries
37   dontDisableStatic = true;
39   meta = {
40     description = "Advanced purely-functional web programming language";
41     homepage    = "http://www.impredicative.com/ur/";
42     license     = lib.licenses.bsd3;
43     platforms   = lib.platforms.linux ++ lib.platforms.darwin;
44     maintainers = [ lib.maintainers.thoughtpolice lib.maintainers.sheganinans ];
45   };