Skip to content

Commit

Permalink
gobject-introspection: Fix giscanner with setuptools 74
Browse files Browse the repository at this point in the history
  • Loading branch information
christophecvr committed Sep 2, 2024
1 parent f84758b commit 345d300
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 41 deletions.
10 changes: 2 additions & 8 deletions gnome/gobject-introspection-devel/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ conflicts gobject-introspection
set my_name gobject-introspection

version 1.78.1
revision 2
revision 1
epoch 1

categories gnome
Expand Down Expand Up @@ -55,13 +55,7 @@ depends_lib-append \
patchfiles-append patch-fix-rpath-gir-typelib.diff
patchfiles-append patch-fix-scanner-in-build-execution.diff
patchfiles-append patch-fix-tools-python.diff
# required for updated py-setuptools tp ver 74.0.0
# Patch needs to be removed when upgraded version of introspection is used.
# Except one rule of this patch will have to be made with new patch :
# change runtime_path_envvar = ['LD_LIBRARY_PATH', 'DYLD_FALLBACK_LIBRARY_PATH'] if not lib_dirs_envvar else [lib_dirs_envvar]
# To runtime_path_envvar = ['DYLD_LIBRARY_PATH'] if not lib_dirs_envvar else [lib_dirs_envvar]
# https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/490/diffs?commit_id=fcf79ca8d068d2e30a6aefdc42dcc6aeab4655e2
patchfiles-append girscanner-msvc9-removal.patch
patchfiles-append msvccompiler.patch

post-patch {
reinplace "s|libcairo-gobject\\.2\\.dylib|${prefix}/lib/libcairo-gobject.2.dylib|g" ${worksrcpath}/gir/meson.build
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
--- giscanner/ccompiler.py.orig 2023-09-16 13:32:07.000000000 +0200
+++ giscanner/ccompiler.py 2024-09-01 07:54:03.000000000 +0200
giscanner: remove dependency on distutils.msvccompiler

It was removed with setuptools 74.0.0. Since we still depend on the
MSVCCompiler class use new_compiler() to get it some other way.

Remove any reference to MSVC9Compiler, which was for Visual Studio 2008
which we no longer support anyway.

https://gitlab.gnome.org/GNOME/gobject-introspection/-/issues/515
https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/490
--- giscanner/ccompiler.py.orig 2024-09-01 21:06:18.000000000 -0500
+++ giscanner/ccompiler.py 2024-09-01 21:06:19.000000000 -0500
@@ -26,7 +26,6 @@
import sys
import distutils
Expand All @@ -17,15 +27,6 @@
# implementation
from . import msvccompiler
self.compiler = msvccompiler.get_msvc_compiler()
@@ -221,7 +220,7 @@
if os.name == 'nt':
runtime_path_envvar = ['LIB', 'PATH']
else:
- runtime_path_envvar = ['LD_LIBRARY_PATH', 'DYLD_FALLBACK_LIBRARY_PATH'] if not lib_dirs_envvar else [lib_dirs_envvar]
+ runtime_path_envvar = ['DYLD_LIBRARY_PATH'] if not lib_dirs_envvar else [lib_dirs_envvar]
# Search the current directory first
# (This flag is not supported nor needed for Visual C++)
args.append('-L.')
@@ -453,7 +452,7 @@
return self.compiler.linker_exe

Expand All @@ -44,8 +45,8 @@
macro_value = macro_value.replace('\"', '\\\"')
macros.append((macro_name, macro_value))
elif option.startswith('-U'):
--- giscanner/msvccompiler.py.orig 2023-09-16 13:32:07.000000000 +0200
+++ giscanner/msvccompiler.py 2024-09-01 07:13:42.000000000 +0200
--- giscanner/msvccompiler.py.orig 2023-09-16 06:32:07.000000000 -0500
+++ giscanner/msvccompiler.py 2024-09-01 21:07:08.000000000 -0500
@@ -19,30 +19,30 @@
#

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
--- giscanner/ccompiler.py.orig
+++ giscanner/ccompiler.py
@@ -184,7 +184,7 @@
if os.name == 'nt':
runtime_path_envvar = ['LIB', 'PATH']
else:
- runtime_path_envvar = ['LD_LIBRARY_PATH', 'DYLD_FALLBACK_LIBRARY_PATH'] if not lib_dirs_envvar else [lib_dirs_envvar]
+ runtime_path_envvar = ['DYLD_LIBRARY_PATH'] if not lib_dirs_envvar else [lib_dirs_envvar]
# Search the current directory first
# (This flag is not supported nor needed for Visual C++)
args.append('-L.')
--- giscanner/dumper.py.orig
+++ giscanner/dumper.py
@@ -236,8 +236,28 @@
Expand Down
8 changes: 1 addition & 7 deletions gnome/gobject-introspection/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,7 @@ depends_lib-append \
patchfiles-append patch-fix-rpath-gir-typelib.diff
patchfiles-append patch-fix-scanner-in-build-execution.diff
patchfiles-append patch-fix-tools-python.diff
# required for updated py-setuptools tp ver 74.0.0
# Patch needs to be removed when upgraded version of introspection is used.
# Except one rule of this patch will have to be made with new patch :
# change runtime_path_envvar = ['LD_LIBRARY_PATH', 'DYLD_FALLBACK_LIBRARY_PATH'] if not lib_dirs_envvar else [lib_dirs_envvar]
# To runtime_path_envvar = ['DYLD_LIBRARY_PATH'] if not lib_dirs_envvar else [lib_dirs_envvar]
# https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/490/diffs?commit_id=fcf79ca8d068d2e30a6aefdc42dcc6aeab4655e2
patchfiles-append girscanner-msvc9-removal.patch
patchfiles-append msvccompiler.patch

post-patch {
reinplace "s|libcairo-gobject\\.2\\.dylib|${prefix}/lib/libcairo-gobject.2.dylib|g" ${worksrcpath}/gir/meson.build
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
--- giscanner/ccompiler.py.orig 2023-09-16 13:32:07.000000000 +0200
+++ giscanner/ccompiler.py 2024-09-01 07:54:03.000000000 +0200
giscanner: remove dependency on distutils.msvccompiler

It was removed with setuptools 74.0.0. Since we still depend on the
MSVCCompiler class use new_compiler() to get it some other way.

Remove any reference to MSVC9Compiler, which was for Visual Studio 2008
which we no longer support anyway.

https://gitlab.gnome.org/GNOME/gobject-introspection/-/issues/515
https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/490
--- giscanner/ccompiler.py.orig 2024-09-01 21:06:18.000000000 -0500
+++ giscanner/ccompiler.py 2024-09-01 21:06:19.000000000 -0500
@@ -26,7 +26,6 @@
import sys
import distutils
Expand All @@ -17,15 +27,6 @@
# implementation
from . import msvccompiler
self.compiler = msvccompiler.get_msvc_compiler()
@@ -221,7 +220,7 @@
if os.name == 'nt':
runtime_path_envvar = ['LIB', 'PATH']
else:
- runtime_path_envvar = ['LD_LIBRARY_PATH', 'DYLD_FALLBACK_LIBRARY_PATH'] if not lib_dirs_envvar else [lib_dirs_envvar]
+ runtime_path_envvar = ['DYLD_LIBRARY_PATH'] if not lib_dirs_envvar else [lib_dirs_envvar]
# Search the current directory first
# (This flag is not supported nor needed for Visual C++)
args.append('-L.')
@@ -453,7 +452,7 @@
return self.compiler.linker_exe

Expand All @@ -44,8 +45,8 @@
macro_value = macro_value.replace('\"', '\\\"')
macros.append((macro_name, macro_value))
elif option.startswith('-U'):
--- giscanner/msvccompiler.py.orig 2023-09-16 13:32:07.000000000 +0200
+++ giscanner/msvccompiler.py 2024-09-01 07:13:42.000000000 +0200
--- giscanner/msvccompiler.py.orig 2023-09-16 06:32:07.000000000 -0500
+++ giscanner/msvccompiler.py 2024-09-01 21:07:08.000000000 -0500
@@ -19,30 +19,30 @@
#

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
--- giscanner/ccompiler.py.orig
+++ giscanner/ccompiler.py
@@ -184,7 +184,7 @@
if os.name == 'nt':
runtime_path_envvar = ['LIB', 'PATH']
else:
- runtime_path_envvar = ['LD_LIBRARY_PATH', 'DYLD_FALLBACK_LIBRARY_PATH'] if not lib_dirs_envvar else [lib_dirs_envvar]
+ runtime_path_envvar = ['DYLD_LIBRARY_PATH'] if not lib_dirs_envvar else [lib_dirs_envvar]
# Search the current directory first
# (This flag is not supported nor needed for Visual C++)
args.append('-L.')
--- giscanner/dumper.py.orig
+++ giscanner/dumper.py
@@ -236,8 +236,28 @@
Expand Down

0 comments on commit 345d300

Please sign in to comment.