diff --git a/projects/libsoup.org/package.yml b/projects/libsoup.org/package.yml new file mode 100644 index 00000000..0f18b01f --- /dev/null +++ b/projects/libsoup.org/package.yml @@ -0,0 +1,49 @@ +distributable: + url: https://download.gnome.org/sources/libsoup/{{version.marketing}}/libsoup-{{version}}.tar.xz + strip-components: 1 +versions: + url: https://download.gnome.org/sources/libsoup/cache.json + match: /libsoup-\d+\.\d+\.\d+\.tar\.xz/ + strip: + - /^libsoup-/ + - /\.tar\.xz/ +dependencies: + gnome.org/glib-networking: '*' + gnutls.org: '*' + rockdaboot.github.io/libpsl: '*' + kerberos.org: '*' + gnome.org/libxml2: '*' + sqlite.org: '*' + nghttp2.org: '*' + linux: + gnu.org/gettext: '*' + gnome.org/glib: '*' + github.com/google/brotli: '*' +build: + dependencies: + gnome.org/gobject-introspection: '*' + mesonbuild.com: '*' + ninja-build.org: '*' + freedesktop.org/pkg-config: '*' + python.org: ~3.11 + gnome.org/vala: '*' + script: + - meson setup build $MESON_ARGS + - meson compile -C build --verbose + - meson install -C build + - run: | + d=$(ls) + ln -s $d/libsoup libsoup + working-directory: "{{prefix}}/include" + env: + MESON_ARGS: + - --prefix="{{prefix}}" + - --libdir="{{prefix}}/lib" + - --buildtype=release + - --wrap-mode=nofallback +test: + dependencies: + freedesktop.org/pkg-config: '*' + script: + - cc test.c $(pkg-config --libs --cflags libsoup-3.0) -o test + - ./test \ No newline at end of file diff --git a/projects/libsoup.org/test.c b/projects/libsoup.org/test.c new file mode 100644 index 00000000..b2def83a --- /dev/null +++ b/projects/libsoup.org/test.c @@ -0,0 +1,25 @@ +#include + +static gboolean +accept_certificate_callback(SoupMessage *msg, GTlsCertificate *certificate, + GTlsCertificateFlags tls_errors, gpointer user_data) +{ + // Here you can inspect @certificate or compare it against a trusted one + // and you can see what is considered invalid by @tls_errors. + // Returning TRUE trusts it anyway. + return TRUE; +} +int main(int argc, char *argv[]) +{ + SoupMessage *msg = soup_message_new(SOUP_METHOD_GET, "https://tea.xyz/"); + SoupSession *session = soup_session_new(); + g_signal_connect(msg, "accept-certificate", G_CALLBACK(accept_certificate_callback), NULL); + GInputStream *in_stream = soup_session_send(session, msg, NULL, NULL); + + if (in_stream) + { + g_object_unref(in_stream); + } + + return 0; +}