1
0
mirror of https://github.com/irssi/irssi.git synced 2024-06-16 06:25:24 +00:00

refactor glib install

This commit is contained in:
Ailin Nemui 2019-07-10 14:00:37 +02:00
parent 9a93e71474
commit 905bf86921
5 changed files with 54 additions and 12 deletions

View File

@ -6,6 +6,7 @@ project('irssi', 'c',
############################
############################
glib_internal_version = 'glib-2.58.3' # keep this in sync with subprojects/glib.wrap
cc = meson.get_compiler('c')
rootinc = include_directories('.')
dep = []
@ -145,11 +146,53 @@ message('*** On Redhat: dnf install glib2-devel')
glib_dep = dependency('glib-2.0', version : '>=2.58', required : not want_glib_internal)
if not glib_dep.found()
glib_internal = true
glib_proj = subproject('glib', default_options : [
'libmount=false',
])
glib_dep = glib_proj.get_variable('libglib_dep')
gmodule_dep = glib_proj.get_variable('libgmodule_dep')
meson_cmd = find_program('meson')
ninja = find_program('ninja')
glib_internal_download_t = custom_target('glib-internal-download',
command : [ meson_cmd, 'subprojects', 'download', 'glib', '--sourcedir', meson.current_source_dir() ],
console : true,
output : ['glib-internal-download'],
)
glib_internal_configure_t = custom_target('glib-internal-configure',
command : [ meson_cmd, 'setup', '--prefix=/irssi-glib-internal',
'--buildtype=' + get_option('buildtype'),
'-Dlibmount=false', '-Dselinux=false', '-Ddefault_library=static', '-Dinternal_pcre=true',
(meson.current_build_dir() / 'build-subprojects' / 'glib'),
(meson.current_source_dir() / 'subprojects' / glib_internal_version) ],
console : true,
output : ['glib-internal-configure'],
depends : glib_internal_download_t,)
glib_internal_build_t = custom_target('glib-internal-build',
command : [ ninja, '-C', meson.current_build_dir() / 'build-subprojects' / 'glib',
'glib' / 'libglib-2.0.a',
'gmodule' / 'libgmodule-2.0.a'],
console : true,
output : ['glib-internal-build'],
depends : glib_internal_configure_t,)
glib_dep = declare_dependency(
dependencies : [
dependency('threads'),
],
sources : glib_internal_build_t,
compile_args : [
'-I' + (meson.current_source_dir() / 'subprojects' / glib_internal_version / 'glib'),
'-I' + (meson.current_source_dir() / 'subprojects' / glib_internal_version),
'-I' + (meson.current_build_dir() / 'build-subprojects' / 'glib' / 'glib'),
],
link_args : [ meson.current_build_dir() / 'build-subprojects' / 'glib' / 'glib' / 'libglib-2.0.a' ],
)
libdl_dep = []
prov_lib = cc.find_library('dl', required : false)
if prov_lib.found() and cc.has_function('dlopen', dependencies : prov_lib)
libdl_dep += prov_lib
endif
gmodule_dep = declare_dependency(sources : glib_internal_build_t,
dependencies : libdl_dep,
compile_args : [
'-I' + (meson.current_source_dir() / 'subprojects' / glib_internal_version / 'gmodule'),
],
link_args : [ meson.current_build_dir() / 'build-subprojects' / 'glib' / 'gmodule' / 'libgmodule-2.0.a' ],
)
else
gmodule_dep = dependency('gmodule-2.0')
endif

View File

@ -1,4 +1,6 @@
[wrap-git]
directory = glib
url = https://github.com/GNOME/glib
revision = glib-2-60
[wrap-file]
# make sure to update the glib_internal_version in meson.build
directory = glib-2.58.3
source_url = https://download.gnome.org/sources/glib/2.58/glib-2.58.3.tar.xz
source_filename = glib-2.58.3.tar.xz
source_hash = 8f43c31767e88a25da72b52a40f3301fefc49a665b56dc10ee7cc9565cbe7481

View File

@ -1 +0,0 @@
glib/subprojects/libffi.wrap

View File

@ -1 +0,0 @@
glib/subprojects/proxy-libintl.wrap

View File

@ -1 +0,0 @@
glib/subprojects/zlib.wrap