Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / compilers / urweb / default.nix
blobb72548e753c37bdb5c0c4022777dce27e4da9179
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${lib.getLib openssl}/lib \
31                    -L${libmysqlclient}/lib \
32                    -L${postgresql.lib}/lib \
33                    -L${sqlite.out}/lib";
34   '';
36   env.NIX_CFLAGS_COMPILE = toString [
37     # Needed with GCC 12
38     "-Wno-error=use-after-free"
39   ];
41   # Be sure to keep the statically linked libraries
42   dontDisableStatic = true;
44   meta = {
45     description = "Advanced purely-functional web programming language";
46     homepage    = "http://www.impredicative.com/ur/";
47     license     = lib.licenses.bsd3;
48     platforms   = lib.platforms.linux ++ lib.platforms.darwin;
49     maintainers = [ lib.maintainers.thoughtpolice lib.maintainers.sheganinans ];
50   };