Skip to content

Commit

Permalink
gobject-introspection: add libtool library path tweaks to scanner
Browse files Browse the repository at this point in the history
Hopefully the final tweaks, since they now handle both libtool and non-libtool library references, both in-build and outside-build.

Now works work: gobject-introspection, poppler, gstreamer1-gst-plugins-base, py38-gobject3, gexiv2, and libsoup

Ref: https://trac.macports.org/ticket/61427
  • Loading branch information
michaelld committed Nov 12, 2020
1 parent 8bc578f commit 53c663e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion gnome/gobject-introspection/Portfile
Expand Up @@ -5,7 +5,7 @@ PortGroup active_variants 1.1

name gobject-introspection
version 1.60.2
revision 3
revision 4
set branch [join [lrange [split ${version} .] 0 1] .]
categories gnome
platforms darwin
Expand Down
Expand Up @@ -14,7 +14,7 @@
args.append('-L.')
--- giscanner/dumper.py.orig
+++ giscanner/dumper.py
@@ -236,8 +236,29 @@
@@ -236,8 +236,28 @@

args.extend(sources)

Expand All @@ -24,25 +24,24 @@
+ self._packages, msvc_syntax=self._compiler.check_is_msvc())
+ this_L = [lib[len('-L'):] for lib in pkg_config_libs_only_L]
+
+ # remove self._options.library_paths entries that are in
+ # "this_L" already, since those are "system" and will be found
+ # via the "runtime_path_envvar" setting below
+ tmp_L = []
+ for t_L in self._options.library_paths:
+ if t_L not in this_L:
+ tmp_L.append (t_L)
+ self._options.library_paths = tmp_L
+ # uniquely merge pkg_config and options library paths
+ self._options.library_paths = list (set().union (self._options.library_paths,
+ this_L))
+
+ # remove anything in LIBRARY_PATH
+ env_LIBRARY_PATH = os.environ['LIBRARY_PATH'].split(':') if \
+ 'LIBRARY_PATH' in os.environ else []
+ self._options.library_paths = [l for l in self._options.library_paths
+ if l not in env_LIBRARY_PATH]
+
+ if os.name == 'nt':
+ runtime_path_envvar = ['LIB', 'PATH']
+ else:
+ runtime_path_envvar = ['LIBRARY_PATH']
+ for envvar in runtime_path_envvar:
+ if envvar in os.environ:
+ os.environ[envvar] = \
+ os.pathsep.join(this_L + [os.environ[envvar]])
+ else:
+ os.environ[envvar] = os.pathsep.join(this_L)
+ os.environ[envvar] = os.pathsep.join \
+ (list (set().union (os.environ[envvar].split(':'), this_L))) \
+ if envvar in os.environ else os.pathsep.join(this_L)

if not self._options.external_library:
self._compiler.get_internal_link_flags(args,
Expand Down

0 comments on commit 53c663e

Please sign in to comment.