core/pkgs/by-name/li/libsoup/3.x.nix

111 lines
2.4 KiB
Nix
Raw Normal View History

2024-06-30 08:16:52 +00:00
{
stdenv,
lib,
fetchurl,
glib,
meson,
ninja,
pkg-config,
gnome,
libsysprof-capture,
sqlite,
buildPackages,
gobject-introspection,
withIntrospection ?
lib.meta.availableOn stdenv.hostPlatform gobject-introspection
&& stdenv.hostPlatform.emulatorAvailable buildPackages,
vala,
libpsl,
python3,
gi-docgen,
brotli,
libnghttp2,
2024-05-02 00:46:19 +00:00
}:
stdenv.mkDerivation rec {
pname = "libsoup";
version = "3.4.4";
2024-06-30 08:16:52 +00:00
outputs = [
"out"
"dev"
] ++ lib.optional withIntrospection "devdoc";
2024-05-02 00:46:19 +00:00
src = fetchurl {
url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
sha256 = "sha256-KRxncl827ZDqQ+//JQZLacWi0ZgUiEd8BcSBo7Swxao=";
};
2024-06-30 08:16:52 +00:00
depsBuildBuild = [ pkg-config ];
2024-05-02 00:46:19 +00:00
2024-06-30 08:16:52 +00:00
nativeBuildInputs =
[
meson
ninja
pkg-config
glib
python3
]
++ lib.optionals withIntrospection [
gi-docgen
gobject-introspection
vala
];
2024-05-02 00:46:19 +00:00
buildInputs = [
sqlite
libpsl
glib.out
brotli
libnghttp2
2024-06-30 08:16:52 +00:00
] ++ lib.optionals stdenv.isLinux [ libsysprof-capture ];
2024-05-02 00:46:19 +00:00
2024-06-30 08:16:52 +00:00
propagatedBuildInputs = [ glib ];
2024-05-02 00:46:19 +00:00
mesonFlags = [
"-Dtls_check=false" # glib-networking is a runtime dependency, not a compile-time dependency
"-Dgssapi=disabled"
"-Dntlm=disabled"
# Requires wstest from autobahn-testsuite.
"-Dautobahn=disabled"
# Requires gnutls, not added for closure size.
"-Dpkcs11_tests=disabled"
(lib.mesonEnable "docs" withIntrospection)
(lib.mesonEnable "introspection" withIntrospection)
(lib.mesonEnable "sysprof" stdenv.isLinux)
(lib.mesonEnable "vapi" withIntrospection)
];
# TODO: For some reason the pkg-config setup hook does not pick this up.
PKG_CONFIG_PATH = "${libnghttp2.dev}/lib/pkgconfig";
# HSTS tests fail.
doCheck = false;
separateDebugInfo = true;
postPatch = ''
patchShebangs libsoup/
'';
postFixup = ''
# Cannot be in postInstall, otherwise _multioutDocs hook in preFixup will move right back.
moveToOutput "share/doc" "$devdoc"
'';
passthru = {
updateScript = gnome.updateScript {
attrPath = "libsoup_3";
packageName = pname;
versionPolicy = "odd-unstable";
};
};
meta = {
description = "HTTP client/server library for GNOME";
homepage = "https://gitlab.gnome.org/GNOME/libsoup";
license = lib.licenses.lgpl2Plus;
inherit (glib.meta) maintainers platforms;
};
}