@@ 147,6 147,8 @@ in nullPkgs // {
stdenv = gcc7Stdenv;
});
+ lwip = final.callPackage ./lwip { };
+
ncurses = addPatchesHost [ ./ncurses/genode.patch ] ncurses;
nim-unwrapped = prev.nim-unwrapped.overrideAttrs
@@ 0,0 1,66 @@
+# Package for testing LwIP applications on Linux.
+
+{ lib, stdenv, fetchurl, check, cmake, subunit, unzip }:
+
+let contribName = "contrib-2.1.0";
+in stdenv.mkDerivation rec {
+ outputs = [ "out" "bin" ];
+ pname = "lwip";
+ version = "2.1.2";
+ srcs = map fetchurl [
+ {
+ url =
+ "http://download.savannah.nongnu.org/releases/${pname}/${pname}-${version}.zip";
+ sha256 = "sha256-XgrhiHvvWyfjX5Jjaj5S87xn8ZRPE21sedGOXZcvdrA=";
+ }
+ {
+ url =
+ "http://download.savannah.nongnu.org/releases/${pname}/${contribName}.zip";
+ sha256 = "sha256-MDif3bQALrfU+dQz2eJb42lOozBxANKXmkjIWJ/Hpo8=";
+ }
+ ];
+ nativeBuildInputs = [ check cmake subunit unzip ];
+ sourceRoot = "${pname}-${version}";
+ postPatch = ''
+ substituteInPlace test/unit/lwip_check.h --replace ',0, 0, 0, 1' ', 0, 0, 1'
+ '';
+ NIX_CFLAGS_COMPILE = [
+ "-Wno-error=format-extra-args"
+ "-Wno-error=incompatible-pointer-types"
+ "-Wno-error=int-conversion"
+ ];
+ preConfigure = lib.strings.optionalString stdenv.hostPlatform.isUnix ''
+ mv $NIX_BUILD_TOP/$sourceRoot $NIX_BUILD_TOP/lwip
+ mv $NIX_BUILD_TOP/${contribName} $NIX_BUILD_TOP/contrib
+ cmakeFlagsArray+=("-DLWIP_DIR=$NIX_BUILD_TOP/lwip")
+ cmakeFlagsArray+=("-DLWIP_CONTRIB_DIR=$NIX_BUILD_TOP/contrib")
+ cd $NIX_BUILD_TOP/contrib/ports/unix/check
+ cat >> CMakeLists.txt << EOF
+ install(TARGETS lwip_unittests lwipallapps lwipcore)
+ install(DIRECTORY
+ "\''${LWIP_DIR}/src/include"
+ "\''${LWIP_CONTRIB_DIR}/ports/unix/port/include"
+ DESTINATION "."
+ FILES_MATCHING
+ PATTERN "*.h"
+ )
+ install(FILES "\''${LWIP_CONTRIB_DIR}/ports/unix/lib/lwipopts.h"
+ DESTINATION "include/lwip"
+ )
+ EOF
+ '';
+ checkPhase = ''
+ runHook preCheck
+ ./lwip_unittests
+ runHook postCheck
+ '';
+ meta = with lib; {
+ broken = !stdenv.hostPlatform.isUnix;
+ description =
+ "Small independent implementation of the TCP/IP protocol suite";
+ homepage = "http://www.nongnu.org/lwip/";
+ downloadPage = "http://download.savannah.nongnu.org/releases/lwip/";
+ license = licenses.bsd3;
+ maintainers = [ maintainers.ehmry ];
+ };
+}