[libhttpseverywhere] build: make mesonfiles for subfolders



commit 3e5068242811004c98dbec17463c90fdc24ea8b3
Author: grindhold <grindhold gmx net>
Date:   Fri Jan 19 20:41:41 2018 +0100

    build: make mesonfiles for subfolders
    
    each folder now has its own meson file

 meson.build      |   59 +-------------------------------------------
 src/meson.build  |   71 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 test/meson.build |   29 ++++++++++++++++++++++
 3 files changed, 102 insertions(+), 57 deletions(-)
---
diff --git a/meson.build b/meson.build
index 2aa3ed1..496ea5d 100644
--- a/meson.build
+++ b/meson.build
@@ -1,5 +1,5 @@
 #********************************************************************+
-# Copyright 2016-2017 Daniel 'grindhold' Brendle
+# Copyright 2016-2018 Daniel 'grindhold' Brendle
 #
 # This file is part of libhttpseverywhere.
 #
@@ -40,48 +40,7 @@ gio = dependency('gio-2.0')
 gee = dependency('gee-0.8')
 archive = dependency('libarchive')
 
-httpseverywhere_lib_source = [
-    'src/context.vala',
-    'src/ruleset.vala',
-    'src/update.vala'
-]
-
-httpseverywhere_test_source = [
-    'test/main.vala'
-]
-
-valagir = 'HTTPSEverywhere-' + api + '.gir'
-
-httpseverywhere_lib = shared_library('httpseverywhere-'+api, httpseverywhere_lib_source,
-                                     dependencies: [glib, gobject, json_glib, soup, gio, gee, archive],
-                                     vala_gir: valagir,
-                                     vala_header: 'httpseverywhere.h',
-                                     install: true,
-                                     version: libhttpseverywhere_version)
-
-httpseverywhere_test = executable('httpseverywhere_test', httpseverywhere_test_source,
-                                  dependencies: [glib, gobject, gio, gee, json_glib],
-                                  link_with: httpseverywhere_lib)
-
-g_ir_compiler = find_program('g-ir-compiler')
-custom_target('httpseverywhere-typelib',
-               command: [g_ir_compiler, '--output', '@OUTPUT@', valagir, '--shared-library', 
'libhttpseverywhere-' + api + '.so'],
-               output: 'HTTPSEverywhere-' + api + '.typelib',
-               depends: httpseverywhere_lib,
-               install: true,
-               install_dir: get_option('libdir') + '/girepository-1.0')
-
-if get_option('enable_valadoc')
-       valadoc = find_program('valadoc')
-       custom_target('apidocs',
-                   input: httpseverywhere_lib_source,
-                   command: [valadoc, '-o', 'devhelp/httpseverywhere-'+api, '--doclet', 'devhelp', '@INPUT@',
-                   '--force', '--pkg', 'gee-0.8', '--pkg', 'json-glib-1.0', '--pkg', 'libarchive', '--pkg', 
'libsoup-2.4'],
-                   output: 'devhelp',
-                   build_by_default: true)
-  install_subdir(meson.current_build_dir()+'/devhelp/httpseverywhere-'+api+'/httpseverywhere-'+api,
-                 install_dir: get_option('datadir')+'/devhelp/books')
-endif
+subdir('src')
 
 pkgconfig.generate(libraries : httpseverywhere_lib,
                    version : libhttpseverywhere_version,
@@ -92,19 +51,5 @@ pkgconfig.generate(libraries : httpseverywhere_lib,
                    description : 'A library to rewrite HTTP URLs to HTTPS URLs.',
                    install: true)
 
-# Create an empty httpseverywhere.h file in the build dir to satisfy
-# install_headers that the file exists. Remove when this PR is merged:
-# https://github.com/mesonbuild/meson/pull/1469
-httpseverywhere_h = meson.current_build_dir()+'/httpseverywhere.h'
-run_command ('touch', httpseverywhere_h)
-install_headers(httpseverywhere_h, subdir: 'httpseverywhere-'+api)
-
-# Create an empty httpseverywhere.vapi file in the build dir to satisfy
-# install_data that the file exists. Remove when this PR is merged:
-# https://github.com/mesonbuild/meson/pull/1469
-httpseverywhere_vapi = meson.current_build_dir()+'/httpseverywhere-'+api+'.vapi'
-run_command ('touch', httpseverywhere_vapi)
-install_data(httpseverywhere_vapi, install_dir: get_option('datadir') + '/vala/vapi')
-
 install_data('data/default.rulesets', install_dir: get_option('datadir') + '/libhttpseverywhere')
 install_data('httpseverywhere-'+api+'.deps', install_dir: get_option('datadir') + '/vala/vapi')
diff --git a/src/meson.build b/src/meson.build
new file mode 100644
index 0000000..0e34414
--- /dev/null
+++ b/src/meson.build
@@ -0,0 +1,71 @@
+#********************************************************************+
+# Copyright 2016-2018 Daniel 'grindhold' Brendle
+#
+# This file is part of libhttpseverywhere.
+#
+# libhttpseverywhere is free software: you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public License
+# as published by the Free Software Foundation, either
+# version 3 of the License, or (at your option) any later
+# version.
+#
+# libhttpseverywhere is distributed in the hope that it will be
+# useful, but WITHOUT ANY WARRANTY; without even the implied
+# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+# PURPOSE. See the GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with libhttpseverywhere.
+# If not, see http://www.gnu.org/licenses/.
+#*********************************************************************
+
+
+httpseverywhere_lib_source = [
+    'context.vala',
+    'ruleset.vala',
+    'update.vala'
+]
+
+valagir = 'HTTPSEverywhere-' + api + '.gir'
+
+httpseverywhere_lib = shared_library('httpseverywhere-'+api, httpseverywhere_lib_source,
+                                     dependencies: [glib, gobject, json_glib, soup, gio, gee, archive],
+                                     vala_gir: valagir,
+                                     vala_header: 'httpseverywhere.h',
+                                     install: true,
+                                     version: libhttpseverywhere_version)
+
+g_ir_compiler = find_program('g-ir-compiler')
+custom_target('httpseverywhere-typelib',
+               command: [g_ir_compiler, '--output', '@OUTPUT@', 'src/'+valagir, '--shared-library', 
'libhttpseverywhere-' + api + '.so'],
+               output: 'HTTPSEverywhere-' + api + '.typelib',
+               depends: httpseverywhere_lib,
+               install: true,
+               install_dir: get_option('libdir') + '/girepository-1.0')
+
+if get_option('enable_valadoc')
+       valadoc = find_program('valadoc')
+       custom_target('apidocs',
+                   input: httpseverywhere_lib_source,
+                   command: [valadoc, '-o', 'devhelp/httpseverywhere-'+api, '--doclet', 'devhelp', '@INPUT@',
+                   '--force', '--pkg', 'gee-0.8', '--pkg', 'json-glib-1.0', '--pkg', 'libarchive', '--pkg', 
'libsoup-2.4'],
+                   output: 'devhelp',
+                   build_by_default: true)
+  install_subdir(meson.current_build_dir()+'/../devhelp/httpseverywhere-'+api+'/httpseverywhere-'+api,
+                 install_dir: get_option('datadir')+'/devhelp/books')
+endif
+
+# Create an empty httpseverywhere.h file in the build dir to satisfy
+# install_headers that the file exists. Remove when this PR is merged:
+# https://github.com/mesonbuild/meson/pull/1469
+httpseverywhere_h = meson.current_build_dir()+'/httpseverywhere.h'
+run_command ('touch', httpseverywhere_h)
+install_headers(httpseverywhere_h, subdir: 'httpseverywhere-'+api)
+
+# Create an empty httpseverywhere.vapi file in the build dir to satisfy
+# install_data that the file exists. Remove when this PR is merged:
+# https://github.com/mesonbuild/meson/pull/1469
+httpseverywhere_vapi = meson.current_build_dir()+'/httpseverywhere-'+api+'.vapi'
+run_command ('touch', httpseverywhere_vapi)
+install_data(httpseverywhere_vapi, install_dir: get_option('datadir') + '/vala/vapi')
+
diff --git a/test/meson.build b/test/meson.build
new file mode 100644
index 0000000..33268c9
--- /dev/null
+++ b/test/meson.build
@@ -0,0 +1,29 @@
+#********************************************************************+
+# Copyright 2016-2018 Daniel 'grindhold' Brendle
+#
+# This file is part of libhttpseverywhere.
+#
+# libhttpseverywhere is free software: you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public License
+# as published by the Free Software Foundation, either
+# version 3 of the License, or (at your option) any later
+# version.
+#
+# libhttpseverywhere is distributed in the hope that it will be
+# useful, but WITHOUT ANY WARRANTY; without even the implied
+# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+# PURPOSE. See the GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with libhttpseverywhere.
+# If not, see http://www.gnu.org/licenses/.
+#*********************************************************************
+
+
+httpseverywhere_test_source = [
+    'main.vala'
+]
+
+httpseverywhere_test = executable('httpseverywhere_test', httpseverywhere_test_source,
+                                  dependencies: [glib, gobject, gio, gee, json_glib],
+                                  link_with: httpseverywhere_lib)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]