I think that by default MAC dependencies should not be checked on non-MAC systems. ```console + export ASMFLAGS CFLAGS CXXFLAGS FFLAGS FCFLAGS LDFLAGS VALAFLAGS CC CXX FC AR NM RANLIB RUSTFLAGS VALAFLAGS + /usr/bin/meson setup --buildtype=plain --prefix=/usr --libdir=/usr/lib64 --libexecdir=/usr/libexec --bindir=/usr/bin --sbindir=/usr/sbin --includedir=/usr/include --datadir=/usr/share --m The Meson build system Version: 1.2.3 Source dir: /home/tkloczko/rpmbuild/BUILD/geany-2.0.0 Build dir: /home/tkloczko/rpmbuild/BUILD/geany-2.0.0/x86_64-redhat-linux-gnu Build type: native build Project name: geany Project version: 2.0.0 C compiler for the host machine: /usr/bin/gcc (gcc 13.2.1 "gcc (GCC) 13.2.1 20231011 (Red Hat 13.2.1-4)") C linker for the host machine: /usr/bin/gcc ld.bfd 2.41-7 C++ compiler for the host machine: /usr/bin/g++ (gcc 13.2.1 "g++ (GCC) 13.2.1 20231011 (Red Hat 13.2.1-4)") C++ linker for the host machine: /usr/bin/g++ ld.bfd 2.41-7 Host machine cpu family: x86_64 Host machine cpu: x86_64 Found pkg-config: /usr/bin/pkg-config (2.0.3) Run-time dependency glib-2.0 found: YES 2.78.0 Run-time dependency gmodule-2.0 found: YES 2.78.0 Run-time dependency gtk+-3.0 found: YES 3.24.38 Did not find CMake 'cmake' Found CMake: NO Run-time dependency gtk-mac-integration found: NO (tried pkgconfig)
meson.build:26:22: ERROR: Dependency "gtk-mac-integration" not found, tried pkgconfig
A full log can be found at /home/tkloczko/rpmbuild/BUILD/geany-2.0.0/x86_64-redhat-linux-gnu/meson-logs/meson-log.txt ```
This appears as if you explicitly enabled it somehow using `-Dmac-integration=enabled` or `auto_features=enabled`.
What is the last `--m` option? I have only meson 1.0.1 and this one is unrecognised.
It was `--mandir=/usr/share/man` ```console + /usr/bin/meson setup --buildtype=plain --prefix=/usr --libdir=/usr/lib64 --libexecdir=/usr/libexec --bindir=/usr/bin --sbindir=/usr/sbin --includedir=/usr/include --datadir=/usr/share --mandir=/usr/share/man --infodir=/usr/share/info --localedir=/usr/share/locale --sysconfdir=/etc --localstatedir=/var --sharedstatedir=/var/lib --wrap-mode=nodownload --auto-features=enabled . x86_64-redhat-linux-gnu -D api-docs=enabled -D gtkdoc=true -D html-docs=enabled -D pdf-docs=disabled -D plugins=true -D socket=true -D vte=true The Meson build system Version: 1.2.3 Source dir: /home/tkloczko/rpmbuild/BUILD/geany-2.0.0 Build dir: /home/tkloczko/rpmbuild/BUILD/geany-2.0.0/x86_64-redhat-linux-gnu Build type: native build Project name: geany Project version: 2.0.0 C compiler for the host machine: /usr/bin/gcc (gcc 13.2.1 "gcc (GCC) 13.2.1 20231011 (Red Hat 13.2.1-4)") C linker for the host machine: /usr/bin/gcc ld.bfd 2.41-7 C++ compiler for the host machine: /usr/bin/g++ (gcc 13.2.1 "g++ (GCC) 13.2.1 20231011 (Red Hat 13.2.1-4)") C++ linker for the host machine: /usr/bin/g++ ld.bfd 2.41-7 Host machine cpu family: x86_64 Host machine cpu: x86_64 Found pkg-config: /usr/bin/pkg-config (2.0.3) Run-time dependency glib-2.0 found: YES 2.78.0 Run-time dependency gmodule-2.0 found: YES 2.78.0 Run-time dependency gtk+-3.0 found: YES 3.24.38 Did not find CMake 'cmake' Found CMake: NO Run-time dependency gtk-mac-integration found: NO (tried pkgconfig) ``` Even with `--auto-features=enabled` MAC related things should be only checked on MAC.
Even with `--auto-features=enabled` MAC related things should be only checked on MAC.
Sounds reasonable to me; and `--auto-features=enabled` seems useful to make sure a (potentially new) dependency is not missed.
Would something like this work? ```diff diff --git a/meson.build b/meson.build index 5c7bc0a04..e5b55aebe 100644 --- a/meson.build +++ b/meson.build @@ -23,9 +23,6 @@ foreach dep : deps_in deps_for_pc += ' ' + dep[0] + ' >= ' + dep[1] endforeach
-dep_mac_integration = dependency('gtk-mac-integration', version: '>= 3.0.1', - required: get_option('mac-integration')) - glib = deps[0]
# detect libc @@ -741,6 +738,17 @@ if (host_machine.system() == 'windows') endforeach endif
+osx_src = [] +osx_deps = [] +if host_machine.system() == 'darwin' + dep_mac_integration = dependency('gtk-mac-integration', version: '>= 3.0.1', + required: get_option('mac-integration')) + if dep_mac_integration.found() + osx_src += ['src/osx.c', 'src/osx.h'] + osx_deps += [dep_mac_integration] + endif +endif + install_headers( 'plugins/geanyfunctions.h', 'plugins/geanyplugin.h', @@ -857,12 +865,12 @@ libgeany = shared_library('geany', 'src/utils.h', gen_src, win_src, - dep_mac_integration.found() ? ['src/osx.c', 'src/osx.h'] : [], + osx_src, host_machine.system() == 'windows' ? ['src/win32.c', 'src/win32.h'] : [ 'src/vte.c', 'src/vte.h' ], soversion: '0', c_args: geany_cflags + [ '-DG_LOG_DOMAIN="Geany"' ], include_directories: [iscintilla], - dependencies: [dep_tagmanager, dep_ctags, dep_scintilla, dep_mac_integration] + deps + win_deps, + dependencies: [dep_tagmanager, dep_ctags, dep_scintilla] + deps + win_deps + osx_deps, install: true ) dep_libgeany = declare_dependency( ```
@b4n Thanks! Just tested and it fixes the problem on linux and does the right thing on macOS too. So I think you can just commit the patch to master.
Closed #3649 as completed via fb202dc583a9deefa3c17046fd7d5ad23c21e180.
@techee thanks for the test! Committed, as well as 2 additional small improvements, that nobody else tested, so I have a chance to have introduced a big stupid error :smile:
github-comments@lists.geany.org