diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2021-06-10 22:01:16 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2021-06-10 22:01:16 +0200 |
commit | 80245fc04e09148863c493af860a6b2710909888 (patch) | |
tree | b12c83377af5017dcb2aa63cfc760209c279dc4e | |
parent | 31484851efadc92f86fb117dcf9b6c81b053de10 (diff) | |
parent | fd8225ec3949f2e94ea8278563c7fdbe427617c7 (diff) | |
download | libayatana-appindicator-80245fc04e09148863c493af860a6b2710909888.tar.gz libayatana-appindicator-80245fc04e09148863c493af860a6b2710909888.tar.bz2 libayatana-appindicator-80245fc04e09148863c493af860a6b2710909888.zip |
Merge branch 'tari01-pr/move-to-cmake'
Attributes GH PR #16: https://github.com/AyatanaIndicators/libayatana-appindicator/pull/16
52 files changed, 1536 insertions, 1825 deletions
@@ -45,6 +45,9 @@ requires: - libgtk2.0-dev - gtk-sharp2-gapi - libgtk2.0-cil-dev + - libgtk3.0-cil-dev + - gtk-sharp3-gapi + - libdbus-1-dev - libdbus-glib-1-dev - libdbusmenu-glib-dev - libdbusmenu-gtk3-dev @@ -75,6 +78,9 @@ requires: - libgtk2.0-dev - gtk-sharp2-gapi - libgtk2.0-cil-dev + - libgtk3.0-cil-dev + - gtk-sharp3-gapi + - libdbus-1-dev - libdbus-glib-1-dev - libdbusmenu-glib-dev - libdbusmenu-gtk3-dev diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..c28eab1 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,74 @@ +cmake_minimum_required(VERSION 3.13) +project(libayatana-appindicator C) + +if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + SET(CMAKE_INSTALL_PREFIX "/usr" CACHE PATH "..." FORCE) +endif(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + +list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) + +option(ENABLE_TESTS "Enable all tests and checks" OFF) +option(ENABLE_COVERAGE "Enable coverage reports (includes enabling all tests and checks)" OFF) + +# Check for prerequisites + +set(DEPS glib-2.0>=2.58 ayatana-indicator3-0.4>=0.8.4 gtk+-3.0>=3.24 dbusmenu-gtk3-0.4) + +if(ENABLE_COVERAGE) + set(ENABLE_TESTS ON) + set(CMAKE_BUILD_TYPE "Coverage") +else() + set(CMAKE_BUILD_TYPE "Release") +endif() + +if(ENABLE_TESTS) + set(DEPS ${DEPS} dbus-1>=1.12 dbus-glib-1>=0.82) +endif() + +find_package(PkgConfig REQUIRED) +pkg_check_modules(PROJECT_DEPS REQUIRED ${DEPS}) + +# Set global variables + +include(GNUInstallDirs) +set(PROJECT_VERSION "0.5.90") +set(PROJECT_NAME "libayatana-appindicator") + +if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + + set(COMPILE_FLAGS "${COMPILE_FLAGS} -Weverything") + set(COMPILE_FLAGS "${COMPILE_FLAGS} -Wno-c++98-compat -Wno-padded") + set(COMPILE_FLAGS "${COMPILE_FLAGS} -Wno-documentation") + +else() + + set(COMPILE_FLAGS "${COMPILE_FLAGS} -Wall") + +endif() + +# Make everything + +add_subdirectory(src) +add_subdirectory(bindings) +add_subdirectory(docs) + +if (ENABLE_TESTS) + + include(CTest) + enable_testing() + add_subdirectory(tests) + add_subdirectory(example) + + if(ENABLE_COVERAGE) + + find_package(CoverageReport) + ENABLE_COVERAGE_REPORT(TARGETS "ayatana-appindicator3" TESTS "test-libappindicator" "test-libappindicator-dbus-client" "test-libappindicator-dbus-server" "test-libappindicator-status-client" "test-libappindicator-status-server" "test-libappindicator-fallback-item" "test-libappindicator-fallback-watcher" FILTER /usr/include ${CMAKE_BINARY_DIR}/*) + + endif() + +endif() + +# Display config info + +message(STATUS "Install prefix: ${CMAKE_INSTALL_PREFIX}") +message(STATUS "Unit tests: ${ENABLE_TESTS}") diff --git a/Makefile.am b/Makefile.am deleted file mode 100644 index 7ecb538..0000000 --- a/Makefile.am +++ /dev/null @@ -1,52 +0,0 @@ -ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} - -SUBDIRS = \ - src \ - bindings \ - docs - -# FIXME: Disabled, vala error -# example - -if WANT_TESTS -SUBDIRS += tests -endif - -EXTRA_DIST = \ - m4/introspection.m4 \ - gtk-doc.make \ - omf.make \ - xmldocs.make \ - autogen.sh \ - COPYING.LGPL.2.1 \ - ChangeLog - -DISTCLEANFILES = \ - INSTALL \ - Makefile.in \ - aclocal.m4 \ - ar-lib \ - autom4te.cache/ \ - compile \ - config.guess \ - config.h.in \ - config.h.in~ \ - config.sub \ - configure \ - depcomp \ - gtk-doc.make \ - install-sh \ - ltmain.sh \ - m4/gtk-doc.m4 \ - m4/libtool.m4 \ - m4/ltoptions.m4 \ - m4/ltsugar.m4 \ - m4/ltversion.m4 \ - m4/lt~obsolete.m4 \ - missing \ - omf.make \ - py-compile \ - test-driver \ - xmldocs.make - -include $(top_srcdir)/Makefile.am.coverage diff --git a/Makefile.am.coverage b/Makefile.am.coverage deleted file mode 100644 index fb97747..0000000 --- a/Makefile.am.coverage +++ /dev/null @@ -1,48 +0,0 @@ - -# Coverage targets - -.PHONY: clean-gcno clean-gcda \ - coverage-html generate-coverage-html clean-coverage-html \ - coverage-gcovr generate-coverage-gcovr clean-coverage-gcovr - -clean-local: clean-gcno clean-coverage-html clean-coverage-gcovr - -if HAVE_GCOV - -clean-gcno: - @echo Removing old coverage instrumentation - -find -name '*.gcno' -print | xargs -r rm - -clean-gcda: - @echo Removing old coverage results - -find -name '*.gcda' -print | xargs -r rm - -coverage-html: clean-gcda - -$(MAKE) $(AM_MAKEFLAGS) -k check - $(MAKE) $(AM_MAKEFLAGS) generate-coverage-html - -generate-coverage-html: - @echo Collecting coverage data - $(LCOV) --directory $(top_builddir) --capture --output-file coverage.info --no-checksum --compat-libtool - LANG=C $(GENHTML) --prefix $(top_builddir) --output-directory coveragereport --title "Code Coverage" --legend --show-details coverage.info - -clean-coverage-html: clean-gcda - -$(LCOV) --directory $(top_builddir) -z - -rm -rf coverage.info coveragereport - -if HAVE_GCOVR - -coverage-gcovr: clean-gcda - -$(MAKE) $(AM_MAKEFLAGS) -k check - $(MAKE) $(AM_MAKEFLAGS) generate-coverage-gcovr - -generate-coverage-gcovr: - @echo Generating coverage GCOVR report - $(GCOVR) -x -r $(top_builddir) -o $(top_builddir)/coverage.xml - -clean-coverage-gcovr: clean-gcda - -rm -rf $(top_builddir)/coverage.xml - -endif # HAVE_GCOVR - -endif # HAVE_GCOV diff --git a/Makefile.am.enum b/Makefile.am.enum deleted file mode 100644 index 0503de0..0000000 --- a/Makefile.am.enum +++ /dev/null @@ -1,45 +0,0 @@ -# Rules for generating enumeration types using glib-mkenums -# -# Define: -# glib_enum_h = header template file -# glib_enum_c = source template file -# glib_enum_headers = list of headers to parse -# -# before including Makefile.am.enums. You will also need to have -# the following targets already defined: -# -# CLEANFILES -# DISTCLEANFILES -# BUILT_SOURCES -# EXTRA_DIST -# -# Author: Emmanuele Bassi <ebassi@linux.intel.com> - -enum_tmpl_h=$(glib_enum_h:.h=.h.in) -enum_tmpl_c=$(glib_enum_c:.c=.c.in) - -CLEANFILES += stamp-enum-types -DISTCLEANFILES += $(glib_enum_h) $(glib_enum_c) -BUILT_SOURCES += $(glib_enum_h) $(glib_enum_c) -EXTRA_DIST += $(enum_tmpl_h) $(enum_tmpl_c) - -stamp-enum-types: $(glib_enum_headers) - $(QUIET_GEN)mkdir -p `dirname $(builddir)/$(glib_enum_h)` - $(QUIET_GEN)$(GLIB_MKENUMS) \ - --template $(srcdir)/$(enum_tmpl_h) \ - $(glib_enum_headers) > xgen-eh \ - && (cmp -s xgen-eh $(builddir)/$(glib_enum_h) || cp -f xgen-eh $(builddir)/$(glib_enum_h)) \ - && rm -f xgen-eh \ - && echo timestamp > $(@F) - -$(glib_enum_h): stamp-enum-types - @true - -$(glib_enum_c): $(glib_enum_h) - $(QUIET_GEN)mkdir -p `dirname $(builddir)/$(glib_enum_c)` - $(QUIET_GEN)$(GLIB_MKENUMS) \ - --template $(srcdir)/$(enum_tmpl_c) \ - $(glib_enum_headers) > xgen-ec \ - && cp -f xgen-ec $(builddir)/$(glib_enum_c) \ - && rm -f xgen-ec - diff --git a/Makefile.am.marshal b/Makefile.am.marshal deleted file mode 100644 index a6ab024..0000000 --- a/Makefile.am.marshal +++ /dev/null @@ -1,45 +0,0 @@ -# Rules for generating marshal files using glib-genmarshal -# -# Define: -# glib_marshal_list = marshal list file -# glib_marshal_prefix = prefix for marshal functions -# -# before including Makefile.am.marshal. You will also need to have -# the following targets already defined: -# -# CLEANFILES -# DISTCLEANFILES -# BUILT_SOURCES -# EXTRA_DIST -# -# Author: Emmanuele Bassi <ebassi@linux.intel.com> - -marshal_h = $(glib_marshal_list:.list=.h) -marshal_c = $(glib_marshal_list:.list=.c) - -CLEANFILES += stamp-marshal -DISTCLEANFILES += $(marshal_h) $(marshal_c) -BUILT_SOURCES += $(marshal_h) $(marshal_c) -EXTRA_DIST += $(glib_marshal_list) - -stamp-marshal: $(glib_marshal_list) - $(QUIET_GEN)$(GLIB_GENMARSHAL) \ - --prefix=$(glib_marshal_prefix) \ - --header \ - $(srcdir)/$(glib_marshal_list) > xgen-mh \ - && (cmp -s xgen-mh $(marshal_h) || cp -f xgen-mh $(marshal_h)) \ - && rm -f xgen-mh \ - && echo timestamp > $(@F) - -$(marshal_h): stamp-marshal - @true - -$(marshal_c): $(marshal_h) - $(QUIET_GEN)(echo "#include \"$(marshal_h)\"" ; \ - $(GLIB_GENMARSHAL) \ - --prefix=$(glib_marshal_prefix) \ - --body \ - $(srcdir)/$(glib_marshal_list)) > xgen-mc \ - && cp xgen-mc $(marshal_c) \ - && rm -f xgen-mc - diff --git a/acinclude.m4 b/acinclude.m4 deleted file mode 100644 index 8c75106..0000000 --- a/acinclude.m4 +++ /dev/null @@ -1,247 +0,0 @@ -## ------------------------ -## Python file handling -## From Andrew Dalke -## Updated by James Henstridge -## ------------------------ - -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 -# Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program 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 General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -# AM_PATH_PYTHON([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) - -# Adds support for distributing Python modules and packages. To -# install modules, copy them to $(pythondir), using the python_PYTHON -# automake variable. To install a package with the same name as the -# automake package, install to $(pkgpythondir), or use the -# pkgpython_PYTHON automake variable. - -# The variables $(pyexecdir) and $(pkgpyexecdir) are provided as -# locations to install python extension modules (shared libraries). -# Another macro is required to find the appropriate flags to compile -# extension modules. - -# If your package is configured with a different prefix to python, -# users will have to add the install directory to the PYTHONPATH -# environment variable, or create a .pth file (see the python -# documentation for details). - -# If the MINIMUM-VERSION argument is passed, AM_PATH_PYTHON will -# cause an error if the version of python installed on the system -# doesn't meet the requirement. MINIMUM-VERSION should consist of -# numbers and dots only. - -AC_DEFUN([AM_PATH_PYTHON], - [ - dnl Find a Python interpreter. Python versions prior to 1.5 are not - dnl supported because the default installation locations changed from - dnl $prefix/lib/site-python in 1.4 to $prefix/lib/python1.5/site-packages - dnl in 1.5. - m4_define([_AM_PYTHON_INTERPRETER_LIST], - [python python2 python2.4 python2.3 python2.2 dnl -python2.1 python2.0 python1.6 python1.5]) - - m4_if([$1],[],[ - dnl No version check is needed. - # Find any Python interpreter. - if test -z "$PYTHON"; then - PYTHON=: - AC_PATH_PROGS([PYTHON], _AM_PYTHON_INTERPRETER_LIST) - fi - am_display_PYTHON=python - ], [ - dnl A version check is needed. - if test -n "$PYTHON"; then - # If the user set $PYTHON, use it and don't search something else. - AC_MSG_CHECKING([whether $PYTHON version >= $1]) - AM_PYTHON_CHECK_VERSION([$PYTHON], [$1], - [AC_MSG_RESULT(yes)], - [AC_MSG_ERROR(too old)]) - am_display_PYTHON=$PYTHON - else - # Otherwise, try each interpreter until we find one that satisfies - # VERSION. - AC_CACHE_CHECK([for a Python interpreter with version >= $1], - [am_cv_pathless_PYTHON],[ - for am_cv_pathless_PYTHON in _AM_PYTHON_INTERPRETER_LIST none; do - test "$am_cv_pathless_PYTHON" = none && break - AM_PYTHON_CHECK_VERSION([$am_cv_pathless_PYTHON], [$1], [break]) - done]) - # Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON. - if test "$am_cv_pathless_PYTHON" = none; then - PYTHON=: - else - AC_PATH_PROG([PYTHON], [$am_cv_pathless_PYTHON]) - fi - am_display_PYTHON=$am_cv_pathless_PYTHON - fi - ]) - - if test "$PYTHON" = :; then - dnl Run any user-specified action, or abort. - m4_default([$3], [AC_MSG_ERROR([no suitable Python interpreter found])]) - else - - dnl Query Python for its version number. Getting [:3] seems to be - dnl the best way to do this; it's what "site.py" does in the standard - dnl library. - - AC_CACHE_CHECK([for $am_display_PYTHON version], [am_cv_python_version], - [am_cv_python_version=`$PYTHON -c "import sys; print sys.version[[:3]]"`]) - AC_SUBST([PYTHON_VERSION], [$am_cv_python_version]) - - dnl Use the values of $prefix and $exec_prefix for the corresponding - dnl values of PYTHON_PREFIX and PYTHON_EXEC_PREFIX. These are made - dnl distinct variables so they can be overridden if need be. However, - dnl general consensus is that you shouldn't need this ability. - - AC_SUBST([PYTHON_PREFIX], ['${prefix}']) - AC_SUBST([PYTHON_EXEC_PREFIX], ['${exec_prefix}']) - - dnl At times (like when building shared libraries) you may want - dnl to know which OS platform Python thinks this is. - - AC_CACHE_CHECK([for $am_display_PYTHON platform], [am_cv_python_platform], - [am_cv_python_platform=`$PYTHON -c "import sys; print sys.platform"`]) - AC_SUBST([PYTHON_PLATFORM], [$am_cv_python_platform]) - - - dnl Set up 4 directories: - - dnl pythondir -- where to install python scripts. This is the - dnl site-packages directory, not the python standard library - dnl directory like in previous automake betas. This behavior - dnl is more consistent with lispdir.m4 for example. - dnl Query distutils for this directory. distutils does not exist in - dnl Python 1.5, so we fall back to the hardcoded directory if it - dnl doesn't work. - AC_CACHE_CHECK([for $am_display_PYTHON script directory], - [am_cv_python_pythondir], - [am_cv_python_pythondir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(0,0,prefix='$PYTHON_PREFIX')" 2>/dev/null || - echo "$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages"`]) - AC_SUBST([pythondir], [$am_cv_python_pythondir]) - - dnl pkgpythondir -- $PACKAGE directory under pythondir. Was - dnl PYTHON_SITE_PACKAGE in previous betas, but this naming is - dnl more consistent with the rest of automake. - - AC_SUBST([pkgpythondir], [\${pythondir}/$PACKAGE]) - - dnl pyexecdir -- directory for installing python extension modules - dnl (shared libraries) - dnl Query distutils for this directory. distutils does not exist in - dnl Python 1.5, so we fall back to the hardcoded directory if it - dnl doesn't work. - AC_CACHE_CHECK([for $am_display_PYTHON extension module directory], - [am_cv_python_pyexecdir], - [am_cv_python_pyexecdir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(1,0,prefix='$PYTHON_EXEC_PREFIX')" 2>/dev/null || - echo "${PYTHON_EXEC_PREFIX}/lib/python${PYTHON_VERSION}/site-packages"`]) - AC_SUBST([pyexecdir], [$am_cv_python_pyexecdir]) - - dnl pkgpyexecdir -- $(pyexecdir)/$(PACKAGE) - - AC_SUBST([pkgpyexecdir], [\${pyexecdir}/$PACKAGE]) - - dnl Run any user-specified action. - $2 - fi - -]) - - -# AM_PYTHON_CHECK_VERSION(PROG, VERSION, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) -# --------------------------------------------------------------------------- -# Run ACTION-IF-TRUE if the Python interpreter PROG has version >= VERSION. -# Run ACTION-IF-FALSE otherwise. -# This test uses sys.hexversion instead of the string equivalent (first -# word of sys.version), in order to cope with versions such as 2.2c1. -# hexversion has been introduced in Python 1.5.2; it's probably not -# worth to support older versions (1.5.1 was released on October 31, 1998). -AC_DEFUN([AM_PYTHON_CHECK_VERSION], - [prog="import sys, string -# split strings by '.' and convert to numeric. Append some zeros -# because we need at least 4 digits for the hex conversion. -minver = map(int, string.split('$2', '.')) + [[0, 0, 0]] -minverhex = 0 -for i in xrange(0, 4): minverhex = (minverhex << 8) + minver[[i]] -sys.exit(sys.hexversion < minverhex)" - AS_IF([AM_RUN_LOG([$1 -c "$prog"])], [$3], [$4])]) -python.m4 - - -## this one is commonly used with AM_PATH_PYTHONDIR ... -dnl AM_CHECK_PYMOD(MODNAME [,SYMBOL [,ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]]]) -dnl Check if a module containing a given symbol is visible to python. -AC_DEFUN([AM_CHECK_PYMOD], -[AC_REQUIRE([AM_PATH_PYTHON]) -py_mod_var=`echo $1['_']$2 | sed 'y%./+-%__p_%'` -AC_MSG_CHECKING(for ifelse([$2],[],,[$2 in ])python module $1) -AC_CACHE_VAL(py_cv_mod_$py_mod_var, [ -ifelse([$2],[], [prog=" -import sys -try: - import $1 -except ImportError: - sys.exit(1) -except: - sys.exit(0) -sys.exit(0)"], [prog=" -import $1 -$1.$2"]) -if $PYTHON -c "$prog" 1>&AC_FD_CC 2>&AC_FD_CC - then - eval "py_cv_mod_$py_mod_var=yes" - else - eval "py_cv_mod_$py_mod_var=no" - fi -]) -py_val=`eval "echo \`echo '$py_cv_mod_'$py_mod_var\`"` -if test "x$py_val" != xno; then - AC_MSG_RESULT(yes) - ifelse([$3], [],, [$3 -])dnl -else - AC_MSG_RESULT(no) - ifelse([$4], [],, [$4 -])dnl -fi -]) - -dnl a macro to check for ability to create python extensions -dnl AM_CHECK_PYTHON_HEADERS([ACTION-IF-POSSIBLE], [ACTION-IF-NOT-POSSIBLE]) -dnl function also defines PYTHON_INCLUDES -AC_DEFUN([AM_CHECK_PYTHON_HEADERS], -[AC_REQUIRE([AM_PATH_PYTHON]) -AC_MSG_CHECKING(for headers required to compile python extensions) -dnl deduce PYTHON_INCLUDES -py_prefix=`$PYTHON -c "import sys; print sys.prefix"` -py_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"` -PYTHON_INCLUDES="`$PYTHON-config --includes`" -if test "$py_prefix" != "$py_exec_prefix"; then - PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}" -fi -AC_SUBST(PYTHON_INCLUDES) -dnl check if the headers exist: -save_CPPFLAGS="$CPPFLAGS" -CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES" -AC_TRY_CPP([#include <Python.h>],dnl -[AC_MSG_RESULT(found) -$1],dnl -[AC_MSG_RESULT(not found) -$2]) -CPPFLAGS="$save_CPPFLAGS" -]) diff --git a/autogen.sh b/autogen.sh deleted file mode 100755 index 4a6b4ec..0000000 --- a/autogen.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -PKG_NAME="libayatana-appindicator" - -which mate-autogen || { - echo "You need mate-common from https://git.mate-desktop.org/mate-common" - exit 1 -} - -gtkdocize || exit 1 -USE_COMMON_DOC_BUILD=yes \ -mate-autogen --enable-gtk-doc $@ diff --git a/bindings/CMakeLists.txt b/bindings/CMakeLists.txt new file mode 100644 index 0000000..b4fa5de --- /dev/null +++ b/bindings/CMakeLists.txt @@ -0,0 +1,2 @@ +add_subdirectory(vala) +add_subdirectory(mono) diff --git a/bindings/Makefile.am b/bindings/Makefile.am deleted file mode 100644 index 804f729..0000000 --- a/bindings/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ -if USE_GTK3 -SUBDIRS = \ - vala -else -SUBDIRS = \ - vala -endif - -if HAS_MONO -SUBDIRS += mono -endif - -DISTCLEANFILES = Makefile.in diff --git a/bindings/mono/ApplicationIndicator.custom b/bindings/mono/ApplicationIndicator.custom deleted file mode 100644 index 4992c08..0000000 --- a/bindings/mono/ApplicationIndicator.custom +++ /dev/null @@ -1,26 +0,0 @@ -[DllImport ("ayatana-appindicator.dll")] -static extern int app_indicator_get_status (IntPtr i); - -[DllImport ("ayatana-appindicator.dll")] -static extern int app_indicator_get_category (IntPtr i); - -[DllImport ("ayatana-appindicator.dll")] -static extern void app_indicator_set_status (IntPtr i, int s); - - [GLib.Property ("status")] - public AppIndicatorStatus AppIndicatorStatus { - get { - return (AppIndicatorStatus) app_indicator_get_status (Handle); - } - - set { - app_indicator_set_status (Handle, (int) value); - } - } - - [GLib.Property ("category")] - public AppIndicatorCategory AppIndicatorCategory { - get { - return (AppIndicatorCategory) app_indicator_get_category (Handle); - } - } diff --git a/bindings/mono/ApplicationIndicatorCustom.cs b/bindings/mono/ApplicationIndicatorCustom.cs new file mode 100644 index 0000000..372b1c1 --- /dev/null +++ b/bindings/mono/ApplicationIndicatorCustom.cs @@ -0,0 +1,40 @@ +using System; +using System.Runtime.InteropServices; + +namespace AyatanaAppIndicator +{ + public partial class ApplicationIndicator : GLib.Object + { + [DllImport ("ayatana-appindicator.dll")] + static extern int app_indicator_get_status (IntPtr i); + + [DllImport ("ayatana-appindicator.dll")] + static extern int app_indicator_get_category (IntPtr i); + + [DllImport ("ayatana-appindicator.dll")] + static extern void app_indicator_set_status (IntPtr i, int s); + + [GLib.Property ("status")] + public AppIndicatorStatus AppIndicatorStatus + { + get + { + return (AppIndicatorStatus) app_indicator_get_status (Handle); + } + + set + { + app_indicator_set_status (Handle, (int) value); + } + } + + [GLib.Property ("category")] + public AppIndicatorCategory AppIndicatorCategory + { + get + { + return (AppIndicatorCategory) app_indicator_get_category (Handle); + } + } + } +} diff --git a/bindings/mono/AssemblyInfo.cs b/bindings/mono/AssemblyInfo.cs index 297eda2..437ce53 100644 --- a/bindings/mono/AssemblyInfo.cs +++ b/bindings/mono/AssemblyInfo.cs @@ -24,7 +24,7 @@ using System.Reflection; [assembly: AssemblyConfiguration ("")] [assembly: AssemblyCompany ("Ayatana Project")] [assembly: AssemblyProduct ("Ayatana AppIndicators")] -[assembly: AssemblyCopyright ("© 2010 Canonical, Ltd.; © 2015 Mike Gabriel")] +[assembly: AssemblyCopyright ("© 2010 Canonical, Ltd.; © 2015 Mike Gabriel; © 2021 Robert Tari")] [assembly: AssemblyTrademark ("")] [assembly: AssemblyCulture ("")] -[assembly: AssemblyVersion ("0.5.5.0")] +[assembly: AssemblyVersion ("0.5.90.0")] diff --git a/bindings/mono/CMakeLists.txt b/bindings/mono/CMakeLists.txt new file mode 100644 index 0000000..2a9d990 --- /dev/null +++ b/bindings/mono/CMakeLists.txt @@ -0,0 +1,203 @@ +# ayatana-appindicator-sharp3-0.1.pc + +configure_file("${CMAKE_CURRENT_SOURCE_DIR}/ayatana-appindicator-sharp3-0.1.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/ayatana-appindicator-sharp3-0.1.pc" @ONLY) +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ayatana-appindicator-sharp3-0.1.pc" DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}/pkgconfig") + +# ayatana-appindicator-sharp.dll.config + +file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/ayatana-appindicator-sharp.dll.config" DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) +install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/ayatana-appindicator-sharp.dll.config" DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}/cli/ayatana-appindicator-sharp3-0.1") + +# app-indicator.sources.xml + +file(RELATIVE_PATH REL_BIN ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_BINARY_DIR}) +file(RELATIVE_PATH REL_SRC ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR}) +configure_file("${CMAKE_CURRENT_SOURCE_DIR}/app-indicator.sources.xml.in" "${CMAKE_CURRENT_BINARY_DIR}/app-indicator.sources.xml" @ONLY) + +# libayatana-appindicator-api.raw + +find_program(GAPI3_PARSER gapi3-parser) + +add_custom_command( + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/libayatana-appindicator-api.raw" + DEPENDS "src" "${CMAKE_CURRENT_BINARY_DIR}/app-indicator.sources.xml" + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMAND + ${GAPI3_PARSER} + "${CMAKE_CURRENT_BINARY_DIR}/app-indicator.sources.xml" +) + +# libayatana-appindicator-api.middle + +find_program(GAPI3_FIXUP gapi3-fixup) + +add_custom_command( + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/libayatana-appindicator-api.middle" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/libayatana-appindicator-api.raw" + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMAND + ${CMAKE_COMMAND} + -E copy + "${CMAKE_CURRENT_BINARY_DIR}/libayatana-appindicator-api.raw" + "${CMAKE_CURRENT_BINARY_DIR}/libayatana-appindicator-api.middle" + COMMAND + ${GAPI3_FIXUP} + --api=libayatana-appindicator-api.middle + --metadata="${CMAKE_CURRENT_SOURCE_DIR}/libayatana-appindicator-api.metadata" +) + +# libayatana-appindicator-api.xml + +add_custom_command( + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/libayatana-appindicator-api.xml" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/libayatana-appindicator-api.middle" + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + VERBATIM + COMMAND + sed + -e "s|PROP_ID_S|id|" + -e "s|PROP_STATUS_S|Status|" + -e "s|PROP_STATUS_S|status|" + -e "s|PROP_CATEGORY_S|Category|" + -e "s|PROP_CATEGORY_S|category|" + -e "s|PROP_ICON_NAME_S|icon-name|" + -e "s|PROP_ICON_DESC_S|IconDesc|" + -e "s|PROP_ICON_DESC_S|icon-desc|" + -e "s|PROP_ATTENTION_ICON_NAME_S|AttentionIconName|" + -e "s|PROP_ATTENTION_ICON_NAME_S|attention-icon-name|" + -e "s|PROP_ATTENTION_ICON_DESC_S|AttentionIconDesc|" + -e "s|PROP_ATTENTION_ICON_DESC_S|attention-icon-desc|" + -e "s|PROP_ICON_THEME_PATH_S|icon-theme-path|" + -e "s|PROP_MENU_S|menu|" + -e "s|PROP_CONNECTED_S|connected|" + -e "s|PROP_LABEL_S|label|" + -e "s|PROP_LABEL_GUIDE_S|label-guide|" + -e "s|PROP_ORDERING_INDEX_S|ordering-index|" + -e "s|PROP_DBUS_MENU_SERVER_S|DbusMenuServer|" + -e "s|PROP_DBUS_MENU_SERVER_S|dbus-menu-server|" + -e "s|PROP_TITLE_S|Title|" + -e "s|PROP_TITLE_S|title|" + "${CMAKE_CURRENT_BINARY_DIR}/libayatana-appindicator-api.middle" > "${CMAKE_CURRENT_BINARY_DIR}/libayatana-appindicator-api.xml" +) + +# AppIndicatorCategory.cs +# NewAttentionIconHandler.cs +# NewStatusHandler.cs +# AppIndicatorStatus.cs +# NewIconHandler.cs +# ObjectManager.cs +# ApplicationIndicator.cs +# NewIconThemePathHandler.cs +# ScrollEventHandler.cs +# ConnectionChangedHandler.cs +# NewLabelHandler.cs + +pkg_check_modules(GTK_SHARP_3_0 REQUIRED gtk-sharp-3.0>=2.99) +string(REPLACE ":" ";-I:" GTK_SHARP_3_0_INCLUDE_DIRS ${GTK_SHARP_3_0_INCLUDE_DIRS}) +find_program(GAPI3_CODEGEN gapi3-codegen) + +add_custom_command( + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/GtkSharp/ObjectManager.cs" + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/AyatanaAppIndicator/AppIndicatorCategory.cs" + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/AyatanaAppIndicator/NewAttentionIconHandler.cs" + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/AyatanaAppIndicator/NewStatusHandler.cs" + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/AyatanaAppIndicator/AppIndicatorStatus.cs" + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/AyatanaAppIndicator/NewIconHandler.cs" + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/AyatanaAppIndicator/ApplicationIndicator.cs" + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/AyatanaAppIndicator/NewIconThemePathHandler.cs" + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/AyatanaAppIndicator/ScrollEventHandler.cs" + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/AyatanaAppIndicator/ConnectionChangedHandler.cs" + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/AyatanaAppIndicator/NewLabelHandler.cs" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/libayatana-appindicator-api.xml" + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMAND + ${GAPI3_CODEGEN} + --generate libayatana-appindicator-api.xml + --outdir=${CMAKE_CURRENT_BINARY_DIR} + --assembly-name=ayatana-appindicator-sharp + ${GTK_SHARP_3_0_INCLUDE_DIRS} +) + +# ayatana-appindicator-sharp.dll + +pkg_check_modules(MONO REQUIRED mono>=5.18) +find_program(MCS mcs) + +add_custom_command( + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/ayatana-appindicator-sharp.dll" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/GtkSharp/ObjectManager.cs" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/AyatanaAppIndicator/AppIndicatorCategory.cs" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/AyatanaAppIndicator/NewAttentionIconHandler.cs" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/AyatanaAppIndicator/NewStatusHandler.cs" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/AyatanaAppIndicator/AppIndicatorStatus.cs" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/AyatanaAppIndicator/NewIconHandler.cs" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/AyatanaAppIndicator/ApplicationIndicator.cs" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/AyatanaAppIndicator/NewIconThemePathHandler.cs" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/AyatanaAppIndicator/ScrollEventHandler.cs" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/AyatanaAppIndicator/ConnectionChangedHandler.cs" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/AyatanaAppIndicator/NewLabelHandler.cs" + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMAND + ${MCS} + -keyfile:"${CMAKE_CURRENT_SOURCE_DIR}/ayatana-appindicator-sharp.snk" + -nowarn:0169,0612,0618 + -unsafe + -out:"${CMAKE_CURRENT_BINARY_DIR}/ayatana-appindicator-sharp.dll" + -target:library + ${GTK_SHARP_3_0_LDFLAGS} "${CMAKE_CURRENT_BINARY_DIR}/AyatanaAppIndicator/*.cs" "${CMAKE_CURRENT_BINARY_DIR}/GtkSharp/ObjectManager.cs" "${CMAKE_CURRENT_SOURCE_DIR}/AssemblyInfo.cs" "${CMAKE_CURRENT_SOURCE_DIR}/ApplicationIndicatorCustom.cs" +) + +find_program(GACUTIL gacutil) +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ayatana-appindicator-sharp.dll" DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}/cli/ayatana-appindicator-sharp3-0.1") +install(CODE "execute_process(WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${GACUTIL} -i ${CMAKE_CURRENT_BINARY_DIR}/ayatana-appindicator-sharp.dll -package ayatana-appindicator-sharp -root ${CMAKE_INSTALL_FULL_LIBDIR})") + +# policy.0.0.ayatana-appindicator-sharp.config + +configure_file("${CMAKE_CURRENT_SOURCE_DIR}/policy.0.0.ayatana-appindicator-sharp.config.in" "${CMAKE_CURRENT_BINARY_DIR}/policy.0.0.ayatana-appindicator-sharp.config" @ONLY) +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/policy.0.0.ayatana-appindicator-sharp.config" DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}/cli/ayatana-appindicator-sharp3-0.1") + +# policy.0.0.ayatana-appindicator-sharp.dll + +find_program(AL al) + +add_custom_command( + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/policy.0.0.ayatana-appindicator-sharp.dll" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/ayatana-appindicator-sharp.dll" + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMAND + ${AL} + -link:"${CMAKE_CURRENT_BINARY_DIR}/policy.0.0.ayatana-appindicator-sharp.config" + -out:"${CMAKE_CURRENT_BINARY_DIR}/policy.0.0.ayatana-appindicator-sharp.dll" + -keyfile:"${CMAKE_CURRENT_SOURCE_DIR}/ayatana-appindicator-sharp.snk" +) + +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/policy.0.0.ayatana-appindicator-sharp.dll" DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}/cli/ayatana-appindicator-sharp3-0.1") +install(CODE "execute_process(WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${GACUTIL} -i ${CMAKE_CURRENT_BINARY_DIR}/policy.0.0.ayatana-appindicator-sharp.dll -package ayatana-appindicator-sharp -root ${CMAKE_INSTALL_FULL_LIBDIR})") + +# policy.0.1.ayatana-appindicator-sharp.config + +configure_file("${CMAKE_CURRENT_SOURCE_DIR}/policy.0.1.ayatana-appindicator-sharp.config.in" "${CMAKE_CURRENT_BINARY_DIR}/policy.0.1.ayatana-appindicator-sharp.config" @ONLY) +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/policy.0.1.ayatana-appindicator-sharp.config" DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}/cli/ayatana-appindicator-sharp3-0.1") + +# policy.0.1.ayatana-appindicator-sharp.dll + +find_program(AL al) + +add_custom_command( + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/policy.0.1.ayatana-appindicator-sharp.dll" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/policy.0.0.ayatana-appindicator-sharp.dll" + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMAND + ${AL} + -link:"${CMAKE_CURRENT_BINARY_DIR}/policy.0.1.ayatana-appindicator-sharp.config" + -out:"${CMAKE_CURRENT_BINARY_DIR}/policy.0.1.ayatana-appindicator-sharp.dll" + -keyfile:"${CMAKE_CURRENT_SOURCE_DIR}/ayatana-appindicator-sharp.snk" +) + +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/policy.0.1.ayatana-appindicator-sharp.dll" DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}/cli/ayatana-appindicator-sharp3-0.1") + +add_custom_target("bindings-mono" ALL DEPENDS "policy.0.1.ayatana-appindicator-sharp.dll") + +if (ENABLE_TESTS) + add_subdirectory(examples) +endif() diff --git a/bindings/mono/Makefile.am b/bindings/mono/Makefile.am deleted file mode 100644 index 3777e1b..0000000 --- a/bindings/mono/Makefile.am +++ /dev/null @@ -1,177 +0,0 @@ -SUBDIRS = . examples - -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = ayatana-appindicator-sharp-0.1.pc - -if BUILD_MONO_TEST -TEST = AyatanaAppIndicator.Test.dll -endif - -API = libayatana-appindicator-api.xml -MIDDLE_API = libayatana-appindicator-api.middle -RAW_API = libayatana-appindicator-api.raw -METADATA = libayatana-appindicator-api.metadata -ASSEMBLY_NAME = ayatana-appindicator-sharp -ASSEMBLY_VERSION = 0.5.5.0 -ASSEMBLY = $(ASSEMBLY_NAME).dll -POLICY = policy.$(POLICY_VERSION).$(ASSEMBLY_NAME) -POLICY_VERSION = 0.0 -DLLPOLICY = $(POLICY).dll -POLICY1 = policy.$(POLICY1_VERSION).$(ASSEMBLY_NAME) -POLICY1_VERSION = 0.1 -DLLPOLICY1 = $(POLICY1).dll -WRAPPER_FREE_BINDING_SRC = $(top_srcdir)/src/app-indicator.c -WRAPPER_FREE_BINDING = app-indicator.c - -TARGET = \ - $(ASSEMBLY) \ - $(ASSEMBLY).config \ - $(DLLPOLICY) \ - $(POLICY).config \ - $(DLLPOLICY1) \ - $(POLICY1).config - -assemblydir = $(libdir)/cli/ayatana-appindicator-sharp-0.1 -assembly_DATA = $(TARGET) - -CLEANFILES = \ - $(ASSEMBLY) \ - $(ASSEMBLY).mdb \ - generated-stamp \ - generated/*.cs \ - $(API) \ - $(MIDDLE_API) \ - $(RAW_API) \ - $(DLLPOLICY) \ - $(DLLPOLICY1) \ - $(WRAPPER_FREE_BINDING) \ - $(POLICY).config \ - $(POLICY1).config - -if BUILD_MONO_TEST -CLEANFILES += $(TEST) -endif - -DISTCLEANFILES = $(ASSEMBLY).config - -if BUILD_MONO_TEST -TEST_SOURCES = TestAyatanaIndicator.cs -endif - -customs = ApplicationIndicator.custom - -EXTRA_DIST = \ - AssemblyInfo.cs \ - $(RAW_API) \ - $(METADATA) \ - ayatana-appindicator-sharp-0.1.pc.in \ - ayatana-appindicator-sharp.dll.config.in \ - app-indicator.sources.xml.in \ - $(ASSEMBLY_NAME).snk \ - $(POLICY).config.in \ - $(POLICY1).config.in \ - $(customs) - -if BUILD_MONO_TEST -EXTRA_DIST += $(TEST_SOURCES) -endif - -GACUTIL_FLAGS=-package $(ASSEMBLY_NAME) -root $(DESTDIR)$(prefix)/lib - -references = $(GTK_SHARP_LIBS) - -if BUILD_MONO_TEST -test_references = $(GTK_SHARP_LIBS) $(NUNIT_LIBS) $(MONO_NUNIT_LIBS) -r:$(ASSEMBLY) -endif - -$(RAW_API): app-indicator.sources.xml $(WRAPPER_FREE_BINDING) - $(GAPI_PARSER) app-indicator.sources.xml - -$(WRAPPER_FREE_BINDING): $(WRAPPER_FREE_BINDING_SRC) - sed '/signals\[X_NEW_LABEL\] /,+6d' $(WRAPPER_FREE_BINDING_SRC) > $(WRAPPER_FREE_BINDING) - -$(MIDDLE_API): $(METADATA) $(RAW_API) - cp $(RAW_API) $(MIDDLE_API) - chmod u+w $(MIDDLE_API) - @if test -n '$(METADATA)'; then \ - echo "$(GAPI_FIXUP) --api=$(MIDDLE_API) --metadata=$(srcdir)/$(METADATA)"; \ - $(GAPI_FIXUP) --api=$(MIDDLE_API) --metadata=$(srcdir)/$(METADATA); \ - fi - -$(API): $(MIDDLE_API) Makefile.am - sed -e "s|PROP_ID_S|id|" \ - -e "s|PROP_STATUS_S|Status|" \ - -e "s|PROP_STATUS_S|status|" \ - -e "s|PROP_CATEGORY_S|Category|" \ - -e "s|PROP_CATEGORY_S|category|" \ - -e "s|PROP_ICON_NAME_S|icon-name|" \ - -e "s|PROP_ICON_DESC_S|IconDesc|" \ - -e "s|PROP_ICON_DESC_S|icon-desc|" \ - -e "s|PROP_ATTENTION_ICON_NAME_S|AttentionIconName|" \ - -e "s|PROP_ATTENTION_ICON_NAME_S|attention-icon-name|" \ - -e "s|PROP_ATTENTION_ICON_DESC_S|AttentionIconDesc|" \ - -e "s|PROP_ATTENTION_ICON_DESC_S|attention-icon-desc|" \ - -e "s|PROP_ICON_THEME_PATH_S|icon-theme-path|" \ - -e "s|PROP_MENU_S|menu|" \ - -e "s|PROP_CONNECTED_S|connected|" \ - -e "s|PROP_LABEL_S|label|" \ - -e "s|PROP_LABEL_GUIDE_S|label-guide|" \ - -e "s|PROP_ORDERING_INDEX_S|ordering-index|" \ - -e "s|PROP_DBUS_MENU_SERVER_S|DbusMenuServer|" \ - -e "s|PROP_DBUS_MENU_SERVER_S|dbus-menu-server|" \ - -e "s|PROP_TITLE_S|Title|" \ - -e "s|PROP_TITLE_S|title|" \ - $< > $@ - -api_includes = $(GTK_SHARP_CFLAGS) - -build_customs = $(addprefix $(srcdir)/, $(customs)) - -generated-stamp: $(API) $(build_customs) - rm -f generated/* && \ - $(GAPI_CODEGEN) --generate $(API) $(api_includes) \ - --customdir=$(srcdir) \ - --outdir=generated --assembly-name=$(ASSEMBLY_NAME) \ - && touch generated-stamp - -$(ASSEMBLY): generated-stamp $(srcdir)/AssemblyInfo.cs - @rm -f $(ASSEMBLY).mdb - $(CSC) $(CSFLAGS) -keyfile:$(srcdir)/$(ASSEMBLY_NAME).snk -nowarn:0169,0612,0618 -unsafe -out:$(ASSEMBLY) -target:library $(references) $(builddir)/$(GENERATED_SOURCES) $(srcdir)/AssemblyInfo.cs - -install-data-local: - echo "$(GACUTIL) -i $(ASSEMBLY_NAME).dll $(GACUTIL_FLAGS)"; \ - $(GACUTIL) -i $(ASSEMBLY_NAME).dll $(GACUTIL_FLAGS) || exit 1; - echo "$(GACUTIL) -i $(DLLPOLICY) $(GACUTIL_FLAGS)"; \ - $(GACUTIL) -i $(DLLPOLICY) $(GACUTIL_FLAGS) || exit 1; - -uninstall-local: - echo "$(GACUTIL) -u $(ASSEMBLY_NAME) $(GACUTIL_FLAGS)"; \ - $(GACUTIL) -u $(ASSEMBLY_NAME) $(GACUTIL_FLAGS) || exit 1; - echo "$(GACUTIL) -u $(DLLPOLICY) $(GACUTIL_FLAGS)"; \ - $(GACUTIL) -u $(POLICY) $(GACUTIL_FLAGS) || exit 1; - -if BUILD_MONO_TEST -$(TEST): $(ASSEMBLY) $(TEST_SOURCES) - $(CSC) -out:$(TEST) -target:library $(test_references) $(srcdir)/$(TEST_SOURCES) - -check: $(TEST) -endif - -$(POLICY).config: $(POLICY).config.in Makefile - sed -e "s|@ASSEMBLY_NAME@|$(ASSEMBLY_NAME)|" \ - -e "s|@ASSEMBLY_VERSION@|$(ASSEMBLY_VERSION)|g" \ - $< > $@ - -$(DLLPOLICY): $(POLICY).config $(ASSEMBLY_NAME).snk Makefile - $(AL) -link:$(POLICY).config -out:$(DLLPOLICY) -keyfile:$(srcdir)/$(ASSEMBLY_NAME).snk - - -$(POLICY1).config: $(POLICY1).config.in Makefile - sed -e "s|@ASSEMBLY_NAME@|$(ASSEMBLY_NAME)|" \ - -e "s|@ASSEMBLY_VERSION@|$(ASSEMBLY_VERSION)|g" \ - $< > $@ - -$(DLLPOLICY1): $(POLICY1).config $(ASSEMBLY_NAME).snk Makefile - $(AL) -link:$(POLICY1).config -out:$(DLLPOLICY1) -keyfile:$(srcdir)/$(ASSEMBLY_NAME).snk - -DISTCLEANFILES += Makefile.in diff --git a/bindings/mono/app-indicator.sources.xml.in b/bindings/mono/app-indicator.sources.xml.in index 9a283ea..4746179 100644 --- a/bindings/mono/app-indicator.sources.xml.in +++ b/bindings/mono/app-indicator.sources.xml.in @@ -1,12 +1,12 @@ <gapi-parser-input> - <api filename="libayatana-appindicator-api.raw"> - <library name="ayatana-appindicator.dll"> - <namespace name="AyatanaAppIndicator"> - <file>@top_builddir@/bindings/mono/app-indicator.c</file> - <file>@top_builddir@/src/app-indicator-enum-types.c</file> - <file>@top_builddir@/src/app-indicator-enum-types.h</file> - <file>@top_srcdir@/src/app-indicator.h</file> - </namespace> - </library> - </api> + <api filename="libayatana-appindicator-api.raw"> + <library name="ayatana-appindicator.dll"> + <namespace name="AyatanaAppIndicator"> + <file>@REL_SRC@src/app-indicator.c</file> + <file>@REL_BIN@src/app-indicator-enum-types.c</file> + <file>@REL_BIN@src/app-indicator-enum-types.h</file> + <file>@REL_SRC@src/app-indicator.h</file> + </namespace> + </library> + </api> </gapi-parser-input> diff --git a/bindings/mono/ayatana-appindicator-sharp.dll.config b/bindings/mono/ayatana-appindicator-sharp.dll.config new file mode 100644 index 0000000..c8f653f --- /dev/null +++ b/bindings/mono/ayatana-appindicator-sharp.dll.config @@ -0,0 +1,7 @@ +<configuration> + <dllmap dll="ayatana-appindicator.dll" target="libayatana-appindicator3.so.1"/> + <dllmap dll="libgtk-3.0-0.dll" target="libgtk-3.0.so.0"/> + <dllmap dll="libglib-2.0-0.dll" target="libglib-2.0.so.0"/> + <dllmap dll="libgobject-2.0-0.dll" target="libgobject-2.0.so.0"/> + <dllmap dll="libgthread-2.0-0.dll" target="libgthread-2.0.so.0"/> +</configuration> diff --git a/bindings/mono/ayatana-appindicator-sharp.dll.config.in b/bindings/mono/ayatana-appindicator-sharp.dll.config.in deleted file mode 100644 index 7061914..0000000 --- a/bindings/mono/ayatana-appindicator-sharp.dll.config.in +++ /dev/null @@ -1,7 +0,0 @@ -<configuration> - <dllmap dll="ayatana-appindicator.dll" target="libayatana-appindicator@LIB_PREFIX@.1@LIB_SUFFIX@"/> - <dllmap dll="libgtk-2.0-0.dll" target="libgtk-2.0@LIB_PREFIX@.0@LIB_SUFFIX@"/> - <dllmap dll="libglib-2.0-0.dll" target="libglib-2.0@LIB_PREFIX@.0@LIB_SUFFIX@"/> - <dllmap dll="libgobject-2.0-0.dll" target="libgobject-2.0@LIB_PREFIX@.0@LIB_SUFFIX@"/> - <dllmap dll="libgthread-2.0-0.dll" target="libgthread-2.0@LIB_PREFIX@.0@LIB_SUFFIX@"/> -</configuration> diff --git a/bindings/mono/ayatana-appindicator-sharp-0.1.pc.in b/bindings/mono/ayatana-appindicator-sharp3-0.1.pc.in index 6c091ed..955e6ba 100644 --- a/bindings/mono/ayatana-appindicator-sharp-0.1.pc.in +++ b/bindings/mono/ayatana-appindicator-sharp3-0.1.pc.in @@ -1,12 +1,12 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -assemblies_dir=${prefix}/lib/cli/ayatana-appindicator-sharp-0.1 +prefix=@CMAKE_INSTALL_PREFIX@ +exec_prefix=${prefix} +libdir=@CMAKE_INSTALL_FULL_LIBDIR@ +assemblies_dir=@CMAKE_INSTALL_FULL_LIBDIR@/cli/ayatana-appindicator-sharp3-0.1 Name: ayatana-appindicator-sharp Description: application indicators for .NET -Version: @VERSION@ +Version: @PROJECT_VERSION@ Libraries: ${assemblies_dir}/ayatana-appindicator-sharp.dll ${assemblies_dir}/ayatana-appindicator-sharp.dll.config -Requires: gtk-sharp-2.0 +Requires: gtk-sharp-3.0 Cflags: Libs: -r:${assemblies_dir}/ayatana-appindicator-sharp.dll diff --git a/bindings/mono/examples/CMakeLists.txt b/bindings/mono/examples/CMakeLists.txt new file mode 100644 index 0000000..431a654 --- /dev/null +++ b/bindings/mono/examples/CMakeLists.txt @@ -0,0 +1,20 @@ +# ayatana-indicator-example + +configure_file("${CMAKE_CURRENT_SOURCE_DIR}/ayatana-indicator-example.in" "${CMAKE_CURRENT_BINARY_DIR}/ayatana-indicator-example" @ONLY) + +# AyatanaIndicatorExample.exe + +find_program(MONO mono) + +add_custom_command( + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/AyatanaIndicatorExample.exe" + DEPENDS "bindings-mono" + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMAND + ${MCS} + -out:"${CMAKE_CURRENT_BINARY_DIR}/AyatanaIndicatorExample.exe" + -target:exe + ${GTK_SHARP_3_0_LDFLAGS} "-r:${CMAKE_BINARY_DIR}/bindings/mono/ayatana-appindicator-sharp.dll" "${CMAKE_CURRENT_SOURCE_DIR}/AyatanaIndicatorExample.cs" +) + +add_custom_target("bindings-mono-examples" ALL DEPENDS "AyatanaIndicatorExample.exe") diff --git a/bindings/mono/examples/Makefile.am b/bindings/mono/examples/Makefile.am deleted file mode 100644 index de93b20..0000000 --- a/bindings/mono/examples/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ -ASSEMBLY = AyatanaIndicatorExample.exe -CSFILES = AyatanaIndicatorExample.cs -CLEANFILES = $(ASSEMBLY) -DISTCLEANFILES = Makefile.in - -EXTRA_DIST = $(CSFILES) - -references = $(GTK_SHARP_LIBS) -r:$(top_builddir)/bindings/mono/ayatana-appindicator-sharp.dll - -$(ASSEMBLY): $(CSFILES) Makefile.am - $(CSC) $(CSFLAGS) -out:$(ASSEMBLY) -target:exe $(references) $(srcdir)/$(CSFILES) - -all: $(ASSEMBLY) diff --git a/bindings/mono/examples/ayatana-indicator-example.in b/bindings/mono/examples/ayatana-indicator-example.in index 07d1473..3f63b3d 100755 --- a/bindings/mono/examples/ayatana-indicator-example.in +++ b/bindings/mono/examples/ayatana-indicator-example.in @@ -1,2 +1,2 @@ #!/bin/sh -MONO_PATH=@top_builddir@/bindings/mono @top_builddir@/bindings/mono/examples/AyatanaIndicatorExample.exe +MONO_PATH=@CMAKE_BINARY_DIR@/bindings/mono @CMAKE_CURRENT_BINARY_DIR@/AyatanaIndicatorExample.exe diff --git a/bindings/mono/policy.0.0.ayatana-appindicator-sharp.config.in b/bindings/mono/policy.0.0.ayatana-appindicator-sharp.config.in index e1fe0db..0801da0 100644 --- a/bindings/mono/policy.0.0.ayatana-appindicator-sharp.config.in +++ b/bindings/mono/policy.0.0.ayatana-appindicator-sharp.config.in @@ -1,10 +1,10 @@ <configuration> - <runtime> - <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> - <dependentAssembly> - <assemblyIdentity name="@ASSEMBLY_NAME@" publicKeyToken="bcae265d1c7ab4c2" /> - <bindingRedirect oldVersion="0.0.0.0-0.1.0.0" newVersion="@ASSEMBLY_VERSION@"/> - </dependentAssembly> - </assemblyBinding> - </runtime> + <runtime> + <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> + <dependentAssembly> + <assemblyIdentity name="ayatana-appindicator-sharp" publicKeyToken="bcae265d1c7ab4c2" /> + <bindingRedirect oldVersion="0.0.0.0-0.1.0.0" newVersion="@PROJECT_VERSION@.0"/> + </dependentAssembly> + </assemblyBinding> + </runtime> </configuration> diff --git a/bindings/mono/policy.0.1.ayatana-appindicator-sharp.config.in b/bindings/mono/policy.0.1.ayatana-appindicator-sharp.config.in index 0a8f9b1..f5a082d 100644 --- a/bindings/mono/policy.0.1.ayatana-appindicator-sharp.config.in +++ b/bindings/mono/policy.0.1.ayatana-appindicator-sharp.config.in @@ -1,10 +1,10 @@ <configuration> - <runtime> - <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> - <dependentAssembly> - <assemblyIdentity name="@ASSEMBLY_NAME@" publicKeyToken="bcae265d1c7ab4c2" /> - <bindingRedirect oldVersion="0.1.0.0-@ASSEMBLY_VERSION@" newVersion="@ASSEMBLY_VERSION@"/> - </dependentAssembly> - </assemblyBinding> - </runtime> + <runtime> + <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> + <dependentAssembly> + <assemblyIdentity name="ayatana-appindicator-sharp" publicKeyToken="bcae265d1c7ab4c2" /> + <bindingRedirect oldVersion="0.1.0.0-@PROJECT_VERSION@.0" newVersion="@PROJECT_VERSION@.0"/> + </dependentAssembly> + </assemblyBinding> + </runtime> </configuration> diff --git a/bindings/vala/CMakeLists.txt b/bindings/vala/CMakeLists.txt new file mode 100644 index 0000000..6d0aa5d --- /dev/null +++ b/bindings/vala/CMakeLists.txt @@ -0,0 +1,29 @@ +# ayatana-appindicator3-0.1.deps + +install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/ayatana-appindicator3-0.1.deps" DESTINATION "${CMAKE_INSTALL_FULL_DATADIR}/vala/vapi") + +# AyatanaAppIndicator3-0.1.vala + +find_package(Vala REQUIRED QUIET) + +add_custom_command( + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/AyatanaAppIndicator3-0.1.vala" + DEPENDS "src" "${CMAKE_BINARY_DIR}/src/AyatanaAppIndicator3-0.1.typelib" + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMAND + ${VAPI_GEN} + --library=ayatana-appindicator3-0.1 + --pkg gtk+-3.0 + --girdir="${CMAKE_SOURCE_DIR}/src" + --metadatadir "${CMAKE_SOURCE_DIR}/src" + "${CMAKE_BINARY_DIR}/src/AyatanaAppIndicator3-0.1.gir" + "${CMAKE_CURRENT_SOURCE_DIR}/ayatana-appindicator-0.1-custom.vala" +) + +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ayatana-appindicator3-0.1.vapi" DESTINATION "${CMAKE_INSTALL_FULL_DATADIR}/vala/vapi") + +add_custom_target("bindings-vala" ALL DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/AyatanaAppIndicator3-0.1.vala") + +if (ENABLE_TESTS) + add_subdirectory(examples) +endif() diff --git a/bindings/vala/Makefile.am b/bindings/vala/Makefile.am deleted file mode 100644 index 2763bc3..0000000 --- a/bindings/vala/Makefile.am +++ /dev/null @@ -1,41 +0,0 @@ -if HAVE_INTROSPECTION -if HAVE_VAPIGEN - -SUBDIRS = . examples - -######################### -# VAPI Files -######################### - -if USE_GTK3 -GTKVAPI = gtk+-3.0 -VER=3 -else -GTKVAPI = gtk+-2.0 -VER= -endif - -vapidir = $(datadir)/vala/vapi -vapiprefix = ayatana-appindicator$(VER)-0.1 -vapi_DATA = $(vapiprefix).vapi $(vapiprefix).deps -DEPS = $(GTKVAPI) - -$(vapiprefix).deps: - echo $(DEPS) > $@ - -$(vapiprefix).vapi: $(top_builddir)/src/AyatanaAppIndicator$(VER)-0.1.gir \ - $(top_builddir)/src/AyatanaAppIndicator$(VER)-0.1.metadata \ - ayatana-appindicator-0.1-custom.vala \ - $(vapiprefix).deps - $(VALA_API_GEN) --library=$(vapiprefix) --girdir=$(srcdir)/src \ - $< $(srcdir)/ayatana-appindicator-0.1-custom.vala - - -CLEANFILES = $(vapi_DATA) -DISTCLEANFILES = Makefile.in - -endif -endif - -EXTRA_DIST = \ - ayatana-appindicator-0.1-custom.vala diff --git a/bindings/vala/ayatana-appindicator3-0.1.deps b/bindings/vala/ayatana-appindicator3-0.1.deps new file mode 100644 index 0000000..f48ab98 --- /dev/null +++ b/bindings/vala/ayatana-appindicator3-0.1.deps @@ -0,0 +1,3 @@ +gtk+-3.0 +glib-2.0 +Dbusmenu-0.4 diff --git a/bindings/vala/examples/CMakeLists.txt b/bindings/vala/examples/CMakeLists.txt new file mode 100644 index 0000000..f393939 --- /dev/null +++ b/bindings/vala/examples/CMakeLists.txt @@ -0,0 +1,27 @@ +# ayatana-indicator-example.c + +add_custom_command( + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/ayatana-indicator-example.c" + DEPENDS "bindings-vala" + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + COMMAND + ${VALA_COMPILER} + --pkg ayatana-appindicator3-0.1 + --pkg gtk+-3.0 + --vapidir=${CMAKE_BINARY_DIR}/bindings/vala + -C ayatana-indicator-example.vala + --metadatadir "${CMAKE_SOURCE_DIR}/src" + --directory=${CMAKE_CURRENT_BINARY_DIR} + VERBATIM + COMMAND + sed + -i "s|#include\\s*<\\s*libayatana-appindicator/app-indicator.h\\s*>||g" + "${CMAKE_CURRENT_BINARY_DIR}/ayatana-indicator-example.c" +) + +# ayatana-indicator-example + +set_source_files_properties("${CMAKE_CURRENT_BINARY_DIR}/ayatana-indicator-example.c" PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS} -include ${CMAKE_SOURCE_DIR}/src/app-indicator.h") +add_executable("ayatana-indicator-example" "${CMAKE_CURRENT_BINARY_DIR}/ayatana-indicator-example.c") +target_include_directories("ayatana-indicator-example" PUBLIC ${PROJECT_DEPS_INCLUDE_DIRS}) +target_link_libraries("ayatana-indicator-example" "${PROJECT_DEPS_LIBRARIES} -layatana-appindicator3 -L${CMAKE_BINARY_DIR}/src") diff --git a/bindings/vala/examples/Makefile.am b/bindings/vala/examples/Makefile.am deleted file mode 100644 index 315447c..0000000 --- a/bindings/vala/examples/Makefile.am +++ /dev/null @@ -1,40 +0,0 @@ -if USE_GTK3 -VER=3 -else -VER= -endif - -VALAFILES = ayatana-indicator-example.vala -EXTRA_DIST = $(VALAFILES) - -VALAFLAGS = \ - --pkg ayatana-appindicator$(VER)-0.1 \ - --vapidir=$(top_builddir)/bindings/vala \ - --save-temps - -if HAVE_VALAC - -BUILT_SOURCES = ayatana-indicator-example.c - -ayatana-indicator-example.c: $(VALAFILES) Makefile.am - $(VALAC) $(VALAFLAGS) -C $< -o $@ - $(SED) -i "s|#include\s*<\s*libayatana-appindicator/app-indicator.h\s*>||g" $@ - -nodist_ayatana_indicator_example_SOURCES = ayatana-indicator-example.c -ayatana_indicator_example_CFLAGS = \ - $(LIBRARY_CFLAGS) \ - -Wall \ - -I$(top_srcdir)/src \ - -include $(top_srcdir)/src/app-indicator.h -ayatana_indicator_example_LDADD = \ - $(LIBRARY_LIBS) \ - $(top_builddir)/src/libayatana-appindicator$(VER).la - -check_PROGRAMS = ayatana-indicator-example - -CLEANFILES = \ - *.c \ - ayatana-indicator-example -DISTCLEANFILES = Makefile.in - -endif diff --git a/cmake/FindGObjectIntrospection.cmake b/cmake/FindGObjectIntrospection.cmake new file mode 100644 index 0000000..2073c3c --- /dev/null +++ b/cmake/FindGObjectIntrospection.cmake @@ -0,0 +1,61 @@ +# - try to find gobject-introspection +# +# Once done this will define +# +# INTROSPECTION_FOUND - system has gobject-introspection +# INTROSPECTION_SCANNER - the gobject-introspection scanner, g-ir-scanner +# INTROSPECTION_COMPILER - the gobject-introspection compiler, g-ir-compiler +# INTROSPECTION_GENERATE - the gobject-introspection generate, g-ir-generate +# INTROSPECTION_GIRDIR +# INTROSPECTION_TYPELIBDIR +# INTROSPECTION_CFLAGS +# INTROSPECTION_LIBS +# +# Copyright (C) 2010, Pino Toscano, <pino@kde.org> +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +macro(_GIR_GET_PKGCONFIG_VAR _outvar _varname) + execute_process( + COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=${_varname} gobject-introspection-1.0 + OUTPUT_VARIABLE _result + RESULT_VARIABLE _null + ) + + if (_null) + else() + string(REGEX REPLACE "[\r\n]" " " _result "${_result}") + string(REGEX REPLACE " +$" "" _result "${_result}") + separate_arguments(_result) + set(${_outvar} ${_result} CACHE INTERNAL "") + endif() +endmacro(_GIR_GET_PKGCONFIG_VAR) + +find_package(PkgConfig) +if(PKG_CONFIG_FOUND) + if(PACKAGE_FIND_VERSION_COUNT GREATER 0) + set(_gir_version_cmp ">=${PACKAGE_FIND_VERSION}") + endif() + pkg_check_modules(_pc_gir gobject-introspection-1.0${_gir_version_cmp}) + if(_pc_gir_FOUND) + set(INTROSPECTION_FOUND TRUE) + _gir_get_pkgconfig_var(INTROSPECTION_SCANNER "g_ir_scanner") + _gir_get_pkgconfig_var(INTROSPECTION_COMPILER "g_ir_compiler") + _gir_get_pkgconfig_var(INTROSPECTION_GENERATE "g_ir_generate") + _gir_get_pkgconfig_var(INTROSPECTION_GIRDIR "girdir") + _gir_get_pkgconfig_var(INTROSPECTION_TYPELIBDIR "typelibdir") + set(INTROSPECTION_CFLAGS "${_pc_gir_CFLAGS}") + set(INTROSPECTION_LIBS "${_pc_gir_LIBS}") + endif() +endif() + +mark_as_advanced( + INTROSPECTION_SCANNER + INTROSPECTION_COMPILER + INTROSPECTION_GENERATE + INTROSPECTION_GIRDIR + INTROSPECTION_TYPELIBDIR + INTROSPECTION_CFLAGS + INTROSPECTION_LIBS +) diff --git a/cmake/FindVala.cmake b/cmake/FindVala.cmake new file mode 100644 index 0000000..a638735 --- /dev/null +++ b/cmake/FindVala.cmake @@ -0,0 +1,57 @@ +# - Find Vala +# This module looks for valac. +# This module defines the following values: +# VALA_FOUND +# VALA_COMPILER +# VALA_VERSION +# VAPI_GEN +# VAPI_GEN_VERSION + +#============================================================================= +# Copyright Přemysl Janouch 2011 +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +# OF SUCH DAMAGE. +#============================================================================= + +find_program (VALA_COMPILER "valac") + +if (VALA_COMPILER) + execute_process (COMMAND ${VALA_COMPILER} --version + OUTPUT_VARIABLE VALA_VERSION) + string (REGEX MATCH "[.0-9]+" VALA_VERSION "${VALA_VERSION}") +endif (VALA_COMPILER) + +find_program (VAPI_GEN "vapigen") + +if (VAPI_GEN) + execute_process (COMMAND ${VAPI_GEN} --version + OUTPUT_VARIABLE VAPI_GEN_VERSION) + string (REGEX MATCH "[.0-9]+" VAPI_GEN_VERSION "${VAPI_GEN_VERSION}") +endif (VAPI_GEN) + +include (FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS (Vala + REQUIRED_VARS VALA_COMPILER + VERSION_VAR VALA_VERSION) + +mark_as_advanced (VALA_COMPILER VALA_VERSION VAPI_GEN) + diff --git a/cmake/UseGObjectIntrospection.cmake b/cmake/UseGObjectIntrospection.cmake new file mode 100644 index 0000000..d6d1810 --- /dev/null +++ b/cmake/UseGObjectIntrospection.cmake @@ -0,0 +1,100 @@ +# Copyright (C) 2010, Pino Toscano, <pino@kde.org> +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +include(ListOperations) + +macro(_gir_list_prefix _outvar _listvar _prefix) + set(${_outvar}) + foreach(_item IN LISTS ${_listvar}) + list(APPEND ${_outvar} ${_prefix}${_item}) + endforeach() +endmacro(_gir_list_prefix) + +macro(gir_add_introspections introspections_girs) + + foreach(gir IN LISTS ${introspections_girs}) + + set(_gir_name "${gir}") + + ## Transform the gir filename to something which can reference through a variable + ## without automake/make complaining, eg Gtk-2.0.gir -> Gtk_2_0_gir + string(REPLACE "-" "_" _gir_name "${_gir_name}") + string(REPLACE "." "_" _gir_name "${_gir_name}") + + # Namespace and Version is either fetched from the gir filename + # or the _NAMESPACE/_VERSION variable combo + set(_gir_namespace "${${_gir_name}_NAMESPACE}") + if (_gir_namespace STREQUAL "") + string(REGEX REPLACE "([^-]+)-.*" "\\1" _gir_namespace "${gir}") + endif () + set(_gir_version "${${_gir_name}_VERSION}") + if (_gir_version STREQUAL "") + string(REGEX REPLACE ".*-([^-]+).gir" "\\1" _gir_version "${gir}") + endif () + + # _PROGRAM is an optional variable which needs it's own --program argument + set(_gir_program "${${_gir_name}_PROGRAM}") + if (NOT _gir_program STREQUAL "") + set(_gir_program "--program=${_gir_program}") + endif () + + # Variables which provides a list of things + _gir_list_prefix(_gir_libraries ${_gir_name}_LIBS "--library=") + _gir_list_prefix(_gir_packages ${_gir_name}_PACKAGES "--pkg=") + _gir_list_prefix(_gir_includes ${_gir_name}_INCLUDES "--include=") + _gir_list_prefix(_gir_export_packages ${_gir_name}_EXPORT_PACKAGES "--pkg-export=") + + # Reuse the LIBTOOL variable from by automake if it's set + set(_gir_libtool "--no-libtool") + + add_custom_command( + COMMAND ${INTROSPECTION_SCANNER} + ${INTROSPECTION_SCANNER_ARGS} + --namespace=${_gir_namespace} + --nsversion=${_gir_version} + ${_gir_libtool} + ${_gir_program} + ${_gir_libraries} + ${_gir_packages} + ${_gir_includes} + ${_gir_export_packages} + ${${_gir_name}_SCANNERFLAGS} + ${${_gir_name}_CFLAGS} + ${${_gir_name}_FILES} + --output ${CMAKE_CURRENT_BINARY_DIR}/${gir} + DEPENDS ${${_gir_name}_FILES} + ${${_gir_name}_LIBS} + OUTPUT ${gir} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + VERBATIM + ) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${gir} DESTINATION share/gir-1.0) + + string(REPLACE ".gir" ".typelib" _typelib "${gir}") + add_custom_command( + COMMAND ${INTROSPECTION_COMPILER} + ${INTROSPECTION_COMPILER_ARGS} + --includedir=. + ${CMAKE_CURRENT_BINARY_DIR}/${gir} + -o ${CMAKE_CURRENT_BINARY_DIR}/${_typelib} + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${gir} + OUTPUT ${_typelib} + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + ) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${_typelib} DESTINATION ${CMAKE_INSTALL_LIBDIR}/girepository-1.0) + + add_custom_target(gir-${gir} ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${gir}) + add_custom_target(gir-typelibs-${_typelib} ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${_typelib}) + endforeach() + +endmacro(gir_add_introspections) + +macro(gir_get_cflags _output) + get_directory_property(_tmp_includes INCLUDE_DIRECTORIES) + list_prefix(_includes _tmp_includes "-I") + get_directory_property(_tmp_compile_definitions COMPILE_DEFINITIONS) + list_prefix(_compile_definitions _tmp_compile_definitions "-D") + set(${_output} ${_includes} ${_compile_definitions}) +endmacro(gir_get_cflags) diff --git a/cmake/UseVala.cmake b/cmake/UseVala.cmake new file mode 100644 index 0000000..f0202e2 --- /dev/null +++ b/cmake/UseVala.cmake @@ -0,0 +1,241 @@ +# - Precompilation of Vala/Genie source files into C sources +# Makes use of the parallel build ability introduced in Vala 0.11. Derived +# from a similar module by Jakob Westhoff and the original GNU Make rules. +# Might be a bit oversimplified. +# +# This module defines three functions. The first one: +# +# vala_init (id +# [DIRECTORY dir] - Output directory (binary dir by default) +# [PACKAGES package...] - Package dependencies +# [OPTIONS option...] - Extra valac options +# [CUSTOM_VAPIS file...]) - Custom vapi files to include in the build +# [DEPENDS targets...]) - Extra dependencies for code generation +# +# initializes a single precompilation unit using the given arguments. +# You can put files into it via the following function: +# +# vala_add (id source.vala +# [DEPENDS source...]) - Vala/Genie source or .vapi dependencies +# +# Finally retrieve paths for generated C files by calling: +# +# vala_finish (id +# [SOURCES sources_var] - Input Vala/Genie sources +# [OUTPUTS outputs_var] - Output C sources +# [GENERATE_HEADER id.h - Generate id.h and id_internal.h +# [GENERATE_VAPI id.vapi] - Generate a vapi file +# [GENERATE_SYMBOLS id.def]]) - Generate a list of public symbols +# + +#============================================================================= +# Copyright Přemysl Janouch 2011 +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +# OF SUCH DAMAGE. +#============================================================================= + +find_package (Vala 0.20 REQUIRED) +include (CMakeParseArguments) + +function (vala_init id) + set (_multi_value PACKAGES OPTIONS CUSTOM_VAPIS DEPENDS) + cmake_parse_arguments (arg "" "DIRECTORY" "${_multi_value}" ${ARGN}) + + if (arg_DIRECTORY) + set (directory ${arg_DIRECTORY}) + if (NOT IS_DIRECTORY ${directory}) + file (MAKE_DIRECTORY ${directory}) + endif (NOT IS_DIRECTORY ${directory}) + else (arg_DIRECTORY) + set (directory ${CMAKE_CURRENT_BINARY_DIR}) + endif (arg_DIRECTORY) + + set (pkg_opts) + foreach (pkg ${arg_PACKAGES}) + list (APPEND pkg_opts "--pkg=${pkg}") + endforeach (pkg) + + set (VALA_${id}_DIR "${directory}" PARENT_SCOPE) + set (VALA_${id}_ARGS ${pkg_opts} ${arg_OPTIONS} + ${arg_CUSTOM_VAPIS} PARENT_SCOPE) + set (VALA_${id}_DEPENDS ${arg_DEPENDS} + PARENT_SCOPE) + + set (VALA_${id}_SOURCES "" PARENT_SCOPE) + set (VALA_${id}_OUTPUTS "" PARENT_SCOPE) + set (VALA_${id}_FAST_VAPI_FILES "" PARENT_SCOPE) + set (VALA_${id}_FAST_VAPI_ARGS "" PARENT_SCOPE) +endfunction (vala_init) + +function (vala_add id file) + cmake_parse_arguments (arg "" "" "DEPENDS" ${ARGN}) + + if (NOT IS_ABSOLUTE "${file}") + set (file "${CMAKE_CURRENT_SOURCE_DIR}/${file}") + endif (NOT IS_ABSOLUTE "${file}") + + get_filename_component (output_name "${file}" NAME) + get_filename_component (output_base "${file}" NAME_WE) + set (output_base "${VALA_${id}_DIR}/${output_base}") + + # XXX: It would be best to have it working without touching the vapi + # but it appears this cannot be done in CMake. + add_custom_command (OUTPUT "${output_base}.vapi" + COMMAND ${VALA_COMPILER} "${file}" "--fast-vapi=${output_base}.vapi" + COMMAND ${CMAKE_COMMAND} -E touch "${output_base}.vapi" + DEPENDS "${file}" + COMMENT "Generating a fast vapi for ${output_name}" VERBATIM) + + set (vapi_opts) + set (vapi_depends) + foreach (vapi ${arg_DEPENDS}) + if (NOT IS_ABSOLUTE "${vapi}") + set (vapi "${VALA_${id}_DIR}/${vapi}.vapi") + endif (NOT IS_ABSOLUTE "${vapi}") + + list (APPEND vapi_opts "--use-fast-vapi=${vapi}") + list (APPEND vapi_depends "${vapi}") + endforeach (vapi) + + add_custom_command (OUTPUT "${output_base}.c" + COMMAND ${VALA_COMPILER} "${file}" -C ${vapi_opts} ${VALA_${id}_ARGS} + COMMAND ${CMAKE_COMMAND} -E touch "${output_base}.c" + DEPENDS "${file}" ${vapi_depends} ${VALA_${id}_DEPENDS} + WORKING_DIRECTORY "${VALA_${id}_DIR}" + COMMENT "Precompiling ${output_name}" VERBATIM) + + set (VALA_${id}_SOURCES ${VALA_${id}_SOURCES} + "${file}" PARENT_SCOPE) + set (VALA_${id}_OUTPUTS ${VALA_${id}_OUTPUTS} + "${output_base}.c" PARENT_SCOPE) + set (VALA_${id}_FAST_VAPI_FILES ${VALA_${id}_FAST_VAPI_FILES} + "${output_base}.vapi" PARENT_SCOPE) + set (VALA_${id}_FAST_VAPI_ARGS ${VALA_${id}_FAST_VAPI_ARGS} + "--use-fast-vapi=${output_base}.vapi" PARENT_SCOPE) +endfunction (vala_add) + +function (vala_finish id) + set (_one_value SOURCES OUTPUTS + GENERATE_VAPI GENERATE_HEADER GENERATE_SYMBOLS) + cmake_parse_arguments (arg "" "${_one_value}" "" ${ARGN}) + + if (arg_SOURCES) + set (${arg_SOURCES} ${VALA_${id}_SOURCES} PARENT_SCOPE) + endif (arg_SOURCES) + + if (arg_OUTPUTS) + set (${arg_OUTPUTS} ${VALA_${id}_OUTPUTS} PARENT_SCOPE) + endif (arg_OUTPUTS) + + set (outputs) + set (export_args) + + if (arg_GENERATE_VAPI) + if (NOT IS_ABSOLUTE "${arg_GENERATE_VAPI}") + set (arg_GENERATE_VAPI + "${VALA_${id}_DIR}/${arg_GENERATE_VAPI}") + endif (NOT IS_ABSOLUTE "${arg_GENERATE_VAPI}") + + list (APPEND outputs "${arg_GENERATE_VAPI}") + list (APPEND export_args "--internal-vapi=${arg_GENERATE_VAPI}") + + if (NOT arg_GENERATE_HEADER) + message (FATAL_ERROR "Header generation required for vapi") + endif (NOT arg_GENERATE_HEADER) + endif (arg_GENERATE_VAPI) + + if (arg_GENERATE_SYMBOLS) + if (NOT IS_ABSOLUTE "${arg_GENERATE_SYMBOLS}") + set (arg_GENERATE_SYMBOLS + "${VALA_${id}_DIR}/${arg_GENERATE_SYMBOLS}") + endif (NOT IS_ABSOLUTE "${arg_GENERATE_SYMBOLS}") + + list (APPEND outputs "${arg_GENERATE_SYMBOLS}") + list (APPEND export_args "--symbols=${arg_GENERATE_SYMBOLS}") + + if (NOT arg_GENERATE_HEADER) + message (FATAL_ERROR "Header generation required for symbols") + endif (NOT arg_GENERATE_HEADER) + endif (arg_GENERATE_SYMBOLS) + + if (arg_GENERATE_HEADER) + if (NOT IS_ABSOLUTE "${arg_GENERATE_HEADER}") + set (arg_GENERATE_HEADER + "${VALA_${id}_DIR}/${arg_GENERATE_HEADER}") + endif (NOT IS_ABSOLUTE "${arg_GENERATE_HEADER}") + + get_filename_component (header_path "${arg_GENERATE_HEADER}" PATH) + get_filename_component (header_name "${arg_GENERATE_HEADER}" NAME_WE) + set (header_base "${header_path}/${header_name}") + get_filename_component (header_ext "${arg_GENERATE_HEADER}" EXT) + + list (APPEND outputs + "${header_base}${header_ext}" + "${header_base}_internal${header_ext}") + list (APPEND export_args + "--header=${header_base}${header_ext}" + "--internal-header=${header_base}_internal${header_ext}") + endif (arg_GENERATE_HEADER) + + if (outputs) + add_custom_command (OUTPUT ${outputs} + COMMAND ${VALA_COMPILER} -C ${VALA_${id}_ARGS} + ${export_args} ${VALA_${id}_FAST_VAPI_ARGS} + DEPENDS ${VALA_${id}_FAST_VAPI_FILES} + COMMENT "Generating vapi/headers/symbols" VERBATIM) + endif (outputs) +endfunction (vala_finish id) + + +function (vapi_gen id) + set (_one_value LIBRARY INPUT) + set (_multi_value PACKAGES) + cmake_parse_arguments (arg "" "${_one_value}" "${_multi_value}" ${ARGN}) + + set(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${id}.vapi") + if (arg_LIBRARY) + set (OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${arg_LIBRARY}.vapi") + endif (arg_LIBRARY) + + set("${id}_OUTPUT" ${OUTPUT} PARENT_SCOPE) + + set(PACKAGE_LIST) + foreach(PACKAGE ${arg_PACKAGES}) + list(APPEND PACKAGE_LIST "--pkg" ${PACKAGE}) + endforeach() + + add_custom_command( + OUTPUT + ${OUTPUT} + COMMAND + ${VAPI_GEN} + ${PACKAGE_LIST} + --library=${arg_LIBRARY} + ${arg_INPUT} + DEPENDS + ${arg_INPUT} + VERBATIM + ) + + add_custom_target(${id} ALL DEPENDS ${OUTPUT}) +endfunction (vapi_gen id) + diff --git a/configure.ac b/configure.ac deleted file mode 100644 index 77ac763..0000000 --- a/configure.ac +++ /dev/null @@ -1,247 +0,0 @@ -AC_INIT([libayatana-appindicator], - [0.5.5], - [https://github.com/ArcticaProject/libayatana-appindicator/issues], - [libayatana-appindicator], - [https://github.com/ArcticaProject/libayatana-appindicator]) -AC_COPYRIGHT([Copyright 2009, 2010 Canonical -Copyright 2015, Arctica Project]) - -AC_PREREQ([2.64]) - -AC_CONFIG_HEADERS([config.h]) -AC_CONFIG_MACRO_DIR([m4]) - -AM_INIT_AUTOMAKE([1.11 -Wall tar-pax]) - -AM_MAINTAINER_MODE([enable]) - -AM_SILENT_RULES([yes]) - -# Check for programs -AC_PROG_CC -AM_PROG_CC_C_O -AM_PROG_AR - -# Initialize libtool -LT_PREREQ([2.2]) -LT_INIT - -AC_PATH_PROG([GLIB_MKENUMS], [glib-mkenums]) -AC_PATH_PROG([GLIB_GENMARSHAL], [glib-genmarshal]) - -PKG_PROG_PKG_CONFIG - -########################### -# GTK Doc -########################### - -GTK_DOC_CHECK([1.14],[--flavour no-tmpl]) - - -########################### -# Dependencies -########################### - -GTK_REQUIRED_VERSION=2.18 -GTK3_REQUIRED_VERSION=2.91 -GLIB_REQUIRED_VERSION=2.35.4 -GIO_REQUIRED_VERSION=2.26 -INDICATOR_REQUIRED_VERSION=0.6.0 -DBUSMENUGTK_REQUIRED_VERSION=0.5.90 -DBUS_GLIB_REQUIRED_VERSION=0.82 - -AC_ARG_WITH([gtk], - [AS_HELP_STRING([--with-gtk], - [Which version of gtk to use @<:@default=3@:>@])], - [], - [with_gtk=3]) -AS_IF([test "x$with_gtk" = x3], - [PKG_CHECK_MODULES(LIBRARY, gtk+-3.0 >= $GTK3_REQUIRED_VERSION - glib-2.0 >= $GLIB_REQUIRED_VERSION - gio-2.0 >= $GIO_REQUIRED_VERSION - ayatana-indicator3-0.4 >= $INDICATOR_REQUIRED_VERSION - dbusmenu-gtk3-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION) - AC_DEFINE(HAVE_GTK3, 1, [whether gtk3 is available]) - ], - [test "x$with_gtk" = x2], - [PKG_CHECK_MODULES(LIBRARY, gtk+-2.0 >= $GTK_REQUIRED_VERSION - glib-2.0 >= $GLIB_REQUIRED_VERSION - gio-2.0 >= $GIO_REQUIRED_VERSION - ayatana-indicator-0.4 >= $INDICATOR_REQUIRED_VERSION - dbusmenu-gtk-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION) - ], - [AC_MSG_FAILURE([Value for --with-gtk was neither 2 nor 3])] -) -AM_CONDITIONAL(USE_GTK3, [test "x$with_gtk" = x3]) - -PKG_CHECK_MODULES(TESTDEPS, dbus-glib-1) - -########################### -# GObject Introspection -########################### - -GOBJECT_INTROSPECTION_CHECK([0.6.7]) - -PKG_CHECK_EXISTS([gobject-introspection-1.0 >= 0.10], - introspection_ten=yes, - introspection_ten=no) - -AM_CONDITIONAL(INTROSPECTION_TEN, [test "x$introspection_ten" = "xyes"]) - -########################### -# Vala API Generation -########################### - -AC_PATH_PROG([VALA_API_GEN], [vapigen]) -AM_CONDITIONAL(HAVE_VAPIGEN, [test "x$VALA_API_GEN" != "x"]) - -########################### -# Vala Compiler support -########################### - -AM_PROG_VALAC([0.14.0]) -AM_CONDITIONAL(HAVE_VALAC, [test "x$VALAC" != "x"]) - -########################### -# Check for Mono support -########################### - -MONO_REQUIRED_VERSION=1.0 -PKG_CHECK_MODULES(MONO_DEPENDENCY, mono >= $MONO_REQUIRED_VERSION, has_mono=true, has_mono=false) -AM_CONDITIONAL(HAS_MONO, [test "x$has_mono" = "xtrue"]) - -AC_PATH_PROG(AL, al, no) -if test "x$AL" = "xno" ; then - AC_MSG_NOTICE([No al tool found. You need to install Mono.]) -fi - -if test "x$has_mono" = "xtrue" ; then - GENERATED_SOURCES=generated/*.cs - AC_PATH_PROG(RUNTIME, mono, no) - - if test "x$RUNTIME" != "no" ; then - RUNTIME=mono - fi - - AC_PATH_PROG(CSC, mono-csc, no) - LIB_PREFIX=.so - LIB_SUFFIX= -fi - -if test "x$CSC" = "xno" ; then - AC_MSG_NOTICE([No Mono compiler found.]) -fi - -AC_PATH_PROG(GACUTIL, gacutil, no) -if test "x$GACUTIL" = "xno" ; then - AC_MSG_NOTICE([No gacutil tool found]) -fi - -AC_SUBST(RUNTIME) -AC_SUBST(CSC) -AC_SUBST(GACUTIL) -AC_SUBST(LIB_PREFIX) -AC_SUBST(LIB_SUFFIX) -AC_SUBST(GENERATED_SOURCES) - -GLIB_SHARP_REQ_VERSION=2.12.1 -GTK_SHARP_REQ_VERSION=2.12 -PKG_CHECK_MODULES(GTK_SHARP, gtk-sharp-2.0 >= $GTK_SHARP_REQ_VERSION, has_gtksharp=true, has_gtksharp=false) - -PKG_CHECK_MODULES(GAPI, gapi-2.0 >= $GLIB_SHARP_REQ_VERSION, has_gapi=true, has_gapi=false) -AC_PATH_PROG(GAPI_PARSER, gapi2-parser, no) -AC_SUBST(GAPI_PARSER) -AC_PATH_PROG(GAPI_CODEGEN, gapi2-codegen, no) -AC_SUBST(GAPI_CODEGEN) -AC_PATH_PROG(GAPI_FIXUP, gapi2-fixup, no) -AC_SUBST(GAPI_FIXUP) - -# Check for nunit -AC_ARG_ENABLE([mono-test], - AC_HELP_STRING([--disable-mono-test], [Disable mono test]),, - [enable_mono_test=auto]) - -if test x"$enable_mono_test" != x"no" ; then - PKG_CHECK_MODULES(NUNIT, nunit >= 2.4.7, - [have_nunit=yes], - [PKG_CHECK_MODULES(MONO_NUNIT, mono-nunit, - [have_nunit=yes], - [have_nunit=no]) - ]) - if test x${enable_mono_test} = xyes && test x${have_nunit} = xno; then - AC_MSG_ERROR([Mono test configured but nunit not found]) - fi -else - have_nunit=no -fi -AM_CONDITIONAL(BUILD_MONO_TEST, test x${have_nunit} = xyes) - -######################### -# Check if build tests -######################### -AC_ARG_ENABLE([tests], - AC_HELP_STRING([--disable-tests], [Disable tests]),, - [enable_tests=yes]) -AM_CONDITIONAL([WANT_TESTS], [test "x$enable_tests" != "xno"]) - -########################### -# gcov coverage reporting -########################### - -m4_include([m4/gcov.m4]) -AC_TDD_GCOV -AM_CONDITIONAL([HAVE_GCOV], [test "x$ac_cv_check_gcov" = xyes]) -AM_CONDITIONAL([HAVE_LCOV], [test "x$ac_cv_check_lcov" = xyes]) -AM_CONDITIONAL([HAVE_GCOVR], [test "x$ac_cv_check_gcovr" = xyes]) -AC_SUBST(COVERAGE_CFLAGS) -AC_SUBST(COVERAGE_CXXFLAGS) -AC_SUBST(COVERAGE_LDFLAGS) - -########################### -# Files -########################### - -AC_CONFIG_FILES([ -Makefile -src/Makefile -src/ayatana-appindicator-0.1.pc -src/ayatana-appindicator3-0.1.pc -bindings/Makefile -bindings/vala/Makefile -bindings/vala/examples/Makefile -tests/Makefile -example/Makefile -docs/Makefile -docs/reference/Makefile -docs/reference/version.xml -docs/reference/libayatana-appindicator-docs.sgml -]) - -if test "x$has_mono" = "xtrue" ; then - AC_CONFIG_FILES([ - bindings/mono/Makefile - bindings/mono/ayatana-appindicator-sharp.dll.config - bindings/mono/ayatana-appindicator-sharp-0.1.pc - bindings/mono/app-indicator.sources.xml - bindings/mono/examples/Makefile - bindings/mono/examples/ayatana-indicator-example - ]) -fi - -AC_OUTPUT - -########################### -# Results -########################### - -AC_MSG_NOTICE([ - -libayatana-appindicator Configuration: - - Prefix: $prefix - GTK+ Version: $with_gtk - Mono: $has_mono - Tests: $enable_tests - Mono tests: $have_nunit - gcov: $use_gcov -]) diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt new file mode 100644 index 0000000..90bb2b5 --- /dev/null +++ b/docs/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory(reference) diff --git a/docs/Makefile.am b/docs/Makefile.am deleted file mode 100644 index e12f36d..0000000 --- a/docs/Makefile.am +++ /dev/null @@ -1,2 +0,0 @@ -SUBDIRS = reference -DISTCLEANFILES = Makefile.in diff --git a/docs/reference/CMakeLists.txt b/docs/reference/CMakeLists.txt new file mode 100644 index 0000000..6ae064a --- /dev/null +++ b/docs/reference/CMakeLists.txt @@ -0,0 +1,233 @@ + +# libayatana-appindicator-docs.sgml + +configure_file("${CMAKE_CURRENT_SOURCE_DIR}/libayatana-appindicator-docs.sgml.in" "${CMAKE_CURRENT_BINARY_DIR}/libayatana-appindicator-docs.sgml" @ONLY) + +# version.xml + +configure_file("${CMAKE_CURRENT_SOURCE_DIR}/version.xml.in" "${CMAKE_CURRENT_BINARY_DIR}/version.xml" @ONLY) + +# libayatana-appindicator-decl.txt +# libayatana-appindicator-decl-list.txt +# libayatana-appindicator-overrides.txt +# libayatana-appindicator-sections.txt + +find_program(GTKDOC_SCAN gtkdoc-scan) + +add_custom_command( + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/libayatana-appindicator-decl.txt" + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/libayatana-appindicator-decl-list.txt" + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/libayatana-appindicator-overrides.txt" + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/libayatana-appindicator-sections.txt" + DEPENDS "src" + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMAND + ${GTKDOC_SCAN} + --ignore-headers="app-indicator-enum-types.h;application-service-appstore.h;application-service-client.h;application-service-lru-file.h;application-service-marshal.h;application-service-server.h;application-service-watcher.h;dbus-properties-client.h;dbus-properties-server.h;dbus-shared.h;generate-id.h;notification-item-client.h;notification-item-server.h;notification-watcher-client.h;notification-watcher-server.h" + --module=libayatana-appindicator + --source-dir="${CMAKE_SOURCE_DIR}/src" + --source-dir="${CMAKE_BINARY_DIR}/src" +) + +# libayatana-appindicator.types + +add_custom_command( + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/libayatana-appindicator.types" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/libayatana-appindicator-decl.txt" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/libayatana-appindicator-decl-list.txt" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/libayatana-appindicator-overrides.txt" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/libayatana-appindicator-sections.txt" + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMAND + ${CMAKE_COMMAND} + -E copy + "${CMAKE_CURRENT_SOURCE_DIR}/libayatana-appindicator.types" + "${CMAKE_CURRENT_BINARY_DIR}/libayatana-appindicator.types" +) + +# scangobj.sh + +list(JOIN PROJECT_DEPS_INCLUDE_DIRS " -I" GTKDOC_SCANGOBJ_INCLUDE_DIRS) +list(JOIN PROJECT_DEPS_LIBRARIES " -l" GTKDOC_SCANGOBJ_LIBRARIES) + +configure_file("${CMAKE_CURRENT_SOURCE_DIR}/scangobj.sh.in" "${CMAKE_CURRENT_BINARY_DIR}/scangobj.sh") + +# libayatana-appindicator.actions +# libayatana-appindicator.args +# libayatana-appindicator.hierarchy +# libayatana-appindicator.interfaces +# libayatana-appindicator.prerequisites +# libayatana-appindicator.signals + +add_custom_command( + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/libayatana-appindicator.actions" + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/libayatana-appindicator.args" + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/libayatana-appindicator.hierarchy" + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/libayatana-appindicator.interfaces" + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/libayatana-appindicator.prerequisites" + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/libayatana-appindicator.signals" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/libayatana-appindicator.types" + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMAND sh scangobj.sh +) + +# gtkdocentities.ent + +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/xml/gtkdocentities.ent" "<!ENTITY package \"libayatana-appindicator\">") +file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/xml/gtkdocentities.ent" "\n<!ENTITY package_bugreport \"https://github.com/AyatanaIndicators/libayatana-appindicator/issues\">") +file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/xml/gtkdocentities.ent" "\n<!ENTITY package_name \"libayatana-appindicator\">") +file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/xml/gtkdocentities.ent" "\n<!ENTITY package_string \"libayatana-appindicator ${PROJECT_VERSION}\">") +file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/xml/gtkdocentities.ent" "\n<!ENTITY package_tarname \"libayatana-appindicator\">") +file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/xml/gtkdocentities.ent" "\n<!ENTITY package_url \"https://github.com/AyatanaIndicators/libayatana-appindicator\">") +file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/xml/gtkdocentities.ent" "\n<!ENTITY package_version \"${PROJECT_VERSION}\">") + +# libayatana-appindicator-undeclared.txt +# libayatana-appindicator-undocumented.txt +# libayatana-appindicator-unused.txt +# xml/annotation-glossary.xml +# xml/api-index-0.5.xml +# xml/api-index-deprecated.xml +# xml/api-index-full.xml +# xml/app-indicator.xml +# xml/libayatana-appindicator-doc.bottom +# xml/libayatana-appindicator-doc.top +# xml/object_index.sgml +# xml/tree_index.sgml + +find_program(GTKDOC_MKDB gtkdoc-mkdb) +list(JOIN PROJECT_DEPS_INCLUDE_DIRS ";-I" GTKDOC_SCANGOBJ_INCLUDE_DIRS) +list(JOIN PROJECT_DEPS_LIBRARIES ";-l" GTKDOC_SCANGOBJ_LIBRARIES) + +add_custom_command( + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/libayatana-appindicator-undeclared.txt" + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/libayatana-appindicator-undocumented.txt" + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/libayatana-appindicator-unused.txt" + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/xml/annotation-glossary.xml" + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/xml/api-index-0.5.xml" + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/xml/api-index-deprecated.xml" + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/xml/api-index-full.xml" + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/xml/app-indicator.xml" + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/xml/libayatana-appindicator-doc.bottom" + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/xml/libayatana-appindicator-doc.top" + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/xml/object_index.sgml" + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/xml/tree_index.sgml" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/libayatana-appindicator.actions" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/libayatana-appindicator.args" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/libayatana-appindicator.hierarchy" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/libayatana-appindicator.interfaces" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/libayatana-appindicator.prerequisites" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/libayatana-appindicator.signals" + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMAND + ${GTKDOC_MKDB} + --module=libayatana-appindicator + --output-format=xml + --expand-content-files="" + --main-sgml-file=libayatana-appindicator-docs.sgml + --source-dir="${CMAKE_SOURCE_DIR}/src" + --sgml-mode +) + +# html +file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/html") + +# html/annotation-glossary.html +# html/api-index-0-5.html +# html/api-index-deprecated.html +# html/api-index-full.html +# html/AppIndicator.html +# html/ch01.html +# html/home.png +# html/index.html +# html/left.png +# html/left-insensitive.png +# html/libayatana-appindicator.devhelp2 +# html/object-tree.html +# html/right.png +# html/right-insensitive.png +# html/style.css +# html/up.png +# html/up-insensitive.png + +find_program(GTKDOC_MKHTML gtkdoc-mkhtml) + +add_custom_command( + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/html/annotation-glossary.html" + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/html/api-index-0-5.html" + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/html/api-index-deprecated.html" + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/html/api-index-full.html" + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/html/AppIndicator.html" + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/html/ch01.html" + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/html/home.png" + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/html/index.html" + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/html/left.png" + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/html/left-insensitive.png" + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/html/libayatana-appindicator.devhelp2" + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/html/object-tree.html" + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/html/right.png" + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/html/right-insensitive.png" + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/html/style.css" + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/html/up.png" + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/html/up-insensitive.png" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/libayatana-appindicator-undeclared.txt" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/libayatana-appindicator-undocumented.txt" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/libayatana-appindicator-unused.txt" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/xml/annotation-glossary.xml" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/xml/api-index-0.5.xml" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/xml/api-index-deprecated.xml" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/xml/api-index-full.xml" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/xml/app-indicator.xml" "xml/libayatana-appindicator-doc.bottom" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/xml/libayatana-appindicator-doc.top" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/xml/object_index.sgml" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/xml/tree_index.sgml" + WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/html" + COMMAND + ${GTKDOC_MKHTML} + --path=${CMAKE_CURRENT_BINARY_DIR} + libayatana-appindicator + libayatana-appindicator-docs.sgml +) + +# html/annotation-glossary.html +# html/api-index-0-5.html +# html/api-index-deprecated.html +# html/api-index-full.html +# html/AppIndicator.html +# html/ch01.html +# html/index.html +# html/object-tree.html +# html/style.css + +find_program(GTKDOC_FIXXREF gtkdoc-fixxref) + +add_custom_command( + OUTPUT "fixxref" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/html/annotation-glossary.html" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/html/api-index-0-5.html" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/html/api-index-deprecated.html" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/html/api-index-full.html" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/html/AppIndicator.html" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/html/ch01.html" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/html/home.png" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/html/index.html" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/html/left.png" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/html/left-insensitive.png" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/html/libayatana-appindicator.devhelp2" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/html/object-tree.html" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/html/right.png" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/html/right-insensitive.png" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/html/style.css" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/html/up.png" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/html/up-insensitive.png" + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMAND + ${GTKDOC_FIXXREF} + --module=libayatana-appindicator + --module-dir=html + --html-dir="${CMAKE_INSTALL_FULL_DATADIR}/gtk-doc/html" +) + +set_source_files_properties("fixxref" PROPERTIES SYMBOLIC True) +install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/html/" DESTINATION "${CMAKE_INSTALL_FULL_DATADIR}/gtk-doc/html/libayatana-appindicator") + +add_custom_target("docs-references" ALL DEPENDS "fixxref") diff --git a/docs/reference/Makefile.am b/docs/reference/Makefile.am deleted file mode 100644 index 950ec37..0000000 --- a/docs/reference/Makefile.am +++ /dev/null @@ -1,125 +0,0 @@ -## Process this file with automake to produce Makefile.in - -# We require automake 1.6 at least. -AUTOMAKE_OPTIONS = 1.6 - -if USE_GTK3 -VER=3 -APPINDICATORLIB = libayatana-appindicator3.la -else -VER= -APPINDICATORLIB = libayatana-appindicator.la -endif - -# This is a blank Makefile.am for using gtk-doc. -# Copy this to your project's API docs directory and modify the variables to -# suit your project. See the GTK+ Makefiles in gtk+/docs/reference for examples -# of using the various options. - -# The name of the module, e.g. 'glib'. -DOC_MODULE=libayatana-appindicator - -# Uncomment for versioned docs and specify the version of the module, e.g. '2'. -#DOC_MODULE_VERSION=2 - - -# The top-level SGML file. You can change this if you want to. -DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.sgml - -# The directory containing the source code. Relative to $(srcdir). -# gtk-doc will search all .c & .h files beneath here for inline comments -# documenting the functions and macros. -# e.g. DOC_SOURCE_DIR=../../../gtk -DOC_SOURCE_DIR=$(top_srcdir)/src - -# Extra options to pass to gtkdoc-scangobj. Not normally needed. -SCANGOBJ_OPTIONS= --type-init-func="g_type_init()" - -# Extra options to supply to gtkdoc-scan. -# e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED" -#SCAN_OPTIONS=--rebuild-types --rebuild-sections -SCAN_OPTIONS= - -# Extra options to supply to gtkdoc-mkdb. -# e.g. MKDB_OPTIONS=--sgml-mode --output-format=xml -MKDB_OPTIONS=--sgml-mode --output-format=xml - -# Extra options to supply to gtkdoc-mktmpl -# e.g. MKTMPL_OPTIONS=--only-section-tmpl -MKTMPL_OPTIONS= - -# Extra options to supply to gtkdoc-mkhtml -MKHTML_OPTIONS= - -# Extra options to supply to gtkdoc-fixref. Not normally needed. -# e.g. FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html -FIXXREF_OPTIONS= - -# Used for dependencies. The docs will be rebuilt if any of these change. -# e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h -# e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c -HFILE_GLOB=$(top_srcdir)/src/app-indicator*.h -CFILE_GLOB=$(top_srcdir)/src/app-indicator*.c - -# Header files to ignore when scanning. -# e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h -IGNORE_HFILES= \ - app-indicator-enum-types.h \ - application-service-appstore.h \ - application-service-client.h \ - application-service-lru-file.h \ - application-service-marshal.h \ - application-service-server.h \ - application-service-watcher.h \ - dbus-properties-client.h \ - dbus-properties-server.h \ - dbus-shared.h \ - generate-id.h \ - notification-item-client.h \ - notification-item-server.h \ - notification-watcher-client.h \ - notification-watcher-server.h - -# Images to copy into HTML directory. -# e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png -HTML_IMAGES= - -# Extra SGML files that are included by $(DOC_MAIN_SGML_FILE). -# e.g. content_files=running.sgml building.sgml changes-2.0.sgml -content_files=version.xml - -# SGML files where gtk-doc abbrevations (#GtkWidget) are expanded -# These files must be listed here *and* in content_files -# e.g. expand_content_files=running.sgml -expand_content_files= - -# CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library. -# Only needed if you are using gtkdoc-scangobj to dynamically query widget -# signals and properties. -# e.g. GTKDOC_CFLAGS=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS) -# e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib) -GTKDOC_CFLAGS=-I$(top_srcdir) -I$(top_srcdir)/src $(LIBRARY_CFLAGS) -GTKDOC_LIBS=$(top_builddir)/src/$(APPINDICATORLIB) $(LIBRARY_LIBS) - -# This includes the standard gtk-doc make rules, copied by gtkdocize. -include $(top_srcdir)/gtk-doc.make - -# Other files to distribute -# e.g. EXTRA_DIST += version.xml.in -EXTRA_DIST += version.xml.in libayatana-appindicator-docs.sgml.in - -# Files not to distribute -# for --rebuild-types in $(SCAN_OPTIONS), e.g. $(DOC_MODULE).types -# for --rebuild-sections in $(SCAN_OPTIONS) e.g. $(DOC_MODULE)-sections.txt -#DISTCLEANFILES += - -# Comment this out if you want 'make check' to test you doc status -# and run some sanity checks -if ENABLE_GTK_DOC -TESTS_ENVIRONMENT = cd $(srcdir) && \ - DOC_MODULE=$(DOC_MODULE) DOC_MAIN_SGML_FILE=$(DOC_MAIN_SGML_FILE) \ - SRCDIR=$(abs_srcdir) BUILDDIR=$(abs_builddir) -#TESTS = $(GTKDOC_CHECK) -endif - -DISTCLEANFILES = Makefile.in
\ No newline at end of file diff --git a/docs/reference/libayatana-appindicator-docs.sgml.in b/docs/reference/libayatana-appindicator-docs.sgml.in index e76b2ec..b30a891 100644 --- a/docs/reference/libayatana-appindicator-docs.sgml.in +++ b/docs/reference/libayatana-appindicator-docs.sgml.in @@ -8,7 +8,7 @@ <bookinfo> <title>libayatana-appindicator Reference Manual</title> <releaseinfo> - for libayatana-appindicator @VERSION@ + for libayatana-appindicator @PROJECT_VERSION@ </releaseinfo> </bookinfo> diff --git a/docs/reference/scangobj.sh.in b/docs/reference/scangobj.sh.in new file mode 100644 index 0000000..0272865 --- /dev/null +++ b/docs/reference/scangobj.sh.in @@ -0,0 +1 @@ +LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${CMAKE_BINARY_DIR}/src" CFLAGS="-I${GTKDOC_SCANGOBJ_INCLUDE_DIRS}" LDFLAGS="-l${GTKDOC_SCANGOBJ_LIBRARIES} -L${CMAKE_BINARY_DIR}/src -layatana-appindicator3" gtkdoc-scangobj --type-init-func="g_type_init()" --module=libayatana-appindicator > /dev/null diff --git a/docs/reference/version.xml.in b/docs/reference/version.xml.in index d78bda9..fdee238 100644 --- a/docs/reference/version.xml.in +++ b/docs/reference/version.xml.in @@ -1 +1 @@ -@VERSION@ +@PROJECT_VERSION@ diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt new file mode 100644 index 0000000..ba8839e --- /dev/null +++ b/example/CMakeLists.txt @@ -0,0 +1,37 @@ +# simple-client-vala.c + +add_custom_command( + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/simple-client-vala.c" + DEPENDS "bindings-vala" + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + COMMAND + ${VALA_COMPILER} + --pkg ayatana-appindicator3-0.1 + --pkg gtk+-3.0 + --vapidir=${CMAKE_BINARY_DIR}/bindings/vala + -C simple-client-vala.vala + --directory=${CMAKE_CURRENT_BINARY_DIR} + VERBATIM + COMMAND + sed + -i "s|#include\\s*<\\s*libayatana-appindicator/app-indicator.h\\s*>||g" + "${CMAKE_CURRENT_BINARY_DIR}/simple-client-vala.c" +) + +# simple-client-vala + +set_source_files_properties("${CMAKE_CURRENT_BINARY_DIR}/simple-client-vala.c" PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS} -include ${CMAKE_SOURCE_DIR}/src/app-indicator.h") +add_executable("simple-client-vala" "${CMAKE_CURRENT_BINARY_DIR}/simple-client-vala.c") +target_include_directories("simple-client-vala" PUBLIC ${PROJECT_DEPS_INCLUDE_DIRS}) +target_link_libraries("simple-client-vala" "${PROJECT_DEPS_LIBRARIES} -layatana-appindicator3 -L${CMAKE_BINARY_DIR}/src") +add_dependencies("simple-client-vala" "ayatana-appindicator3") + +# simple-client + +set_source_files_properties("${CMAKE_CURRENT_SOURCE_DIR}/simple-client.c" PROPERTIES COMPILE_FLAGS ${COMPILE_FLAGS}) +add_executable("simple-client" "${CMAKE_CURRENT_SOURCE_DIR}/simple-client.c") +target_compile_definitions("simple-client" PUBLIC LOCAL_ICON="${CMAKE_CURRENT_SOURCE_DIR}/simple-client-test-icon.png") +target_include_directories("simple-client" PUBLIC ${PROJECT_DEPS_INCLUDE_DIRS}) +target_include_directories("simple-client" PUBLIC "${CMAKE_SOURCE_DIR}/src") +target_link_libraries("simple-client" "${PROJECT_DEPS_LIBRARIES} -layatana-appindicator3 -L${CMAKE_BINARY_DIR}/src") +add_dependencies("simple-client" "ayatana-appindicator3") diff --git a/example/Makefile.am b/example/Makefile.am deleted file mode 100644 index 0509e3e..0000000 --- a/example/Makefile.am +++ /dev/null @@ -1,63 +0,0 @@ -if USE_GTK3 -VER=3 -else -VER= -endif - -CLEANFILES = -DISTCLEANFILES = Makefile Makefile.in .deps/ -EXTRA_DIST = - -check_PROGRAMS = \ - simple-client \ - simple-client-vala - -######################################### -## simple-client -######################################### - -simple_client_SOURCES = \ - simple-client.c - -#-Werror removed for Vala -simple_client_CFLAGS = \ - $(LIBRARY_CFLAGS) \ - -DLOCAL_ICON="\"$(abs_srcdir)/simple-client-test-icon.png\"" \ - -Wall \ - -I$(top_srcdir)/src - -simple_client_LDADD = \ - $(LIBRARY_LIBS) \ - $(top_builddir)/src/libayatana-appindicator$(VER).la - -EXTRA_DIST += \ - simple-client-test-icon.png - -######################################### -## simple-client-vala -######################################### -if HAVE_VALAC - -VALAFLAGS = \ - --pkg appindicator$(VER)-0.1 \ - --vapidir=$(top_builddir)/bindings/vala - -BUILT_SOURCES = simple-client-vala.c -simple-client-vala.c: $(srcdir)/simple-client-vala.vala - $(VALAC) $(VALAFLAGS) -C $< -o $@ - $(SED) -i "s|#include\s*<\s*libayatana-appindicator/app-indicator.h\s*>||g" $@ - -simple_client_vala_SOURCES = simple-client-vala.c -simple_client_vala_CFLAGS = \ - $(simple_client_CFLAGS) \ - -include $(top_srcdir)/src/app-indicator.h - -simple_client_vala_LDADD = $(simple_client_LDADD) - -CLEANFILES += *.stamp *-vala.c - -endif - -EXTRA_DIST += \ - simple-client-vala.vala - diff --git a/m4/gcov.m4 b/m4/gcov.m4 deleted file mode 100644 index bd96386..0000000 --- a/m4/gcov.m4 +++ /dev/null @@ -1,86 +0,0 @@ -# Checks for existence of coverage tools: -# * gcov -# * lcov -# * genhtml -# * gcovr -# -# Sets ac_cv_check_gcov to yes if tooling is present -# and reports the executables to the variables LCOV, GCOVR and GENHTML. -AC_DEFUN([AC_TDD_GCOV], -[ - AC_ARG_ENABLE(gcov, - AS_HELP_STRING([--enable-gcov], - [enable coverage testing with gcov]), - [use_gcov=$enableval], [use_gcov=no]) - - if test "x$use_gcov" = "xyes"; then - # we need gcc: - if test "$GCC" != "yes"; then - AC_MSG_ERROR([GCC is required for --enable-gcov]) - fi - - # Check if ccache is being used - AC_CHECK_PROG(SHTOOL, shtool, shtool) - case `$SHTOOL path $CC` in - *ccache*[)] gcc_ccache=yes;; - *[)] gcc_ccache=no;; - esac - - if test "$gcc_ccache" = "yes" && (test -z "$CCACHE_DISABLE" || test "$CCACHE_DISABLE" != "1"); then - AC_MSG_ERROR([ccache must be disabled when --enable-gcov option is used. You can disable ccache by setting environment variable CCACHE_DISABLE=1.]) - fi - - lcov_version_list="1.6 1.7 1.8 1.9 1.10 1.11" - AC_CHECK_PROG(LCOV, lcov, lcov) - AC_CHECK_PROG(GENHTML, genhtml, genhtml) - - if test "$LCOV"; then - AC_CACHE_CHECK([for lcov version], glib_cv_lcov_version, [ - glib_cv_lcov_version=invalid - lcov_version=`$LCOV -v 2>/dev/null | $SED -e 's/^.* //'` - for lcov_check_version in $lcov_version_list; do - if test "$lcov_version" = "$lcov_check_version"; then - glib_cv_lcov_version="$lcov_check_version (ok)" - fi - done - ]) - else - lcov_msg="To enable code coverage reporting you must have one of the following lcov versions installed: $lcov_version_list" - AC_MSG_ERROR([$lcov_msg]) - fi - - case $glib_cv_lcov_version in - ""|invalid[)] - lcov_msg="You must have one of the following versions of lcov: $lcov_version_list (found: $lcov_version)." - AC_MSG_ERROR([$lcov_msg]) - LCOV="exit 0;" - ;; - esac - - if test -z "$GENHTML"; then - AC_MSG_ERROR([Could not find genhtml from the lcov package]) - fi - - ac_cv_check_gcov=yes - ac_cv_check_lcov=yes - - # Remove all optimization flags from CFLAGS - changequote({,}) - CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O[0-9]*//g'` - changequote([,]) - - # Add the special gcc flags - COVERAGE_CFLAGS="-O0 -fprofile-arcs -ftest-coverage" - COVERAGE_CXXFLAGS="-O0 -fprofile-arcs -ftest-coverage" - COVERAGE_LDFLAGS="-lgcov" - - # Check availability of gcovr - AC_CHECK_PROG(GCOVR, gcovr, gcovr) - if test -z "$GCOVR"; then - ac_cv_check_gcovr=no - else - ac_cv_check_gcovr=yes - fi - -fi -]) # AC_TDD_GCOV diff --git a/m4/introspection.m4 b/m4/introspection.m4 deleted file mode 100644 index 589721c..0000000 --- a/m4/introspection.m4 +++ /dev/null @@ -1,94 +0,0 @@ -dnl -*- mode: autoconf -*- -dnl Copyright 2009 Johan Dahlin -dnl -dnl This file is free software; the author(s) gives unlimited -dnl permission to copy and/or distribute it, with or without -dnl modifications, as long as this notice is preserved. -dnl - -# serial 1 - -m4_define([_GOBJECT_INTROSPECTION_CHECK_INTERNAL], -[ - AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first - AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first - AC_BEFORE([LT_INIT],[$0])dnl setup libtool first - - dnl enable/disable introspection - m4_if([$2], [require], - [dnl - enable_introspection=yes - ],[dnl - AC_ARG_ENABLE(introspection, - AS_HELP_STRING([--enable-introspection[=@<:@no/auto/yes@:>@]], - [Enable introspection for this build]),, - [enable_introspection=auto]) - ])dnl - - AC_MSG_CHECKING([for gobject-introspection]) - - dnl presence/version checking - AS_CASE([$enable_introspection], - [no], [dnl - found_introspection="no (disabled, use --enable-introspection to enable)" - ],dnl - [yes],[dnl - PKG_CHECK_EXISTS([gobject-introspection-1.0],, - AC_MSG_ERROR([gobject-introspection-1.0 is not installed])) - PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1], - found_introspection=yes, - AC_MSG_ERROR([You need to have gobject-introspection >= $1 installed to build AC_PACKAGE_NAME])) - ],dnl - [auto],[dnl - PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1], found_introspection=yes, found_introspection=no) - ],dnl - [dnl - AC_MSG_ERROR([invalid argument passed to --enable-introspection, should be one of @<:@no/auto/yes@:>@]) - ])dnl - - AC_MSG_RESULT([$found_introspection]) - - INTROSPECTION_SCANNER= - INTROSPECTION_COMPILER= - INTROSPECTION_GENERATE= - INTROSPECTION_GIRDIR= - INTROSPECTION_TYPELIBDIR= - if test "x$found_introspection" = "xyes"; then - INTROSPECTION_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0` - INTROSPECTION_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0` - INTROSPECTION_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0` - INTROSPECTION_GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0` - INTROSPECTION_TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)" - INTROSPECTION_CFLAGS=`$PKG_CONFIG --cflags gobject-introspection-1.0` - INTROSPECTION_LIBS=`$PKG_CONFIG --libs gobject-introspection-1.0` - INTROSPECTION_MAKEFILE=`$PKG_CONFIG --variable=datadir gobject-introspection-1.0`/gobject-introspection-1.0/Makefile.introspection - fi - AC_SUBST(INTROSPECTION_SCANNER) - AC_SUBST(INTROSPECTION_COMPILER) - AC_SUBST(INTROSPECTION_GENERATE) - AC_SUBST(INTROSPECTION_GIRDIR) - AC_SUBST(INTROSPECTION_TYPELIBDIR) - AC_SUBST(INTROSPECTION_CFLAGS) - AC_SUBST(INTROSPECTION_LIBS) - AC_SUBST(INTROSPECTION_MAKEFILE) - - AM_CONDITIONAL(HAVE_INTROSPECTION, test "x$found_introspection" = "xyes") -]) - - -dnl Usage: -dnl GOBJECT_INTROSPECTION_CHECK([minimum-g-i-version]) - -AC_DEFUN([GOBJECT_INTROSPECTION_CHECK], -[ - _GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1]) -]) - -dnl Usage: -dnl GOBJECT_INTROSPECTION_REQUIRE([minimum-g-i-version]) - - -AC_DEFUN([GOBJECT_INTROSPECTION_REQUIRE], -[ - _GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1], [require]) -]) diff --git a/src/AyatanaAppIndicator-0.1.metadata.in b/src/AyatanaAppIndicator-0.1.metadata.in deleted file mode 100644 index 1af31e7..0000000 --- a/src/AyatanaAppIndicator-0.1.metadata.in +++ /dev/null @@ -1,3 +0,0 @@ -AyatanaAppIndicator name="AppIndicator" -Indicator.priv hidden="1" -IndicatorPrivate hidden="1" diff --git a/src/AyatanaAppIndicator3-0.1.metadata.in b/src/AyatanaAppIndicator3-0.1.metadata index 09d457d..09d457d 100644 --- a/src/AyatanaAppIndicator3-0.1.metadata.in +++ b/src/AyatanaAppIndicator3-0.1.metadata diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000..3a0ce71 --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,166 @@ +set(HEADERS + app-indicator.h +) + +set(SOURCES + app-indicator.c + app-indicator-enum-types.c + application-service-marshal.c + generate-id.c + gen-notification-item.xml.c + gen-notification-watcher.xml.c +) + +install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/app-indicator.h" DESTINATION "${CMAKE_INSTALL_FULL_INCLUDEDIR}/libayatana-appindicator3-0.1/libayatana-appindicator") + +# ayatana-appindicator3-0.1.pc + +configure_file("${CMAKE_CURRENT_SOURCE_DIR}/ayatana-appindicator3-0.1.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/ayatana-appindicator3-0.1.pc" @ONLY) +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ayatana-appindicator3-0.1.pc" DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}/pkgconfig") + +# app-indicator-enum-types.h + +find_program(GLIB_MKENUMS glib-mkenums) + +add_custom_command( + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/app-indicator-enum-types.h" + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + COMMAND + ${GLIB_MKENUMS} + --template app-indicator-enum-types.h.in + ${HEADERS} + --output="${CMAKE_CURRENT_BINARY_DIR}/app-indicator-enum-types.h" +) + +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/app-indicator-enum-types.h" DESTINATION "${CMAKE_INSTALL_FULL_INCLUDEDIR}/libayatana-appindicator3-0.1/libayatana-appindicator") + +# app-indicator-enum-types.c + +add_custom_command( + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/app-indicator-enum-types.c" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/app-indicator-enum-types.h" + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + COMMAND + ${GLIB_MKENUMS} + --template app-indicator-enum-types.c.in + ${HEADERS} + --output="${CMAKE_CURRENT_BINARY_DIR}/app-indicator-enum-types.c" +) + +find_program(GLIB_GENMARSHAL glib-genmarshal) + +# application-service-marshal.h + +add_custom_command( + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/application-service-marshal.h" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/app-indicator-enum-types.c" + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + COMMAND + ${GLIB_GENMARSHAL} + --prefix=_application_service_marshal + --header application-service-marshal.list + --quiet + --output="${CMAKE_CURRENT_BINARY_DIR}/application-service-marshal.h" +) + +# application-service-marshal.c + +add_custom_command( + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/application-service-marshal.c" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/application-service-marshal.h" + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + COMMAND + ${GLIB_GENMARSHAL} + --prefix=_application_service_marshal + --body application-service-marshal.list + --include-header=application-service-marshal.h + --quiet + --output="${CMAKE_CURRENT_BINARY_DIR}/application-service-marshal.c" +) + +# gen-notification-item.xml.h + +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/gen-notification-item.xml.h" "extern const char * _notification_item;") + +# gen-notification-item.xml.c + +file(READ "${CMAKE_CURRENT_SOURCE_DIR}/notification-item.xml" GEN_NOTIFICATION_ITEM_XML_C) +string(REPLACE "\"" "\\\"" GEN_NOTIFICATION_ITEM_XML_C ${GEN_NOTIFICATION_ITEM_XML_C}) +string(REPLACE "\n" "\\n\"\n\"" GEN_NOTIFICATION_ITEM_XML_C ${GEN_NOTIFICATION_ITEM_XML_C}) +string(REGEX REPLACE "\n\"$" "\n" GEN_NOTIFICATION_ITEM_XML_C ${GEN_NOTIFICATION_ITEM_XML_C}) +string(PREPEND GEN_NOTIFICATION_ITEM_XML_C "const char * _notification_item = \n\"") +string(APPEND GEN_NOTIFICATION_ITEM_XML_C "\;") +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/gen-notification-item.xml.c" ${GEN_NOTIFICATION_ITEM_XML_C}) + +# gen-notification-watcher.xml.h + +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/gen-notification-watcher.xml.h" "extern const char * _notification_watcher;") + +# gen-notification-watcher.xml.c + +file(READ "${CMAKE_CURRENT_SOURCE_DIR}/notification-watcher.xml" GEN_NOTIFICATION_WATCHER_XML_C) +string(REPLACE "\"" "\\\"" GEN_NOTIFICATION_WATCHER_XML_C ${GEN_NOTIFICATION_WATCHER_XML_C}) +string(REPLACE "\n" "\\n\"\n\"" GEN_NOTIFICATION_WATCHER_XML_C ${GEN_NOTIFICATION_WATCHER_XML_C}) +string(REGEX REPLACE "\n\"$" "\n" GEN_NOTIFICATION_WATCHER_XML_C ${GEN_NOTIFICATION_WATCHER_XML_C}) +string(PREPEND GEN_NOTIFICATION_WATCHER_XML_C "const char * _notification_watcher = \n\"") +string(APPEND GEN_NOTIFICATION_WATCHER_XML_C "\;") +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/gen-notification-watcher.xml.c" ${GEN_NOTIFICATION_WATCHER_XML_C}) + +# libayatana-appindicator3.so + +set_source_files_properties(${SOURCES} PROPERTIES COMPILE_FLAGS ${COMPILE_FLAGS}) +add_library("ayatana-appindicator3" SHARED ${SOURCES}) +set_target_properties("ayatana-appindicator3" PROPERTIES VERSION 1.0.0 SOVERSION 1) +target_compile_definitions("ayatana-appindicator3" PUBLIC G_LOG_DOMAIN="libayatana-appindicator") +target_include_directories("ayatana-appindicator3" PUBLIC ${PROJECT_DEPS_INCLUDE_DIRS}) +target_include_directories("ayatana-appindicator3" PUBLIC ${CMAKE_CURRENT_BINARY_DIR}) +target_include_directories("ayatana-appindicator3" PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) +target_link_libraries("ayatana-appindicator3" ${PROJECT_DEPS_LIBRARIES}) +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libayatana-appindicator3.so" DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}") +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libayatana-appindicator3.so.1" DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}") +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libayatana-appindicator3.so.1.0.0" DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}") + +# AyatanaAppIndicator3-0.1.gir + +find_package(GObjectIntrospection REQUIRED QUIET) + +add_custom_command( + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/AyatanaAppIndicator3-0.1.gir" + DEPENDS "ayatana-appindicator3" + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + COMMAND + ${INTROSPECTION_SCANNER} + app-indicator.c ${HEADERS} + --add-include-path=${CMAKE_CURRENT_BINARY_DIR} + --c-include=libayatana-appindicator/app-indicator.h + --symbol-prefix=app + --identifier-prefix=App + --namespace=AyatanaAppIndicator3 + --nsversion=0.1 + --quiet + --warn-all + --include=GObject-2.0 + --include=Gtk-3.0 + --library-path=${CMAKE_CURRENT_BINARY_DIR} + --library="ayatana-appindicator3" + --output "${CMAKE_CURRENT_BINARY_DIR}/AyatanaAppIndicator3-0.1.gir" +) + +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/AyatanaAppIndicator3-0.1.gir" DESTINATION "${CMAKE_INSTALL_FULL_DATADIR}/gir-1.0") + +# AyatanaAppIndicator3-0.1.typelib + +add_custom_command( + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/AyatanaAppIndicator3-0.1.typelib" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/AyatanaAppIndicator3-0.1.gir" + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMAND + ${INTROSPECTION_COMPILER} + --includedir=${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_BINARY_DIR}/AyatanaAppIndicator3-0.1.gir + -o "${CMAKE_CURRENT_BINARY_DIR}/AyatanaAppIndicator3-0.1.typelib" +) + +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/AyatanaAppIndicator3-0.1.typelib" DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}/girepository-1.0") + +add_custom_target(src ALL DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/AyatanaAppIndicator3-0.1.typelib") diff --git a/src/Makefile.am b/src/Makefile.am deleted file mode 100644 index a1bbcf0..0000000 --- a/src/Makefile.am +++ /dev/null @@ -1,188 +0,0 @@ -if USE_GTK3 -VER=3 -lib_LTLIBRARIES = libayatana-appindicator3.la -GTKGIR = Gtk-3.0 -else -VER= -lib_LTLIBRARIES = libayatana-appindicator.la -GTKGIR = Gtk-2.0 -endif - -CLEANFILES = -DISTCLEANFILES = Makefile.in -BUILT_SOURCES = -EXTRA_DIST = \ - ayatana-appindicator-0.1.pc.in \ - ayatana-appindicator3-0.1.pc.in \ - AyatanaAppIndicator-0.1.metadata.in \ - AyatanaAppIndicator3-0.1.metadata.in - -include $(top_srcdir)/Makefile.am.enum -include $(top_srcdir)/Makefile.am.marshal - -################################## -# Marshallers -################################## - -BUILT_SOURCES += \ - application-service-marshal.h \ - application-service-marshal.c - -glib_marshal_list = application-service-marshal.list -glib_marshal_prefix = _application_service_marshal - -################################## -# Library -################################## - -pkgconfig_DATA = ayatana-appindicator$(VER)-0.1.pc -pkgconfigdir = $(libdir)/pkgconfig - -glib_enum_h = app-indicator-enum-types.h -glib_enum_c = app-indicator-enum-types.c -glib_enum_headers = $(addprefix $(srcdir)/, $(libayatana_appindicator_headers)) - -DISTCLEANFILES += app-indicator-enum-types.c - -libayatana_appindicatorincludefolder=libayatana-appindicator -libayatana_appindicatorincludedir=$(includedir)/libayatana-appindicator$(VER)-0.1/$(libayatana_appindicatorincludefolder) - -libayatana_appindicator_headers = \ - app-indicator.h - -libayatana_appindicatorinclude_HEADERS = \ - $(libayatana_appindicator_headers) \ - $(glib_enum_h) - -libayatana_appindicator_la_SOURCES = \ - $(libayatana_appindicator_headers) \ - app-indicator-enum-types.c \ - app-indicator.c \ - application-service-marshal.c \ - dbus-shared.h \ - generate-id.h \ - generate-id.c \ - gen-notification-item.xml.h \ - gen-notification-item.xml.c \ - gen-notification-watcher.xml.h \ - gen-notification-watcher.xml.c - -libayatana_appindicator_la_LDFLAGS = \ - $(COVERAGE_LDFLAGS) \ - -version-info 1:0:0 \ - -no-undefined \ - -export-symbols-regex "^[^_d].*" - -libayatana_appindicator_la_CFLAGS = \ - $(LIBRARY_CFLAGS) \ - $(COVERAGE_CFLAGS) \ - -Wall -Wno-error=deprecated-declarations \ - -DG_LOG_DOMAIN=\"libayatana-appindicator\" - -libayatana_appindicator_la_LIBADD = \ - $(LIBRARY_LIBS) - -# We duplicate these here because Automake won't let us use $(VER) on the left hand side. -# Since we carefully use $(VER) in the right hand side above, we can assign the same values. -# Only one version of the library is every compiled at the same time, so it is safe to reuse -# the right hand sides like this. -libayatana_appindicator3includedir = $(libayatana_appindicatorincludedir) -libayatana_appindicator3include_HEADERS = $(libayatana_appindicatorinclude_HEADERS) -libayatana_appindicator3_la_SOURCES = $(libayatana_appindicator_la_SOURCES) -libayatana_appindicator3_la_LDFLAGS = $(libayatana_appindicator_la_LDFLAGS) -libayatana_appindicator3_la_CFLAGS = $(libayatana_appindicator_la_CFLAGS) -libayatana_appindicator3_la_LIBADD = $(libayatana_appindicator_la_LIBADD) - -################################## -# DBus Specs -################################## - -DBUS_SPECS = \ - notification-item.xml \ - notification-watcher.xml - -gen-%.xml.h: %.xml - @echo "Building $@ from $<" - @echo "extern const char * _$(subst -,_,$(subst .,_,$(basename $(notdir $<))));" > $@ - -gen-%.xml.c: %.xml - @echo "Building $@ from $<" - @echo "const char * _$(subst -,_,$(subst .,_,$(basename $(notdir $<)))) = " > $@ - @sed -e "s:\":\\\\\":g" -e s:^:\": -e s:\$$:\\\\n\": $< >> $@ - @echo ";" >> $@ - -BUILT_SOURCES += \ - gen-notification-item.xml.c \ - gen-notification-item.xml.h \ - gen-notification-watcher.xml.c \ - gen-notification-watcher.xml.h - -CLEANFILES += \ - gen-notification-item.xml.c \ - gen-notification-item.xml.h \ - gen-notification-watcher.xml.c \ - gen-notification-watcher.xml.h - -EXTRA_DIST += $(DBUS_SPECS) - -######################### -# GObject Introsepction -######################### - --include $(INTROSPECTION_MAKEFILE) -INTROSPECTION_GIRS = - -if INTROSPECTION_TEN -INTROSPECTION_SCANNER_ARGS = \ - --add-include-path=$(srcdir) \ - $(addprefix --c-include=$(libayatana_appindicatorincludefolder)/, $(libayatana_appindicator_headers)) \ - --symbol-prefix=app \ - --identifier-prefix=App \ - --warn-all -else -INTROSPECTION_SCANNER_ARGS = \ - --add-include-path=$(srcdir) \ - $(addprefix --c-include=$(libayatana_appindicatorincludefolder)/, $(libayatana_appindicator_headers)) -endif - -INTROSPECTION_COMPILER_ARGS = --includedir=$(builddir) - -if HAVE_INTROSPECTION - -introspection_sources = \ - $(addprefix $(srcdir)/,app-indicator.c) \ - $(addprefix $(srcdir)/,$(libayatana_appindicator_headers)) - -AyatanaAppIndicator$(VER)-0.1.gir: libayatana-appindicator$(VER).la - -AyatanaAppIndicator_0_1_gir_INCLUDES = \ - GObject-2.0 \ - $(GTKGIR) -AyatanaAppIndicator_0_1_gir_CFLAGS = $(LIBRARY_CFLAGS) -I$(srcdir) -I$(top_builddir)/src -AyatanaAppIndicator_0_1_gir_LIBS = libayatana-appindicator$(VER).la -AyatanaAppIndicator_0_1_gir_FILES = $(introspection_sources) -# AyatanaAppIndicator_0_1_gir_NAMESPACE = AyatanaAppIndicator - -AyatanaAppIndicator3_0_1_gir_INCLUDES = $(AyatanaAppIndicator_0_1_gir_INCLUDES) -AyatanaAyatanaAppIndicator3_0_1_gir_CFLAGS = $(AyatanaAyatanaAppIndicator_0_1_gir_CFLAGS) -AyatanaAppIndicator3_0_1_gir_LIBS = $(AyatanaAppIndicator_0_1_gir_LIBS) -AyatanaAppIndicator3_0_1_gir_FILES = $(AyatanaAppIndicator_0_1_gir_FILES) -# AyatanaAppIndicator3_0_1_gir_NAMESPACE = AyatanaAppIndicator - -INTROSPECTION_GIRS += AyatanaAppIndicator$(VER)-0.1.gir - -AyatanaAppIndicator$(VER)-0.1.metadata: AyatanaAppIndicator$(VER)-0.1.gir - cp -f $(srcdir)/$@.in $@ - -BUILT_SOURCES += AyatanaAppIndicator$(VER)-0.1.metadata -CLEANFILES += AyatanaAppIndicator$(VER)-0.1.metadata - -girdir = $(datadir)/gir-1.0 -gir_DATA = $(INTROSPECTION_GIRS) - -typelibdir = $(libdir)/girepository-1.0 -typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib) - -CLEANFILES += $(gir_DATA) $(typelib_DATA) - -endif diff --git a/src/ayatana-appindicator3-0.1.pc.in b/src/ayatana-appindicator3-0.1.pc.in index 51eb96b..bf8c1b8 100644 --- a/src/ayatana-appindicator3-0.1.pc.in +++ b/src/ayatana-appindicator3-0.1.pc.in @@ -1,14 +1,14 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -bindir=@bindir@ -includedir=@includedir@ +prefix=@CMAKE_INSTALL_PREFIX@ +exec_prefix=${prefix} +libdir=@CMAKE_INSTALL_FULL_LIBDIR@ +bindir=@CMAKE_INSTALL_FULL_BINDIR@ +includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ Cflags: -I${includedir}/libayatana-appindicator3-0.1 -Requires: dbusmenu-glib-0.4 gtk+-3.0 +Requires: ayatana-indicator3-0.4 dbusmenu-glib-0.4 glib-2.0 gtk+-3.0 Libs: -L${libdir} -layatana-appindicator3 Name: ayatana-appindicator3-0.1 Description: Ayatana Application Indicators -Version: @VERSION@ +Version: @PROJECT_VERSION@ diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt new file mode 100644 index 0000000..03771ba --- /dev/null +++ b/tests/CMakeLists.txt @@ -0,0 +1,184 @@ +# test-libappindicator + +set_source_files_properties("${CMAKE_CURRENT_SOURCE_DIR}/test-libappindicator.c" PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS} -include ${CMAKE_SOURCE_DIR}/src/app-indicator.h") +add_executable("test-libappindicator" "${CMAKE_CURRENT_SOURCE_DIR}/test-libappindicator.c") +target_compile_definitions("test-libappindicator" PUBLIC SRCDIR="${CMAKE_CURRENT_SOURCE_DIR}") +target_include_directories("test-libappindicator" PUBLIC ${PROJECT_DEPS_INCLUDE_DIRS}) +target_include_directories("test-libappindicator" PUBLIC "${CMAKE_SOURCE_DIR}/src") +target_link_libraries("test-libappindicator" "${PROJECT_DEPS_LIBRARIES} -layatana-appindicator3") +target_link_directories("test-libappindicator" PUBLIC "${CMAKE_BINARY_DIR}/src") +add_dependencies("test-libappindicator" "ayatana-appindicator3") + +# test-libappindicator-dbus-client + +set_source_files_properties("${CMAKE_CURRENT_SOURCE_DIR}/test-libappindicator.c" PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS}") +add_executable("test-libappindicator-dbus-client" "${CMAKE_CURRENT_SOURCE_DIR}/test-libappindicator-dbus-client.c") +target_include_directories("test-libappindicator-dbus-client" PUBLIC ${PROJECT_DEPS_INCLUDE_DIRS}) +target_include_directories("test-libappindicator-dbus-client" PUBLIC "${CMAKE_SOURCE_DIR}/src") +target_link_libraries("test-libappindicator-dbus-client" "${PROJECT_DEPS_LIBRARIES} -layatana-appindicator3") +target_link_directories("test-libappindicator-dbus-client" PUBLIC "${CMAKE_BINARY_DIR}/src") +add_dependencies("test-libappindicator-dbus-client" "ayatana-appindicator3") + +# test-libappindicator-dbus-server + +set_source_files_properties("${CMAKE_CURRENT_SOURCE_DIR}/test-libappindicator-dbus-server.c" PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS}") +add_executable("test-libappindicator-dbus-server" "${CMAKE_CURRENT_SOURCE_DIR}/test-libappindicator-dbus-server.c") +target_include_directories("test-libappindicator-dbus-server" PUBLIC ${PROJECT_DEPS_INCLUDE_DIRS}) +target_include_directories("test-libappindicator-dbus-server" PUBLIC "${CMAKE_SOURCE_DIR}/src") +target_link_libraries("test-libappindicator-dbus-server" "${PROJECT_DEPS_LIBRARIES} -layatana-appindicator3") +target_link_directories("test-libappindicator-dbus-server" PUBLIC "${CMAKE_BINARY_DIR}/src") +add_dependencies("test-libappindicator-dbus-server" "ayatana-appindicator3") + +# test-libappindicator-status-client + +set_source_files_properties("${CMAKE_CURRENT_SOURCE_DIR}/test-libappindicator-status-client.c" PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS}") +add_executable("test-libappindicator-status-client" "${CMAKE_CURRENT_SOURCE_DIR}/test-libappindicator-status-client.c") +target_include_directories("test-libappindicator-status-client" PUBLIC ${PROJECT_DEPS_INCLUDE_DIRS}) +target_link_libraries("test-libappindicator-status-client" "${PROJECT_DEPS_LIBRARIES} -layatana-appindicator3") +target_link_directories("test-libappindicator-status-client" PUBLIC "${CMAKE_BINARY_DIR}/src") +add_dependencies("test-libappindicator-status-client" "ayatana-appindicator3") + +# test-libappindicator-status-server + +set_source_files_properties("${CMAKE_CURRENT_SOURCE_DIR}/test-libappindicator-status-server.c" PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS}") +add_executable("test-libappindicator-status-server" "${CMAKE_CURRENT_SOURCE_DIR}/test-libappindicator-status-server.c") +target_include_directories("test-libappindicator-status-server" PUBLIC ${PROJECT_DEPS_INCLUDE_DIRS}) +target_include_directories("test-libappindicator-status-server" PUBLIC "${CMAKE_SOURCE_DIR}/src") +target_link_libraries("test-libappindicator-status-server" "${PROJECT_DEPS_LIBRARIES} -layatana-appindicator3") +target_link_directories("test-libappindicator-status-server" PUBLIC "${CMAKE_BINARY_DIR}/src") +add_dependencies("test-libappindicator-status-server" "ayatana-appindicator3") + +# test-libappindicator-fallback-item + +set_source_files_properties("${CMAKE_CURRENT_SOURCE_DIR}/test-libappindicator-fallback-item.c" PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS}") +add_executable("test-libappindicator-fallback-item" "${CMAKE_CURRENT_SOURCE_DIR}/test-libappindicator-fallback-item.c") +target_include_directories("test-libappindicator-fallback-item" PUBLIC ${PROJECT_DEPS_INCLUDE_DIRS}) +target_include_directories("test-libappindicator-fallback-item" PUBLIC "${CMAKE_SOURCE_DIR}/src") +target_link_libraries("test-libappindicator-fallback-item" "${PROJECT_DEPS_LIBRARIES} -layatana-appindicator3") +target_link_directories("test-libappindicator-fallback-item" PUBLIC "${CMAKE_BINARY_DIR}/src") +add_dependencies("test-libappindicator-fallback-item" "ayatana-appindicator3") + +# test-libappindicator-fallback-watcher + +set_source_files_properties("${CMAKE_CURRENT_SOURCE_DIR}/test-libappindicator-fallback-watcher.c" PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS}") +add_executable("test-libappindicator-fallback-watcher" "${CMAKE_CURRENT_SOURCE_DIR}/test-libappindicator-fallback-watcher.c") +target_include_directories("test-libappindicator-fallback-watcher" PUBLIC ${PROJECT_DEPS_INCLUDE_DIRS}) +target_link_libraries("test-libappindicator-fallback-watcher" "${PROJECT_DEPS_LIBRARIES} -layatana-appindicator3") +target_link_directories("test-libappindicator-fallback-watcher" PUBLIC "${CMAKE_BINARY_DIR}/src") +add_dependencies("test-libappindicator-fallback-watcher" "ayatana-appindicator3") + +# test-simple-app + +set_source_files_properties("${CMAKE_CURRENT_SOURCE_DIR}/test-simple-app.c" PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS}") +add_executable("test-simple-app" "${CMAKE_CURRENT_SOURCE_DIR}/test-simple-app.c") +target_include_directories("test-simple-app" PUBLIC ${PROJECT_DEPS_INCLUDE_DIRS}) +target_include_directories("test-simple-app" PUBLIC "${CMAKE_SOURCE_DIR}/src") +target_link_libraries("test-simple-app" "${PROJECT_DEPS_LIBRARIES} -layatana-appindicator3") +target_link_directories("test-simple-app" PUBLIC "${CMAKE_BINARY_DIR}/src") +add_dependencies("test-simple-app" "ayatana-appindicator3") + +# test-libappindicator-fallback + +find_program(DBUS_TEST_RUNNER dbus-test-runner) + +add_custom_command( + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/test-libappindicator-fallback" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/test-libappindicator-fallback-watcher" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/test-libappindicator-fallback-item" + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + VERBATIM + COMMAND + echo "#!/bin/bash" > "${CMAKE_CURRENT_BINARY_DIR}/test-libappindicator-fallback" + COMMAND + echo "export DISPLAY=" >> "${CMAKE_CURRENT_BINARY_DIR}/test-libappindicator-fallback" + COMMAND + echo ". ${CMAKE_CURRENT_SOURCE_DIR}/run-xvfb.sh" >> "${CMAKE_CURRENT_BINARY_DIR}/test-libappindicator-fallback" + COMMAND + echo "${DBUS_TEST_RUNNER} -m 300 --dbus-config /usr/share/dbus-test-runner/session.conf --task ${CMAKE_CURRENT_BINARY_DIR}/test-libappindicator-fallback-watcher --task-name Watcher --ignore-return --task ${CMAKE_CURRENT_BINARY_DIR}/test-libappindicator-fallback-item --task-name Item" >> "${CMAKE_CURRENT_BINARY_DIR}/test-libappindicator-fallback" + COMMAND + chmod +x "${CMAKE_CURRENT_BINARY_DIR}/test-libappindicator-fallback" +) + +add_test("test-libappindicator-fallback" "test-libappindicator-fallback") + +# test-libappindicator-dbus + +add_custom_command( + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/test-libappindicator-dbus" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/test-libappindicator-dbus-client" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/test-libappindicator-dbus-server" + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + VERBATIM + COMMAND + echo "#!/bin/bash" > "${CMAKE_CURRENT_BINARY_DIR}/test-libappindicator-dbus" + COMMAND + echo "export DISPLAY=" >> "${CMAKE_CURRENT_BINARY_DIR}/test-libappindicator-dbus" + COMMAND + echo ". ${CMAKE_CURRENT_SOURCE_DIR}/run-xvfb.sh" >> "${CMAKE_CURRENT_BINARY_DIR}/test-libappindicator-dbus" + COMMAND + echo "${DBUS_TEST_RUNNER} -m 300 --dbus-config /usr/share/dbus-test-runner/session.conf --task ${CMAKE_CURRENT_BINARY_DIR}/test-libappindicator-dbus-client --task-name Client --ignore-return --task ${CMAKE_CURRENT_BINARY_DIR}/test-libappindicator-dbus-server --task-name Server" >> "${CMAKE_CURRENT_BINARY_DIR}/test-libappindicator-dbus" + COMMAND + chmod +x "${CMAKE_CURRENT_BINARY_DIR}/test-libappindicator-dbus" +) + +add_test("test-libappindicator-dbus" "test-libappindicator-dbus") + +# test-libappindicator-status + +add_custom_command( + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/test-libappindicator-status" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/test-libappindicator-status-client" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/test-libappindicator-status-server" + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + VERBATIM + COMMAND + echo "#!/bin/bash" > "${CMAKE_CURRENT_BINARY_DIR}/test-libappindicator-status" + COMMAND + echo "export DISPLAY=" >> "${CMAKE_CURRENT_BINARY_DIR}/test-libappindicator-status" + COMMAND + echo ". ${CMAKE_CURRENT_SOURCE_DIR}/run-xvfb.sh" >> "${CMAKE_CURRENT_BINARY_DIR}/test-libappindicator-status" + COMMAND + echo "${DBUS_TEST_RUNNER} -m 300 --dbus-config /usr/share/dbus-test-runner/session.conf --task ${CMAKE_CURRENT_BINARY_DIR}/test-libappindicator-status-client --task-name Client --ignore-return --task ${CMAKE_CURRENT_BINARY_DIR}/test-libappindicator-status-server --task-name Server" >> "${CMAKE_CURRENT_BINARY_DIR}/test-libappindicator-status" + COMMAND + chmod +x "${CMAKE_CURRENT_BINARY_DIR}/test-libappindicator-status" +) + +add_test("test-libappindicator-status" "test-libappindicator-status") + +# libappindicator-tests-gtester + +add_custom_command( + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/libappindicator-tests-gtester" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/test-libappindicator" + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + VERBATIM + COMMAND + echo "#!/bin/sh" > "${CMAKE_CURRENT_BINARY_DIR}/libappindicator-tests-gtester" + COMMAND + echo "gtester -k --verbose -o=${CMAKE_CURRENT_BINARY_DIR}/libappindicator-check-results.xml ${CMAKE_CURRENT_BINARY_DIR}/test-libappindicator" >> "${CMAKE_CURRENT_BINARY_DIR}/libappindicator-tests-gtester" + COMMAND + chmod +x "${CMAKE_CURRENT_BINARY_DIR}/libappindicator-tests-gtester" +) + +# libappindicator-tests + +add_custom_command( + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/libappindicator-tests" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/libappindicator-tests-gtester" + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + VERBATIM + COMMAND + echo "#!/bin/bash" > "${CMAKE_CURRENT_BINARY_DIR}/libappindicator-tests" + COMMAND + echo "export DISPLAY=" >> "${CMAKE_CURRENT_BINARY_DIR}/libappindicator-tests" + COMMAND + echo ". ${CMAKE_CURRENT_SOURCE_DIR}/run-xvfb.sh" >> "${CMAKE_CURRENT_BINARY_DIR}/libappindicator-tests" + COMMAND + echo "${DBUS_TEST_RUNNER} -m 300 --dbus-config /usr/share/dbus-test-runner/session.conf --task ${CMAKE_CURRENT_BINARY_DIR}/libappindicator-tests-gtester" >> "${CMAKE_CURRENT_BINARY_DIR}/libappindicator-tests" + COMMAND + chmod +x "${CMAKE_CURRENT_BINARY_DIR}/libappindicator-tests" +) + +add_test("libappindicator-tests" "libappindicator-tests") + +add_custom_target("tests" ALL DEPENDS "test-libappindicator-fallback" "test-libappindicator-dbus" "test-libappindicator-status" "libappindicator-tests") diff --git a/tests/Makefile.am b/tests/Makefile.am deleted file mode 100644 index 0e1ef96..0000000 --- a/tests/Makefile.am +++ /dev/null @@ -1,207 +0,0 @@ -if USE_GTK3 -VER=3 -else -VER= -endif - - -check_PROGRAMS = \ - test-libappindicator \ - test-libappindicator-dbus-client \ - test-libappindicator-dbus-server \ - test-libappindicator-status-client \ - test-libappindicator-status-server \ - test-libappindicator-fallback-watcher \ - test-libappindicator-fallback-item \ - test-simple-app - -TESTS = -DISTCLEANFILES = $(TESTS) Makefile.in - -EXTRA_DIST = \ - run-xvfb.sh \ - test-libappindicator.desktop - -######################################### -## test-libappindicator -######################################### - -test_libappindicator_SOURCES = \ - test-libappindicator.c - -test_libappindicator_CFLAGS = \ - $(TESTDEPS_CFLAGS) $(LIBRARY_CFLAGS) \ - -DSRCDIR="\"$(srcdir)\"" \ - -Wall -Wno-error=deprecated-declarations \ - -I$(top_srcdir)/src - -test_libappindicator_LDADD = \ - $(TESTDEPS_LIBS) $(LIBRARY_LIBS) \ - $(top_builddir)/src/libayatana-appindicator$(VER).la - -######################################### -## test-libappindicator-dbus-client -######################################### - -test_libappindicator_dbus_client_SOURCES = \ - test-defines.h \ - test-libappindicator-dbus-client.c - -test_libappindicator_dbus_client_CFLAGS = \ - $(TESTDEPS_CFLAGS) $(LIBRARY_CFLAGS) \ - -Wall -Wno-error=deprecated-declarations \ - -I$(top_srcdir)/src - -test_libappindicator_dbus_client_LDADD = \ - $(TESTDEPS_LIBS) $(LIBRARY_LIBS) \ - $(top_builddir)/src/libayatana-appindicator$(VER).la - -######################################### -## test-libappindicator-dbus-server -######################################### - -test_libappindicator_dbus_server_SOURCES = \ - test-defines.h \ - test-libappindicator-dbus-server.c - -test_libappindicator_dbus_server_CFLAGS = \ - $(TESTDEPS_CFLAGS) $(LIBRARY_CFLAGS) \ - -Wall -Wno-error=deprecated-declarations \ - -I$(top_srcdir)/src - -test_libappindicator_dbus_server_LDADD = \ - $(TESTDEPS_LIBS) $(LIBRARY_LIBS) \ - $(top_builddir)/src/libayatana-appindicator$(VER).la - -######################################### -## test-libappindicator-status-client -######################################### - -test_libappindicator_status_client_SOURCES = \ - test-defines.h \ - test-libappindicator-status-client.c - -test_libappindicator_status_client_CFLAGS = \ - $(TESTDEPS_CFLAGS) $(LIBRARY_CFLAGS) \ - -Wall -Wno-error=deprecated-declarations \ - -I$(top_srcdir)/src - -test_libappindicator_status_client_LDADD = \ - $(TESTDEPS_LIBS) $(LIBRARY_LIBS) \ - $(top_builddir)/src/libayatana-appindicator$(VER).la - -######################################### -## test-libappindicator-status-server -######################################### - -test_libappindicator_status_server_SOURCES = \ - test-defines.h \ - test-libappindicator-status-server.c - -test_libappindicator_status_server_CFLAGS = \ - $(TESTDEPS_CFLAGS) $(LIBRARY_CFLAGS) \ - -Wall -Wno-error=deprecated-declarations \ - -I$(top_srcdir)/src - -test_libappindicator_status_server_LDADD = \ - $(TESTDEPS_LIBS) $(LIBRARY_LIBS) \ - $(top_builddir)/src/libayatana-appindicator$(VER).la - -######################################### -## test-libappindicator-fallback -######################################### - -test_libappindicator_fallback_watcher_SOURCES = \ - test-libappindicator-fallback-watcher.c - -test_libappindicator_fallback_watcher_CFLAGS = \ - $(TESTDEPS_CFLAGS) $(LIBRARY_CFLAGS) \ - -Wall -Wno-error=deprecated-declarations \ - -I$(top_srcdir)/src - -test_libappindicator_fallback_watcher_LDADD = \ - $(TESTDEPS_LIBS) $(LIBRARY_LIBS) \ - $(top_builddir)/src/libayatana-appindicator$(VER).la - -test_libappindicator_fallback_item_SOURCES = \ - test-libappindicator-fallback-item.c - -test_libappindicator_fallback_item_CFLAGS = \ - $(TESTDEPS_CFLAGS) $(LIBRARY_CFLAGS) \ - -Wall -Wno-error=deprecated-declarations \ - -I$(top_srcdir)/src - -test_libappindicator_fallback_item_LDADD = \ - $(TESTDEPS_LIBS) $(LIBRARY_LIBS) \ - $(top_builddir)/src/libayatana-appindicator$(VER).la - -test-libappindicator-fallback: test-libappindicator-fallback-watcher test-libappindicator-fallback-item Makefile.am - @echo "#!/bin/bash" > $@ - @echo export DISPLAY= >> $@ - @echo . $(srcdir)/run-xvfb.sh >> $@ - @echo $(DBUS_RUNNER) --task ./test-libappindicator-fallback-watcher --task-name Watcher --ignore-return --task ./test-libappindicator-fallback-item --task-name Item >> $@ - @chmod +x $@ - -TESTS += test-libappindicator-fallback - -######################################### -## Actual tests -######################################### - -XML_REPORT = libappindicator-check-results.xml -HTML_REPORT = libappindicator-check-results.html - -libappindicator-tests: libappindicator-tests-gtester Makefile.am - @echo "#!/bin/bash" > $@ - @echo export DISPLAY= >> $@ - @echo . $(srcdir)/run-xvfb.sh >> $@ - @echo export UBUNTU_MENUPROXY= >> $@ - @echo $(DBUS_RUNNER) --task ./libappindicator-tests-gtester >> $@ - @chmod +x $@ - -libappindicator-tests-gtester: test-libappindicator Makefile.am - @echo "#!/bin/sh" > $@ - @echo gtester -k --verbose -o=$(XML_REPORT) ./test-libappindicator >> $@ - @chmod +x $@ - -TESTS += libappindicator-tests -DISTCLEANFILES += $(XML_REPORT) $(HTML_REPORT) libappindicator-tests-gtester - - -DBUS_RUNNER=dbus-test-runner --keep-env -m 300 --dbus-config /usr/share/dbus-test-runner/session.conf - -test-libappindicator-dbus: test-libappindicator-dbus-client test-libappindicator-dbus-server Makefile.am - @echo "#!/bin/bash" > test-libappindicator-dbus - @echo export DISPLAY= >> $@ - @echo . $(srcdir)/run-xvfb.sh >> $@ - @echo $(DBUS_RUNNER) --task ./test-libappindicator-dbus-client --task-name Client --task ./test-libappindicator-dbus-server --task-name Server --ignore-return >> test-libappindicator-dbus - @chmod +x test-libappindicator-dbus - -TESTS += test-libappindicator-dbus -XFAIL_TESTS = test-libappindicator-dbus - -test-libappindicator-status: test-libappindicator-status-client test-libappindicator-status-server Makefile.am - @echo "#!/bin/bash" > test-libappindicator-status - @echo export DISPLAY= >> $@ - @echo . $(srcdir)/run-xvfb.sh >> $@ - @echo $(DBUS_RUNNER) --task ./test-libappindicator-status-client --task-name Client --task ./test-libappindicator-status-server --task-name Server --ignore-return >> test-libappindicator-status - @chmod +x test-libappindicator-status - -TESTS += test-libappindicator-status - -######################################### -## test-simple-app -######################################### - -test_simple_app_SOURCES = \ - test-simple-app.c - -test_simple_app_CFLAGS = \ - $(TESTDEPS_CFLAGS) $(LIBRARY_CFLAGS) \ - -Wall -Wno-error=deprecated-declarations \ - -I$(top_srcdir)/src - -test_simple_app_LDADD = \ - $(TESTDEPS_LIBS) $(LIBRARY_LIBS) \ - $(top_builddir)/src/libayatana-appindicator$(VER).la - |