From 3fff7926332e0f2ba2aff24407d1fe0fd547c375 Mon Sep 17 00:00:00 2001 From: Carlos Garcia Campos Date: Tue, 23 Mar 2021 16:14:34 +0100 Subject: [PATCH] Use GUri instead of SoupURI It removes the direct dependency on libsoup so that we don't need to migrate to libsoup3 Fixes #324 --- PACKAGING | 2 +- libgitg-ext/meson.build | 1 - libgitg/gitg-credentials-manager.vala | 4 +- libgitg/meson.build | 1 - meson.build | 3 +- osx/Taps/gitg/gitg.rb | 1 - osx/Taps/gitg/libsoup.rb | 67 --------------------------- 7 files changed, 4 insertions(+), 75 deletions(-) delete mode 100644 osx/Taps/gitg/libsoup.rb diff --git a/PACKAGING b/PACKAGING index 68199d11..fe0f11bc 100644 --- a/PACKAGING +++ b/PACKAGING @@ -87,7 +87,7 @@ Installed: Following is a list of dependencies of gitg. Note that these are subject to change and a definite list can be obtained by inspecting configure.ac instead: -- glib >= 2.38 +- glib >= 2.68 - gtk+ >= 3.10 - gtksourceview >= 3.10 - gobject-introspection >= 0.10.1 diff --git a/libgitg-ext/meson.build b/libgitg-ext/meson.build index f116ba01..f49c1dbd 100644 --- a/libgitg-ext/meson.build +++ b/libgitg-ext/meson.build @@ -89,7 +89,6 @@ if get_option('docs') '--pkg', 'ggit-1.0', '--pkg', 'gio-2.0', '--pkg', 'gtk+-3.0', - '--pkg', 'libsoup-2.4', '--pkg', 'gee-0.8', ] diff --git a/libgitg/gitg-credentials-manager.vala b/libgitg/gitg-credentials-manager.vala index 331aaaf5..686a6889 100644 --- a/libgitg/gitg-credentials-manager.vala +++ b/libgitg/gitg-credentials-manager.vala @@ -225,13 +225,13 @@ public class CredentialsManager } else { - var uri = new Soup.URI(url); + var uri = GLib.Uri.parse(url, GLib.UriFlags.NONE); if (uri != null) { host = uri.get_host(); - if (!uri.uses_default_port()) + if (uri.get_port() != -1) { host = @"$(host):$(uri.get_port())"; } diff --git a/libgitg/meson.build b/libgitg/meson.build index 493fef5d..e20e07c8 100644 --- a/libgitg/meson.build +++ b/libgitg/meson.build @@ -99,7 +99,6 @@ deps = common_deps + [ gtksourceview_dep, libide_dep, libsecret_dep, - libsoup_dep, m_dep, ] diff --git a/meson.build b/meson.build index f5db5ae8..ec87a214 100644 --- a/meson.build +++ b/meson.build @@ -123,7 +123,7 @@ add_project_arguments('--vapidir=' + vapi_dir, language: 'vala') symbol_map = join_paths(source_root, 'libgitg.map') common_ldflags = cc.get_supported_link_arguments('-Wl,--version-script,@0@'.format(symbol_map)) -glib_req_version = '>= 2.38' +glib_req_version = '>= 2.68' gee_dep = dependency('gee-0.8') gio_dep = dependency('gio-2.0', version: glib_req_version) @@ -136,7 +136,6 @@ gtksourceview_dep = dependency('gtksourceview-4', version: '>= 4.0.3') libgit2_glib_dep = dependency('libgit2-glib-1.0', version: ['>= 0.27.8']) libpeas_dep = dependency('libpeas-1.0') libsecret_dep = dependency('libsecret-1') -libsoup_dep = dependency('libsoup-2.4') libxml_dep = dependency('libxml-2.0', version: '>= 2.9.0') libdazzle_dep = dependency('libdazzle-1.0') json_glib_dependency = dependency('json-glib-1.0') diff --git a/osx/Taps/gitg/gitg.rb b/osx/Taps/gitg/gitg.rb index 4fdc92e7..0e7f687a 100644 --- a/osx/Taps/gitg/gitg.rb +++ b/osx/Taps/gitg/gitg.rb @@ -14,7 +14,6 @@ class Gitg < Formula depends_on "gnome/gitg/shared-mime-info" depends_on "gnome/gitg/gtk+3" => "with-quartz-relocation" depends_on "gnome/gitg/gtksourceview3" - depends_on "gnome/gitg/libsoup" depends_on "gnome/gitg/libsecret" depends_on "gnome/gitg/libpeas" depends_on "gnome/gitg/gspell" diff --git a/osx/Taps/gitg/libsoup.rb b/osx/Taps/gitg/libsoup.rb deleted file mode 100644 index 882cf9ed..00000000 --- a/osx/Taps/gitg/libsoup.rb +++ /dev/null @@ -1,67 +0,0 @@ -class Libsoup < Formula - desc "HTTP client/server library for GNOME" - homepage "https://live.gnome.org/LibSoup" - url "https://download.gnome.org/sources/libsoup/2.54/libsoup-2.54.1.tar.xz" - sha256 "47b42c232034734d66e5f093025843a5d8cc4b2357c011085a2fd04ef02dd633" - - depends_on "pkg-config" => :build - depends_on "intltool" => :build - depends_on "gnome/gitg/gtk-doc" => :build - depends_on "gnome/gitg/glib-networking" - depends_on "gnome/gitg/gnutls" - depends_on "sqlite" - depends_on "gnome/gitg/gobject-introspection" => :recommended - depends_on "gnome/gitg/vala" - - def install - args = [ - "--disable-debug", - "--disable-dependency-tracking", - "--disable-silent-rules", - "--prefix=#{prefix}", - "--without-gnome", - "--disable-tls-check" - ] - - if build.with? "gobject-introspection" - args << "--enable-introspection" - else - args << "--disable-introspection" - end - - system "./configure", *args - system "make", "install" - end - - test do - (testpath/"test.c").write <<-EOS.undent - #include - - int main(int argc, char *argv[]) { - guint version = soup_get_major_version(); - return 0; - } - EOS - ENV.libxml2 - gettext = Formula["gettext"] - glib = Formula["glib"] - flags = (ENV.cflags || "").split + (ENV.cppflags || "").split + (ENV.ldflags || "").split - flags += %W[ - -I#{gettext.opt_include} - -I#{glib.opt_include}/glib-2.0 - -I#{glib.opt_lib}/glib-2.0/include - -I#{include}/libsoup-2.4 - -D_REENTRANT - -L#{gettext.opt_lib} - -L#{glib.opt_lib} - -L#{lib} - -lgio-2.0 - -lglib-2.0 - -lgobject-2.0 - -lintl - -lsoup-2.4 - ] - system ENV.cc, "test.c", "-o", "test", *flags - system "./test" - end -end