mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-09-30 01:17:28 +03:00
Merge pull request #269326 from obsidiansystems/libgit-windows
libgit2, http-parser: Fix Windows Build
This commit is contained in:
commit
281f0e65b0
@ -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;
|
||||
};
|
||||
}
|
||||
|
@ -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 ];
|
||||
|
Loading…
Reference in New Issue
Block a user