aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Tari <robert@tari.in>2021-04-29 10:24:35 +0200
committerRobert Tari <robert@tari.in>2021-04-29 10:24:35 +0200
commit0d153a37a753b9486a06d79332ea00a8f8f983c7 (patch)
treed4400816e363cfc40d3882edaa51f1bf5b392d83
parent9929648bbbcd4449a5ac3962535031da8c62fb0e (diff)
parent298f4b37043e0921761c8242cabd762d1014c771 (diff)
downloadlibayatana-common-0d153a37a753b9486a06d79332ea00a8f8f983c7.tar.gz
libayatana-common-0d153a37a753b9486a06d79332ea00a8f8f983c7.tar.bz2
libayatana-common-0d153a37a753b9486a06d79332ea00a8f8f983c7.zip
Merge branch 'sunweaver-pr/travis-ci'
Attributes GH PR #12: https://github.com/AyatanaIndicators/libayatana-common/pull/12
-rw-r--r--.build.yml136
-rw-r--r--.travis.yml43
-rw-r--r--CMakeLists.txt19
-rw-r--r--README.md45
-rwxr-xr-xdebian/rules1
-rw-r--r--tests/CMakeLists.txt2
6 files changed, 241 insertions, 5 deletions
diff --git a/.build.yml b/.build.yml
new file mode 100644
index 0000000..870b03c
--- /dev/null
+++ b/.build.yml
@@ -0,0 +1,136 @@
+#########################################################
+# THE FOLLOWING LINES IS USED BY docker-build
+##########################################################
+requires:
+ archlinux:
+ # Useful URL: https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=ayatana-indicator-keyboard
+ - clang
+ - gcc
+ - git
+ - make
+ - startup-notification
+ - which
+ - cmake
+ - cmake-extras
+ - mate-common
+ - cmake
+ - intltool
+ - glib2
+ - systemd
+
+ debian:
+ # Useful URL: https://salsa.debian.org/debian-ayatana-team/ayatana-ido
+ - autopoint
+ - clang
+ - clang-tools
+ - g++
+ - cppcheck
+ - git
+ - cmake
+ - cmake-extras
+ - mate-common
+ - libglib2.0-dev
+ - liblomiri-url-dispatcher-dev
+ - libgtest-dev
+
+ debian:stable:
+ # Useful URL: https://salsa.debian.org/debian-ayatana-team/ayatana-ido
+ - autopoint
+ - clang
+ - clang-tools
+ - g++
+ - cppcheck
+ - git
+ - cmake
+ - cmake-extras
+ - mate-common
+ - libglib2.0-dev
+ - libgtest-dev
+
+ ubuntu:
+ - autopoint
+ - clang
+ - clang-tools
+ - g++
+ - git
+ - cmake
+ - cmake-extras
+ - mate-common
+ - libglib2.0-dev
+ - liblomiri-url-dispatcher-dev
+ - libgtest-dev
+
+ ubuntu:focal:
+ - autopoint
+ - clang
+ - clang-tools
+ - g++
+ - git
+ - cmake
+ - cmake-extras
+ - mate-common
+ - libglib2.0-dev
+ - libgtest-dev
+
+variables:
+ - 'CHECKERS="
+ -enable-checker deadcode.DeadStores
+ -enable-checker alpha.deadcode.UnreachableCode
+ -enable-checker alpha.core.CastSize
+ -enable-checker alpha.core.CastToStruct
+ -enable-checker alpha.core.IdenticalExpr
+ -enable-checker alpha.core.SizeofPtr
+ -enable-checker alpha.security.ArrayBoundV2
+ -enable-checker alpha.security.MallocOverflow
+ -enable-checker alpha.security.ReturnPtrRange
+ -enable-checker alpha.unix.SimpleStream
+ -enable-checker alpha.unix.cstring.BufferOverlap
+ -enable-checker alpha.unix.cstring.NotNullTerminated
+ -enable-checker alpha.unix.cstring.OutOfBounds
+ -enable-checker alpha.core.FixedAddr
+ -enable-checker security.insecureAPI.strcpy"'
+
+build_scripts:
+ - if [ ${DISTRO_NAME} == "debian" ];then
+ - export CFLAGS+=" -Wsign-compare -Wunused-parameter"
+ - cppcheck --enable=warning,style,performance,portability,information,missingInclude .
+ - fi
+ -
+ - if [ -e ./autogen.sh ]; then
+ - NOCONFIGURE=1 ./autogen.sh
+ - scan-build $CHECKERS ./configure --prefix=/usr --enable-gtk-doc --enable-compile-warnings=maximum
+ - elif [ -e ./CMakeLists.txt ]; 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
+ - fi
+ - else
+ - exit 1
+ - fi
+ -
+ - if [ $CPU_COUNT -gt 1 ]; then
+ - if [ ${DISTRO_NAME} == "debian" ];then
+ - scan-build $CHECKERS --keep-cc --use-cc=clang --use-c++=clang++ -o html-report make -j $CPU_COUNT
+ - make clean
+ - fi
+ - 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
+
+after_scripts:
+ - if [ ${BUILD_TYPE} == "scripts" ];then
+ - XVFB_RUN="$(which xvfb-run || true)"
+ - if [ ${DISTRO_NAME} == "debian" ];then
+ - if [ -e ./autogen.sh ]; then
+ - ${XVFB_RUN} make check
+ - elif [ -e ./CMakeLists.txt ]; then
+ - ${XVFB_RUN} env CTEST_OUTPUT_ON_FAILURE=1 make test
+ - fi
+ - fi
+ - fi
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..2efd2f4
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,43 @@
+# vim: set ts=2 sts=2 sw=2 expandtab :
+dist: bionic
+language: shell
+os: linux
+
+arch:
+ - amd64
+ - ppc64le
+
+services:
+ - docker
+
+addons:
+ apt:
+ packages:
+ - python3-pip
+ - python3-setuptools
+
+before_install:
+ # let's use the MATE project's docker build script...
+ - curl -Ls -o docker-build https://github.com/AyatanaIndicators/ayatana-dev-scripts/raw/master/travis/docker-build
+ - chmod +x docker-build
+
+install:
+ - pip3 install wheel
+ - pip3 install PyGithub
+ - ./docker-build --name ${DISTRO} --config .build.yml --install
+
+script:
+ - ./docker-build --name ${DISTRO} --verbose --config .build.yml --build scripts --build autotools
+
+env:
+# temp disable of archlinux builds, see https://gitlab.archlinux.org/archlinux/archlinux-docker/-/issues/56
+# - DISTRO="archlinux:latest"
+ - DISTRO="debian:testing"
+ - DISTRO="debian:stable"
+# - DISTRO="ubuntu:rolling"
+ - DISTRO="ubuntu:focal"
+
+jobs:
+ exclude:
+ - env: DISTRO="archlinux:latest"
+ arch: ppc64le
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c1bffc3..aaeb591 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,5 +1,5 @@
project (libayatana-common C CXX)
-cmake_minimum_required(VERSION 3.16)
+cmake_minimum_required(VERSION 3.13)
set(PROJECT_VERSION "0.9.1")
set(PACKAGE ${CMAKE_PROJECT_NAME})
@@ -8,7 +8,16 @@ set(API_VERSION 0)
set(ABI_VERSION 0)
# Options
-option(DISABLE_TESTS "Disable tests" off)
+option (ENABLE_TESTS "Build the package's automatic tests." OFF)
+option (ENABLE_COVERAGE "Generate lcov code coverage reports." OFF)
+
+if(ENABLE_COVERAGE)
+ set(ENABLE_TESTS ON)
+ set(CMAKE_BUILD_TYPE "Coverage")
+else()
+ set(CMAKE_BUILD_TYPE "Release")
+endif()
+
# GNU standard installation directories
include (GNUInstallDirs)
@@ -34,10 +43,10 @@ set(CC_WARNING_ARGS " -Wall -pedantic -Wextra -Wno-missing-field-initializers")
add_subdirectory(src)
-if (DISABLE_TESTS)
- message(STATUS "Tests disabled")
-else()
+if (ENABLE_TESTS)
include(CTest)
enable_testing()
add_subdirectory(tests)
+else()
+ message(STATUS "Tests disabled")
endif()
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..6487f56
--- /dev/null
+++ b/README.md
@@ -0,0 +1,45 @@
+# libayatana-common - Common functions for Ayatana System Indicators [![Build Status](https://travis-ci.org/AyatanaIndicators/libayatana-common.svg)](https://travis-ci.org/AyatanaIndicators/libayatana-common)
+
+## About Ayatana Indicators
+
+The Ayatana Indicators project is the continuation of Application
+Indicators and System Indicators, two technologies developed by Canonical
+Ltd. for the Unity7 desktop.
+
+Application Indicators are a GTK implementation of the StatusNotifierItem
+Specification (SNI) that was originally submitted to freedesktop.org by
+KDE.
+
+System Indicators are an extensions to the Application Indicators idea.
+System Indicators allow for far more widgets to be displayed in the
+indicator's menu.
+
+The Ayatana Indicators project is the new upstream for application
+indicators, system indicators and associated projects with a focus on
+making Ayatana Indicators a desktop agnostic technology.
+
+On GNU/Linux, Ayatana Indicators are currently available for desktop
+envinronments like MATE (used by default in [Ubuntu
+MATE](https://ubuntu-mate.com)), XFCE (used by default in
+[Xubuntu](https://bluesabre.org/2021/02/25/xubuntu-21-04-progress-update/),
+LXDE, and the Budgie Desktop.
+
+The Lomiri Operating Environment (UI of the Ubuntu Touch OS, formerly
+known as Unity8) uses Ayatana Indicators for rendering its notification
+area and the [UBports](https://ubports.com) project is a core contributor
+to the Ayatana Indicators project.
+
+For further info, please visit:
+https://ayatana-indicators.org
+
+## About this Software Component
+
+This shared library contains functions that two or more system indicator
+components share.
+
+This shared library was originally created to reduce code duplication
+across various system indicator components.
+
+## License and Copyright
+
+See COPYING and AUTHORS file in this project.
diff --git a/debian/rules b/debian/rules
index f447c58..82088c0 100755
--- a/debian/rules
+++ b/debian/rules
@@ -11,6 +11,7 @@ include /usr/share/dpkg/buildflags.mk
override_dh_auto_configure:
dh_auto_configure -- \
+ -DENABLE_TESTS=ON \
-DCMAKE_INSTALL_DIR=/usr \
$(NULL)
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 1c5d318..c6e26ae 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -1,5 +1,7 @@
find_package(GMock)
+SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -no-pie")
+
include_directories(
${CMAKE_SOURCE_DIR}/src
)