Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 62 additions & 5 deletions enginePlugin/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,67 @@ resynthesizer_sources = [

# define dependencies on libraries

# libgimp, the API to gimp.
# Need headers i.e. include file libgimp.h
# If fails, try install a dev package such as "gimp-3.0-dev"
# version 2.99 is the beta for v3.0
gimp_dep = dependency('gimp-3.0', version : '>=2.99.0')
mac_gimp_app = get_option('mac-gimp-app')
if mac_gimp_app == ''
# libgimp, the API to gimp.
# Need headers i.e. include file libgimp.h
# If fails, try install a dev package such as "gimp-3.0-dev"
# version 2.99 is the beta for v3.0
gimp_dep = dependency('gimp-3.0', version : '>=2.99.0')
gimp_rpath = {}
else
# On macOS, we'll grab the shared libraries from the GIMP App.
gimp_inc_dir = get_option('gimp-source-dir')
if gimp_inc_dir == ''
error('Missing reqired option for macOS: gimp-source_dir')
endif

# The dependencies of libgimp-3.0, either Homebrew or MacPorts should work.
# These are only needed as header file dependencies of <libgimp/gimp.h>.
_babl_includes = dependency('babl-0.1').partial_dependency(compile_args: true)
_gegl_includes = dependency('gegl-0.4').partial_dependency(compile_args: true)
_cairo_includes = dependency('cairo').partial_dependency(compile_args: true)
_gexiv_includes = dependency('gexiv2').partial_dependency(compile_args: true)
_pango_includes = dependency('pango').partial_dependency(compile_args: true)
_pixbuf_includes = dependency('gdk-pixbuf-2.0').partial_dependency(compile_args: true)

gimp_inc = include_directories(gimp_inc_dir)
gimp_dep = declare_dependency(
include_directories: [
gimp_inc,
],
dependencies: [
cc.find_library(
'gimp-3.0',
dirs : [mac_dylib_path],
has_headers : ['libgimp/gimp.h', 'libgimpbase/gimpversion.h'],
header_include_directories : [gimp_inc],
required: true),

# The following libraries from GIMP.app must be mentioned explicitly
# to the linker, which can't follow transitive dependencies just by
# looking at libgimp-3.0.dylib.
glib_dep,
cc.find_library('gobject-2.0', dirs: [mac_dylib_path], required: true),
cc.find_library('gegl-0.4', dirs: [mac_dylib_path], required: true),
cc.find_library('babl-0.1', dirs: [mac_dylib_path], required: true),
cc.find_library('intl', dirs: [mac_dylib_path], required: true),

# The include paths.
_babl_includes,
_gegl_includes,
_cairo_includes,
_gexiv_includes,
_pango_includes,
_pixbuf_includes,
],
)
mac_rpath = mac_gimp_app / 'Contents/Resources'
gimp_rpath = {
'build_rpath': mac_rpath,
'install_rpath': mac_rpath,
}
endif

# resynthesizer engine plugin calls (depends on)
# the resynthesizer engine library (libresynthesizer).
Expand All @@ -55,4 +111,5 @@ executable(plugin_name,
include_directories: resynthesizer_inc,
install: true,
install_dir: gimpplugindir / plugin_name,
kwargs: gimp_rpath,
)
26 changes: 26 additions & 0 deletions lib/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,32 @@ math_dep = cc.find_library('m', required : false)
if get_option('synth-use-glib')
# Might work with earlier versions, choosing 2.54 somewhat
glib_dep = dependency('glib-2.0', version : '>=2.54.0')

mac_gimp_app = get_option('mac-gimp-app')
if mac_gimp_app != ''
# On macOS, we'll use the shared library from the GIMP App and
# keep only the headers from the glib_dep we just found.
mac_dylib_path = mac_gimp_app / 'Contents/Resources/lib'
glib_dep = declare_dependency(
compile_args: [
# Current versions of GIMP.app use glib 2.78. If the headers we find
# are for version >= 2.80, the G_DEFINE_TYPE macro uses a g_once_init
# symbol that isn't available in GIMP.app's glib-2.0.dylib.
# Here, we limit this to 2.54 <= version <= 2.79.
# The value is defined in glib/gversionmacros.h as:
#
# ((major << 16) | (minor << 8))
#
# The 2.54 lower bound comes from the depencency() call, above.
'-DGLIB_VERSION_MIN_REQUIRED=0x23600',
'-DGLIB_VERSION_MAX_ALLOWED=0x24f00',
],
dependencies: [
glib_dep.partial_dependency(compile_args: true),
cc.find_library('glib-2.0', dirs: [mac_dylib_path], required: true),
],
)
endif
else
glib_dep = dependency('', required: false)
libresynthesizer_sources += 'glibProxy.c'
Expand Down
5 changes: 4 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,10 @@ resynthesizer_inc = include_directories('lib')
# TODO this is platform specific, for Ubuntu
# TODO should install to user specific location (customizations) ???
# define the location to install gimp plugins.
gimpplugindir = prefix / get_option('libdir') / 'gimp/3.0/plug-ins'
gimpplugindir = get_option('gimp-plugin-dir')
if gimpplugindir == ''
gimpplugindir = prefix / get_option('libdir') / 'gimp/3.0/plug-ins'
endif



Expand Down
16 changes: 15 additions & 1 deletion meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,20 @@
# But that file is not in the source.
# And then the source optionally compiles using e.g. "#ifdef SYNTH_THREADED"

# Option to set the plugin install path. If not set, these wil go into
# prefix / libdir / 'gimp/3.0/plug-ins'
option('gimp-plugin-dir', type : 'string', value : '')

# Option to set the search path for GIMP include files.
# Use this to point at a GIMP source checkout to get
# headers if you don't have a standalone libgimp-3.0 package.
# This option is required on macOS, along with mac-gimp-app.
option('gimp-source-dir', type : 'string', value : '')

# macOS: Option to point at the installed GIMP App, which contains all
# the dynamic libraries required by this plugin.
# Usually /Applications/GIMP.app
option('mac-gimp-app', type : 'string', value : '')


# Option to install translations.
Expand Down Expand Up @@ -96,4 +110,4 @@ option('synth-animate', type : 'boolean', value : false)
# that displaying progress is not useful?
# But shallow progress is not very useful since the first pass takes most of the time.

option('synth-deep-progress', type : 'boolean', value : false)
option('synth-deep-progress', type : 'boolean', value : false)