meson build system

Test Plan: compilation

Reviewers: raster, devilhorns

Differential Revision: https://phab.enlightenment.org/D12238
master
Vincent Torri 3 years ago committed by Carsten Haitzler (Rasterman)
parent dd0f6e5351
commit 0674d038f5
  1. 10
      data/desktop/meson.build
  2. 31
      data/fonts/meson.build
  3. 5
      data/images/meson.build
  4. 23
      data/themes/meson.build
  5. 148
      meson.build
  6. 6
      meson_options.txt
  7. 53
      src/bin/meson.build
  8. 49
      src/lib/meson.build

@ -0,0 +1,10 @@
install_data(
sources : 'express.desktop',
install_dir : join_paths(dir_data, 'applications')
)
install_data(
sources : 'express.png',
install_dir : join_paths(dir_data, 'icons')
)

@ -0,0 +1,31 @@
font_files = [
'10x20.pcf',
'4x6.pcf',
'5x7.pcf',
'5x8.pcf',
'6x10.pcf',
'6x12.pcf',
'6x13.pcf',
'6x9.pcf',
'7x13.pcf',
'7x14.pcf',
'8x13.pcf',
'9x15.pcf',
'9x18.pcf',
'nexus.pcf',
'terminus-12.pcf',
'terminus-14-bold.pcf',
'terminus-14.pcf',
'terminus-16-bold.pcf',
'terminus-16.pcf',
'terminus-18-bold.pcf',
'terminus-18.pcf',
'terminus-20-bold.pcf',
'terminus-20.pcf'
]
install_data(
sources : font_files,
install_dir : join_paths(dir_pkgdata, 'fonts')
)

@ -0,0 +1,5 @@
install_data(
sources : 'operator.png',
install_dir : join_paths(dir_pkgdata, 'images')
)

@ -0,0 +1,23 @@
edc_files = [
'default.edc'
]
express_themes = []
_edje_cc = find_program('edje_cc', native: true)
edje_cc_exe = [_edje_cc]
foreach edc_file : edc_files
express_themes += custom_target('edje_cc_' + edc_file,
input : edc_file,
depfile: '@BASENAME@.edj.d',
output : '@BASENAME@.edj',
command : edje_cc_exe + [ '-beta', '-fastcomp',
'-sd', join_paths(meson.current_source_dir(), 'sounds'),
'-id', join_paths(meson.current_source_dir(), 'images'),
'@INPUT@', '@OUTPUT@'],
install : true,
install_dir : join_paths(dir_pkgdata, 'themes'),
)
endforeach

@ -0,0 +1,148 @@
project('express', 'c',
version : '0.0.2',
meson_version : '>= 0.53',
default_options : [
'warning_level=2',
'buildtype=debugoptimized'
]
)
v_array = meson.project_version().split('.')
v_maj = v_array[0]
v_min = v_array[1]
v_mic = v_array[2]
# install paths
dir_prefix = get_option('prefix')
dir_include = join_paths(dir_prefix, get_option('includedir'))
dir_pkginclude = join_paths(dir_include, meson.project_name())
dir_bin = join_paths(dir_prefix, get_option('bindir'))
dir_lib = join_paths(dir_prefix, get_option('libdir'))
dir_data = join_paths(dir_prefix, get_option('datadir'))
dir_pkgdata = join_paths(dir_data, meson.project_name())
dir_locale = join_paths(dir_prefix, get_option('localedir'))
# host
host_os = host_machine.system()
# binaries
cc = meson.get_compiler('c')
express_cflags = []
express_cflags_try = [
'-fvisibility=hidden',
'-fdata-sections',
'-ffunction-sections',
'-fno-strict-aliasing',
'-Wl,--gc-sections',
'-Wl,--as-needed',
'-Wl,--no-copy-dt-needed-entries',
'-Wshadow',
'-Wstrict-prototypes',
'-Werror=missing-prototypes',
'-Werror=pointer-arith',
'-Wno-missing-field-initializers']
foreach cf: express_cflags_try
if cc.has_argument(cf) == true
express_cflags += cf
endif
endforeach
add_global_arguments(express_cflags, language: 'c')
have_visibility_hidden = cc.has_argument('-fvisibility=hidden')
if have_visibility_hidden
add_global_arguments('-fvisibility=hidden', language: 'c')
endif
pkgconfig = import('pkgconfig')
windows = import('windows')
edje_cc = find_program('edje_cc', native: true)
edje_cc_exe = [ edje_cc ]
# libraries
config_dir = [include_directories('.')]
efl_req = '>= 1.12.0'
express_lib_deps = [
dependency('eina', version : efl_req),
dependency('ecore', version : efl_req),
dependency('ecore-con', version : efl_req)
]
requirement_express_pc = ' eina ' + efl_req + ' ecore ' + efl_req + ' ecore-con ' + efl_req
if get_option('nls') == true
express_lib_deps += cc.find_library('intl', required: false)
endif
express_cargs = [ ]
# configuration
config_h = configuration_data()
config_h.set_quoted('PACKAGE_NAME', meson.project_name())
config_h.set_quoted('PACKAGE_VERSION', meson.project_version())
config_h.set_quoted('PACKAGE_BIN_DIR', dir_bin)
config_h.set_quoted('PACKAGE_LIB_DIR', dir_lib)
config_h.set_quoted('PACKAGE_DATA_DIR', dir_data)
config_h.set_quoted('PACKAGE_LOCALE_DIR', dir_locale)
subdir('data/desktop')
subdir('data/fonts')
subdir('data/images')
subdir('data/themes')
subdir('src/lib')
subdir('src/bin')
#if get_option('nls') == true
# subdir('po')
#endif
# Use config_h after all subdirs have set values
configure_file(output : 'express_config.h', configuration : config_h)
# pkg-config
pkgconf = configuration_data()
pkgconf.set('prefix', get_option('prefix'))
pkgconf.set('exec_prefix', '${prefix}')
pkgconf.set('libdir', '${prefix}/@0@'.format(get_option('libdir')))
pkgconf.set('includedir', '${prefix}/@0@'.format(get_option('includedir')))
pkgconf.set('pkgincludedir', '${prefix}/@0@'.format(get_option('includedir')) + '/express')
pkgconf.set('VMAJ', v_maj)
pkgconf.set('VERSION', meson.project_version())
pkgconf.set('requirements_libexpress_pc', requirement_express_pc)
pkg_install_dir = '@0@/pkgconfig'.format(get_option('libdir'))
configure_file(
input : join_paths(meson.source_root(), 'express.pc.in'),
output : 'express.pc',
configuration : pkgconf,
install_dir : pkg_install_dir
)
# output
summary({'OS': host_os,
}, section: 'Configuration Options Summary:')
summary({'prefix': dir_prefix,
'bindir': dir_bin,
'libdir': dir_lib,
'incdir': dir_include,
'pkgincdir': dir_pkginclude,
'datadir': dir_data,
'pkgdatadir': dir_pkgdata,
}, section: 'Directories:')
summary({'compilation': 'ninja',
'installation': 'ninja install',
}, section: 'Compilation')

@ -0,0 +1,6 @@
option('nls',
type: 'boolean',
value: true,
description: 'enable localization: (default=true)'
)

@ -0,0 +1,53 @@
express_bin_src = [
'callbacks.c',
'channel.c',
'colors.c',
'commands.c',
'config.c',
'dbus.c',
'gravatar.c',
'grid.c',
'grid_save.c',
'main.c',
'media.c',
'options.c',
'options_channels.c',
'options_colors.c',
'options_font.c',
'options_general.c',
'options_network.c',
'options_networks.c',
'options_servers.c',
'options_tools.c',
'options_video.c',
'selector.c',
'theme.c',
'utils.c',
'window.c',
'lz4/lz4.c',
'md5/md5.c'
]
express_bin_args = [ ]
if get_option('nls')
express_bin_args += [ '-DGETTEXT_PACKAGE="express"' ]
endif
express_headers = [
'sys/mman.h'
]
foreach header : express_headers
if cc.has_header(header)
config_h.set10('HAVE_'+header.underscorify().to_upper(), true)
endif
endforeach
express_bin = executable('express', express_bin_src,
c_args : [ express_bin_args, '-DHAVE_CONFIG_H' ],
dependencies : [ express, dependency('elementary', version : efl_req) ],
include_directories : config_dir,
install : true
)

@ -0,0 +1,49 @@
express_header_src = [ 'Express.h' ]
install_headers(express_header_src,
install_dir : dir_pkginclude + '-' + v_maj
)
express_lib_src = [
'main.c',
'network.c'
]
express_headers = [
'arpa/inet.h',
'netinet/in.h',
'sys/socket.h',
]
foreach header : express_headers
if cc.has_header(header)
config_h.set10('HAVE_'+header.underscorify().to_upper(), true)
endif
endforeach
win32 = ['windows']
sys_windows = win32.contains(host_os)
if sys_windows == true
ws2_32 = cc.find_library('ws2_32')
express_ext_deps = [ ws2_32 ]
else
express_ext_deps = [ ]
endif
express_lib = library('express', express_lib_src,
c_args : [ express_cargs,
'-DHAVE_CONFIG_H',
'-DEXPRESS_WIN32_BUILD'
],
dependencies : [ express_lib_deps, express_ext_deps ],
include_directories : config_dir,
install : true,
version : meson.project_version()
)
express = declare_dependency(
include_directories : [ include_directories('.')],
link_with : express_lib,
dependencies : express_lib_deps
)
Loading…
Cancel
Save