Commit 7768d9b4 authored by Daniele Napolitano's avatar Daniele Napolitano
Browse files

Porting the build system to meson; remove autotools files and waf

parent 9a3a55e8
SUBDIRS = src data po
EXTRA_DIST = \
autogen.sh \
intltool-extract.in \
intltool-merge.in \
intltool-update.in
DISTCLEANFILES = \
intltool-extract \
intltool-merge \
intltool-update
dist-hook:
@if test -d "$(srcdir)/.bzr"; \
then \
echo Creating ChangeLog && \
( cd "$(top_srcdir)" && \
echo '# Generated by Makefile. Do not edit.'; echo; \
$(top_srcdir)/missing --run bzr log \
--gnu-changelog ) | \
fmt --split-only > ChangeLog.tmp \
&& mv -f ChangeLog.tmp $(top_distdir)/ChangeLog \
|| ( rm -f ChangeLog.tmp ; \
echo Failed to generate ChangeLog >&2 ); \
else \
echo A bzr branch is required to generate a ChangeLog >&2; \
fi
......@@ -14,14 +14,11 @@ In order to compile UPnP Router Control you need following software packages:
- GSSDP library ( >= 1.2 )
- GUPnP library ( >= 1.2 )
To configure run:
./configure --prefix=/usr
To build you need Meson (and thereby Ninja) build system:
Configure automatically searches for all required components and packages.
To compile and install run:
make
sudo make install
meson build
ninja -C build
(sudo) ninja -C build install
Information
......
This diff is collapsed.
AC_INIT([upnp-router-control],
[0.3.1],
[https://bugs.launchpad.net/upnp-router-control/+filebug],
[upnp-router-control])
AC_CONFIG_HEADERS(config.h)
AC_CONFIG_SRCDIR(src/urc-main.c)
AC_CONFIG_MACRO_DIR([m4])
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE
AM_MAINTAINER_MODE([enable])
# Use AM_SILENT_RULES if present
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
dnl make sure we keep ACLOCAL_FLAGS around for maintainer builds to work
AC_SUBST(ACLOCAL_AMFLAGS, "\${ACLOCAL_FLAGS}")
AC_ISC_POSIX
AC_PROG_CC
AM_PROG_CC_STDC
AC_HEADER_STDC
AC_PROG_INSTALL
AC_PROG_MAKE_SET
CFLAGS="${CFLAGS} -Wall"
dnl Initialize intltool
GETTEXT_PACKAGE=upnp-router-control
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [GETTEXT package name])
IT_PROG_INTLTOOL(0.40.0)
AM_GLIB_GNU_GETTEXT
AC_SEARCH_LIBS([ceil], [m])
AC_PATH_PROG(GLIB_COMPILE_RESOURCES, glib-compile-resources, glib-compile-resources)
#### Check for GTK+ 3 ####
PKG_CHECK_MODULES(GTK, gtk+-3.0 >= 3.10,,
AC_MSG_ERROR([GTK3 >= 3.10 is required to compile upnp-router-control]))
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)
#### Check for gssdp1.2 ####
PKG_CHECK_MODULES(GSSDP, gssdp-1.2,,
AC_MSG_ERROR([libgssdp-1.2 is required to compile upnp-router-control]))
AC_SUBST(GSSDP_CFLAGS)
AC_SUBST(GSSDP_LIBS)
#### Check for gupnp1.2 ####
PKG_CHECK_MODULES(GUPNP, gupnp-1.2,,
AC_MSG_ERROR([libgupnp-1.2 is required to compile upnp-router-control]))
AC_SUBST(GUPNP_CFLAGS)
AC_SUBST(GUPNP_LIBS)
AC_CONFIG_FILES([
Makefile
src/Makefile
data/Makefile
po/Makefile.in
])
AC_OUTPUT
echo
echo -e "Now type 'make' to compile upnp-router-control,\nthen type 'sudo make install' to install it."
icons = \
apps_16x16_org.upnproutercontrol.UPnPRouterControl.png \
apps_22x22_org.upnproutercontrol.UPnPRouterControl.png \
apps_24x24_org.upnproutercontrol.UPnPRouterControl.png \
apps_32x32_org.upnproutercontrol.UPnPRouterControl.png \
apps_48x48_org.upnproutercontrol.UPnPRouterControl.png \
apps_scalable_org.upnproutercontrol.UPnPRouterControl.svg \
$(NULL)
noinst_DATA = \
apps_16x16_org.upnproutercontrol.UPnPRouterControl.svg \
apps_22x22_org.upnproutercontrol.UPnPRouterControl.svg \
apps_24x24_org.upnproutercontrol.UPnPRouterControl.svg \
apps_32x32_org.upnproutercontrol.UPnPRouterControl.svg \
apps_48x48_org.upnproutercontrol.UPnPRouterControl.svg \
apps_64x64_org.upnproutercontrol.UPnPRouterControl.svg \
$(NULL)
# AppData
@INTLTOOL_XML_RULE@
appdatadir = $(datadir)/metainfo
appdata_in_files = org.upnproutercontrol.UPnPRouterControl.appdata.xml.in
appdata_DATA = $(appdata_in_files:.xml.in=.xml)
@INTLTOOL_DESKTOP_RULE@
desktopdir = $(datadir)/applications
desktop_in_files = upnp-router-control.desktop.in
desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
man_MANS = upnp-router-control.1
EXTRA_DIST = \
$(icons) \
$(noinst_DATA) \
$(desktop_in_files) \
$(appdata_in_files) \
$(man_MANS) \
$(NULL)
DISTCLEANFILES = \
$(desktop_DATA) \
$(appdata_DATA) \
$(NULL)
CLEANFILES = \
$(desktop_DATA) \
$(appdata_DATA) \
$(NULL)
###############################################################################
gtk_update_icon_cache = gtk-update-icon-cache -f -t $(datadir)/icons/hicolor
update-icon-cache:
@-if test -z "$(DESTDIR)"; then \
echo "Updating Gtk icon cache."; \
$(gtk_update_icon_cache); \
else \
echo "*** Icon cache not updated. After (un)install, run this:"; \
echo "*** $(gtk_update_icon_cache)"; \
fi
install-icons:
for icon in $(icons); do \
CONTEXT=`echo $$icon | cut -d_ -f1`; \
SIZE=`echo $$icon | cut -d_ -f2`; \
ICONFILE=`echo $$icon | cut -d_ -f3`; \
mkdir -p $(DESTDIR)$(datadir)/icons/hicolor/$$SIZE/$$CONTEXT; \
$(INSTALL_DATA) $(srcdir)/$$icon $(DESTDIR)$(datadir)/icons/hicolor/$$SIZE/$$CONTEXT/$$ICONFILE; \
done;
uninstall-icons:
-for icon in $(icons); do \
CONTEXT=`echo $$icon | cut -d_ -f1`; \
SIZE=`echo $$icon | cut -d_ -f2`; \
ICONFILE=`echo $$icon | cut -d_ -f3`; \
rm -f $(DESTDIR)$(datadir)/icons/hicolor/$$SIZE/$$CONTEXT/$$ICONFILE; \
done;
clean-local:
rm -f *~
install-data-local: install-icons update-icon-cache
uninstall-local: uninstall-icons update-icon-cache
install_subdir(
'scalable/apps',
install_dir: join_paths(data_dir, 'icons/hicolor/scalable'),
)
foreach icon_size: ['16x16', '22x22', '24x24', '32x32', '48x48']
install_subdir(
join_paths(icon_size, 'apps'),
install_dir: join_paths(data_dir, 'icons/hicolor', icon_size),
)
endforeach
subdir('icons')
desktop = meson.project_name() + '.desktop'
# Desktop files
i18n.merge_file(
type: 'desktop',
input: desktop + '.in',
output: desktop,
po_dir: po_dir,
install: true,
install_dir: join_paths(data_dir, 'applications')
)
# Man file
install_man('upnp-router-control.1')
# Appdata files
appdata = i18n.merge_file(
'appdata',
input: '@0@.appdata.xml.in'.format(application_id),
output: '@0@.appdata.xml'.format(application_id),
po_dir: po_dir,
install: true,
install_dir: join_paths(data_dir, 'metainfo')
)
[Desktop Entry]
Type=Application
_Name=UPnP Router Control
_Comment=A simple program to manage UPnP IGD compliant routers
Name=UPnP Router Control
Comment=A simple program to manage UPnP IGD compliant routers
Exec=upnp-router-control
Icon=org.upnproutercontrol.UPnPRouterControl
StartupNotify=true
Terminal=false
Categories=Utility;
Categories=GTK;Network;Utility;
#! /usr/bin/env python
# encoding: utf-8
# Daniele Napolitano, 2009
# Launcher
if bld.env['INTLTOOL']:
obj = bld.new_task_gen('intltool_in')
obj.source = 'upnp-router-control.desktop.in'
obj.install_path = '${DATADIR}/applications'
obj.podir = '../po'
obj.flags = ['-d', '-u', '-c' ]
# Appdata
if bld.env['INTLTOOL']:
obj = bld.new_task_gen('intltool_in')
obj.source = 'upnp-router-control.appdata.xml.in'
obj.install_path = '${DATADIR}/appdata'
obj.podir = '../po'
obj.flags = ['-d', '-u', '-c' ]
# Icons
bld.install_as('${DATADIR}/icons/hicolor/scalable/apps/upnp-router-control.svg', 'apps_scalable_upnp-router-control.svg')
for i in ["16x16", "22x22", "24x24", "32x32", "48x48"]:
bld.install_as('${DATADIR}/icons/hicolor/%s/apps/upnp-router-control.png' % i, 'apps_%s_upnp-router-control.png' % i)
# Glade file
bld.install_as('${DATADIR}/upnp-router-control/upnp-router-control.ui', 'upnp-router-control.ui')
bld.install_as('${DATADIR}/upnp-router-control/upnp-router-control-headermenu.ui', 'upnp-router-control-headermenu.ui')
# Man page
bld.install_as('${DATADIR}/man/man1/upnp-router-control.1', 'upnp-router-control.1')
project('upnp-router-control', 'c',
version: '0.3.1',
meson_version: '>= 0.50.0',
license: 'GPLv3+',
)
#################
# Default paths #
#################
prefix = get_option('prefix')
bin_dir = join_paths(prefix, get_option('bindir'))
locale_dir = join_paths(prefix, get_option('localedir'))
data_dir = join_paths(prefix, get_option('datadir'))
man_dir = join_paths(prefix, get_option('mandir'))
po_dir = join_paths(meson.source_root(), 'po')
###########
# Config #
###########
application_id = 'org.upnproutercontrol.UPnPRouterControl'
config_h = configuration_data()
# package
set_defines = [
['PACKAGE', meson.project_name()],
['PACKAGE_NAME', meson.project_name()],
['PACKAGE_STRING', '@0@ @1@'.format(meson.project_name(), meson.project_version())],
['PACKAGE_TARNAME', meson.project_name()],
['PACKAGE_VERSION', meson.project_version()],
['VERSION', meson.project_version()],
['GETTEXT_PACKAGE', meson.project_name()],
['APPLICATION_ID', application_id]
]
foreach define: set_defines
config_h.set_quoted(define[0], define[1])
endforeach
configure_file(
output: 'config.h',
configuration: config_h
)
cc = meson.get_compiler('c')
# Compiler flags
common_flags = [
'-DHAVE_CONFIG_H',
'-DPACKAGE_LOCALE_DIR="@0@"'.format(locale_dir),
]
add_project_arguments(common_flags, language: 'c')
libm_dep = cc.find_library('m')
check_math_functions_required = [
'ceil',
]
foreach func: check_math_functions_required
assert(cc.has_function(func, dependencies: libm_dep), func + ' not found')
endforeach
################
# Dependencies #
################
glib = dependency('glib-2.0', version: '>= 2.67.5')
gtk = dependency('gtk+-3.0', version: '>= 3.10')
gssdp = dependency('gssdp-1.2', version: '>= 1.2')
gupnp = dependency('gupnp-1.2', version: '>= 1.2')
i18n = import('i18n')
gnome = import('gnome')
top_inc = include_directories('.')
# Subdirs
subdir('src')
subdir('data')
subdir('po')
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment