diff --git a/Build-Scripts/gen-dependencies.sh b/Build-Scripts/gen-dependencies.sh new file mode 100755 index 0000000..e282762 --- /dev/null +++ b/Build-Scripts/gen-dependencies.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash + +HOMEBREW_BIN="${HOMEBREW_ROOT:-/opt/homebrew}/bin" +if [ -d "$HOMEBREW_BIN" ] ; then + PATH="$HOMEBREW_BIN:$PATH" + export PATH +else + echo "warning: $HOMEBREW_BIN doesn't exist. This build will likely fail." + echo "warning: If homebrew is installed elsewhere, set the HOMEBREW_ROOT environment variable." +fi + +PACKAGES="pidgin gtk-mac-integration-gtk2" +PIDGIN_PATH="$(pkg-config pidgin --variable=prefix)/bin/pidgin" +OTHER_CFLAGS="$(pkg-config $PACKAGES --cflags-only-other)" +OTHER_LDFLAGS="$(pkg-config $PACKAGES --libs-only-l) -bundle_loader ${PIDGIN_PATH}" +HEADER_SEARCH_PATHS="$(pkg-config $PACKAGES --cflags-only-I | sed 's/^-I//g;s/ -I/ /g')" +LIBRARY_SEARCH_PATHS="$(pkg-config $PACKAGES --libs-only-L | sed 's/^-L//g;s/ -L/ /g')" + +cat < "${PROJECT_DIR}/Dependencies.xcconfig" +// With Homebrew path = ${HOMEBREW_BIN} +OTHER_CFLAGS = \$(inherited) ${OTHER_CFLAGS} +OTHER_LDFLAGS = \$(inherited) ${OTHER_LDFLAGS} +HEADER_SEARCH_PATHS = \$(inherited) ${HEADER_SEARCH_PATHS} +LIBRARY_SEARCH_PATHS = \$(inherited) ${LIBRARY_SEARCH_PATHS} +EOF + diff --git a/Dependencies.xcconfig b/Dependencies.xcconfig new file mode 100644 index 0000000..e69de29 diff --git a/PidginMacOSIntegration-Bridging-Header.h b/PidginMacOSIntegration-Bridging-Header.h index d5b18ad..fc86cd1 100644 --- a/PidginMacOSIntegration-Bridging-Header.h +++ b/PidginMacOSIntegration-Bridging-Header.h @@ -9,13 +9,13 @@ #import // Pidgin -#import -#import -#import -#import -#import -#import -#import +#import +#import +#import +#import +#import +#import +#import // Purple #import @@ -28,6 +28,4 @@ #import "PluginLoad.h" #import "Log.h" #import "Menu.h" -#import "GtkTree.h" -#import "GtkWindow.h" #import "PidginImage.h" diff --git a/PidginMacOSIntegration.xcodeproj/project.pbxproj b/PidginMacOSIntegration.xcodeproj/project.pbxproj index 9faed81..db4e885 100644 --- a/PidginMacOSIntegration.xcodeproj/project.pbxproj +++ b/PidginMacOSIntegration.xcodeproj/project.pbxproj @@ -35,6 +35,7 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 9DFC539927488134005F0927 /* Dependencies.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Dependencies.xcconfig; sourceTree = ""; }; DF0215C824D1F2A100B1437C /* Menu.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Menu.swift; sourceTree = ""; }; DF05113E212621A000B993BA /* PluginLoad.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PluginLoad.h; sourceTree = ""; }; DF32486824CF59CE003E4F23 /* Log.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Log.m; sourceTree = ""; }; @@ -50,27 +51,6 @@ DF496AEA211E76020059EE2C /* Main.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Main.h; sourceTree = ""; }; DF496AEB211E76020059EE2C /* Main.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = Main.c; sourceTree = ""; }; DFAB7D9824D0B24600BED1F9 /* Callback.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Callback.swift; sourceTree = ""; }; - DFD69E6F2126633300532B79 /* sendbutton.so */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.bundle"; name = sendbutton.so; path = ../../../../../usr/local/Cellar/pidgin/2.13.0_2/lib/pidgin/sendbutton.so; sourceTree = ""; }; - DFD69E702126633300532B79 /* history.so */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.bundle"; name = history.so; path = ../../../../../usr/local/Cellar/pidgin/2.13.0_2/lib/pidgin/history.so; sourceTree = ""; }; - DFD69E712126633300532B79 /* relnot.so */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.bundle"; name = relnot.so; path = ../../../../../usr/local/Cellar/pidgin/2.13.0_2/lib/pidgin/relnot.so; sourceTree = ""; }; - DFD69E722126633300532B79 /* themeedit.so */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.bundle"; name = themeedit.so; path = ../../../../../usr/local/Cellar/pidgin/2.13.0_2/lib/pidgin/themeedit.so; sourceTree = ""; }; - DFD69E732126633300532B79 /* notify.so */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.bundle"; name = notify.so; path = ../../../../../usr/local/Cellar/pidgin/2.13.0_2/lib/pidgin/notify.so; sourceTree = ""; }; - DFD69E742126633300532B79 /* convcolors.so */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.bundle"; name = convcolors.so; path = ../../../../../usr/local/Cellar/pidgin/2.13.0_2/lib/pidgin/convcolors.so; sourceTree = ""; }; - DFD69E752126633300532B79 /* markerline.so */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.bundle"; name = markerline.so; path = ../../../../../usr/local/Cellar/pidgin/2.13.0_2/lib/pidgin/markerline.so; sourceTree = ""; }; - DFD69E762126633300532B79 /* gtkbuddynote.so */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.bundle"; name = gtkbuddynote.so; path = ../../../../../usr/local/Cellar/pidgin/2.13.0_2/lib/pidgin/gtkbuddynote.so; sourceTree = ""; }; - DFD69E772126633300532B79 /* timestamp_format.so */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.bundle"; name = timestamp_format.so; path = ../../../../../usr/local/Cellar/pidgin/2.13.0_2/lib/pidgin/timestamp_format.so; sourceTree = ""; }; - DFD69E782126633300532B79 /* xmppdisco.so */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.bundle"; name = xmppdisco.so; path = ../../../../../usr/local/Cellar/pidgin/2.13.0_2/lib/pidgin/xmppdisco.so; sourceTree = ""; }; - DFD69E792126633300532B79 /* iconaway.so */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.bundle"; name = iconaway.so; path = ../../../../../usr/local/Cellar/pidgin/2.13.0_2/lib/pidgin/iconaway.so; sourceTree = ""; }; - DFD69E7A2126633300532B79 /* extplacement.so */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.bundle"; name = extplacement.so; path = ../../../../../usr/local/Cellar/pidgin/2.13.0_2/lib/pidgin/extplacement.so; sourceTree = ""; }; - DFD69E7B2126633300532B79 /* spellchk.so */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.bundle"; name = spellchk.so; path = ../../../../../usr/local/Cellar/pidgin/2.13.0_2/lib/pidgin/spellchk.so; sourceTree = ""; }; - DFD69E7C2126633300532B79 /* ticker.so */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.bundle"; name = ticker.so; path = ../../../../../usr/local/Cellar/pidgin/2.13.0_2/lib/pidgin/ticker.so; sourceTree = ""; }; - DFD69E7D2126633300532B79 /* pidginrc.so */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.bundle"; name = pidginrc.so; path = ../../../../../usr/local/Cellar/pidgin/2.13.0_2/lib/pidgin/pidginrc.so; sourceTree = ""; }; - DFD69E7E2126633300532B79 /* timestamp.so */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.bundle"; name = timestamp.so; path = ../../../../../usr/local/Cellar/pidgin/2.13.0_2/lib/pidgin/timestamp.so; sourceTree = ""; }; - DFD69E7F2126633300532B79 /* transparency.so */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.bundle"; name = transparency.so; path = ../../../../../usr/local/Cellar/pidgin/2.13.0_2/lib/pidgin/transparency.so; sourceTree = ""; }; - DFD69E802126633300532B79 /* pidgin-otr.so */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.bundle"; name = "pidgin-otr.so"; path = "../../../../../usr/local/Cellar/pidgin/2.13.0_2/lib/pidgin/pidgin-otr.so"; sourceTree = ""; }; - DFD69E812126633300532B79 /* xmppconsole.so */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.bundle"; name = xmppconsole.so; path = ../../../../../usr/local/Cellar/pidgin/2.13.0_2/lib/pidgin/xmppconsole.so; sourceTree = ""; }; - DFD69E95212663A100532B79 /* lib */ = {isa = PBXFileReference; lastKnownFileType = folder; name = lib; path = ../../../../../usr/local/Cellar/pidgin/2.13.0_2/lib; sourceTree = ""; }; - DFD69E972126699A00532B79 /* pidgin */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.executable"; name = pidgin; path = ../../../../../usr/local/Cellar/pidgin/2.13.0_2/bin/pidgin; sourceTree = ""; }; DFE300C1211E5B89000E188E /* PidginMacOSIntegration */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = PidginMacOSIntegration; sourceTree = BUILT_PRODUCTS_DIR; }; DFE300C4211E5B89000E188E /* Plugin.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Plugin.swift; sourceTree = ""; }; DFE300CB211E5BFC000E188E /* PidginMacOSIntegration-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "PidginMacOSIntegration-Bridging-Header.h"; sourceTree = ""; }; @@ -124,27 +104,6 @@ DFD69E6E2126633300532B79 /* Frameworks */ = { isa = PBXGroup; children = ( - DFD69E972126699A00532B79 /* pidgin */, - DFD69E95212663A100532B79 /* lib */, - DFD69E742126633300532B79 /* convcolors.so */, - DFD69E7A2126633300532B79 /* extplacement.so */, - DFD69E762126633300532B79 /* gtkbuddynote.so */, - DFD69E702126633300532B79 /* history.so */, - DFD69E792126633300532B79 /* iconaway.so */, - DFD69E752126633300532B79 /* markerline.so */, - DFD69E732126633300532B79 /* notify.so */, - DFD69E802126633300532B79 /* pidgin-otr.so */, - DFD69E7D2126633300532B79 /* pidginrc.so */, - DFD69E712126633300532B79 /* relnot.so */, - DFD69E6F2126633300532B79 /* sendbutton.so */, - DFD69E7B2126633300532B79 /* spellchk.so */, - DFD69E722126633300532B79 /* themeedit.so */, - DFD69E7C2126633300532B79 /* ticker.so */, - DFD69E772126633300532B79 /* timestamp_format.so */, - DFD69E7E2126633300532B79 /* timestamp.so */, - DFD69E7F2126633300532B79 /* transparency.so */, - DFD69E812126633300532B79 /* xmppconsole.so */, - DFD69E782126633300532B79 /* xmppdisco.so */, ); name = Frameworks; sourceTree = ""; @@ -152,6 +111,7 @@ DFE300B8211E5B89000E188E = { isa = PBXGroup; children = ( + 9DFC539927488134005F0927 /* Dependencies.xcconfig */, DFE300C3211E5B89000E188E /* PidginMacOSItegration */, DFE300C2211E5B89000E188E /* Products */, DFE300CB211E5BFC000E188E /* PidginMacOSIntegration-Bridging-Header.h */, @@ -384,7 +344,9 @@ }; DFE300C9211E5B89000E188E /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 9DFC539927488134005F0927 /* Dependencies.xcconfig */; buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ENABLE_MODULES = YES; CODE_SIGN_STYLE = Automatic; GCC_PREPROCESSOR_DEFINITIONS = ( @@ -394,73 +356,30 @@ "PACKAGE=\\\"pidgin\\\"", "PACKAGE_NAME=\\\"pidgin\\\"", ); - HEADER_SEARCH_PATHS = ""; + HEADER_SEARCH_PATHS = "$(inherited)"; LD_DYLIB_INSTALL_NAME = pidgin_macos_integration; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/../Frameworks", "@loader_path/../Frameworks", ); - LIBRARY_SEARCH_PATHS = ( - "/usr/local/opt/pidgin/lib/**", - /usr/local/opt/glib/lib/, - "/usr/local/opt/gtk-mac-integration/lib/", - "/usr/local/opt/gtk+/lib/", - "/usr/local/opt/cairo/lib/**", - "/usr/local/opt/pango/lib/**", - "/usr/local/opt/gdk-pixbuf/lib/**", - "/usr/local/opt/atk/lib/**", - /usr/local/opt/pidgin/bin, - /usr/local/opt/gettext/lib, - ); + LIBRARY_SEARCH_PATHS = "$(inherited)"; MACH_O_TYPE = mh_bundle; MACOSX_DEPLOYMENT_TARGET = 10.14; - OTHER_LDFLAGS = ( - "-lglib-2.0", - "-lpurple", - "-lgobject-2.0", - "-lgtkmacintegration-gtk2", - "-lcairo-gobject", - "-lgtkmacintegration-gtk2", - "-lgtk-quartz-2.0", - "-lgdk-quartz-2.0", - "-lpangocairo-1.0", - "-lpango-1.0", - "-latk-1.0", - "-lcairo", - "-lgdk_pixbuf-2.0", - "-lgio-2.0", - "-lgobject-2.0", - "-lintl", - "-lglib-2.0", - "-bundle_loader", - /usr/local/bin/pidgin, - ); + OTHER_LDFLAGS = "$(inherited)"; PRODUCT_NAME = "${TARGET_NAME}"; SWIFT_OBJC_BRIDGING_HEADER = "PidginMacOSIntegration-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-O"; SWIFT_VERSION = 5.0; - SYSTEM_HEADER_SEARCH_PATHS = ( - "/usr/local/opt/glib/include/**", - "/usr/local/opt/glib/lib/glib-2.0/include/", - "/usr/local/opt/gtk-mac-integration/include/**", - "/usr/local/opt/gtk+/include/**", - "/usr/local/opt/gtk+/lib/gtk-2.0/include/**", - "/usr/local/opt/cairo/include/**", - "/usr/local/opt/pango/include/**", - "/usr/local/opt/gdk-pixbuf/include/**", - "/usr/local/opt/atk/include/**", - "/usr/local/opt/pidgin/include/**", - /usr/local/opt/gettext/include, - /usr/local/opt/pidgin/include/libpurple/, - "/usr/local/opt/harfbuzz/include/**", - ); + SYSTEM_HEADER_SEARCH_PATHS = ""; }; name = Debug; }; DFE300CA211E5B89000E188E /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 9DFC539927488134005F0927 /* Dependencies.xcconfig */; buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ENABLE_MODULES = YES; CODE_SIGN_STYLE = Automatic; GCC_PREPROCESSOR_DEFINITIONS = ( @@ -470,67 +389,22 @@ "PACKAGE=\\\"pidgin\\\"", "PACKAGE_NAME=\\\"pidgin\\\"", ); - HEADER_SEARCH_PATHS = ""; + HEADER_SEARCH_PATHS = "$(inherited)"; LD_DYLIB_INSTALL_NAME = pidgin_macos_integration; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/../Frameworks", "@loader_path/../Frameworks", ); - LIBRARY_SEARCH_PATHS = ( - "/usr/local/opt/pidgin/lib/**", - /usr/local/opt/glib/lib/, - "/usr/local/opt/gtk-mac-integration/lib/", - "/usr/local/opt/gtk+/lib/", - "/usr/local/opt/cairo/lib/**", - "/usr/local/opt/pango/lib/**", - "/usr/local/opt/gdk-pixbuf/lib/**", - "/usr/local/opt/atk/lib/**", - /usr/local/opt/pidgin/bin, - /usr/local/opt/gettext/lib, - ); + LIBRARY_SEARCH_PATHS = "$(inherited)"; MACH_O_TYPE = mh_bundle; MACOSX_DEPLOYMENT_TARGET = 10.14; ONLY_ACTIVE_ARCH = YES; - OTHER_LDFLAGS = ( - "-lglib-2.0", - "-lpurple", - "-lgobject-2.0", - "-lgtkmacintegration-gtk2", - "-lcairo-gobject", - "-lgtkmacintegration-gtk2", - "-lgtk-quartz-2.0", - "-lgdk-quartz-2.0", - "-lpangocairo-1.0", - "-lpango-1.0", - "-latk-1.0", - "-lcairo", - "-lgdk_pixbuf-2.0", - "-lgio-2.0", - "-lgobject-2.0", - "-lintl", - "-lglib-2.0", - "-bundle_loader", - /usr/local/bin/pidgin, - ); + OTHER_LDFLAGS = "$(inherited)"; PRODUCT_NAME = "${TARGET_NAME}"; SWIFT_OBJC_BRIDGING_HEADER = "PidginMacOSIntegration-Bridging-Header.h"; SWIFT_VERSION = 5.0; - SYSTEM_HEADER_SEARCH_PATHS = ( - "/usr/local/opt/glib/include/**", - "/usr/local/opt/glib/lib/glib-2.0/include/", - "/usr/local/opt/gtk-mac-integration/include/**", - "/usr/local/opt/gtk+/include/**", - "/usr/local/opt/gtk+/lib/gtk-2.0/include/**", - "/usr/local/opt/cairo/include/**", - "/usr/local/opt/pango/include/**", - "/usr/local/opt/gdk-pixbuf/include/**", - "/usr/local/opt/atk/include/**", - "/usr/local/opt/pidgin/include/**", - /usr/local/opt/gettext/include, - /usr/local/opt/pidgin/include/libpurple/, - "/usr/local/opt/harfbuzz/include/**", - ); + SYSTEM_HEADER_SEARCH_PATHS = ""; }; name = Release; };