raster pushed a commit to branch master.

http://git.enlightenment.org/apps/express.git/commit/?id=0674d038f535ece1bafb65ae54be5fb3b17308e5

commit 0674d038f535ece1bafb65ae54be5fb3b17308e5
Author: Vincent Torri <vincent.to...@gmail.com>
Date:   Fri Feb 12 16:18:55 2021 +0000

    meson build system
    
    Test Plan: compilation
    
    Reviewers: raster, devilhorns
    
    Differential Revision: https://phab.enlightenment.org/D12238
---
 data/desktop/meson.build |  10 ++++
 data/fonts/meson.build   |  31 ++++++++++
 data/images/meson.build  |   5 ++
 data/themes/meson.build  |  23 ++++++++
 meson.build              | 148 +++++++++++++++++++++++++++++++++++++++++++++++
 meson_options.txt        |   6 ++
 src/bin/meson.build      |  53 +++++++++++++++++
 src/lib/meson.build      |  49 ++++++++++++++++
 8 files changed, 325 insertions(+)

diff --git a/data/desktop/meson.build b/data/desktop/meson.build
new file mode 100644
index 0000000..b6aa39b
--- /dev/null
+++ b/data/desktop/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')
+)
diff --git a/data/fonts/meson.build b/data/fonts/meson.build
new file mode 100644
index 0000000..e222439
--- /dev/null
+++ b/data/fonts/meson.build
@@ -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')
+)
diff --git a/data/images/meson.build b/data/images/meson.build
new file mode 100644
index 0000000..65e7102
--- /dev/null
+++ b/data/images/meson.build
@@ -0,0 +1,5 @@
+
+install_data(
+  sources     : 'operator.png',
+  install_dir : join_paths(dir_pkgdata, 'images')
+)
diff --git a/data/themes/meson.build b/data/themes/meson.build
new file mode 100644
index 0000000..1f347a5
--- /dev/null
+++ b/data/themes/meson.build
@@ -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
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..e4cb4b9
--- /dev/null
+++ b/meson.build
@@ -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')
diff --git a/meson_options.txt b/meson_options.txt
new file mode 100644
index 0000000..d48dc63
--- /dev/null
+++ b/meson_options.txt
@@ -0,0 +1,6 @@
+
+option('nls',
+  type: 'boolean',
+  value: true,
+  description: 'enable localization: (default=true)'
+)
diff --git a/src/bin/meson.build b/src/bin/meson.build
new file mode 100644
index 0000000..7141dd5
--- /dev/null
+++ b/src/bin/meson.build
@@ -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
+)
diff --git a/src/lib/meson.build b/src/lib/meson.build
new file mode 100644
index 0000000..760d797
--- /dev/null
+++ b/src/lib/meson.build
@@ -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
+)

-- 


Reply via email to