diff options
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/libsoup')
-rw-r--r-- | nixpkgs/pkgs/development/libraries/libsoup/3.x.nix | 108 | ||||
-rw-r--r-- | nixpkgs/pkgs/development/libraries/libsoup/default.nix | 104 |
2 files changed, 212 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/libsoup/3.x.nix b/nixpkgs/pkgs/development/libraries/libsoup/3.x.nix new file mode 100644 index 000000000000..6d1545af4079 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/libsoup/3.x.nix @@ -0,0 +1,108 @@ +{ 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 +}: + +stdenv.mkDerivation rec { + pname = "libsoup"; + version = "3.4.4"; + + outputs = [ "out" "dev" ] ++ lib.optional withIntrospection "devdoc"; + + src = fetchurl { + url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; + sha256 = "sha256-KRxncl827ZDqQ+//JQZLacWi0ZgUiEd8BcSBo7Swxao="; + }; + + 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; + 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://wiki.gnome.org/Projects/libsoup"; + license = lib.licenses.lgpl2Plus; + inherit (glib.meta) maintainers platforms; + }; +} diff --git a/nixpkgs/pkgs/development/libraries/libsoup/default.nix b/nixpkgs/pkgs/development/libraries/libsoup/default.nix new file mode 100644 index 000000000000..11e1a5a40f1e --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/libsoup/default.nix @@ -0,0 +1,104 @@ +{ stdenv +, lib +, fetchurl +, glib +, libxml2 +, meson +, ninja +, pkg-config +, gnome +, libsysprof-capture +, gobject-introspection +, vala +, libpsl +, brotli +, gnomeSupport ? true +, sqlite +, buildPackages +, withIntrospection ? lib.meta.availableOn stdenv.hostPlatform gobject-introspection && stdenv.hostPlatform.emulatorAvailable buildPackages +}: + +stdenv.mkDerivation rec { + pname = "libsoup"; + version = "2.74.3"; + + outputs = [ "out" "dev" ]; + + src = fetchurl { + url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; + sha256 = "sha256-5Ld8Qc/EyMWgNfzcMgx7xs+3XvfFoDQVPfFBP6HZLxM="; + }; + + depsBuildBuild = [ + pkg-config + ]; + + nativeBuildInputs = [ + meson + ninja + pkg-config + glib + ] ++ lib.optionals withIntrospection [ + gobject-introspection + vala + ]; + + buildInputs = [ + sqlite + libpsl + glib.out + brotli + ] ++ lib.optionals stdenv.isLinux [ + libsysprof-capture + ]; + + propagatedBuildInputs = [ + glib + libxml2 + ]; + + mesonFlags = [ + "-Dtls_check=false" # glib-networking is a runtime dependency, not a compile-time dependency + "-Dgssapi=disabled" + "-Dvapi=${if withIntrospection then "enabled" else "disabled"}" + "-Dintrospection=${if withIntrospection then "enabled" else "disabled"}" + "-Dgnome=${lib.boolToString gnomeSupport}" + "-Dntlm=disabled" + ] ++ lib.optionals (!stdenv.isLinux) [ + "-Dsysprof=disabled" + ]; + + env.NIX_CFLAGS_COMPILE = "-lpthread"; + + doCheck = false; # ERROR:../tests/socket-test.c:37:do_unconnected_socket_test: assertion failed (res == SOUP_STATUS_OK): (2 == 200) + separateDebugInfo = true; + + postPatch = '' + # fixes finding vapigen when cross-compiling + # the commit is in 3.0.6 + # https://gitlab.gnome.org/GNOME/libsoup/-/commit/5280e936d0a76f94dbc5d8489cfbdc0a06343f65 + substituteInPlace meson.build \ + --replace "required: vapi_opt)" "required: vapi_opt, native: false)" + + patchShebangs libsoup/ + ''; + + passthru = { + updateScript = gnome.updateScript { + packageName = pname; + versionPolicy = "odd-unstable"; + freeze = true; + }; + }; + + meta = { + description = "HTTP client/server library for GNOME"; + homepage = "https://wiki.gnome.org/Projects/libsoup"; + license = lib.licenses.lgpl2Plus; + inherit (glib.meta) maintainers platforms; + pkgConfigModules = [ + "libsoup-2.4" + "libsoup-gnome-2.4" + ]; + }; +} |