[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
43/331: gnu: gobject-introspection: Update package definition.
From: |
guix-commits |
Subject: |
43/331: gnu: gobject-introspection: Update package definition. |
Date: |
Fri, 14 Aug 2020 11:12:47 -0400 (EDT) |
dannym pushed a commit to branch wip-desktop
in repository guix.
commit 0e48725e4eec83987aa67ea8eb4e3156fddc46e6
Author: Raghav Gururajan <raghavgururajan@disroot.org>
AuthorDate: Wed Jun 24 22:27:11 2020 -0400
gnu: gobject-introspection: Update package definition.
* gnu/packages/glib.scm (gobject-introspection) [version]: Update
to 1.64.1.
[patches]: Remove all patches.
[arguments]<#:glib-or-gtk?>: New argument.
<#:phases>: Remove all phases.
[native-inputs]: Add bison and flex.
[inputs]: Remove bison, flex and zlib.
[synopsis]: Modify.
[description]: Modify.
[home-page]: Modify.
[license]: Modify.
* gnu/packages/patches/gobject-introspection-absolute-shlib-path.patch:
Delete file.
* gnu/packages/patches/gobject-introspection-cc.patch: Delete file.
* gnu/packages/patches/gobject-introspection-girepository.patch: Delete
file.
* gnu/local.mk (dist_patch_DATA): Remove them.
Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org>
---
gnu/local.mk | 3 -
gnu/packages/glib.scm | 69 ++++-----
...gobject-introspection-absolute-shlib-path.patch | 166 ---------------------
.../patches/gobject-introspection-cc.patch | 14 --
.../gobject-introspection-girepository.patch | 25 ----
5 files changed, 30 insertions(+), 247 deletions(-)
diff --git a/gnu/local.mk b/gnu/local.mk
index ba18ed9..ef97c6b 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1061,9 +1061,6 @@ dist_patch_DATA =
\
%D%/packages/patches/gnupg-default-pinentry.patch \
%D%/packages/patches/gnutls-skip-trust-store-test.patch \
%D%/packages/patches/gnutls-cross.patch \
- %D%/packages/patches/gobject-introspection-absolute-shlib-path.patch \
- %D%/packages/patches/gobject-introspection-cc.patch \
- %D%/packages/patches/gobject-introspection-girepository.patch \
%D%/packages/patches/go-skip-gc-test.patch \
%D%/packages/patches/gpm-glibc-2.26.patch \
%D%/packages/patches/gpsbabel-minizip.patch \
diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm
index 36d7278..603f030 100644
--- a/gnu/packages/glib.scm
+++ b/gnu/packages/glib.scm
@@ -331,56 +331,47 @@ threads, dynamic loading, and an object system.")
(define gobject-introspection
(package
(name "gobject-introspection")
- (version "1.62.0")
- (source (origin
- (method url-fetch)
- (uri (string-append "mirror://gnome/sources/"
- "gobject-introspection/" (version-major+minor version)
- "/gobject-introspection-" version ".tar.xz"))
- (sha256
- (base32 "18lhglg9v6y83lhqzyifc1z0wrlawzrhzzxx0a3h1g7xaz97xvmi"))
- (patches (search-patches
- "gobject-introspection-cc.patch"
- "gobject-introspection-girepository.patch"
- "gobject-introspection-absolute-shlib-path.patch"))))
+ (version "1.64.1")
+ (source
+ (origin
+ (method url-fetch)
+ (uri
+ (string-append "mirror://gnome/sources/"
+ name "/" (version-major+minor version) "/"
+ name "-" version ".tar.xz"))
+ (sha256
+ (base32 "19vz7vp10h0zj3f491yk72dp89bix6rgkzxg4qcm4d6151ksxgl0"))))
(build-system meson-build-system)
(arguments
- `(#:phases
- (modify-phases %standard-phases
- (add-after 'unpack 'do-not-use-/usr/bin/env
- (lambda _
- (substitute* "tools/g-ir-tool-template.in"
- (("#!@PYTHON_CMD@")
- (string-append "#!" (which "python3"))))
- #t)))))
- (inputs
+ `(#:glib-or-gtk? #t)) ; To wrap binaries and/or compile schemas
+ (native-inputs
`(("bison" ,bison)
("flex" ,flex)
- ("glib" ,glib)
- ("python" ,python-wrapper)
- ("zlib" ,zlib)))
- (native-inputs
- `(("glib" ,glib "bin")
+ ("glib" ,glib "bin")
("pkg-config" ,pkg-config)))
+ (inputs
+ `(("glib" ,glib)
+ ("python" ,python-wrapper)))
(propagated-inputs
- `(;; In practice, GIR users will need libffi when using
- ;; gobject-introspection.
- ("libffi" ,libffi)))
+ `(("libffi" ,libffi)))
(native-search-paths
(list (search-path-specification
(variable "GI_TYPELIB_PATH")
(files '("lib/girepository-1.0")))))
(search-paths native-search-paths)
- (home-page "https://wiki.gnome.org/GObjectIntrospection")
- (synopsis "Generate interface introspection data for GObject libraries")
- (description
- "GObject introspection is a middleware layer between C libraries (using
-GObject) and language bindings. The C library can be scanned at compile time
-and generate a metadata file, in addition to the actual native C library. Then
-at runtime, language bindings can read this metadata and automatically provide
-bindings to call into the C library.")
- ; Some bits are distributed under the LGPL2+, others under the GPL2+
- (license license:gpl2+)))
+ (synopsis "GObject introspection tools and libraries")
+ (description "GObject introspection is a middleware layer between
+C libraries (using GObject) and language bindings. The C library can be
scanned
+at compile time and generate metadata files, in addition to the actual native
+C library. Then language bindings can read this metadata and automatically
+provide bindings to call into the C library.")
+ (home-page "https://wiki.gnome.org/Projects/GObjectIntrospection")
+ (license
+ (list
+ ;; For library.
+ license:lgpl2.0+
+ ;; For tools.
+ license:gpl2+))))
(define intltool
(package
diff --git
a/gnu/packages/patches/gobject-introspection-absolute-shlib-path.patch
b/gnu/packages/patches/gobject-introspection-absolute-shlib-path.patch
deleted file mode 100644
index 956fa61..0000000
--- a/gnu/packages/patches/gobject-introspection-absolute-shlib-path.patch
+++ /dev/null
@@ -1,166 +0,0 @@
-# Names of libraries included in typelib files are opened by dlopen. Here we
-# add the full path.
-#
-# This patch was provided by Luca Bruno <lucabru@src.gnome.org> for
-# 'gobject-introspection' 1.40.0 in Nix.
-#
-# It has since been updated to work with newer versions of
-# gobject-introspection.
---- a/giscanner/scannermain.py
-+++ b/giscanner/scannermain.py
-@@ -95,6 +95,39 @@ def get_windows_option_group(parser):
- return group
-
-
-+def _get_default_fallback_libpath():
-+ # Newer multiple-output-optimized stdenv has an environment variable
-+ # $outputLib which in turn specifies another variable which then is used
as
-+ # the destination for the library contents (${!outputLib}/lib).
-+ store_path = os.environ.get(os.environ.get("outputLib")) if "outputLib"
in os.environ else None
-+ if store_path is None:
-+ outputs = os.environ.get("outputs", "out").split()
-+ if "lib" in outputs:
-+ # For multiple output derivations let's try whether there is a
$lib
-+ # environment variable and use that as the base store path.
-+ store_path = os.environ.get("lib")
-+ elif "out" in outputs:
-+ # Otherwise we have a single output derivation, so the libraries
-+ # most certainly will end up in "$out/lib".
-+ store_path = os.environ.get("out")
-+
-+ if store_path is not None:
-+ # Even if we have a $lib as output, there still should be a $lib/lib
-+ # directory.
-+ return os.path.join(store_path, 'lib')
-+ else:
-+ # If we haven't found a possible scenario, let's return an empty
string
-+ # so that the shared library won't be prepended with a path.
-+ #
-+ # Note that this doesn't mean that all hope is lost, because after all
-+ # we can still use --fallback-library-path to set one.
-+ #
-+ # Also, we're not returning None, because that would make it very
-+ # difficult to disable adding fallback paths altogether using
something
-+ # like: --fallback-library-path=""
-+ return ""
-+
-+
- def _get_option_parser():
- parser = optparse.OptionParser('%prog [options] sources',
- version='%prog ' + giscanner.__version__)
-@@ -205,6 +238,10 @@ match the namespace prefix.""")
- parser.add_option("", "--filelist",
- action="store", dest="filelist", default=[],
- help="file containing headers and sources to be
scanned")
-+ parser.add_option("", "--fallback-library-path",
-+ action="store", dest="fallback_libpath",
-+ default=_get_default_fallback_libpath(),
-+ help="Path to prepend to unknown shared libraries")
-
- group = get_preprocessor_option_group(parser)
- parser.add_option_group(group)
---- a/giscanner/shlibs.py
-+++ b/giscanner/shlibs.py
-@@ -57,6 +57,14 @@ def _ldd_library_pattern(library_name):
- $""" % re.escape(library_name), re.VERBOSE)
-
-
-+def _ldd_library_guix_pattern(library_name):
-+ store_dir = re.escape(
-+ os.environ.get("NIX_STORE", default="/gnu/store")
-+ )
-+ pattern = r'(%s(?:/[^/]*)+lib%s[^A-Za-z0-9_-][^\s\(\)]*)'
-+ return re.compile(pattern % (store_dir, re.escape(library_name)))
-+
-+
- # This is a what we do for non-la files. We assume that we are on an
- # ELF-like system where ldd exists and the soname extracted with ldd is
- # a filename that can be opened with dlopen().
-@@ -106,7 +112,8 @@ def _resolve_non_libtool(options, binary, libraries):
- output = output.decode("utf-8", "replace")
-
- shlibs = resolve_from_ldd_output(libraries, output)
-- return list(map(sanitize_shlib_path, shlibs))
-+ fallback_libpath = options.fallback_libpath or "";
-+ return list(map(lambda p: os.path.join(fallback_libpath, p),
map(sanitize_shlib_path, shlibs)))
-
-
- def sanitize_shlib_path(lib):
-@@ -115,19 +122,18 @@ def sanitize_shlib_path(lib):
- # In case we get relative paths on macOS (like @rpath) then we fall
- # back to the basename as well:
- # https://gitlab.gnome.org/GNOME/gobject-introspection/issues/222
-- if sys.platform == "darwin":
-- if not os.path.isabs(lib):
-- return os.path.basename(lib)
-- return lib
-- else:
-+
-+ # Always use absolute paths if available
-+ if not os.path.isabs(lib):
- return os.path.basename(lib)
-+ return lib
-
-
- def resolve_from_ldd_output(libraries, output):
- patterns = {}
- for library in libraries:
- if not os.path.isfile(library):
-- patterns[library] = _ldd_library_pattern(library)
-+ patterns[library] = (_ldd_library_pattern(library),
_ldd_library_guix_pattern(library))
- if len(patterns) == 0:
- return []
-
-@@ -139,8 +145,12 @@ def resolve_from_ldd_output(libraries, output):
- if line.endswith(':'):
- continue
- for word in line.split():
-- for library, pattern in patterns.items():
-- m = pattern.match(word)
-+ for library, (pattern, guix_pattern) in patterns.items():
-+ store_dir = os.environ.get("NIX_STORE", default="/gnu/store")
-+ if line.find(store_dir) != -1:
-+ m = guix_pattern.match(word)
-+ else:
-+ m = pattern.match(word)
- if m:
- del patterns[library]
- shlibs.append(m.group())
-
---- a/giscanner/utils.py
-+++ b/giscanner/utils.py
-@@ -111,17 +111,11 @@ def extract_libtool_shlib(la_file):
- if dlname is None:
- return None
-
-- # Darwin uses absolute paths where possible; since the libtool files never
-- # contain absolute paths, use the libdir field
-- if platform.system() == 'Darwin':
-- dlbasename = os.path.basename(dlname)
-- libdir = _extract_libdir_field(la_file)
-- if libdir is None:
-- return dlbasename
-- return libdir + '/' + dlbasename
-- # From the comments in extract_libtool(), older libtools had
-- # a path rather than the raw dlname
-- return os.path.basename(dlname)
-+ dlbasename = os.path.basename(dlname)
-+ libdir = _extract_libdir_field(la_file)
-+ if libdir is None:
-+ return dlbasename
-+ return libdir + '/' + dlbasename
-
-
- def extract_libtool(la_file):
---- a/tests/scanner/test_shlibs.py
-+++ b/tests/scanner/test_shlibs.py
-@@ -40,6 +64,7 @@ class TestLddParser(unittest.TestCase):
-
- self.assertEqual(
- sanitize_shlib_path('/foo/bar'),
-- '/foo/bar' if sys.platform == 'darwin' else 'bar')
-+ # Always use an absolute filename for Guix
-+ '/foo/bar')
-
- def test_unresolved_library(self):
-output = ''
diff --git a/gnu/packages/patches/gobject-introspection-cc.patch
b/gnu/packages/patches/gobject-introspection-cc.patch
deleted file mode 100644
index 6a86b56..0000000
--- a/gnu/packages/patches/gobject-introspection-cc.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-Use gcc as the default C compiler if CC is not set.
-
-diff -ru gobject-introspection-1.58.1.orig/giscanner/__init__.py
gobject-introspection-1.58.1/giscanner/__init__.py
---- gobject-introspection-1.58.1.orig/giscanner/__init__.py 1970-01-01
01:00:00.000000000 +0100
-+++ gobject-introspection-1.58.1/giscanner/__init__.py 2018-12-03
13:33:28.788971299 +0100
-@@ -22,6 +22,8 @@
- builddir = os.environ.get('UNINSTALLED_INTROSPECTION_BUILDDIR')
- if builddir is not None:
- __path__.append(os.path.join(builddir, 'giscanner'))
-+if not 'CC' in os.environ:
-+ os.environ['CC'] = 'gcc'
- try:
- from ._version import __version__
- except ImportError:
diff --git a/gnu/packages/patches/gobject-introspection-girepository.patch
b/gnu/packages/patches/gobject-introspection-girepository.patch
deleted file mode 100644
index 380617f..0000000
--- a/gnu/packages/patches/gobject-introspection-girepository.patch
+++ /dev/null
@@ -1,25 +0,0 @@
---- a/girepository/gitypelib.c.orig
-+++ b/girepository/gitypelib.c
-@@ -2296,7 +2296,22 @@ _g_typelib_do_dlopen (GITypelib *typelib)
- {
- GModule *module;
-
-+ /* 'gobject-introspection' doesn't store the path of shared
-+ libraries into '.typelib' and '.gir' files. Shared
-+ libraries are searched for in the dynamic linker search
-+ path. In Guix we patch 'gobject-introspection' such that
-+ it stores the absolute path of shared libraries in
-+ '.typelib' and '.gir' files. Here, in order to minimize
-+ side effects, we make sure that if the library is not
-+ found at the indicated path location, we try with just
-+ the basename and the system dynamic library
-+ infrastructure, as per default behaviour of the
-+ library. */
- module = load_one_shared_library (shlibs[i]);
-+ if (module == NULL && g_path_is_absolute (shlibs[i]))
-+ {
-+ module = load_one_shared_library (g_basename(shlibs[i]));
-+ }
-
- if (module == NULL)
- {
- 37/331: gnu: gsettings-desktop-schemas: Update package definition., (continued)
- 37/331: gnu: gsettings-desktop-schemas: Update package definition., guix-commits, 2020/08/14
- 21/331: gnu: Add ronn., guix-commits, 2020/08/14
- 26/331: gnu: fcitx: Update package definition., guix-commits, 2020/08/14
- 30/331: gnu: gdk-pixbuf+svg: Update package definition., guix-commits, 2020/08/14
- 36/331: gnu: graphene: Update package definition., guix-commits, 2020/08/14
- 35/331: gnu: Add mutest., guix-commits, 2020/08/14
- 39/331: gnu: faad2: Update to 2.8.8., guix-commits, 2020/08/14
- 40/331: gnu: glib: Update package definition., guix-commits, 2020/08/14
- 42/331: gnu: glib-networking: Update to 2.64.3., guix-commits, 2020/08/14
- 38/331: gnu: Add esound., guix-commits, 2020/08/14
- 43/331: gnu: gobject-introspection: Update package definition.,
guix-commits <=
- 44/331: gnu: gstreamer: Update package definition., guix-commits, 2020/08/14
- 18/331: gnu: clutter-gst: Update package definition., guix-commits, 2020/08/14
- 29/331: gnu: gdk-pixbuf: Update package definition., guix-commits, 2020/08/14
- 19/331: gnu: cogl: Update package definition., guix-commits, 2020/08/14
- 20/331: gnu: dconf: Update to 0.36.0., guix-commits, 2020/08/14
- 24/331: gnu: enchant: Update package definition., guix-commits, 2020/08/14
- 25/331: gnu: Add presage., guix-commits, 2020/08/14
- 27/331: gnu: gcab: Update to 1.4., guix-commits, 2020/08/14
- 28/331: gnu: gcr: Update to 3.36.0., guix-commits, 2020/08/14
- 31/331: gnu: geoclue: Update to 2.5.6., guix-commits, 2020/08/14