diff --git a/pkgs/development/libraries/http-parser/default.nix b/pkgs/development/libraries/http-parser/default.nix index 327121dc6b1b..a499f6bf207b 100644 --- a/pkgs/development/libraries/http-parser/default.nix +++ b/pkgs/development/libraries/http-parser/default.nix @@ -12,6 +12,7 @@ stdenv.mkDerivation rec { }; env.NIX_CFLAGS_COMPILE = "-Wno-error"; + patches = [ ./build-shared.patch ] ++ lib.optionals stdenv.isAarch32 [ @@ -21,18 +22,36 @@ stdenv.mkDerivation rec { sha256 = "sha256-rZZMJeow3V1fTnjadRaRa+xTq3pdhZn/eJ4xjxEDoU4="; }) ]; - makeFlags = [ "DESTDIR=" "PREFIX=$(out)" ]; + + makeFlags = [ + "DESTDIR=" + "PREFIX=$(out)" + "SOEXT=${lib.strings.removePrefix "." stdenv.hostPlatform.extensions.sharedLibrary}" + "BINEXT=${stdenv.hostPlatform.extensions.executable}" + "Platform=${lib.toLower stdenv.hostPlatform.uname.system}" + ] ++ lib.optionals stdenv.hostPlatform.isWindows [ + "SONAME=$(SOLIBNAME).$(SOMAJOR).$(SOMINOR).$(SOEXT)" + "LIBNAME=$(SOLIBNAME).$(SOMAJOR).$(SOMINOR).$(SOREV).$(SOEXT)" + "LDFLAGS=-Wl,--out-implib=$(LIBNAME).a" + ]; + buildFlags = [ "library" ]; + doCheck = true; checkTarget = "test"; enableParallelBuilding = true; + postInstall = lib.optionalString stdenv.hostPlatform.isWindows '' + install -D *.dll.a $out/lib + ln -sf libhttp_parser.${version}.dll.a $out/lib/libhttp_parser.dll.a + ''; + meta = with lib; { description = "An HTTP message parser written in C"; homepage = "https://github.com/nodejs/http-parser"; maintainers = with maintainers; [ matthewbauer ]; license = licenses.mit; - platforms = platforms.unix; + platforms = platforms.all; }; } diff --git a/pkgs/development/libraries/libgit2/default.nix b/pkgs/development/libraries/libgit2/default.nix index 085c4c79bdc9..d21dbcb7ac0a 100644 --- a/pkgs/development/libraries/libgit2/default.nix +++ b/pkgs/development/libraries/libgit2/default.nix @@ -33,6 +33,10 @@ stdenv.mkDerivation rec { "-DUSE_HTTP_PARSER=system" "-DUSE_SSH=ON" "-DBUILD_SHARED_LIBS=${if staticBuild then "OFF" else "ON"}" + ] ++ lib.optionals stdenv.hostPlatform.isWindows [ + "-DDLLTOOL=${stdenv.cc.bintools.targetPrefix}dlltool" + # For ws2_32, refered to by a `*.pc` file + "-DCMAKE_LIBRARY_PATH=${stdenv.cc.libc}/lib" ]; nativeBuildInputs = [ cmake python3 pkg-config ];