From eb5314319f7eb50a5d99196b8bf222770b2a16f1 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 12 May 2021 15:23:40 +0200 Subject: */Makefile.am: Drop more remnants of autotools. --- tests/Makefile.am | 528 ------------------------------------------------------ tools/Makefile.am | 43 ----- 2 files changed, 571 deletions(-) delete mode 100644 tests/Makefile.am delete mode 100644 tools/Makefile.am diff --git a/tests/Makefile.am b/tests/Makefile.am deleted file mode 100644 index 476de28..0000000 --- a/tests/Makefile.am +++ /dev/null @@ -1,528 +0,0 @@ -if USE_GTK3 -INDICATOR_LIB = -layatana-indicator3 -else -INDICATOR_LIB = -layatana-indicator -GTK_DISABLE_DEPRECATED = -DGTK_DISABLE_DEPRECATED -endif - -TESTS = -DISTCLEANFILES = -XFAIL_TESTS = - -check_PROGRAMS = - -lib_LTLIBRARIES = \ - libdummy-indicator-blank.la \ - libdummy-indicator-null.la \ - libdummy-indicator-signaler.la \ - libdummy-indicator-simple.la \ - libdummy-indicator-visible.la \ - libdummy-indicator-entry-func.la - -DBUS_RUNNER=dbus-test-runner --dbus-config /usr/share/dbus-test-runner/session.conf -XVFB_RUN=". $(srcdir)/run-xvfb.sh" - -EXTRA_DIST = \ - run-xvfb.sh \ - session.conf.in \ - service-manager-connect.service.in \ - service-version-bad.service.in \ - service-version-good.service.in \ - org.ayatana.indicator.test.service.in - -############################# -# Test Loader -############################# - -check_PROGRAMS += test-loader - -test_loader_SOURCES = \ - test-loader.c - -test_loader_CFLAGS = \ - -Wall \ - $(LIBINDICATOR_CFLAGS) -I$(top_srcdir) \ - -DBUILD_DIR="\"$(builddir)\"" - -test_loader_LDADD = \ - $(LIBINDICATOR_LIBS) \ - -L$(top_builddir)/src/.libs \ - $(INDICATOR_LIB) - -############################# -# Test Desktop Shortcuts -############################# - -check_PROGRAMS += test-desktop-shortcuts - -test_desktop_shortcuts_SOURCES = \ - test-desktop-shortcuts.c - -test_desktop_shortcuts_CFLAGS = \ - -Wall \ - -DSRCDIR="\"$(srcdir)\"" \ - $(LIBINDICATOR_CFLAGS) -I$(top_srcdir) \ - -DBUILD_DIR="\"$(abs_builddir)\"" - -test_desktop_shortcuts_LDADD = \ - $(LIBINDICATOR_LIBS) \ - -L$(top_builddir)/src/.libs \ - $(INDICATOR_LIB) - -DS_XML_REPORT = desktop-shortcuts-check-results.xml -DS_HTML_REPORT = desktop-shortcuts-check-results.html - -test-desktop-shortcuts-tester: test-desktop-shortcuts Makefile.am - @echo "#!/bin/bash" > $@ - @echo $(XVFB_RUN) >> $@ - @echo gtester -k --verbose -o=$(XML_REPORT) ./test-desktop-shortcuts >> $@ - @chmod +x $@ - -TESTS += test-desktop-shortcuts-tester -DISTCLEANFILES += test-desktop-shortcuts-tester \ - test-desktop-shortcuts-touch-test \ - $(DS_XML_REPORT) \ - $(DS_HTML_REPORT) -EXTRA_DIST += test-well-formed.desktop - -############################# -# Dummy Indicator Blank -############################# - -libdummy_indicator_blank_la_SOURCES = \ - dummy-indicator-blank.c - -libdummy_indicator_blank_la_CFLAGS = \ - -Wall \ - $(GTK_DISABLE_DEPRECATED) \ - $(LIBINDICATOR_CFLAGS) -I$(top_srcdir) - -libdummy_indicator_blank_la_LIBADD = \ - $(LIBINDICATOR_LIBS) \ - -L$(top_builddir)/src/.libs \ - $(INDICATOR_LIB) - -libdummy_indicator_blank_la_LDFLAGS = \ - -module \ - -avoid-version - -############################# -# Dummy Indicator NULL -############################# - -libdummy_indicator_null_la_SOURCES = \ - dummy-indicator-null.c - -libdummy_indicator_null_la_CFLAGS = \ - -Wall \ - $(GTK_DISABLE_DEPRECATED) \ - $(LIBINDICATOR_CFLAGS) -I$(top_srcdir) - -libdummy_indicator_null_la_LIBADD = \ - $(LIBINDICATOR_LIBS) \ - -L$(top_builddir)/src/.libs \ - $(INDICATOR_LIB) - -libdummy_indicator_null_la_LDFLAGS = \ - -module \ - -avoid-version - -############################# -# Dummy Indicator Signaler -############################# - -libdummy_indicator_signaler_la_SOURCES = \ - dummy-indicator-signaler.c - -libdummy_indicator_signaler_la_CFLAGS = \ - -Wall \ - $(GTK_DISABLE_DEPRECATED) \ - $(LIBINDICATOR_CFLAGS) -I$(top_srcdir) - -libdummy_indicator_signaler_la_LIBADD = \ - $(LIBINDICATOR_LIBS) \ - -L$(top_builddir)/src/.libs \ - $(INDICATOR_LIB) - -libdummy_indicator_signaler_la_LDFLAGS = \ - -module \ - -avoid-version - -############################# -# Dummy Indicator Simple -############################# - -libdummy_indicator_simple_la_SOURCES = \ - dummy-indicator-simple.c - -libdummy_indicator_simple_la_CFLAGS = \ - -Wall \ - $(GTK_DISABLE_DEPRECATED) \ - $(LIBINDICATOR_CFLAGS) -I$(top_srcdir) - -libdummy_indicator_simple_la_LIBADD = \ - $(LIBINDICATOR_LIBS) \ - -L$(top_builddir)/src/.libs \ - $(INDICATOR_LIB) - -libdummy_indicator_simple_la_LDFLAGS = \ - -module \ - -avoid-version - -############################# -# Dummy Indicator Entry Func -############################# - -libdummy_indicator_entry_func_la_SOURCES = \ - dummy-indicator-entry-func.c \ - dummy-indicator-entry-func.h - -libdummy_indicator_entry_func_la_CFLAGS = \ - -Wall \ - $(GTK_DISABLE_DEPRECATED) \ - $(LIBINDICATOR_CFLAGS) -I$(top_srcdir) - -libdummy_indicator_entry_func_la_LIBADD = \ - $(LIBINDICATOR_LIBS) \ - -L$(top_builddir)/src/.libs \ - $(INDICATOR_LIB) - -libdummy_indicator_entry_func_la_LDFLAGS = \ - -module \ - -avoid-version - -############################# -# Dummy Indicator Visible -############################# - -libdummy_indicator_visible_la_SOURCES = \ - dummy-indicator-visible.c - -libdummy_indicator_visible_la_CFLAGS = \ - -Wall \ - $(GTK_DISABLE_DEPRECATED) \ - $(LIBINDICATOR_CFLAGS) -I$(top_srcdir) - -libdummy_indicator_visible_la_LIBADD = \ - $(LIBINDICATOR_LIBS) \ - -L$(top_builddir)/src/.libs \ - $(INDICATOR_LIB) - -libdummy_indicator_visible_la_LDFLAGS = \ - -module \ - -avoid-version - -############################# -# Service Shutdown Timeout -############################# - -check_PROGRAMS += service-shutdown-timeout - -service_shutdown_timeout_SOURCES = \ - service-shutdown-timeout.c - -service_shutdown_timeout_CFLAGS = \ - -Wall \ - $(LIBINDICATOR_CFLAGS) -I$(top_srcdir) - -service_shutdown_timeout_LDADD = \ - $(LIBINDICATOR_LIBS) \ - -L$(top_builddir)/src/.libs \ - $(INDICATOR_LIB) - -service-shutdown-timeout-tester: service-shutdown-timeout Makefile - @echo "#!/bin/sh" > service-shutdown-timeout-tester - @echo $(DBUS_RUNNER) --task ./service-shutdown-timeout >> service-shutdown-timeout-tester - @chmod +x service-shutdown-timeout-tester - -TESTS += service-shutdown-timeout-tester -DISTCLEANFILES += service-shutdown-timeout-tester - -############################# -# Service Manager No Connect -############################# - -check_PROGRAMS += service-manager-no-connect - -service_manager_no_connect_SOURCES = \ - service-manager-no-connect.c - -service_manager_no_connect_CFLAGS = \ - -Wall \ - $(LIBINDICATOR_CFLAGS) -I$(top_srcdir) - -service_manager_no_connect_LDADD = \ - $(LIBINDICATOR_LIBS) \ - -L$(top_builddir)/src/.libs \ - $(INDICATOR_LIB) - -service-manager-no-connect-tester: service-manager-no-connect Makefile.am - @echo "#!/bin/sh" > service-manager-no-connect-tester - @echo $(DBUS_RUNNER) --task ./service-manager-no-connect >> service-manager-no-connect-tester - @chmod +x service-manager-no-connect-tester - -TESTS += service-manager-no-connect-tester -DISTCLEANFILES += service-manager-no-connect-tester - -############################# -# Service Manager Connect -############################# - -session.conf: $(srcdir)/session.conf.in Makefile.am - sed -e "s|\@servicedir\@|$(abs_builddir)|" $< > $@ - -service-manager-connect.service: $(srcdir)/service-manager-connect.service.in Makefile.am - sed -e "s|\@builddir\@|$(abs_builddir)|" $< > $@ - -check_PROGRAMS += service-manager-connect - -service_manager_connect_SOURCES = \ - service-manager-connect.c - -service_manager_connect_CFLAGS = \ - -Wall \ - $(LIBINDICATOR_CFLAGS) -I$(top_srcdir) - -service_manager_connect_LDADD = \ - $(LIBINDICATOR_LIBS) \ - -L$(top_builddir)/src/.libs \ - $(INDICATOR_LIB) - -check_PROGRAMS += service-manager-connect-service - -service_manager_connect_service_SOURCES = \ - service-manager-connect-service.c - -service_manager_connect_service_CFLAGS = \ - -Wall \ - $(LIBINDICATOR_CFLAGS) -I$(top_srcdir) - -service_manager_connect_service_LDADD = \ - $(LIBINDICATOR_LIBS) \ - -L$(top_builddir)/src/.libs \ - $(INDICATOR_LIB) - -service-manager-connect-tester: service-manager-connect service-manager-connect-service session.conf service-manager-connect.service Makefile.am - @echo "#!/bin/sh" > service-manager-connect-tester - @echo dbus-test-runner --dbus-config $(builddir)/session.conf --task ./service-manager-connect >> service-manager-connect-tester - @chmod +x service-manager-connect-tester - -TESTS += service-manager-connect-tester -DISTCLEANFILES += service-manager-connect-tester session.conf service-manager-connect.service - -############################# -# Service Versions -############################# - -service-version-good.service: $(srcdir)/service-version-good.service.in Makefile.am - sed -e "s|\@builddir\@|$(abs_builddir)|" $< > $@ - -service-version-bad.service: $(srcdir)/service-version-bad.service.in Makefile.am - sed -e "s|\@builddir\@|$(abs_builddir)|" $< > $@ - -check_PROGRAMS += service-version-manager - -service_version_manager_SOURCES = \ - service-version-values.h \ - service-version-manager.c - -service_version_manager_CFLAGS = \ - -Wall \ - $(LIBINDICATOR_CFLAGS) -I$(top_srcdir) - -service_version_manager_LDADD = \ - $(LIBINDICATOR_LIBS) \ - -L$(top_builddir)/src/.libs \ - $(INDICATOR_LIB) - -check_PROGRAMS += service-version-bad-service - -service_version_bad_service_SOURCES = \ - service-version-values.h \ - service-version-bad-service.c - -service_version_bad_service_CFLAGS = \ - -Wall \ - $(LIBINDICATOR_CFLAGS) -I$(top_srcdir) - -service_version_bad_service_LDADD = \ - $(LIBINDICATOR_LIBS) \ - -L$(top_builddir)/src/.libs \ - $(INDICATOR_LIB) - -check_PROGRAMS += service-version-good-service - -service_version_good_service_SOURCES = \ - service-version-values.h \ - service-version-good-service.c - -service_version_good_service_CFLAGS = \ - -Wall \ - $(LIBINDICATOR_CFLAGS) -I$(top_srcdir) - -service_version_good_service_LDADD = \ - $(LIBINDICATOR_LIBS) \ - -L$(top_builddir)/src/.libs \ - $(INDICATOR_LIB) - -service-version-tester: service-version-manager service-version-bad-service service-version-good-service session.conf service-version-bad.service service-version-good.service Makefile.am - @echo "#!/bin/sh" > $@ - @echo dbus-test-runner --dbus-config $(builddir)/session.conf --task ./service-version-manager >> $@ - @chmod +x $@ - -TESTS += service-version-tester -DISTCLEANFILES += service-version-tester service-version-bad.service service-version-good.service - -############################# -# Service Versions -############################# - -check_PROGRAMS += service-version-multiwatch-manager - -service_version_multiwatch_manager_SOURCES = \ - service-version-values.h \ - service-version-multiwatch-manager.c - -service_version_multiwatch_manager_CFLAGS = \ - -Wall \ - $(LIBINDICATOR_CFLAGS) -I$(top_srcdir) - -service_version_multiwatch_manager_LDADD = \ - $(LIBINDICATOR_LIBS) \ - -L$(top_builddir)/src/.libs \ - $(INDICATOR_LIB) - -check_PROGRAMS += service-version-multiwatch-manager-impolite - -service_version_multiwatch_manager_impolite_SOURCES = \ - service-version-values.h \ - service-version-multiwatch-manager-impolite.c - -service_version_multiwatch_manager_impolite_CFLAGS = \ - -Wall \ - $(LIBINDICATOR_CFLAGS) -I$(top_srcdir) - -service_version_multiwatch_manager_impolite_LDADD = \ - $(LIBINDICATOR_LIBS) \ - -L$(top_builddir)/src/.libs \ - $(INDICATOR_LIB) - -check_PROGRAMS += service-version-multiwatch-service - -service_version_multiwatch_service_SOURCES = \ - service-version-values.h \ - service-version-multiwatch-service.c - -service_version_multiwatch_service_CFLAGS = \ - -Wall \ - $(LIBINDICATOR_CFLAGS) -I$(top_srcdir) - -service_version_multiwatch_service_LDADD = \ - $(LIBINDICATOR_LIBS) \ - -L$(top_builddir)/src/.libs \ - $(INDICATOR_LIB) - -service-version-multiwatch-tester: service-version-multiwatch-manager service-version-multiwatch-service service-version-multiwatch-manager-impolite Makefile.am - @echo "#!/bin/sh" > $@ - @echo dbus-test-runner --task ./service-version-multiwatch-service --task-name Service --task ./service-version-multiwatch-manager --task-name Manager1 --task ./service-version-multiwatch-manager --task-name Manager2 --task ./service-version-multiwatch-manager --task-name Manager3 --task ./service-version-multiwatch-manager --task-name Manager4 --task ./service-version-multiwatch-manager --task-name Manager5 --task ./service-version-multiwatch-manager-impolite --task-name Impolite1 --task ./service-version-multiwatch-manager-impolite --task-name Impolite2 --task ./service-version-multiwatch-manager-impolite --task-name Impolite3 >> $@ - @chmod +x $@ - -TESTS += service-version-multiwatch-tester -DISTCLEANFILES += service-version-multiwatch-tester - -############################# -# Service Manager Shutdown -############################# - -check_PROGRAMS += service-manager-nostart-connect - -service_manager_nostart_connect_SOURCES = \ - service-manager-nostart-connect.c - -service_manager_nostart_connect_CFLAGS = \ - -Wall \ - $(LIBINDICATOR_CFLAGS) -I$(top_srcdir) - -service_manager_nostart_connect_LDADD = \ - $(LIBINDICATOR_LIBS) \ - -L$(top_builddir)/src/.libs \ - $(INDICATOR_LIB) - -service-manager-connect-nostart-tester: service-manager-nostart-connect service-manager-connect-service Makefile.am - @echo "#!/bin/sh" > $@ - @echo dbus-test-runner --task ./service-manager-nostart-connect --task ./service-manager-connect-service >> $@ - @chmod +x $@ - -TESTS += service-manager-connect-nostart-tester -DISTCLEANFILES += service-manager-connect-nostart-tester - -############################# -# Test stuff -############################# - -XML_REPORT = loader-check-results.xml -HTML_REPORT = loader-check-results.html - -loader-tester: test-loader libdummy-indicator-null.la libdummy-indicator-simple.la libdummy-indicator-entry-func.la Makefile - @echo "#!/bin/bash" > loader-tester - @echo $(XVFB_RUN) >> $@ - @echo gtester -k --verbose -o=$(XML_REPORT) ./test-loader >> loader-tester - @chmod +x loader-tester - -TESTS += loader-tester -DISTCLEANFILES += loader-tester - -DISTCLEANFILES += $(XML_REPORT) $(HTML_REPORT) - -############################# -# Indicator-ng -############################# - -if USE_GTK3 - -org.ayatana.indicator.test.service: org.ayatana.indicator.test.service.in Makefile.am - sed -e "s|\@builddir\@|$(abs_builddir)|" $< > $@ - -check_PROGRAMS += test-indicator-ng - -test_indicator_ng_SOURCES = test-indicator-ng.c - -test_indicator_ng_CFLAGS = \ - $(LIBINDICATOR_CFLAGS) \ - -I$(top_srcdir) \ - -DSRCDIR="\"$(srcdir)\"" \ - -DBUILD_DIR="\"$(abs_builddir)\"" \ - -Wall - -test_indicator_ng_LDADD = \ - $(LIBINDICATOR_LIBS) \ - -L$(top_builddir)/src/.libs \ - $(INDICATOR_LIB) - - -test-indicator-ng-dbus-runner: test-indicator-ng Makefile.am - @echo "#!/bin/sh" > $@ - @echo $(DBUS_RUNNER) --task ./test-indicator-ng >> $@ - @chmod +x $@ - -test-indicator-ng-tester: test-indicator-ng-dbus-runner Makefile.am - @echo "#!/bin/bash" > $@ - @echo $(XVFB_RUN) >> $@ - @echo gtester -k --verbose -o=$(XML_REPORT) ./test-indicator-ng-dbus-runner >> $@ - @chmod +x $@ - -TESTS += test-indicator-ng-tester -DISTCLEANFILES += test-indicator-ng-tester test-indicator-ng-dbus-runner test-indicator-ng - -# Mock indicator service -check_PROGRAMS += indicator-test-service - -indicator_test_service_SOURCES = indicator-test-service.c -indicator_test_service_CFLAGS = $(LIBINDICATOR_CFLAGS) -indicator_test_service_LDADD = $(LIBINDICATOR_LIBS) - -EXTRA_indicator_test_service_DEPENDENCIES = org.ayatana.indicator.test.service - -DISTCLEANFILES += indicator-test-service org.ayatana.indicator.test.service - -endif diff --git a/tools/Makefile.am b/tools/Makefile.am deleted file mode 100644 index 7d25b5c..0000000 --- a/tools/Makefile.am +++ /dev/null @@ -1,43 +0,0 @@ -if USE_IDO -if USE_GTK3 -INDICATOR_LIB = -layatana-indicator3 -libexec_PROGRAMS = ayatana-indicator-loader3 -VER=3 -endif -endif - - -############################# -# Indicator Loader -############################# - -ayatana_indicator_loader_SOURCES = \ - indicator-loader.c - -ayatana_indicator_loader_CFLAGS = \ - -Wall \ - $(LIBINDICATOR_CFLAGS) \ - $(LIBINDICATOR_IDO_CFLAGS) -I$(top_srcdir) \ - -DBUILD_DIR="\"$(builddir)\"" - -ayatana_indicator_loader_LDADD = \ - $(LIBINDICATOR_LIBS) \ - $(LIBINDICATOR_IDO_LIBS) \ - -L$(top_builddir)/src/.libs \ - $(INDICATOR_LIB) - -# 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. -ayatana_indicator_loader3_SOURCES = $(ayatana_indicator_loader_SOURCES) -ayatana_indicator_loader3_CFLAGS = $(ayatana_indicator_loader_CFLAGS) -ayatana_indicator_loader3_LDADD = $(ayatana_indicator_loader_LDADD) - -xsessiondir = $(pkgdatadir) - -xsession_DATA = 80indicator-debugging - -EXTRA_DIST = $(xsession_DATA) - -DISTCLEANFILES = Makefile.in -- cgit v1.2.3 From e2d3331cb7b85f4c08304217b6d4931b4230b620 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 12 May 2021 15:23:52 +0200 Subject: trim-lcov.py: Drop file, not required anymore with CMake. --- trim-lcov.py | 73 ------------------------------------------------------------ 1 file changed, 73 deletions(-) delete mode 100755 trim-lcov.py diff --git a/trim-lcov.py b/trim-lcov.py deleted file mode 100755 index 767ab37..0000000 --- a/trim-lcov.py +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2013 Canonical Ltd. -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# version 3.0 as published by the Free Software Foundation. -# -# This library 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 version 3.0 for more details. -# -# You should have received a copy of the GNU General Public -# License along with this library. If not, see -# . -# -# Author: Ryan Lortie - - -# This script removes branch and/or line coverage data for lines that -# contain a particular substring. -# -# In the interest of "fairness" it removes all branch or coverage data -# when a match is found -- not just negative data. It is therefore -# likely that running this script will actually reduce the total number -# of lines and branches that are marked as covered (in absolute terms). -# -# This script intentionally avoids checking for errors. Any exceptions -# will trigger make to fail. - -import sys - -line_suppress = ['g_assert_not_reached'] -branch_suppress = ['g_assert', 'g_return_if_fail', 'g_return_val_if_fail', 'G_DEFINE_TYPE'] - -def check_suppress(suppressions, source, data): - line, _, rest = data.partition(',') - line = int(line) - 1 - - assert line < len(source) - - for suppression in suppressions: - if suppression in source[line]: - return True - - return False - -source = [] -for line in sys.stdin: - line = line[:-1] - - keyword, _, rest = line.partition(':') - - # Source file - if keyword == 'SF': - - with open(rest, 'r') as pFile: - - source = pFile.readlines() - - # Branch coverage data - elif keyword == 'BRDA': - if check_suppress(branch_suppress, source, rest): - continue - - # Line coverage data - elif keyword == 'DA': - if check_suppress(line_suppress, source, rest): - continue - - print(line) -- cgit v1.2.3 From c7a152ad3da254704945de297f0de957966fb6b8 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 12 May 2021 15:28:26 +0200 Subject: tests/run-xvfb.sh: Drop file, not required with CMake. --- tests/run-xvfb.sh | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 tests/run-xvfb.sh diff --git a/tests/run-xvfb.sh b/tests/run-xvfb.sh deleted file mode 100644 index 63b6f0d..0000000 --- a/tests/run-xvfb.sh +++ /dev/null @@ -1,8 +0,0 @@ -if [ "$DISPLAY" == "" ]; then -Xvfb -ac -noreset -screen 0 800x600x16 -help 2>/dev/null 1>&2 -XID=`for id in 101 102 103 104 105 106 107 197 199 211 223 227 293 307 308 309 310 311 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 4703 4721 4723 4729 4733 4751 9973 9974 9975 9976 9977 9978 9979 9980 9981 9982 9983 9984 9985 9986 9987 9988 9989 9990 9991 9992 9993 9994 9995 9996 9997 9998 9999 ; do test -e /tmp/.X$id-lock || { echo $id; exit 0; }; done; exit 1` -{ Xvfb -ac -noreset -screen 0 800x600x16 :$XID -screen 0 800x600x16 -nolisten tcp -auth /dev/null >/dev/null 2>&1 & trap "kill -15 $! " 0 HUP INT QUIT TRAP USR1 PIPE TERM ; } || { echo "Gtk+Tests:ERROR: Failed to start Xvfb environment for X11 target tests."; exit 1; } -DISPLAY=:$XID -export DISPLAY -echo Setting display: $DISPLAY -fi -- cgit v1.2.3 From bfb679de31ba276e0155153fc3efff9b8aacbbf6 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 12 May 2021 13:27:15 +0200 Subject: Bring back GTK+-2.0 and GTK+-3.0 build flavours. --- CMakeLists.txt | 35 ++++++- data/CMakeLists.txt | 26 ++++-- data/ayatana-indicator.pc.in | 15 +++ data/ayatana-indicator3-0.4.pc.in | 15 --- data/ayatana-indicator3.pc.in | 15 +++ src/CMakeLists.txt | 50 +++++++--- tests/CMakeLists.txt | 190 +++++++++++--------------------------- tools/CMakeLists.txt | 19 ++-- 8 files changed, 186 insertions(+), 179 deletions(-) create mode 100644 data/ayatana-indicator.pc.in delete mode 100644 data/ayatana-indicator3-0.4.pc.in create mode 100644 data/ayatana-indicator3.pc.in diff --git a/CMakeLists.txt b/CMakeLists.txt index e580790..7b509db 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,11 +17,44 @@ endif() # Check for prerequisites -set(DEPS glib-2.0>=2.58 gtk+-3.0>=3.24 libayatana-ido3-0.4>=0.8.2) +option(FLAVOUR_GTK2 "Build against GTK+-2.0" OFF) +option(FLAVOUR_GTK3 "Build against GTK+-3.0" ON) + +if (FLAVOUR_GTK2) + set (FLAVOUR_GTK3 OFF) +endif() +if (FLAVOUR_GTK3) + set (FLAVOUR_GTK2 OFF) +endif() + +if (FLAVOUR_GTK3) + set(DEPS + glib-2.0>=2.37 + gtk+-3.0>=3.24 + gmodule-2.0 + gio-unix-2.0 + libayatana-ido3-0.4>=0.8.2 + ) +endif() +if (FLAVOUR_GTK2) + set(DEPS + glib-2.0>=2.37 + gtk+-2.0>=2.18 + gmodule-2.0 + gio-unix-2.0 + ) +endif() find_package (PkgConfig REQUIRED) pkg_check_modules(PROJECT_DEPS REQUIRED ${DEPS}) +include(CheckLibraryExists) + +CHECK_LIBRARY_EXISTS(m sin "" HAVE_LIB_M) +if (HAVE_LIB_M) + set(EXTRA_LIBS ${EXTRA_LIBS} m) +endif (HAVE_LIB_M) + # Set global variables include(GNUInstallDirs) diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt index f6c71d9..8e10313 100644 --- a/data/CMakeLists.txt +++ b/data/CMakeLists.txt @@ -1,12 +1,26 @@ # ayatana-indicator3-0.4.pc -configure_file("${CMAKE_CURRENT_SOURCE_DIR}/ayatana-indicator3-0.4.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/ayatana-indicator3-0.4.pc" @ONLY) -install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ayatana-indicator3-0.4.pc" DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/pkgconfig/") +if (FLAVOUR_GTK3) + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/ayatana-indicator3.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/ayatana-indicator3-0.${API_VERSION}.pc" @ONLY) + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ayatana-indicator3-0.${API_VERSION}.pc" DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/pkgconfig/") +else() + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/ayatana-indicator.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/ayatana-indicator-0.${API_VERSION}.pc" @ONLY) + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ayatana-indicator-0.${API_VERSION}.pc" DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/pkgconfig/") +endif() + +# ayatana-indicators.target (only required once, so let's do it with FLAVOUR_GTK3) + +if (FLAVOUR_GTK3) -# ayatana-indicators.target + pkg_check_modules(SYSTEMD systemd) -pkg_check_modules(SYSTEMD systemd) + if (${SYSTEMD_FOUND}) + if (${SYSTEMD_VERSION} VERSION_LESS 247) + set(SYSTEMD_USER_UNIT_DIR ${CMAKE_INSTALL_PREFIX}/lib/systemd/user) + else() + pkg_get_variable(SYSTEMD_USER_UNIT_DIR systemd systemd_user_unit_dir) + endif() + install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/ayatana-indicators.target" DESTINATION "${SYSTEMD_USER_UNIT_DIR}") + endif() -if (${SYSTEMD_FOUND}) - install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/ayatana-indicators.target" DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/systemd/user") endif() diff --git a/data/ayatana-indicator.pc.in b/data/ayatana-indicator.pc.in new file mode 100644 index 0000000..e4f06a2 --- /dev/null +++ b/data/ayatana-indicator.pc.in @@ -0,0 +1,15 @@ +prefix=@CMAKE_INSTALL_PREFIX@ +exec_prefix=${prefix} +libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@ +bindir=${exec_prefix}/@CMAKE_INSTALL_BINDIR@ +includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@ +indicatordir=${exec_prefix}/lib/ayatana-indicators/@ABI_VERSION@/ +iconsdir=${prefix}/@CMAKE_INSTALL_DATADIR@/@PROJECT_NAME@/icons/ + +Cflags: -I${includedir}/libayatana-indicator-0.@API_VERSION@ +Requires: gtk+-2.0 +Libs: -layatana-indicator + +Name: libayatana-indicator +Description: libayatana-indicator. +Version: @PROJECT_VERSION@ diff --git a/data/ayatana-indicator3-0.4.pc.in b/data/ayatana-indicator3-0.4.pc.in deleted file mode 100644 index 231fa71..0000000 --- a/data/ayatana-indicator3-0.4.pc.in +++ /dev/null @@ -1,15 +0,0 @@ -prefix=@CMAKE_INSTALL_PREFIX@ -exec_prefix=${prefix} -libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@ -bindir=${exec_prefix}/@CMAKE_INSTALL_BINDIR@ -includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@ -indicatordir=${exec_prefix}/lib/ayatana-indicators3/@ABI_VERSION@/ -iconsdir=${prefix}/@CMAKE_INSTALL_DATADIR@/@PROJECT_NAME@/icons/ - -Cflags: -I${includedir}/libayatana-indicator3-0.@API_VERSION@ -Requires: gtk+-3.0 -Libs: -layatana-indicator3 - -Name: libayatana-indicator3 -Description: libayatana-indicator3. -Version: @PROJECT_VERSION@ diff --git a/data/ayatana-indicator3.pc.in b/data/ayatana-indicator3.pc.in new file mode 100644 index 0000000..231fa71 --- /dev/null +++ b/data/ayatana-indicator3.pc.in @@ -0,0 +1,15 @@ +prefix=@CMAKE_INSTALL_PREFIX@ +exec_prefix=${prefix} +libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@ +bindir=${exec_prefix}/@CMAKE_INSTALL_BINDIR@ +includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@ +indicatordir=${exec_prefix}/lib/ayatana-indicators3/@ABI_VERSION@/ +iconsdir=${prefix}/@CMAKE_INSTALL_DATADIR@/@PROJECT_NAME@/icons/ + +Cflags: -I${includedir}/libayatana-indicator3-0.@API_VERSION@ +Requires: gtk+-3.0 +Libs: -layatana-indicator3 + +Name: libayatana-indicator3 +Description: libayatana-indicator3. +Version: @PROJECT_VERSION@ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d6c6647..d396ed9 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -21,22 +21,33 @@ set(HEADERS indicator-object.h indicator-service.h indicator-service-manager.h - indicator-ng.h ) +if (FLAVOUR_GTK3) + set(HEADERS + ${HEADERS} + indicator-ng.h + ) +endif() + set(SOURCES gen-indicator-service.xml.c indicator-desktop-shortcuts.c indicator-image-helper.c - indicator-ng.c indicator-object.c indicator-object-enum-types.c indicator-object-marshal.c indicator-service.c indicator-service-manager.c - ) +if (FLAVOUR_GTK3) + set(SOURCES + ${SOURCES} + indicator-ng.c + ) +endif() + # indicator-object-enum-types.h find_program(GLIB_MKENUMS glib-mkenums) @@ -111,17 +122,26 @@ string(PREPEND GEN_INDICATOR_SERVICE_XML_C "const char * _indicator_service = \n string(APPEND GEN_INDICATOR_SERVICE_XML_C "\;") file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/gen-indicator-service.xml.c" ${GEN_INDICATOR_SERVICE_XML_C}) -# libayatana-indicator3.so + +if (FLAVOUR_GTK3) + # libayatana-indicator3.so + set (ayatana_indicator_gtkver "ayatana-indicator3") +else() + # libayatana-indicator.so + set (ayatana_indicator_gtkver "ayatana-indicator") +endif() + +# libayatana-indicator{,3}.so set_source_files_properties(${SOURCES} PROPERTIES COMPILE_FLAGS ${COMPILE_FLAGS}) -add_library("ayatana-indicator3" SHARED ${SOURCES}) -set_target_properties("ayatana-indicator3" PROPERTIES VERSION 7.0.0 SOVERSION 7) -target_compile_definitions("ayatana-indicator3" PUBLIC DG_LOG_DOMAIN="libayatana-indicator") -target_include_directories("ayatana-indicator3" PUBLIC ${PROJECT_DEPS_INCLUDE_DIRS}) -target_include_directories("ayatana-indicator3" PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) -target_include_directories("ayatana-indicator3" PUBLIC ${CMAKE_CURRENT_BINARY_DIR}) -target_link_libraries("ayatana-indicator3" ${PROJECT_DEPS_LIBRARIES}) -add_dependencies("ayatana-indicator3" "src-generated") -install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libayatana-indicator3.so" DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") -install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libayatana-indicator3.so.7" DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") -install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libayatana-indicator3.so.7.0.0" DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") +add_library("${ayatana_indicator_gtkver}" SHARED ${SOURCES}) +set_target_properties("${ayatana_indicator_gtkver}" PROPERTIES VERSION ${ABI_VERSION}.0.0 SOVERSION ${ABI_VERSION}) +target_compile_definitions("${ayatana_indicator_gtkver}" PUBLIC DG_LOG_DOMAIN="libayatana-indicator") +target_include_directories("${ayatana_indicator_gtkver}" PUBLIC ${PROJECT_DEPS_INCLUDE_DIRS}) +target_include_directories("${ayatana_indicator_gtkver}" PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) +target_include_directories("${ayatana_indicator_gtkver}" PUBLIC ${CMAKE_CURRENT_BINARY_DIR}) +target_link_libraries("${ayatana_indicator_gtkver}" ${PROJECT_DEPS_LIBRARIES} ${EXTRA_LIBS}) +add_dependencies("${ayatana_indicator_gtkver}" "src-generated") +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/lib${ayatana_indicator_gtkver}.so" DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/lib${ayatana_indicator_gtkver}.so.${ABI_VERSION}" DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/lib${ayatana_indicator_gtkver}.so.${ABI_VERSION}.0.0" DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index bb9c0f4..4c24321 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,121 +1,39 @@ -# dummy-indicator-blank - -set_source_files_properties(dummy-indicator-blank.c PROPERTIES COMPILE_FLAGS ${COMPILE_FLAGS}) -add_library("dummy-indicator-blank" SHARED dummy-indicator-blank.c) -target_include_directories("dummy-indicator-blank" PUBLIC ${PROJECT_DEPS_INCLUDE_DIRS}) -target_include_directories("dummy-indicator-blank" PUBLIC "${CMAKE_SOURCE_DIR}/src") - -# dummy-indicator-entry-func - -set_source_files_properties(dummy-indicator-entry-func.h PROPERTIES COMPILE_FLAGS ${COMPILE_FLAGS}) -add_library("dummy-indicator-entry-func" SHARED dummy-indicator-entry-func.c) -target_include_directories("dummy-indicator-entry-func" PUBLIC ${PROJECT_DEPS_INCLUDE_DIRS}) -target_include_directories("dummy-indicator-entry-func" PUBLIC "${CMAKE_SOURCE_DIR}/src") - -# dummy-indicator-null - -set_source_files_properties(dummy-indicator-null.c PROPERTIES COMPILE_FLAGS ${COMPILE_FLAGS}) -add_library("dummy-indicator-null" SHARED dummy-indicator-null.c) -target_include_directories("dummy-indicator-null" PUBLIC ${PROJECT_DEPS_INCLUDE_DIRS}) -target_include_directories("dummy-indicator-null" PUBLIC "${CMAKE_SOURCE_DIR}/src") - -# dummy-indicator-signaller - -set_source_files_properties(dummy-indicator-signaler.c PROPERTIES COMPILE_FLAGS ${COMPILE_FLAGS}) -add_library("dummy-indicator-signaler" SHARED dummy-indicator-signaler.c) -target_include_directories("dummy-indicator-signaler" PUBLIC ${PROJECT_DEPS_INCLUDE_DIRS}) -target_include_directories("dummy-indicator-signaler" PUBLIC "${CMAKE_SOURCE_DIR}/src") - -# dummy-indicator-simple - -set_source_files_properties(dummy-indicator-simple.c PROPERTIES COMPILE_FLAGS ${COMPILE_FLAGS}) -add_library("dummy-indicator-simple" SHARED dummy-indicator-simple.c) -target_include_directories("dummy-indicator-simple" PUBLIC ${PROJECT_DEPS_INCLUDE_DIRS}) -target_include_directories("dummy-indicator-simple" PUBLIC "${CMAKE_SOURCE_DIR}/src") - -# dummy-indicator-visible - -set_source_files_properties(dummy-indicator-visible.c PROPERTIES COMPILE_FLAGS ${COMPILE_FLAGS}) -add_library("dummy-indicator-visible" SHARED dummy-indicator-visible.c) -target_include_directories("dummy-indicator-visible" PUBLIC ${PROJECT_DEPS_INCLUDE_DIRS}) -target_include_directories("dummy-indicator-visible" PUBLIC "${CMAKE_SOURCE_DIR}/src") - -# service-manager-connect - -set_source_files_properties(service-manager-connect.c PROPERTIES COMPILE_FLAGS ${COMPILE_FLAGS}) -add_library("service-manager-connect" SHARED service-manager-connect.c) -target_include_directories("service-manager-connect" PUBLIC ${PROJECT_DEPS_INCLUDE_DIRS}) -target_include_directories("service-manager-connect" PUBLIC "${CMAKE_SOURCE_DIR}/src") - -# service-manager-connect-service - -set_source_files_properties(service-manager-connect-service.c PROPERTIES COMPILE_FLAGS ${COMPILE_FLAGS}) -add_library("service-manager-connect-service" SHARED service-manager-connect-service.c) -target_include_directories("service-manager-connect-service" PUBLIC ${PROJECT_DEPS_INCLUDE_DIRS}) -target_include_directories("service-manager-connect-service" PUBLIC "${CMAKE_SOURCE_DIR}/src") - -# service-manager-no-connect - -set_source_files_properties(service-manager-no-connect.c PROPERTIES COMPILE_FLAGS ${COMPILE_FLAGS}) -add_library("service-manager-no-connect" SHARED service-manager-no-connect.c) -target_include_directories("service-manager-no-connect" PUBLIC ${PROJECT_DEPS_INCLUDE_DIRS}) -target_include_directories("service-manager-no-connect" PUBLIC "${CMAKE_SOURCE_DIR}/src") - -# service-manager-nostart-connect - -set_source_files_properties(service-manager-nostart-connect.c PROPERTIES COMPILE_FLAGS ${COMPILE_FLAGS}) -add_library("service-manager-nostart-connect" SHARED service-manager-nostart-connect.c) -target_include_directories("service-manager-nostart-connect" PUBLIC ${PROJECT_DEPS_INCLUDE_DIRS}) -target_include_directories("service-manager-nostart-connect" PUBLIC "${CMAKE_SOURCE_DIR}/src") - -# service-shutdown-timeout - -set_source_files_properties(service-shutdown-timeout.c PROPERTIES COMPILE_FLAGS ${COMPILE_FLAGS}) -add_library("service-shutdown-timeout" SHARED service-shutdown-timeout.c) -target_include_directories("service-shutdown-timeout" PUBLIC ${PROJECT_DEPS_INCLUDE_DIRS}) -target_include_directories("service-shutdown-timeout" PUBLIC "${CMAKE_SOURCE_DIR}/src") - -# service-version-bad-service - -set_source_files_properties(service-version-bad-service.c PROPERTIES COMPILE_FLAGS ${COMPILE_FLAGS}) -add_library("service-version-bad-service" SHARED service-version-bad-service.c) -target_include_directories("service-version-bad-service" PUBLIC ${PROJECT_DEPS_INCLUDE_DIRS}) -target_include_directories("service-version-bad-service" PUBLIC "${CMAKE_SOURCE_DIR}/src") - -# service-version-good-service - -set_source_files_properties(service-version-good-service.c PROPERTIES COMPILE_FLAGS ${COMPILE_FLAGS}) -add_library("service-version-good-service" SHARED service-version-good-service.c) -target_include_directories("service-version-good-service" PUBLIC ${PROJECT_DEPS_INCLUDE_DIRS}) -target_include_directories("service-version-good-service" PUBLIC "${CMAKE_SOURCE_DIR}/src") - -# service-version-manager - -set_source_files_properties(service-version-manager.c PROPERTIES COMPILE_FLAGS ${COMPILE_FLAGS}) -add_library("service-version-manager" SHARED service-version-manager.c) -target_include_directories("service-version-manager" PUBLIC ${PROJECT_DEPS_INCLUDE_DIRS}) -target_include_directories("service-version-manager" PUBLIC "${CMAKE_SOURCE_DIR}/src") - -# service-version-multiwatch-manager - -set_source_files_properties(service-version-multiwatch-manager.c PROPERTIES COMPILE_FLAGS ${COMPILE_FLAGS}) -add_library("service-version-multiwatch-manager" SHARED service-version-multiwatch-manager.c) -target_include_directories("service-version-multiwatch-manager" PUBLIC ${PROJECT_DEPS_INCLUDE_DIRS}) -target_include_directories("service-version-multiwatch-manager" PUBLIC "${CMAKE_SOURCE_DIR}/src") - -# service-version-multiwatch-manager-impolite - -set_source_files_properties(service-version-multiwatch-manager-impolite.c PROPERTIES COMPILE_FLAGS ${COMPILE_FLAGS}) -add_library("service-version-multiwatch-manager-impolite" SHARED service-version-multiwatch-manager-impolite.c) -target_include_directories("service-version-multiwatch-manager-impolite" PUBLIC ${PROJECT_DEPS_INCLUDE_DIRS}) -target_include_directories("service-version-multiwatch-manager-impolite" PUBLIC "${CMAKE_SOURCE_DIR}/src") - -# service-version-multiwatch-service - -set_source_files_properties(service-version-multiwatch-service.c PROPERTIES COMPILE_FLAGS ${COMPILE_FLAGS}) -add_library("service-version-multiwatch-service" SHARED service-version-multiwatch-service.c) -target_include_directories("service-version-multiwatch-service" PUBLIC ${PROJECT_DEPS_INCLUDE_DIRS}) -target_include_directories("service-version-multiwatch-service" PUBLIC "${CMAKE_SOURCE_DIR}/src") +if (FLAVOUR_GTK3) + # libayatana-indicator3.so + set (ayatana_indicator_gtkver "ayatana-indicator3") +else() + # libayatana-indicator.so + set (ayatana_indicator_gtkver "ayatana-indicator") +endif() + +function(add_test_helper_by_name name) + set (TEST_HELPER_NAME ${name}) + set_source_files_properties(${TEST_HELPER_NAME}.c PROPERTIES COMPILE_FLAGS ${COMPILE_FLAGS}) + add_library("${TEST_HELPER_NAME}" SHARED ${TEST_HELPER_NAME}.c) + target_include_directories("${TEST_HELPER_NAME}" PUBLIC ${PROJECT_DEPS_INCLUDE_DIRS}) + target_include_directories("${TEST_HELPER_NAME}" PUBLIC "${CMAKE_SOURCE_DIR}/src") + target_link_libraries("${TEST_HELPER_NAME}" ${PROJECT_DEPS_LIBRARIES} -l${ayatana_indicator_gtkver}) + target_link_directories("${TEST_HELPER_NAME}" PUBLIC "${CMAKE_BINARY_DIR}/src") + add_dependencies("${TEST_HELPER_NAME}" "${ayatana_indicator_gtkver}") +endfunction() + +add_test_helper_by_name(dummy-indicator-blank) +add_test_helper_by_name(dummy-indicator-entry-func) +add_test_helper_by_name(dummy-indicator-null) +add_test_helper_by_name(dummy-indicator-signaler) +add_test_helper_by_name(dummy-indicator-simple) +add_test_helper_by_name(dummy-indicator-visible) +add_test_helper_by_name(service-manager-connect) +add_test_helper_by_name(service-manager-connect-service) +add_test_helper_by_name(service-manager-no-connect) +add_test_helper_by_name(service-manager-nostart-connect) +add_test_helper_by_name(service-shutdown-timeout) +add_test_helper_by_name(service-version-bad-service) +add_test_helper_by_name(service-version-good-service) +add_test_helper_by_name(service-version-manager) +add_test_helper_by_name(service-version-multiwatch-manager) +add_test_helper_by_name(service-version-multiwatch-manager-impolite) +add_test_helper_by_name(service-version-multiwatch-service) # test-desktop-shortcuts @@ -125,24 +43,11 @@ target_compile_definitions("test-desktop-shortcuts" PUBLIC BUILD_DIR="${CMAKE_CU target_compile_definitions("test-desktop-shortcuts" PUBLIC SRCDIR="${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories("test-desktop-shortcuts" PUBLIC ${PROJECT_DEPS_INCLUDE_DIRS}) target_include_directories("test-desktop-shortcuts" PUBLIC "${CMAKE_SOURCE_DIR}/src") -target_link_libraries("test-desktop-shortcuts" ${PROJECT_DEPS_LIBRARIES} -layatana-indicator3) +target_link_libraries("test-desktop-shortcuts" ${PROJECT_DEPS_LIBRARIES} -l${ayatana_indicator_gtkver}) target_link_directories("test-desktop-shortcuts" PUBLIC "${CMAKE_BINARY_DIR}/src") -add_dependencies("test-desktop-shortcuts" "ayatana-indicator3") +add_dependencies("test-desktop-shortcuts" "${ayatana_indicator_gtkver}") add_test("test-desktop-shortcuts" "test-desktop-shortcuts") -# test-indicator-ng - -set_source_files_properties(test-indicator-ng.c PROPERTIES COMPILE_FLAGS ${COMPILE_FLAGS}) -add_executable("test-indicator-ng" test-indicator-ng.c) -target_compile_definitions("test-indicator-ng" PUBLIC BUILD_DIR="${CMAKE_CURRENT_BINARY_DIR}") -target_compile_definitions("test-indicator-ng" PUBLIC SRCDIR="${CMAKE_CURRENT_SOURCE_DIR}") -target_include_directories("test-indicator-ng" PUBLIC ${PROJECT_DEPS_INCLUDE_DIRS}) -target_include_directories("test-indicator-ng" PUBLIC "${CMAKE_SOURCE_DIR}/src") -target_link_libraries("test-indicator-ng" ${PROJECT_DEPS_LIBRARIES} -layatana-indicator3) -target_link_directories("test-indicator-ng" PUBLIC "${CMAKE_BINARY_DIR}/src") -add_dependencies("test-indicator-ng" "ayatana-indicator3") -add_test("test-indicator-ng" "test-indicator-ng") - # test-loader set_source_files_properties(test-loader.c PROPERTIES COMPILE_FLAGS ${COMPILE_FLAGS}) @@ -150,7 +55,22 @@ add_executable("test-loader" test-loader.c) target_compile_definitions("test-loader" PUBLIC BUILD_DIR="${CMAKE_CURRENT_BINARY_DIR}") target_include_directories("test-loader" PUBLIC ${PROJECT_DEPS_INCLUDE_DIRS}) target_include_directories("test-loader" PUBLIC "${CMAKE_SOURCE_DIR}/src") -target_link_libraries("test-loader" ${PROJECT_DEPS_LIBRARIES} -layatana-indicator3) +target_link_libraries("test-loader" ${PROJECT_DEPS_LIBRARIES} -l${ayatana_indicator_gtkver}) target_link_directories("test-loader" PUBLIC "${CMAKE_BINARY_DIR}/src") -add_dependencies("test-loader" "ayatana-indicator3") +add_dependencies("test-loader" "${ayatana_indicator_gtkver}") add_test("test-loader" "test-loader") + +# test-indicator-ng + +if (FLAVOUR_GTK3) + set_source_files_properties(test-indicator-ng.c PROPERTIES COMPILE_FLAGS ${COMPILE_FLAGS}) + add_executable("test-indicator-ng" test-indicator-ng.c) + target_compile_definitions("test-indicator-ng" PUBLIC BUILD_DIR="${CMAKE_CURRENT_BINARY_DIR}") + target_compile_definitions("test-indicator-ng" PUBLIC SRCDIR="${CMAKE_CURRENT_SOURCE_DIR}") + target_include_directories("test-indicator-ng" PUBLIC ${PROJECT_DEPS_INCLUDE_DIRS}) + target_include_directories("test-indicator-ng" PUBLIC "${CMAKE_SOURCE_DIR}/src") + target_link_libraries("test-indicator-ng" ${PROJECT_DEPS_LIBRARIES} -l${ayatana_indicator_gtkver}) + target_link_directories("test-indicator-ng" PUBLIC "${CMAKE_BINARY_DIR}/src") + add_dependencies("test-indicator-ng" "${ayatana_indicator_gtkver}") + add_test("test-indicator-ng" "test-indicator-ng") +endif() diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 4120f31..3be325d 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -1,8 +1,13 @@ -# ayatana-indicator-loader3 +if (FLAVOUR_GTK3) + # ayatana-indicator-loader3 -set_source_files_properties(indicator-loader.c PROPERTIES COMPILE_FLAGS ${COMPILE_FLAGS}) -add_executable("ayatana-indicator-loader3" indicator-loader.c) -target_include_directories("ayatana-indicator-loader3" PUBLIC ${PROJECT_DEPS_INCLUDE_DIRS}) -target_include_directories("ayatana-indicator-loader3" PUBLIC "${CMAKE_SOURCE_DIR}/src") -target_link_libraries("ayatana-indicator-loader3" ${PROJECT_DEPS_LIBRARIES} "-L${CMAKE_BINARY_DIR}/src" -layatana-indicator3) -add_dependencies("ayatana-indicator-loader3" "ayatana-indicator3") + set_source_files_properties(indicator-loader.c PROPERTIES COMPILE_FLAGS ${COMPILE_FLAGS}) + add_executable("ayatana-indicator-loader3" indicator-loader.c) + target_include_directories("ayatana-indicator-loader3" PUBLIC ${PROJECT_DEPS_INCLUDE_DIRS}) + target_include_directories("ayatana-indicator-loader3" PUBLIC "${CMAKE_SOURCE_DIR}/src") + target_link_libraries("ayatana-indicator-loader3" ${PROJECT_DEPS_LIBRARIES} "-L${CMAKE_BINARY_DIR}/src" -layatana-indicator3) + add_dependencies("ayatana-indicator-loader3" "ayatana-indicator3") + + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ayatana-indicator-loader3" DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBEXECDIR}/${PROJECT_NAME}") + install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/80indicator-debugging" DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}") +endif() -- cgit v1.2.3 From 0a9b030b9ede20cc678e64d478e50529afb1054c Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 12 May 2021 15:29:55 +0200 Subject: CMakeLists.txt: Always builds indicator3 loader tool (not just when ENABLE_TESTS is set). --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7b509db..bc65cee 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -79,11 +79,11 @@ endif() add_subdirectory(src) add_subdirectory(data) +add_subdirectory(tools) if(ENABLE_TESTS) include(CTest) enable_testing() - add_subdirectory(tools) add_subdirectory(tests) if (ENABLE_COVERAGE) -- cgit v1.2.3 From 1140a11e33a1d47f9b4425317f777920d9777b66 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 12 May 2021 16:21:50 +0200 Subject: debian/control: Adjust B-Ds for CMake based build. --- debian/control | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/debian/control b/debian/control index 8e177c0..3a73b18 100644 --- a/debian/control +++ b/debian/control @@ -3,15 +3,16 @@ Section: libs Priority: optional Maintainer: Mike Gabriel Build-Depends: at-spi2-core, + cmake, + cmake-extras, debhelper (>= 9), - dh-autoreconf, dh-exec, dpkg-dev (>= 1.16.1.1), libtool, intltool, - mate-common, gtk-doc-tools, dbus-test-runner, + xauth, xvfb, libglib2.0-dev (>= 2.37), libgtk2.0-dev (>= 2.18), -- cgit v1.2.3 From 73e6c3aceb13b155c1f7af983acb8e7ed51e97c2 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 12 May 2021 13:30:01 +0200 Subject: debian/rules: Adjust to CMake based build. (Fixes DEB builds after CMake switch). --- debian/rules | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/debian/rules b/debian/rules index 3082a13..ae8b287 100755 --- a/debian/rules +++ b/debian/rules @@ -6,10 +6,10 @@ export DEB_BUILD_MAINT_OPTIONS = hardening=+all DPKG_EXPORT_BUILDFLAGS = 1 include /usr/share/dpkg/buildflags.mk -COMMON_CONFIGURE_FLAGS = --disable-silent-rules +COMMON_CONFIGURE_FLAGS = -CONFIGURE_FLAGS_gtk2 = --with-gtk=2 -CONFIGURE_FLAGS_gtk3 = --with-gtk=3 +CONFIGURE_FLAGS_gtk2 = -DFLAVOUR_GTK2=ON -DFLAVOUR_GTK3=OFF +CONFIGURE_FLAGS_gtk3 = -DFLAVOUR_GTK3=ON -DFLAVOUR_GTK2=OFF LDFLAGS += -Wl,-z,defs -Wl,--as-needed @@ -17,10 +17,7 @@ export G_MESSAGES_DEBUG = all export DPKG_GENSYMBOLS_CHECK_LEVEL = 4 %: - dh $@ --with autoreconf - -override_dh_autoreconf: - NOCONFIGURE=1 dh_autoreconf ./autogen.sh + dh $@ override_dh_auto_configure: $(FLAVORS:%=doconfigure-%) -- cgit v1.2.3 From 0371084641a17e014e274f3ba7745e6ff8964173 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 12 May 2021 15:31:06 +0200 Subject: debian/rules: Explicitly enable tests at build time. --- debian/rules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/rules b/debian/rules index ae8b287..aa08911 100755 --- a/debian/rules +++ b/debian/rules @@ -6,7 +6,7 @@ export DEB_BUILD_MAINT_OPTIONS = hardening=+all DPKG_EXPORT_BUILDFLAGS = 1 include /usr/share/dpkg/buildflags.mk -COMMON_CONFIGURE_FLAGS = +COMMON_CONFIGURE_FLAGS = -DENABLE_TESTS=ON CONFIGURE_FLAGS_gtk2 = -DFLAVOUR_GTK2=ON -DFLAVOUR_GTK3=OFF CONFIGURE_FLAGS_gtk3 = -DFLAVOUR_GTK3=ON -DFLAVOUR_GTK2=OFF -- cgit v1.2.3 From 262df761724be86fad5026452aa9636de4f8a53a Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 12 May 2021 15:30:48 +0200 Subject: debian/rules: Run GTK2/GTK3 unit tests sequentially. --- debian/rules | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/debian/rules b/debian/rules index aa08911..300730b 100755 --- a/debian/rules +++ b/debian/rules @@ -29,10 +29,9 @@ override_dh_auto_build: $(FLAVORS:%=dobuild-%) dobuild-%: dh_auto_build --builddirectory=builddir/$* -override_dh_auto_test: $(FLAVORS:%=dotest-%) - -dotest-%: - dh_auto_test --no-parallel --builddirectory=builddir/$* +override_dh_auto_test: + xvfb-run -a dh_auto_test --no-parallel --builddirectory=builddir/gtk2 + xvfb-run -a dh_auto_test --no-parallel --builddirectory=builddir/gtk3 override_dh_auto_install: $(FLAVORS:%=doinstall-%) -- cgit v1.2.3 From 8eec783d329921fffd5a5640a5c953ac937e4ab6 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 12 May 2021 15:29:14 +0200 Subject: debian/*.symbols: Update symbols files. --- debian/libayatana-indicator3-7.symbols | 5 +++++ debian/libayatana-indicator7.symbols | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/debian/libayatana-indicator3-7.symbols b/debian/libayatana-indicator3-7.symbols index a0bc0c3..7973468 100644 --- a/debian/libayatana-indicator3-7.symbols +++ b/debian/libayatana-indicator3-7.symbols @@ -2,6 +2,11 @@ libayatana-indicator3.so.7 libayatana-indicator3-7 #MINVER# *Build-Depends-Package: libayatana-indicator3-dev ICON_SIZE@Base 0.6.0 INDICATOR_NAMES_DATA@Base 0.6.0 + _indicator_object_marshal_VOID__POINTER_BOOLEAN@Base 0.8.5 + _indicator_object_marshal_VOID__POINTER_UINT@Base 0.8.5 + _indicator_object_marshal_VOID__POINTER_UINT_ENUM@Base 0.8.5 + _indicator_object_marshal_VOID__POINTER_UINT_UINT@Base 0.8.5 + _indicator_service@Base 0.8.5 #MISSING: 0.8.0# ayatana_menu_item_factory_create_menu_item@Base 0.7.0 #MISSING: 0.8.0# ayatana_menu_item_factory_get_all@Base 0.7.0 #MISSING: 0.8.0# ayatana_menu_item_factory_get_type@Base 0.7.0 diff --git a/debian/libayatana-indicator7.symbols b/debian/libayatana-indicator7.symbols index 66393ab..7489c2b 100644 --- a/debian/libayatana-indicator7.symbols +++ b/debian/libayatana-indicator7.symbols @@ -2,6 +2,11 @@ libayatana-indicator.so.7 libayatana-indicator7 #MINVER# *Build-Depends-Package: libayatana-indicator-dev ICON_SIZE@Base 0.6.0 INDICATOR_NAMES_DATA@Base 0.6.0 + _indicator_object_marshal_VOID__POINTER_BOOLEAN@Base 0.8.5 + _indicator_object_marshal_VOID__POINTER_UINT@Base 0.8.5 + _indicator_object_marshal_VOID__POINTER_UINT_ENUM@Base 0.8.5 + _indicator_object_marshal_VOID__POINTER_UINT_UINT@Base 0.8.5 + _indicator_service@Base 0.8.5 indicator_desktop_shortcuts_get_nicks@Base 0.6.0 indicator_desktop_shortcuts_get_type@Base 0.6.0 indicator_desktop_shortcuts_new@Base 0.6.0 -- cgit v1.2.3 From 08a856c5db3b44960384f2727100133552a21768 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 12 May 2021 16:18:38 +0200 Subject: debian/libayatana-indicator*-dev.install: No .a files shipped anymore. --- debian/libayatana-indicator-dev.install | 1 - debian/libayatana-indicator3-dev.install | 1 - 2 files changed, 2 deletions(-) diff --git a/debian/libayatana-indicator-dev.install b/debian/libayatana-indicator-dev.install index dbf81cf..8d167db 100644 --- a/debian/libayatana-indicator-dev.install +++ b/debian/libayatana-indicator-dev.install @@ -1,4 +1,3 @@ usr/include usr/lib/*/pkgconfig/ayatana-indicator-0.4.pc -usr/lib/*/libayatana-indicator.a usr/lib/*/libayatana-indicator.so diff --git a/debian/libayatana-indicator3-dev.install b/debian/libayatana-indicator3-dev.install index 4cc05d4..73dc715 100644 --- a/debian/libayatana-indicator3-dev.install +++ b/debian/libayatana-indicator3-dev.install @@ -1,4 +1,3 @@ usr/include usr/lib/*/pkgconfig/ayatana-indicator3-0.4.pc -usr/lib/*/libayatana-indicator3.a usr/lib/*/libayatana-indicator3.so -- cgit v1.2.3 From b2214f2cbe1a7cd1b104ff32fc121cd84862b9a6 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 12 May 2021 16:21:30 +0200 Subject: debian/libayatana-indicator3-tools.install: Install ayatana-indicator3-loader test tool to LIBEXECDIR. --- debian/libayatana-indicator3-tools.install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/libayatana-indicator3-tools.install b/debian/libayatana-indicator3-tools.install index dadee01..41bcf7a 100644 --- a/debian/libayatana-indicator3-tools.install +++ b/debian/libayatana-indicator3-tools.install @@ -1,2 +1,2 @@ -usr/lib/*/ayatana-indicator-loader3 +usr/libexec/libayatana-indicator/ayatana-indicator-loader3 usr/share/libayatana-indicator/80indicator-debugging /usr/share/libayatana-indicator/ -- cgit v1.2.3 From 173f104d15f5bd7478eed303c43e8426fb6d67a8 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 12 May 2021 16:22:26 +0200 Subject: Travis CI: Drop autotools support, build and test GTK+-2.0 and GTK+-3.0 flavours. --- .build.yml | 47 +++++++++++++++++++++++++++++++++-------------- 1 file changed, 33 insertions(+), 14 deletions(-) diff --git a/.build.yml b/.build.yml index 16d1816..5a68fb5 100644 --- a/.build.yml +++ b/.build.yml @@ -104,17 +104,35 @@ build_scripts: - cppcheck --enable=warning,style,performance,portability,information,missingInclude . - fi - - - if [ -e ./CMakeLists.txt ]; then + - mkdir build-gtk3/ + - cd build-gtk3/ + - if [ ${DISTRO_NAME} == "debian" ];then + - scan-build $CHECKERS cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_VERBOSE_MAKEFILE=ON -DENABLE_TESTS=ON -DFLAVOUR_GTK3=ON + - else + - scan-build $CHECKERS cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_VERBOSE_MAKEFILE=ON -DFLAVOUR_GTK3=ON + - fi + - + - if [ $CPU_COUNT -gt 1 ]; then - if [ ${DISTRO_NAME} == "debian" ];then - - scan-build $CHECKERS cmake . -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_VERBOSE_MAKEFILE=ON -DENABLE_TESTS=ON - - else - - scan-build $CHECKERS cmake . -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_VERBOSE_MAKEFILE=ON + - scan-build $CHECKERS --keep-cc --use-cc=clang --use-c++=clang++ -o html-report make -j $CPU_COUNT + - make clean - fi - - elif [ -e ./autogen.sh ]; then - - NOCONFIGURE=1 ./autogen.sh - - scan-build $CHECKERS ./configure --prefix=/usr --enable-gtk-doc --enable-compile-warnings=maximum + - scan-build $CHECKERS --keep-cc -o html-report make -j $CPU_COUNT + - else + - if [ ${DISTRO_NAME} == "debian" ];then + - scan-build $CHECKERS --keep-cc --use-cc=clang --use-c++=clang++ -o html-report make + - make clean + - fi + - scan-build $CHECKERS --keep-cc -o html-report make + - fi + - cd ../ + - + - mkdir build-gtk2/ + - cd build-gtk2/ + - if [ ${DISTRO_NAME} == "debian" ];then + - scan-build $CHECKERS cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_VERBOSE_MAKEFILE=ON -DENABLE_TESTS=ON -DFLAVOUR_GTK2=ON - else - - exit 1 + - scan-build $CHECKERS cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_VERBOSE_MAKEFILE=ON -DFLAVOUR_GTK2=ON - fi - - if [ $CPU_COUNT -gt 1 ]; then @@ -130,16 +148,17 @@ build_scripts: - fi - scan-build $CHECKERS --keep-cc -o html-report make - fi + - cd ../ after_scripts: - if [ ${BUILD_TYPE} == "scripts" ];then - XVFB_RUN="$(which xvfb-run || true)" - if [ ${DISTRO_NAME} == "debian" ];then - - if [ -e ./CMakeLists.txt ]; then - - ${XVFB_RUN} env CTEST_OUTPUT_ON_FAILURE=1 make test - - elif [ -e ./autogen.sh ]; then - - ${XVFB_RUN} make check - - cat tests/test-suite.log - - fi + - cd build-gtk3/ + - ${XVFB_RUN} env CTEST_OUTPUT_ON_FAILURE=1 make test + - cd ../ + - cd build-gtk2/ + - ${XVFB_RUN} env CTEST_OUTPUT_ON_FAILURE=1 make test + - cd ../ - fi - fi -- cgit v1.2.3