Commit 6541ce60 authored by Cédric Bellegarde's avatar Cédric Bellegarde

Move to meson

parent 0afad198
[submodule "subprojects/po"]
path = subprojects/po
url = https://github.com/gnumdk/eolie-po.git
ACLOCAL_AMFLAGS = -I m4
NULL =
bin_SCRIPTS = eolie
SUBDIRS = src data python-webextension po search-provider
EXTRA_DIST = \
eolie.in\
$(NULL)
CLEANFILES = \
$(bin_SCRIPTS)\
$(NULL)
MAINTAINERCLEANFILES = \
$(srcdir)/AUTHORS \
$(srcdir)/INSTALL \
$(srcdir)/aclocal.m4 \
$(srcdir)/autoscan.log \
$(srcdir)/compile \
$(srcdir)/config.guess \
$(srcdir)/config.h.in \
$(srcdir)/config.sub \
$(srcdir)/configure.scan \
$(srcdir)/depcomp \
$(srcdir)/install-sh \
$(srcdir)/ltmain.sh \
$(srcdir)/missing \
$(srcdir)/mkinstalldirs \
$(NULL)
GITIGNOREFILES = \
m4 \
$(NULL)
eolie: eolie.in Makefile
$(AM_V_GEN)sed \
-e s!\@srcdir\@!$(abs_top_srcdir)! \
-e s!\@prefix\@!$(prefix)! \
-e s!\@datadir\@!$(datadir)! \
-e s!\@pkgdatadir\@!$(pkgdatadir)! \
-e s!\@libexecdir\@!$(libexecdir)! \
-e s!\@libdir\@!$(libdir)! \
-e s!\@PYTHON\@!$(PYTHON)! \
-e s!\@pkglibdir\@!$(pkglibdir)! \
-e s!\@localedir\@!$(localedir)! \
-e s!\@pythondir\@!$(pythondir)! \
-e s!\@pyexecdir\@!$(pyexecdir)! \
-e s!\@PACKAGE\@!$(PACKAGE)! \
-e s!\@VERSION\@!$(VERSION)! \
< $< > $@
chmod a+x $@
all-local: eolie
-include $(top_srcdir)/git.mk
#!/bin/sh
# Run this to generate all the initial makefiles, etc.
srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.
[ ! -d "$srcdir"/po ] && git clone https://github.com/gnumdk/eolie-po.git "$srcdir"/po
#[ ! -d "$srcdir"/help ] && git clone https://github.com/gnumdk/lollypop-help.git "$srcdir"/help
(test -f $srcdir/configure.ac) || {
echo "**Error**: Directory "\`$srcdir\'" does not look like the top-level project directory"
exit 1
}
PKG_NAME=`autoconf --trace 'AC_INIT:$1' "$srcdir/configure.ac"`
if [ "$#" = 0 -a "x$NOCONFIGURE" = "x" ]; then
echo "**Warning**: I am going to run \`configure' with no arguments." >&2
echo "If you wish to pass any to it, please specify them on the" >&2
echo \`$0\'" command line." >&2
echo "" >&2
fi
set -x
aclocal --install || exit 1
glib-gettextize --force --copy || exit 1
#gtkdocize --copy || exit 1
intltoolize --force --copy --automake || exit 1
autoreconf --verbose --force --install -Wno-portability || exit 1
{ set +x; } 2>/dev/null
if [ "$NOCONFIGURE" = "" ]; then
set -x
$srcdir/configure "$@" || exit 1
{ set +x; } 2>/dev/null
if [ "$1" = "--help" ]; then exit 0 else
echo "Now type \`make\' to compile $PKG_NAME" || exit 1
fi
else
echo "Skipping configure process."
fi
AC_PREREQ(2.63)
AC_INIT([eolie],
[m4_esyscmd_s([git describe --tags])],
[https://github.com/gnumdk/eolie],
[eolie],
[https://github.com/gnumdk/eolie])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR([Makefile.am])
AC_CONFIG_HEADERS(config.h)
AM_INIT_AUTOMAKE([1.11 tar-ustar dist-xz no-dist-gzip -Wno-portability subdir-objects])
AM_MAINTAINER_MODE([enable])
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
AM_PATH_PYTHON(3.0)
AM_PYTHON_CHECK_VERSION(3.0)
PYTHON_CFLAGS=`${PYTHON}-config --includes`
PYTHON_LDFLAGS=`${PYTHON}-config --libs`
AC_SUBST(PYTHON_CFLAGS)
AC_SUBST(PYTHON_LDFLAGS)
GETTEXT_PACKAGE=eolie
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",
[The prefix for our gettext translation domains.])
IT_PROG_INTLTOOL(0.26)
LT_INIT
PKG_PROG_PKG_CONFIG([0.22])
GLIB_GSETTINGS
YELP_HELP_INIT
GOBJECT_INTROSPECTION_REQUIRE([1.35.9])
PKG_CHECK_MODULES([GTK], [gtk+-3.0 >= 3.14])
PKG_CHECK_MODULES([WEBKIT2GTK], [webkit2gtk-4.0 >= 2.16])
PKG_CHECK_MODULES([PYGOBJECT], [pygobject-3.0])
PKG_CHECK_MODULES([WEBKIT2GTK_WEB_EXTENSION], [webkit2gtk-web-extension-4.0 >= 2.16])
GLIB_COMPILE_RESOURCES=`$PKG_CONFIG --variable glib_compile_resources gio-2.0`
WEB_EXT_FLAGS=`$PKG_CONFIG pygobject-3.0 webkit2gtk-web-extension-4.0 python3 --cflags`
WEB_EXT_LIBS=`$PKG_CONFIG pygobject-3.0 webkit2gtk-web-extension-4.0 python3 --libs`
AC_SUBST(GLIB_COMPILE_RESOURCES)
AC_CONFIG_FILES([
Makefile
data/Makefile
data/AboutDialog.ui
src/Makefile
python-webextension/Makefile
search-provider/Makefile
po/Makefile.in
])
AC_OUTPUT
......@@ -9,7 +9,7 @@
<property name="destroy_with_parent">True</property>
<property name="type_hint">dialog</property>
<property name="program_name">Eolie</property>
<property name="version">@PACKAGE_VERSION@</property>
<property name="version">@VERSION@</property>
<property name="copyright">Copyright © 2016-2017 Cédric Bellegarde</property>
<property name="comments" translatable="yes">A web browser for GNOME.</property>
<property name="website">@PACKAGE_URL@</property>
......
resource_files = $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir) --sourcedir=$(builddir) --generate-dependencies $(builddir)/eolie.gresource.xml)
eolie.gresource: eolie.gresource.xml $(resource_files)
$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --sourcedir=$(builddir) $<
resourcedir = $(pkgdatadir)
resource_DATA = eolie.gresource
appsdir = $(datadir)/applications
apps_DATA = org.gnome.Eolie.desktop
@INTLTOOL_DESKTOP_RULE@
appdatadir = $(datadir)/appdata
appdata_DATA = $(appdata_in_files:.xml.in=.xml)
appdata_in_files = org.gnome.Eolie.appdata.xml.in
@INTLTOOL_XML_RULE@
# hicolor icons
hicolor_icon16dir = $(datadir)/icons/hicolor/16x16/apps
hicolor_icon16_DATA = icons/hicolor/16x16/apps/org.gnome.Eolie.png
hicolor_icon22dir = $(datadir)/icons/hicolor/22x22/apps
hicolor_icon22_DATA = icons/hicolor/22x22/apps/org.gnome.Eolie.png
hicolor_icon32dir = $(datadir)/icons/hicolor/32x32/apps
hicolor_icon32_DATA = icons/hicolor/32x32/apps/org.gnome.Eolie.png
hicolor_icon48dir = $(datadir)/icons/hicolor/48x48/apps
hicolor_icon48_DATA = icons/hicolor/48x48/apps/org.gnome.Eolie.png
hicolor_icon256dir = $(datadir)/icons/hicolor/256x256/apps
hicolor_icon256_DATA = icons/hicolor/256x256/apps/org.gnome.Eolie.png
hicolor_icon512dir = $(datadir)/icons/hicolor/512x512/apps
hicolor_icon512_DATA = icons/hicolor/512x512/apps/org.gnome.Eolie.png
hicolor_iconscalabledir = $(datadir)/icons/hicolor/scalable/apps
hicolor_iconscalable_DATA = icons/hicolor/scalable/apps/org.gnome.Eolie-symbolic.svg
hicolor_icon_files = \
$(hicolor_icon16_DATA) \
$(hicolor_icon22_DATA) \
$(hicolor_icon32_DATA) \
$(hicolor_icon48_DATA) \
$(hicolor_icon256_DATA) \
$(hicolor_icon512_DATA) \
$(hicolor_iconscalable_DATA)\
icons/hicolor/org.gnome.Eolie.svg
gtk_update_hicolor_icon_cache = gtk-update-icon-cache -f -t $(datadir)/icons/hicolor
#gtk_update_hicontrast_icon_cache = gtk-update-icon-cache -f -t $(datadir)/icons/HighContrast
install-data-hook: update-icon-cache
uninstall-hook: update-icon-cache
update-icon-cache:
@-if test -z "$(DESTDIR)"; then \
echo "Updating Gtk hicolor icon cache."; \
$(gtk_update_hicolor_icon_cache); \
#echo "Updating Gtk highcontrast icon cache."; \
#$(gtk_update_hicontrast_icon_cache); \
else \
echo "*** Icon cache not updated. After (un)install, run this:"; \
echo "*** $(gtk_update_hicolor_icon_cache)"; \
echo "*** $(gtk_update_hicolor_icon_cache)"; \
fi
gsettings_SCHEMAS = org.gnome.Eolie.gschema.xml
# For uninstalled use
gschemas.compiled: $(gsettings_SCHEMAS) Makefile
$(AM_V_GEN) $(GLIB_COMPILE_SCHEMAS) $(builddir)
@GSETTINGS_RULES@
EXTRA_DIST = \
$(hicolor_icon_files) \
$(resource_files) \
org.gnome.Eolie.appdata.xml.in \
org.gnome.Eolie.desktop.in \
eolie.gresource.xml \
org.gnome.Eolie.gschema.xml \
$(NULL)
CLEANFILES = \
eolie.gresource \
org.gnome.Eolie.appdata.xml \
$(apps_DATA) \
*.valid \
gschemas.compiled \
$(NULL)
all-local: gschemas.compiled
-include $(top_srcdir)/git.mk
icon_themes = ['hicolor']
foreach theme : icon_themes
install_subdir(theme, install_dir: 'share/icons/')
endforeach
gnome = import('gnome')
message('Compiling resources')
gnome.compile_resources(
meson.project_name(),
meson.project_name() + '.gresource.xml',
gresource_bundle: true,
source_dir: '.',
install_dir: DATA_DIR,
install: true,
dependencies: configure_file(
input: 'AboutDialog.ui.in',
output: 'AboutDialog.ui',
configuration: conf
)
)
message('Compiling schemas')
gnome.compile_schemas()
install_data(
project_id + '.gschema.xml',
install_dir: 'share/glib-2.0/schemas'
)
message('Making a .desktop file')
i18n.merge_file(
output: project_id + '.desktop',
input: project_id + '.desktop.in',
po_dir: '../subprojects/po',
type: 'desktop',
install: true,
install_dir: join_paths(get_option('datadir'), 'applications')
)
message('Preparing appdata')
i18n.merge_file(
output: project_id + '.appdata.xml',
input: project_id + '.appdata.xml.in',
po_dir: '../subprojects/po',
install: true,
install_dir: join_paths(get_option('datadir'), 'appdata')
)
message('Making a list of icons')
subdir('icons')
<?xml version="1.0" encoding="UTF-8"?>
<application>
<id type="desktop">org.gnome.Eolie.desktop</id>
<component type="desktop">
<id>org.gnome.Eolie.desktop</id>
<licence>CC0</licence>
<_name>Eolie</_name>
<_summary>Web browser</_summary>
......@@ -14,4 +14,4 @@
</screenshots>
<url type="homepage">https://github.com/gnumdk/eolie</url>
<updatecontact>cedric.bellegarde@adishatz.org</updatecontact>
</application>
</component>
[Desktop Entry]
_Name=Eolie
_GenericName=Web browser
_Comment=Web browser
Name=Eolie
GenericName=Web browser
Comment=Web browser
Icon=org.gnome.Eolie
Exec=eolie %U
Terminal=false
......@@ -12,5 +12,5 @@ StartupNotify=true
Actions=Private
[Desktop Action Private]
_Name=New private page
Name=New private page
Exec=eolie -p
......@@ -10,16 +10,16 @@ if 'EOLIE_TRACE' in os.environ:
from pycallgraph import PyCallGraph
from pycallgraph.output import GraphvizOutput
# Make sure we'll find the pygobject module, even in JHBuild
sys.path.insert(1, '@pyexecdir@')
sys.path.insert(1, '@PYTHON_EXEC_DIR@')
# Make sure we'll find the eolie modules, even in JHBuild
sys.path.insert(1, '@pythondir@')
sys.path.insert(1, '@PYTHON_DIR@')
os.environ["MOZ_PLUGIN_PATH"]="/usr/lib/epiphany/plugins"
from gi.repository import Gio
localedir = '@localedir@'
pkgdatadir = '@pkgdatadir@'
pkglibdir = '@pkglibdir@'
localedir = '@LOCALE_DIR@'
pkgdatadir = '@DATA_DIR@'
extensiondir = '@EXTENSION_DIR@'
from eolie.application import Application
......@@ -46,7 +46,7 @@ if __name__ == "__main__":
resource = Gio.resource_load(os.path.join(pkgdatadir, 'eolie.gresource'))
Gio.Resource._register(resource)
app = Application("@VERSION@", os.path.join(pkglibdir, 'webkitextension'))
app = Application("@VERSION@", os.path.join(extensiondir, 'webkitextension'))
signal.signal(signal.SIGINT, signal.SIG_DFL)
if 'EOLIE_TRACE' in os.environ:
graphviz = GraphvizOutput()
......
#!/bin/bash
pycodestyle --ignore=E722,E741,E402,E121,E123,E126,E226,E24,E704 src/*.py python-webextension/extension.py.in
pycodestyle --ignore=E722,E741,E402,E121,E123,E126,E226,E24,E704 eolie/*.py python-webextension/extension.py.in
ret="$?"
if (( ret != 0 ))
......@@ -8,7 +8,7 @@ then
exit 1
fi
flake8 --ignore=E722,E741,E402,E121,E123,E126,E226,E24,E704 src/*.py python-webextension/extension.py.in
flake8 --ignore=E722,E741,E402,E121,E123,E126,E226,E24,E704 eolie/*.py python-webextension/extension.py.in
ret="$?"
if (( ret != 0 ))
......
#!/bin/bash
pep8 --ignore=E722,E741,E402,E121,E123,E126,E226,E24,E704 src/*.py
pep8 --ignore=E722,E741,E402,E121,E123,E126,E226,E24,E704 eolie/*.py
ret="$?"
if (( ret != 0 ))
......
#!/bin/bash
python3-pep8 --ignore=E722,E741,E402,E121,E123,E126,E226,E24,E704 src/*.py
python3-pep8 --ignore=E722,E741,E402,E121,E123,E126,E226,E24,E704 eolie/*.py
ret="$?"
if (( ret != 0 ))
......@@ -8,7 +8,7 @@ then
exit 1
fi
python3-flake8 --ignore=E722,E741,E402,E121,E123,E126,E226,E24,E704 src/*.py
python3-flake8 --ignore=E722,E741,E402,E121,E123,E126,E226,E24,E704 eolie/*.py
ret="$?"
if (( ret != 0 ))
......
#!/bin/bash
pep8 --ignore=E741,E402,E121,E123,E126,E226,E24,E704 src/*.py
pep8 --ignore=E741,E402,E121,E123,E126,E226,E24,E704 eolie/*.py
ret="$?"
if (( ret != 0 ))
......@@ -8,7 +8,7 @@ then
exit 1
fi
flake8 --ignore=E741,E402,E121,E123,E126,E226,E24,E704 src/*.py
flake8 --ignore=E741,E402,E121,E123,E126,E226,E24,E704 eolie/*.py
ret="$?"
if (( ret != 0 ))
......
project('eolie', 'c',
version: '0.9.2',
meson_version: '>= 0.40.0',
)
i18n = import('i18n')
python = import('python3')
project_id = 'org.gnome.Eolie'
message('Looking for dependencies')
python_bin = python.find_python()
if not python_bin.found()
error('No valid python3 binary found')
else
message('Found python3 binary')
endif
dependency('glib-2.0')
dependency('gobject-introspection-1.0', version: '>=1.35.9')
dependency('gtk+-3.0', version :'>=3.14')
env = environment()
python_dir = join_paths(get_option('prefix'), python.sysconfig_path('purelib'))
LIBEXEC_DIR = join_paths(get_option('prefix'), get_option('libexecdir'))
EXTENSION_DIR = join_paths(get_option('prefix'), get_option('libdir'), meson.project_name())
DATA_DIR = join_paths(get_option('prefix'), get_option('datadir'), meson.project_name())
bindir = join_paths(get_option('prefix'), get_option('bindir'))
conf = configuration_data()
conf.set('PACKAGE_URL', 'https://github.com/gnumdk/eolie')
conf.set('DATA_DIR', DATA_DIR)
conf.set('EXTENSION_DIR', EXTENSION_DIR)
conf.set('LOCALE_DIR', join_paths(get_option('prefix'), get_option('datadir'), 'locale'))
conf.set('PYTHON_DIR', python_dir)
conf.set('PYTHON_EXEC_DIR', join_paths(get_option('prefix'), python.sysconfig_path('stdlib')))
conf.set('PYTHON', python_bin.path())
conf.set('libexecdir', LIBEXEC_DIR)
conf.set('VERSION', meson.project_version())
subdir('data')
subdir('python-webextension')
subproject('po')
subdir('search-provider')
install_subdir(
'eolie',
install_dir: python_dir
)
message('Preparing init file')
configure_file(
input: 'eolie.in',
output: 'eolie',
configuration: conf,
install_dir: bindir
)
meson.add_install_script('meson_post_install.py')
#!/usr/bin/env python3
from os import environ, path
from subprocess import call
prefix = environ.get('MESON_INSTALL_PREFIX', '/usr/local')
datadir = path.join(prefix, 'share')
destdir = environ.get('DESTDIR', '')
if not destdir:
print('Updating icon cache...')
call(['gtk-update-icon-cache', '-qtf', path.join(datadir, 'icons', 'hicolor')])
print("Installing new Schemas")
call(['glib-compile-schemas', path.join(datadir, 'glib-2.0/schemas')])
#
# Makefile
# Adrian Perez, 2015-08-25 11:58
#
webkitextensiondir = $(libdir)/eolie/webkitextension
webkitextension_DATA = extension.py
extension.py: extension.py.in Makefile
$(AM_V_GEN)sed \
-e s!\@pythondir\@!$(pythondir)! \
-e s!\@pyexecdir\@!$(pyexecdir)! \
< $< > $@
chmod a+x $@
libpythonloader_la_SOURCES=libpythonloader.c
libpythonloader_la_CFLAGS=$(WEBKIT2GTK_WEB_EXTENSION_CFLAGS)\
$(PYGOBJECT_CFLAGS)\
$(PYTHON_CFLAGS)
libpythonloader_la_LDFLAGS=$(PYTHON_LDFLAGS)
webkitextension_LTLIBRARIES = libpythonloader.la
EXTRA_DIST = \
extension.py.in\
$(webkitextension_DATA)
CLEANFILES = \
extension.py\
$(lib_LTLIBRARIES)
-include $(top_srcdir)/git.mk
......@@ -12,9 +12,9 @@
import sys
# Make sure we'll find the pygobject module, even in JHBuild
sys.path.insert(1, '@pyexecdir@')
sys.path.insert(1, '@PYTHON_EXEC_DIR@')
# Make sure we'll find the eolie modules, even in JHBuild
sys.path.insert(1, '@pythondir@')
sys.path.insert(1, '@PYTHON_DIR@')
from gi.repository import Gio
......
extension_dir = join_paths(get_option('libdir'), 'eolie', 'webkitextension')
webkitextension = dependency('webkit2gtk-web-extension-4.0')
pyobject = dependency('pygobject-3.0')
python3 = dependency('python3')
shared_library('pythonloader',
'pythonloader.c',
dependencies: [webkitextension, pyobject, python3],
install: true,
install_dir: extension_dir)
configure_file(
input: 'extension.py.in',
output: 'extension.py',
configuration: conf,
install_dir: extension_dir
)
eolie-sp: eolie-sp.in Makefile
$(AM_V_GEN)sed \
-e s!\@srcdir\@!$(abs_top_srcdir)! \
-e s!\@prefix\@!$(prefix)! \
-e s!\@datadir\@!$(datadir)! \
-e s!\@pkgdatadir\@!$(pkgdatadir)! \
-e s!\@libexecdir\@!$(libexecdir)! \
-e s!\@libdir\@!$(libdir)! \
-e s!\@PYTHON\@!$(PYTHON)! \
-e s!\@pkglibdir\@!$(pkglibdir)! \
-e s!\@localedir\@!$(localedir)! \
-e s!\@pythondir\@!$(pythondir)! \
-e s!\@pyexecdir\@!$(pyexecdir)! \
-e s!\@PACKAGE\@!$(PACKAGE)! \
-e s!\@VERSION\@!$(VERSION)! \
< $< > $@
chmod a+x $@
org.gnome.Eolie.SearchProvider.service: org.gnome.Eolie.SearchProvider.service.in Makefile
$(AM_V_GEN)sed \
-e s!\@srcdir\@!$(abs_top_srcdir)! \
-e s!\@prefix\@!$(prefix)! \
-e s!\@datadir\@!$(datadir)! \
-e s!\@pkgdatadir\@!$(pkgdatadir)! \
-e s!\@libexecdir\@!$(libexecdir)! \
-e s!\@libdir\@!$(libdir)! \
-e s!\@pkglibdir\@!$(pkglibdir)! \
-e s!\@localedir\@!$(localedir)! \
-e s!\@pythondir\@!$(pythondir)! \
-e s!\@pyexecdir\@!$(pyexecdir)! \
-e s!\@PACKAGE\@!$(PACKAGE)! \
-e s!\@VERSION\@!$(VERSION)! \
< $< > $@
searchproviderdir = $(datadir)/gnome-shell/search-providers
searchprovider_DATA = eolie-search-provider.ini
servicedir = $(datadir)/dbus-1/services
service_DATA = $(service_in_files:.service.in=.service)
service_in_files = org.gnome.Eolie.SearchProvider.service.in
libexec_SCRIPTS = eolie-sp
EXTRA_DIST = \
org.gnome.Eolie.SearchProvider.service.in\
eolie-sp.in\
$(libexec_SCRIPTS)\
$(searchprovider_DATA) \
$(service_DATA)
CLEANFILES = \
$(libexec_SCRIPTS)\
$(service_DATA)
-include $(top_srcdir)/git.mk
......@@ -13,9 +13,9 @@
import sys
# Make sure we'll find the pygobject module, even in JHBuild
sys.path.insert(1, '@pyexecdir@')
sys.path.insert(1, '@PYTHON_EXEC_DIR@')
# Make sure we'll find the eolie modules, even in JHBuild
sys.path.insert(1, '@pythondir@')
sys.path.insert(1, '@PYTHON_DIR@')
import gi
gi.require_version('Gtk', '3.0')
......
service_dir = join_paths(get_option('datadir'), 'dbus-1', 'services')
serarch_provider_dir = join_paths(get_option('datadir'), 'gnome-shell', 'search-providers')