diff options
-rw-r--r-- | 3rd-party/SingleApplication/meson.build | 25 | ||||
-rw-r--r-- | include/version.h.in (renamed from src/version.h.in) | 6 | ||||
-rw-r--r-- | lib/about/aboutdialog.cpp | 4 | ||||
-rw-r--r-- | lib/about/meson.build | 17 | ||||
-rw-r--r-- | lib/addressbar/meson.build | 16 | ||||
-rw-r--r-- | lib/bookmarks/meson.build | 23 | ||||
-rw-r--r-- | lib/configuration/meson.build | 11 | ||||
-rw-r--r-- | lib/downloads/meson.build | 19 | ||||
-rw-r--r-- | lib/urlfilter/meson.build | 17 | ||||
-rw-r--r-- | lib/web/meson.build | 16 | ||||
-rw-r--r-- | meson.build | 48 | ||||
-rw-r--r-- | meson_options.txt | 6 | ||||
-rw-r--r-- | src/meson.build | 34 | ||||
-rwxr-xr-x | tools/config.py | 27 |
14 files changed, 259 insertions, 10 deletions
diff --git a/3rd-party/SingleApplication/meson.build b/3rd-party/SingleApplication/meson.build new file mode 100644 index 0000000..a52df27 --- /dev/null +++ b/3rd-party/SingleApplication/meson.build @@ -0,0 +1,25 @@ +SingleApplication_inc = include_directories('SingleApplication.git') + +SingleApplication_moc = qt5.preprocess( + moc_headers: ['SingleApplication.git/singleapplication.h', 'SingleApplication.git/singleapplication_p.h'], + dependencies: dep_qt5 +) + +SingleApplication_lib = static_library('SingleApplication', + ['SingleApplication.git/singleapplication.cpp', 'SingleApplication.git/singleapplication_p.cpp'], + cpp_args : '-DQAPPLICATION_CLASS=QApplication', + dependencies: dep_qt5 +) + +dep_SingleApplication = declare_dependency( + include_directories: SingleApplication_inc, + link_with: SingleApplication_lib +) + +# target_include_directories(['SingleApplication', 'PUBLIC', 'SingleApplication.git']) +# target_link_libraries(['SingleApplication', 'Qt5::Core', 'Qt5::Network', 'Qt5::Widgets']) +# target_compile_definitions(['SingleApplication', 'PRIVATE', 'QAPPLICATION_CLASS=QApplication']) + +#if cmake_system_name, 'MATCHES', 'Windows' + # target_link_libraries(['SingleApplication', 'Advapi32']) +#endif diff --git a/src/version.h.in b/include/version.h.in index c31c4a8..c52ce77 100644 --- a/src/version.h.in +++ b/include/version.h.in @@ -2,13 +2,13 @@ #define SMOLBOTE_VERSION_H // Version: 1.2.3 -#cmakedefine poi_Version "@poi_Version@" +#mesondefine poi_Version // Describe: 1.2.3-r123-0123456789ab -#cmakedefine poi_Describe "@poi_Describe@" +#mesondefine poi_Describe // Build -#cmakedefine poi_Build "@poi_Build@" +#mesondefine poi_Build #endif // SMOLBOTE_VERSION_H diff --git a/lib/about/aboutdialog.cpp b/lib/about/aboutdialog.cpp index c7ed385..555a69f 100644 --- a/lib/about/aboutdialog.cpp +++ b/lib/about/aboutdialog.cpp @@ -9,8 +9,6 @@ #include "aboutdialog.h" #include "ui_aboutdialog.h" #include <version.h> -#include <QtWebEngine/QtWebEngineVersion> -#include <boost/version.hpp> // compiler // clang also defines __GNUC__, so we need to check for clang first @@ -36,7 +34,7 @@ AboutDialog::AboutDialog(QWidget *parent) ui->aboutLabel->setText(tr("<h2>smolbote %1</h2>" "<p><i>yet another no-frills browser</i></p>" "<p>This program is free software, see <i>License</i> for more information.</p>" - "<p>This program uses free software: Qt " QT_VERSION_STR " and Boost " BOOST_LIB_VERSION "</p>") + "<p>This program uses free software: Qt5, Boost</p>") .arg(qApp->applicationVersion())); ui->licenseLabel->setText(tr("<p>Copyright 2017 - 2018 aqua</p>" diff --git a/lib/about/meson.build b/lib/about/meson.build new file mode 100644 index 0000000..38769a8 --- /dev/null +++ b/lib/about/meson.build @@ -0,0 +1,17 @@ +about_moc = qt5.preprocess( + moc_headers: ['aboutdialog.h'], + ui_files: ['aboutdialog.ui'], + dependencies: dep_qt5 +) + +about_inc = include_directories('.') +about_lib = static_library('about', ['aboutdialog.cpp', about_moc], + dependencies: dep_qt5, + include_directories: genheader_inc +) + +dep_about = declare_dependency( + include_directories: about_inc, + link_with: about_lib, + sources: ['aboutdialog.cpp', about_moc] +) diff --git a/lib/addressbar/meson.build b/lib/addressbar/meson.build new file mode 100644 index 0000000..de54352 --- /dev/null +++ b/lib/addressbar/meson.build @@ -0,0 +1,16 @@ +addressbar_inc = include_directories('.') +addressbar_moc = qt5.preprocess( + moc_headers: ['addressbar.h', 'completer.h', 'urllineedit.h'], + ui_files: ['addressbar.ui'], + dependencies: dep_qt5 +) + +addressbar_lib = static_library('addressbar', ['addressbar.cpp', 'completer.cpp', 'urllineedit.cpp', addressbar_moc], + dependencies: dep_qt5, +) + +dep_addressbar = declare_dependency( + include_directories: addressbar_inc, + link_with: addressbar_lib, + sources: ['addressbar.cpp', 'completer.cpp', 'urllineedit.cpp', addressbar_moc] +) diff --git a/lib/bookmarks/meson.build b/lib/bookmarks/meson.build new file mode 100644 index 0000000..faaa154 --- /dev/null +++ b/lib/bookmarks/meson.build @@ -0,0 +1,23 @@ +bookmarks_inc = include_directories('.') +bookmarks_moc = qt5.preprocess( + moc_headers: ['bookmarkswidget.h', 'model/bookmarkitem.h', 'model/bookmarkmodel.h', 'forms/editbookmarkdialog.h'], + ui_files: ['bookmarksform.ui', 'forms/editbookmarkdialog.ui'], + dependencies: dep_qt5 +) + +bookmarks_lib = static_library('bookmarks', + ['bookmarkswidget.cpp', bookmarks_moc, + 'xbel.cpp', 'xbel.h', + 'model/bookmarkitem.cpp', 'model/bookmarkmodel.cpp', + 'forms/editbookmarkdialog.cpp'], + dependencies: dep_qt5 +) + +dep_bookmarks = declare_dependency( + include_directories: bookmarks_inc, + link_with: bookmarks_lib, + sources: ['bookmarkswidget.cpp', bookmarks_moc, + 'xbel.cpp', 'xbel.h', + 'model/bookmarkitem.cpp', 'model/bookmarkmodel.cpp', + 'forms/editbookmarkdialog.cpp'] +) diff --git a/lib/configuration/meson.build b/lib/configuration/meson.build new file mode 100644 index 0000000..ea78f8d --- /dev/null +++ b/lib/configuration/meson.build @@ -0,0 +1,11 @@ +configuration_inc = include_directories('.') +configuration_lib = static_library('configuration', ['configuration.cpp', 'configuration.h'], + dependencies: [dep_boost, dep_qt5], + include_directories: genheader_inc +) + +dep_configuration = declare_dependency( + include_directories: configuration_inc, + link_with: configuration_lib, + sources: ['configuration.cpp', 'configuration.h'] +) diff --git a/lib/downloads/meson.build b/lib/downloads/meson.build new file mode 100644 index 0000000..761ab78 --- /dev/null +++ b/lib/downloads/meson.build @@ -0,0 +1,19 @@ +downloads_inc = include_directories('.') +downloads_moc = qt5.preprocess( + moc_headers: ['downloadswidget.h', 'widgets/downloaditemwidget.h', 'widgets/elidedlabel.h'], + ui_files: ['downloadsform.ui', 'widgets/downloaditemform.ui'], + dependencies: dep_qt5 +) + +downloads_lib = static_library('downloads', + ['downloadswidget.cpp', downloads_moc, + 'widgets/downloaditemwidget.cpp', 'widgets/elidedlabel.cpp'], + dependencies: dep_qt5 +) + +dep_downloads = declare_dependency( + include_directories: downloads_inc, + link_with: downloads_lib, + sources: ['downloadswidget.cpp', downloads_moc, + 'widgets/downloaditemwidget.cpp', 'widgets/elidedlabel.cpp'] +) diff --git a/lib/urlfilter/meson.build b/lib/urlfilter/meson.build new file mode 100644 index 0000000..9178d1c --- /dev/null +++ b/lib/urlfilter/meson.build @@ -0,0 +1,17 @@ +urlfilter_inc = include_directories('.') +urlfilter_lib = static_library('urlfilter', + ['filtertree.cpp', 'filtertree.h', 'filterleaf.cpp', 'filterleaf.h', + 'domain.cpp', 'domain.h', + 'formats/adblockrule.cpp', 'formats/adblockrule.h', + 'formats/hostlistrule.cpp', 'formats/hostlistrule.h'], + dependencies: dep_qt5 +) + +dep_urlfilter = declare_dependency( + include_directories: urlfilter_inc, + link_with: urlfilter_lib, + sources: ['filtertree.cpp', 'filtertree.h', 'filterleaf.cpp', 'filterleaf.h', + 'domain.cpp', 'domain.h', + 'formats/adblockrule.cpp', 'formats/adblockrule.h', + 'formats/hostlistrule.cpp', 'formats/hostlistrule.h'] +) diff --git a/lib/web/meson.build b/lib/web/meson.build new file mode 100644 index 0000000..55534d3 --- /dev/null +++ b/lib/web/meson.build @@ -0,0 +1,16 @@ +web_inc = include_directories('.') +web_moc = qt5.preprocess( + moc_headers: ['profilemanager.h', 'webprofile.h'], + dependencies: dep_qt5 +) +web_lib = static_library('web', + ['profilemanager.cpp', 'webprofile.cpp', web_moc], + dependencies: dep_qt5, + include_directories: include +) + +dep_web = declare_dependency( + include_directories: web_inc, + link_with: web_lib, + sources: ['profilemanager.cpp', 'webprofile.cpp', web_moc] +) diff --git a/meson.build b/meson.build new file mode 100644 index 0000000..596da57 --- /dev/null +++ b/meson.build @@ -0,0 +1,48 @@ +project('smolbote', 'cpp', + version: 'master', + default_options: ['cpp_std=c++17', 'strip=true', 'warning_level=3'], + license: 'GPL3') + +# Qt 5 +qt5 = import('qt5') +dep_qt5 = dependency('qt5', modules: ['Core', 'Gui', 'Network', 'Widgets', 'WebEngineWidgets']) + +# Boost +dep_boost = dependency('boost', modules: ['program_options']) + +# Breakpad +dep_breakpad = dependency('breakpad-client', required : get_option('Breakpad')) + +# Generate config header +include = include_directories('include') +conf = configuration_data() +conf.set_quoted('poi_Version', '1.0.0') +conf.set_quoted('poi_Describe', '1.0.0-stable') +conf.set_quoted('poi_Build', 'custom-1.0.0') + +configure_file(configuration: conf, input: 'include/version.h.in', output: 'version.h') +genheader_inc = include_directories('.') + +pymod = import('python') +python3 = pymod.find_installation('python3') + +kconfiggen = custom_target('configheader', + input: ['tools/config.py', 'src/Kconfig', 'linux/.config'], + output: 'config.h', + command: [python3, '@INPUT0@', '--kconfig=@INPUT1@', '--dotconfig=@INPUT2@', '--generate=@OUTPUT@'], + build_by_default: true +) + +lib_inc = include_directories('lib') +subdir('lib/about') +subdir('lib/addressbar') +subdir('lib/bookmarks') +subdir('lib/configuration') +subdir('lib/downloads') +subdir('lib/urlfilter') +subdir('lib/web') + +thirdparty_inc = include_directories('3rd-party/SingleApplication/SingleApplication.git') +subdir('3rd-party/SingleApplication') + +subdir('src') diff --git a/meson_options.txt b/meson_options.txt new file mode 100644 index 0000000..8982176 --- /dev/null +++ b/meson_options.txt @@ -0,0 +1,6 @@ +# Executable options +option('poiName', description: 'Executable name', type: 'string', value: 'poi') + +# Feature options +option('Breakpad', description: 'Enable breakpad crash reporting', type: 'feature', value: 'auto') +option('Plasma', description: 'Enable KDE plasma integration', type: 'feature', value: 'auto') diff --git a/src/meson.build b/src/meson.build new file mode 100644 index 0000000..83ef998 --- /dev/null +++ b/src/meson.build @@ -0,0 +1,34 @@ +# poi +poi_moc = qt5.preprocess( + moc_headers: [], + ui_files: ['mainwindow/mainwindow.ui', 'mainwindow/widgets/searchform.ui'], + qresources: '../data/resources.qrc', + dependencies: dep_qt5 +) + +poi = executable('poi', install: true, + dependencies: [dep_qt5, dep_boost, dep_breakpad, dep_SingleApplication, + dep_about, dep_addressbar, dep_bookmarks, dep_configuration, dep_downloads, dep_urlfilter, dep_web], + cpp_args : '-DQAPPLICATION_CLASS=QApplication', + include_directories: [include, genheader_inc, lib_inc, thirdparty_inc], + sources: ['main.cpp', poi_moc, + 'browser.cpp', 'browser.h', + 'session.cpp', 'session.h', + 'util.cpp', 'util.h', + + 'mainwindow/mainwindow.cpp', 'mainwindow/mainwindow.h', + 'mainwindow/widgets/dockwidget.cpp', 'mainwindow/widgets/dockwidget.h', + 'mainwindow/widgets/navigationbar.cpp', 'mainwindow/widgets/navigationbar.h', + 'mainwindow/widgets/searchform.cpp', 'mainwindow/widgets/searchform.h', + + 'subwindow/subwindow.cpp', 'subwindow/subwindow.h', + 'subwindow/tabwidget.cpp', 'subwindow/tabwidget.h', + + 'webengine/filter.cpp', 'webengine/filter.h', + 'webengine/urlinterceptor.cpp', 'webengine/urlinterceptor.h', + 'webengine/webpage.cpp', 'webengine/webpage.h', + 'webengine/webview.cpp', 'webengine/webview.h', + + 'wallet/wallet.cpp', 'wallet/wallet.h'] +) + diff --git a/tools/config.py b/tools/config.py index 22defdd..96c4576 100755 --- a/tools/config.py +++ b/tools/config.py @@ -50,15 +50,34 @@ def main(args): if i is not None: print(i) +def writeItem(node, gen): + while node: + if isinstance(node.item, kconfiglib.Symbol): + gen.write("#define CONFIG_{0} \"{1}\"\n".format(node.item.name, node.item.str_value)) + + if node.list: + writeItem(node.list, gen) + + node = node.next + +def generate(args): + kconf = kconfiglib.Kconfig(args.kconfig) + if args.dotconfig is not None: + kconf.load_config(args.dotconfig) + + with open(args.generate, "wt") as gen: + gen.write("// This is an auto-generated file, do not edit.\n") + writeItem(kconf.top_node, gen) if __name__ == "__main__": parser = argparse.ArgumentParser() - parser.add_argument("--kconfig", metavar="Kconfig", nargs="?", default="Kconfig", help="Top-level Kconfig file (default: Kconfig)") - parser.add_argument("--dotconfig", metavar="dotconfig", nargs="?", help=".config") - + parser.add_argument("--generate", metavar="config_header", nargs="?", help="Generate config file") parser.add_argument("setting", metavar="CONFIG_KEY", nargs="?", help="Top-level Kconfig file (default: Kconfig)") args = parser.parse_args() - main(args) + if args.generate is not None: + generate(args) + else: + main(args) |