Use GUri instead of SoupURI

It removes the direct dependency on libsoup so that we don't need to
migrate to libsoup3

Fixes #324
This commit is contained in:
Carlos Garcia Campos 2021-03-23 16:14:34 +01:00 committed by Alberto Fanjul
parent 75e371dcc5
commit 3fff792633
7 changed files with 4 additions and 75 deletions

View file

@ -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

View file

@ -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',
]

View file

@ -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())";
}

View file

@ -99,7 +99,6 @@ deps = common_deps + [
gtksourceview_dep,
libide_dep,
libsecret_dep,
libsoup_dep,
m_dep,
]

View file

@ -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')

View file

@ -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"

View file

@ -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 <libsoup/soup.h>
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