# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 PortSystem 1.0 PortGroup active_variants 1.1 name gtk-osx-application conflicts ige-mac-integration set my_name gtk-mac-integration version 3.0.1 revision 2 categories devel platforms darwin license LGPL-2.1 maintainers {mascguy @mascguy} openmaintainer description Mac OS X menu bar integration library for GTK2 quartz long_description \ A simple library whose purpose is to \ allow GTK quartz applications to integrate with \ the Mac OS X menu bar. Requires gtk2 or gtk3 and its \ dependencies to be built with variant +quartz homepage https://wiki.gnome.org/Projects/GTK%2B/OSX/Integration set branch [join [lrange [split ${version} .] 0 1] .] master_sites gnome:sources/gtk-mac-integration/${branch}/ distname ${my_name}-${version} use_xz yes # sha256 from upstream, rmd160 computed locally checksums sha256 f19e35bc4534963127bbe629b9b3ccb9677ef012fc7f8e97fd5e890873ceb22d \ rmd160 50b403a4fa0216f87fc462b775dacd4a366935df \ size 349228 # Avoid crash when non-UTF-8 locale is set: # https://trac.macports.org/ticket/65474 # Fix merged by upstream via: # https://gitlab.gnome.org/GNOME/gtk-mac-integration/-/merge_requests/6 patchfiles-append patch-locale-gettext.diff depends_build port:pkgconfig proc gtk_version {ver} { global gtk_version subport_dir set gtk_version ${ver} set subport_dir gtkmacintegration-${gtk_version} } gtk_version gtk2 pre-configure { if {${name} eq ${subport}} { ui_error " The gtk-osx-application port has been replaced by 'gtk-osx-application-gtk2' and 'gtk-osx-application-gtk3'. Please `sudo port deactivate gtk-osx-application` followed by `sudo port upgrade -u outdated` or another command to update. Then if all works as intended `sudo port uninstall gtk-osx-application` " return -code error } if {![active_variants $gtk_version quartz ""]} { ui_error " ${subport} is meant to be used only in a GTK quartz development environment but your version of GTK does not support quartz. Please make sure that port $gtk_version and all its dependencies are built with variants +quartz and try again. " error "$gtk_version +quartz not installed." } } configure.ccache no subport ${name}-gtk3 { gtk_version gtk3 depends_lib-append \ path:lib/pkgconfig/gtk+-3.0.pc:gtk3 \ path:include/${subport_dir}/gtkmacintegration/gtk-mac-bundle.h:gtk-osx-application-common-gtk3 # force gtk version configure.args-append \ --with-gtk3 \ --without-gtk2 configure.args-append \ --enable-python=no post-destroot { delete ${destroot}${prefix}/include delete ${destroot}${prefix}/lib/pkgconfig/gtk-mac-integration.pc delete ${destroot}${prefix}/share/${subport_dir}/locale delete ${destroot}${prefix}/share/${subport_dir}/strings } } subport ${name}-common-gtk3 { gtk_version gtk3 depends_lib-append \ path:lib/pkgconfig/gtk+-3.0.pc:gtk3 # force gtk version configure.args-append \ --with-gtk3 \ --without-gtk2 configure.args-append \ --enable-python=no post-destroot { delete ${destroot}${prefix}/lib delete ${destroot}${prefix}/share/${subport_dir}/gir-1.0 } } subport ${name}-gtk2 { gtk_version gtk2 depends_lib-append \ path:lib/pkgconfig/gtk+-2.0.pc:gtk2 \ path:include/${subport_dir}/gtkmacintegration/gtk-mac-bundle.h:gtk-osx-application-common-gtk2 # force gtk version configure.args-append \ --with-gtk2 \ --without-gtk3 \ --disable-introspection configure.args-append \ --enable-python=no post-destroot { delete ${destroot}${prefix}/include delete ${destroot}${prefix}/lib/pkgconfig/gtk-mac-integration.pc delete ${destroot}${prefix}/share/${subport_dir}/locale delete ${destroot}${prefix}/share/${subport_dir}/strings } } subport ${name}-common-gtk2 { gtk_version gtk2 depends_lib-append \ path:lib/pkgconfig/gtk+-2.0.pc:gtk2 # force gtk version configure.args-append \ --with-gtk2 \ --without-gtk3 \ --disable-introspection configure.args-append \ --enable-python=no post-destroot { delete ${destroot}${prefix}/lib } } # NOTE: This must be done after all subport declarations, as we're dependent on value of 'subport_dir' configure.cmd-append \ --includedir=${prefix}/include/${subport_dir} \ --libdir=${prefix}/lib/${subport_dir} \ --datarootdir=${prefix}/share/${subport_dir} \ --with-pkgconfigdir=${prefix}/lib/pkgconfig livecheck.type gnome livecheck.name ${my_name}