nixpkgs/pkgs/development/libraries/libsoup/3.x.nix
Alyssa Ross 69b87ae0ec
libsoup_3: re-disable introspection if no emulator
e.g. when cross compiling from Linux to FreeBSD.
2023-03-02 14:41:51 +00:00

112 lines
2.3 KiB
Nix

{ stdenv
, lib
, fetchurl
, glib
, meson
, ninja
, pkg-config
, gnome
, libsysprof-capture
, sqlite
, glib-networking
, buildPackages
, gobject-introspection
, withIntrospection ? stdenv.hostPlatform.emulatorAvailable buildPackages
, vala
, libpsl
, python3
, gi-docgen
, brotli
, libnghttp2
}:
stdenv.mkDerivation rec {
pname = "libsoup";
version = "3.2.2";
outputs = [ "out" "dev" ] ++ lib.optional withIntrospection "devdoc";
src = fetchurl {
url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
sha256 = "sha256-g2c8aFuRD7fTnx8o7uWvvvtxwFeY/DUKw78biF4e+qE=";
};
depsBuildBuild = [
pkg-config
];
nativeBuildInputs = [
meson
ninja
pkg-config
glib
python3
] ++ lib.optionals withIntrospection [
gi-docgen
gobject-introspection
vala
];
buildInputs = [
sqlite
libpsl
glib.out
brotli
libnghttp2
] ++ lib.optionals stdenv.isLinux [
libsysprof-capture
];
propagatedBuildInputs = [
glib
];
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;
postPatch = ''
patchShebangs libsoup/
'';
postFixup = ''
# Cannot be in postInstall, otherwise _multioutDocs hook in preFixup will move right back.
moveToOutput "share/doc" "$devdoc"
'';
passthru = {
propagatedUserEnvPackages = [
glib-networking.out
];
updateScript = gnome.updateScript {
attrPath = "libsoup_3";
packageName = pname;
versionPolicy = "odd-unstable";
};
};
meta = {
description = "HTTP client/server library for GNOME";
homepage = "https://wiki.gnome.org/Projects/libsoup";
license = lib.licenses.lgpl2Plus;
inherit (glib.meta) maintainers platforms;
};
}