Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at 23.05 51 lines 1.6 kB view raw
1{ lib, stdenv, fetchurl, file, openssl, mlton 2, libmysqlclient, postgresql, sqlite, gcc, icu 3}: 4 5stdenv.mkDerivation rec { 6 pname = "urweb"; 7 version = "20200209"; 8 9 src = fetchurl { 10 url = "https://github.com/urweb/urweb/releases/download/${version}/${pname}-${version}.tar.gz"; 11 sha256 = "0qh6wcxfk5kf735i5gqwnkdirnnmqhnnpkfz96gz144dgz2i0c5c"; 12 }; 13 14 buildInputs = [ openssl mlton libmysqlclient postgresql sqlite icu ]; 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="${libmysqlclient}/include/mysql/mysql.h"; 25 export SQHEADER="${sqlite.dev}/include/sqlite3.h"; 26 export ICU_INCLUDES="-I${icu.dev}/include"; 27 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 ''; 35 36 env.NIX_CFLAGS_COMPILE = toString [ 37 # Needed with GCC 12 38 "-Wno-error=use-after-free" 39 ]; 40 41 # Be sure to keep the statically linked libraries 42 dontDisableStatic = true; 43 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 }; 51}