Skip to content
Commits on Source (214)
......@@ -24,12 +24,25 @@
# <distribution>:<version>@activity:
# e.g. fedora:29@build-default
include:
# Arch container builder template
- project: 'wayland/ci-templates'
ref: 955e61e67cf29327cf907432f668df9eec4ca6a2 # see https://docs.gitlab.com/ee/ci/yaml/#includefile
file: '/templates/arch.yml'
# Fedora container builder template
- project: 'wayland/ci-templates'
ref: 955e61e67cf29327cf907432f668df9eec4ca6a2 # see https://docs.gitlab.com/ee/ci/yaml/#includefile
file: '/templates/fedora.yml'
# Ubuntu container builder template
- project: 'wayland/ci-templates'
ref: 955e61e67cf29327cf907432f668df9eec4ca6a2 # see https://docs.gitlab.com/ee/ci/yaml/#includefile
file: '/templates/ubuntu.yml'
stages:
- bootstrapping # creates the initial container image (optional)
- container_check # check if the current container images are up to date
- container_prep # rebuild the container images if previous step failed
- container_prep # rebuild the container images if there is a change
- build # for actually building things
- deploy # trigger wayland's website generation
- container_clean # clean up unused container images
variables:
###############################################################################
......@@ -43,23 +56,35 @@ variables:
# https://wayland.freedesktop.org/libinput/doc/latest/building_libinput.html #
###############################################################################
FEDORA_RPMS: 'git gcc gcc-c++ pkgconf-pkg-config meson check-devel libudev-devel libevdev-devel doxygen graphviz python3-sphinx python3-recommonmark libwacom-devel cairo-devel gtk3-devel glib2-devel mtdev-devel'
UBUNTU_DEBS: 'git gcc g++ pkg-config meson check libudev-dev libevdev-dev doxygen graphviz python3-sphinx python3-recommonmark python3-sphinx-rtd-theme libwacom-dev libcairo2-dev libgtk-3-dev libglib2.0-dev libmtdev-dev'
ARCH_PKGS: 'git gcc pkgconfig meson check libsystemd libevdev doxygen graphviz python-sphinx python-recommonmark libwacom gtk3 mtdev diffutils'
UBUNTU_CUSTOM_DEBS: 'git gcc g++ pkg-config meson check libudev-dev libevdev-dev doxygen graphviz python3-sphinx python3-recommonmark python3-sphinx-rtd-theme libwacom-dev libcairo2-dev libgtk-3-dev libglib2.0-dev libmtdev-dev'
ARCH_PKGS: 'git gcc pkgconfig meson check libsystemd libevdev doxygen graphviz python-sphinx python-recommonmark python-sphinx_rtd_theme libwacom gtk3 mtdev diffutils'
FREEBSD_BUILD_PKGS: 'meson'
FREEBSD_PKGS: 'libepoll-shim libudev-devd libevdev libwacom gtk3 libmtdev '
############################ end of package lists #############################
# these tags should be updated each time the list of packages is updated
# changing these will force rebuilding the associated image
# Note: these tags have no meaning and are not tied to a particular
# libinput version
FEDORA_TAG: '2019-08-07.0'
UBUNTU_TAG: '2019-08-07.0'
ARCH_TAG: '2019-08-07.0'
FREEBSD_TAG: '2019-08-07.0'
UBUNTU_EXEC: "bash .gitlab-ci/ubuntu_install.sh $UBUNTU_CUSTOM_DEBS"
UPSTREAM_REPO: libinput/libinput
BUILDAH_IMAGE: $CI_REGISTRY/wayland/ci-templates/buildah:latest
FEDORA_CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/fedora/$FEDORA_VERSION:$FEDORA_TAG
UBUNTU_CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/ubuntu/$UBUNTU_VERSION:$UBUNTU_TAG
ARCH_CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/archlinux/rolling:$ARCH_TAG
FREEBSD_CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/freebsd/11.2:$FREEBSD_TAG
MESON_BUILDDIR: "build dir"
NINJA_ARGS: 'test'
NINJA_ARGS: ''
MESON_ARGS: ''
# We do not use CI_PROJECT_NAMESPACE or CI_REGISTRY_IMAGE because we want
# forks to use these particular images
PROJECT_NAMESPACE: libinput
FEDORA_CONTAINER_IMAGE: $CI_REGISTRY/$PROJECT_NAMESPACE/$CI_PROJECT_NAME/fedora/$FEDORA_VERSION
UBUNTU_CONTAINER_IMAGE: $CI_REGISTRY/$PROJECT_NAMESPACE/$CI_PROJECT_NAME/ubuntu/$UBUNTU_VERSION
ARCH_CONTAINER_IMAGE: $CI_REGISTRY/$PROJECT_NAMESPACE/$CI_PROJECT_NAME/arch/rolling
FREEBSD_CONTAINER_IMAGE: $CI_REGISTRY/$PROJECT_NAMESPACE/$CI_PROJECT_NAME/freebsd/11.2
# Until we have a VM with full access, we cannot run the test suite runner
SKIP_LIBINPUT_TEST_SUITE_RUNNER: 1
MESON_TEST_ARGS: '--no-suite=hardware'
# udev isn't available/working properly in the containers
UDEV_NOT_AVAILABLE: 1
GIT_DEPTH: 1
......@@ -79,120 +104,7 @@ variables:
- meson "$MESON_BUILDDIR" $MESON_ARGS
- meson configure "$MESON_BUILDDIR"
- ninja -C "$MESON_BUILDDIR" $NINJA_ARGS
# special rule to not expose the container creation runners to other users
# than those who have set up the CI to push on the registry.
# Users who have write access to libinput/libinput will have write
# access to the registry, so the libinput/libinput is a catch-all for
# our core developers.
#
# we can add as many users as we want by adding a new line like:
# - $GITLAB_USER_LOGIN == "someone"
.restrict_container_creation: &restrict_container_creation
only:
variables:
# Note: this is a set of logical OR, not AND
- $CI_PROJECT_PATH == "libinput/libinput"
#################################################################
# #
# bootstrapping stage #
# #
#################################################################
# we need a minimalist image capable of buildah, podman, skopeo, curl,
# jq, date and test. Instead of using a full fedora and install the
# dependencies, we can build an alpine container through buildah with
# the script at `ci/bootstrap.sh`
bootstrap:
stage: bootstrapping
when: manual
image: $CI_REGISTRY/$PROJECT_NAMESPACE/$CI_PROJECT_NAME/containers:latest
script:
- podman login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- bash ci/bootstrap.sh $CI_REGISTRY/$PROJECT_NAMESPACE/$CI_PROJECT_NAME/containers:latest
- podman images
- podman push --quiet $CI_REGISTRY/$PROJECT_NAMESPACE/$CI_PROJECT_NAME/containers:latest
# add an extra tag to the docker registry:
- skopeo copy docker://$CI_REGISTRY/$PROJECT_NAMESPACE/$CI_PROJECT_NAME/containers:latest docker://$CI_REGISTRY/$PROJECT_NAMESPACE/$CI_PROJECT_NAME/containers:$CI_JOB_ID
<<: *restrict_container_creation
#################################################################
# #
# container check stage #
# #
#################################################################
.container-check:
stage: container_check
image: $CI_REGISTRY/$PROJECT_NAMESPACE/$CI_PROJECT_NAME/containers:latest
script:
# get the full container image name (CURRENT_CONTAINER_IMAGE still has indirections)
- CONTAINER_IMAGE=$(eval echo "$CURRENT_CONTAINER_IMAGE")
# get the date of the current image
- IMG_DATE=$(skopeo inspect docker://$CONTAINER_IMAGE | jq -r '.Created' | cut -dT -f1)
- TODAY_SECS=$(date -u +%s)
- IMG_SECS=$(date -u --date="$IMG_DATE" +%s)
- echo "today $TODAY_SECS, image $IMG_SECS"
- echo "image age $(($TODAY_SECS - $IMG_SECS))s"
# check if image is less than a week old
- test $(($IMG_SECS + 604800)) -gt $TODAY_SECS
# export an artefact telling the next stage that the image is valid
- touch .img_ready
artifacts:
name: image-$CURRENT_CONTAINER_IMAGE-check
expire_in: 6 hrs
paths:
- .img_ready
allow_failure: true
<<: *restrict_container_creation
# TODO: check that the RPMS/DEBS are all in the current images
fedora:28@container-check:
extends: .container-check
variables:
GIT_STRATEGY: none
FEDORA_VERSION: 28
CURRENT_CONTAINER_IMAGE: $FEDORA_CONTAINER_IMAGE:latest
fedora:29@container-check:
extends: .container-check
variables:
GIT_STRATEGY: none
FEDORA_VERSION: 29
CURRENT_CONTAINER_IMAGE: $FEDORA_CONTAINER_IMAGE:latest
ubuntu:18.10@container-check:
extends: .container-check
variables:
GIT_STRATEGY: none
UBUNTU_VERSION: "18.10"
CURRENT_CONTAINER_IMAGE: $UBUNTU_CONTAINER_IMAGE:latest
ubuntu:18.04@container-check:
extends: .container-check
variables:
GIT_STRATEGY: none
UBUNTU_VERSION: "18.04"
CURRENT_CONTAINER_IMAGE: $UBUNTU_CONTAINER_IMAGE:latest
arch:rolling@container-check:
extends: .container-check
variables:
GIT_STRATEGY: none
CURRENT_CONTAINER_IMAGE: $ARCH_CONTAINER_IMAGE:latest
freebsd:11.2@container-check:
extends: .container-check
variables:
GIT_STRATEGY: none
CURRENT_CONTAINER_IMAGE: $FREEBSD_CONTAINER_IMAGE:latest
- if test x"$MESON_TEST_ARGS" != "x"; then echo "Running meson test -C \"$MESON_BUILDDIR\" $MESON_TEST_ARGS"; meson test -C "$MESON_BUILDDIR" $MESON_TEST_ARGS; fi
#################################################################
# #
......@@ -201,208 +113,158 @@ freebsd:11.2@container-check:
#################################################################
#
# This stage will recreate the container images only if the previous
# stage had a build failure, i.e. the image is too old or if it is
# missing some dependencies.
# This stage will recreate the container images only if the image
# is too old or if it is missing some dependencies.
#
.container-prep:
stage: container_prep
image: $CI_REGISTRY/$PROJECT_NAMESPACE/$CI_PROJECT_NAME/containers:latest
.pull_upstream_or_rebuild: &pull_upstream_or_rebuild
before_script:
# if the check was successful, we just skip recreating the container image
- test -e .img_ready && exit 0
# log in to the registry
- podman login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
<<: *restrict_container_creation
.fedora@container-prep:
extends: .container-prep
script:
- buildcntr=$(buildah from --quiet fedora:$FEDORA_VERSION)
- buildah run $buildcntr dnf upgrade -y
- buildah run $buildcntr dnf install -y $FEDORA_RPMS
- buildah run $buildcntr dnf clean all
- buildah config --workingdir /app $buildcntr
# tag the current container
- buildah commit --quiet $buildcntr $FEDORA_CONTAINER_IMAGE:latest
# clean up the working container
- buildah rm $buildcntr
# get the full container image name (DISTRIB_VERSION still has indirections)
- IMAGE=$(eval echo "$DISTRIB_FLAVOR/$DISTRIB_VERSION:$TAG")
# push the container image to the libinput registry
- podman push --quiet $FEDORA_CONTAINER_IMAGE:latest
- skopeo copy docker://$FEDORA_CONTAINER_IMAGE:latest docker://$FEDORA_CONTAINER_IMAGE:$CI_JOB_ID
- |
# force rebuild if schedule, reuse otherwise
if [[ $CI_PIPELINE_SOURCE != "schedule" ]] ;
then
# pull the latest upstream image if it exists
skopeo copy docker://$CI_REGISTRY/$UPSTREAM_REPO/$IMAGE \
docker://$CI_REGISTRY_IMAGE/$IMAGE && exit 0 || true ;
# check if our image is already in the current registry
skopeo inspect docker://$CI_REGISTRY_IMAGE/$IMAGE > /dev/null && exit 0 || true ;
fi
fedora:28@container-prep:
extends: .fedora@container-prep
fedora:30@container-prep:
extends: .fedora@container-build
stage: container_prep
variables:
GIT_STRATEGY: none
FEDORA_VERSION: 28
dependencies:
# Note: we can not use $FEDORA_VERSION here
- fedora:28@container-check
FEDORA_VERSION: 30
DISTRIB_FLAVOR: fedora
DISTRIB_VERSION: $FEDORA_VERSION
TAG: $FEDORA_TAG
<<: *pull_upstream_or_rebuild
fedora:29@container-prep:
extends: .fedora@container-prep
extends: .fedora@container-build
stage: container_prep
variables:
GIT_STRATEGY: none
FEDORA_VERSION: 29
dependencies:
# Note: we can not use $FEDORA_VERSION here
- fedora:29@container-check
.ubuntu@container-prep:
extends: .container-prep
script:
- buildcntr=$(buildah from --quiet ubuntu:$UBUNTU_VERSION)
- buildah run $buildcntr env DEBIAN_FRONTEND=noninteractive apt-get update
- buildah run $buildcntr env DEBIAN_FRONTEND=noninteractive apt-get install -y software-properties-common
- buildah run $buildcntr env DEBIAN_FRONTEND=noninteractive add-apt-repository universe
- buildah run $buildcntr env DEBIAN_FRONTEND=noninteractive apt-get update
- buildah run $buildcntr env DEBIAN_FRONTEND=noninteractive apt-get install -y $UBUNTU_DEBS
- buildah run $buildcntr env DEBIAN_FRONTEND=noninteractive apt-get clean
- buildah config --workingdir /app $buildcntr
# tag the current container
- buildah commit --quiet $buildcntr $UBUNTU_CONTAINER_IMAGE:latest
# clean up the working container
- buildah rm $buildcntr
DISTRIB_FLAVOR: fedora
DISTRIB_VERSION: $FEDORA_VERSION
TAG: $FEDORA_TAG
<<: *pull_upstream_or_rebuild
# push the container image to the libinput registry
- podman push --quiet $UBUNTU_CONTAINER_IMAGE:latest
- skopeo copy docker://$UBUNTU_CONTAINER_IMAGE:latest docker://$UBUNTU_CONTAINER_IMAGE:$CI_JOB_ID
ubuntu:18.10@container-prep:
extends: .ubuntu@container-prep
extends: .ubuntu@container-build
stage: container_prep
variables:
GIT_STRATEGY: none
UBUNTU_VERSION: "18.10"
dependencies:
# Note: we can not use $UBUNTU_VERSION here
- ubuntu:18.10@container-check
DISTRIB_FLAVOR: ubuntu
DISTRIB_VERSION: $UBUNTU_VERSION
TAG: $UBUNTU_TAG
<<: *pull_upstream_or_rebuild
ubuntu:18.04@container-prep:
extends: .ubuntu@container-prep
ubuntu:19.04@container-prep:
extends: .ubuntu@container-build
stage: container_prep
variables:
GIT_STRATEGY: none
UBUNTU_VERSION: "18.04"
dependencies:
# Note: we can not use $UBUNTU_VERSION here
- ubuntu:18.04@container-check
.arch@container-prep:
extends: .container-prep
script:
- buildcntr=$(buildah from --quiet archlinux/base)
- buildah run $buildcntr pacman -S --refresh
- buildah run $buildcntr pacman -S --sysupgrade --noconfirm
- buildah run $buildcntr pacman -S --noconfirm $ARCH_PKGS
# in case it doesn't exist yet, otherwise pacman clean fails
- buildah run $buildcntr mkdir -p /var/cache/pacman/pkg
- buildah run $buildcntr pacman -S --clean --noconfirm
- buildah config --workingdir /app $buildcntr
# tag the current container
- buildah commit --quiet $buildcntr $ARCH_CONTAINER_IMAGE:latest
# clean up the working container
- buildah rm $buildcntr
UBUNTU_VERSION: "19.04"
DISTRIB_FLAVOR: ubuntu
DISTRIB_VERSION: $UBUNTU_VERSION
TAG: $UBUNTU_TAG
<<: *pull_upstream_or_rebuild
# push the container image to the libinput registry
- podman push --quiet $ARCH_CONTAINER_IMAGE:latest
- skopeo copy docker://$ARCH_CONTAINER_IMAGE:latest docker://$ARCH_CONTAINER_IMAGE:$CI_JOB_ID
arch:rolling@container-prep:
extends: .arch@container-prep
extends: .arch@container-build
stage: container_prep
variables:
GIT_STRATEGY: none
dependencies:
- arch:rolling@container-check
ARCH_VERSION: rolling
DISTRIB_FLAVOR: archlinux
DISTRIB_VERSION: $ARCH_VERSION
TAG: $ARCH_TAG
<<: *pull_upstream_or_rebuild
.freebsd@container-prep:
extends: .container-prep
stage: container_prep
image: $BUILDAH_IMAGE
<<: *pull_upstream_or_rebuild
script:
- export BUILDAH_RUN="buildah run --isolation chroot"
- export BUILDAH_COMMIT="buildah commit --format docker"
- buildcntr=$(buildah from --quiet myfreeweb/freebsd-cross:latest)
- buildah run $buildcntr apk add --no-cache $FREEBSD_BUILD_PKGS
- buildah run $buildcntr pkg -r /freebsd update -f
- buildah run $buildcntr pkg -r /freebsd install -y $FREEBSD_PKGS
- $BUILDAH_RUN $buildcntr apk add --no-cache $FREEBSD_BUILD_PKGS
- $BUILDAH_RUN $buildcntr pkg -r /freebsd update -f
- $BUILDAH_RUN $buildcntr pkg -r /freebsd install -y $FREEBSD_PKGS
- buildah config --workingdir /app $buildcntr
# tag the current container
- buildah commit --quiet $buildcntr $FREEBSD_CONTAINER_IMAGE:latest
- $BUILDAH_COMMIT $buildcntr $FREEBSD_CONTAINER_IMAGE
# clean up the working container
- buildah rm $buildcntr
# push the container image to the libinput registry
- podman push --quiet $FREEBSD_CONTAINER_IMAGE:latest
- skopeo copy docker://$FREEBSD_CONTAINER_IMAGE:latest docker://$FREEBSD_CONTAINER_IMAGE:$CI_JOB_ID
- podman push --quiet $FREEBSD_CONTAINER_IMAGE
- skopeo copy docker://$FREEBSD_CONTAINER_IMAGE docker://$CI_REGISTRY_IMAGE/freebsd/$FREEBSD_VERSION:$CI_JOB_ID
freebsd:11.2@container-prep:
extends: .freebsd@container-prep
variables:
GIT_STRATEGY: none
dependencies:
# Note: we can not use $FREEBSD_VERSION here
- freebsd:11.2@container-check
# Add some manual runners to be able to recreate the cache on a day
# the list of the rpms changed
fedora:28@force-container-prep:
extends: fedora:28@container-prep
when: manual
dependencies: []
fedora:29@force-container-prep:
extends: fedora:29@container-prep
when: manual
dependencies: []
ubuntu:18.10@force-container-prep:
extends: ubuntu:18.10@container-prep
when: manual
dependencies: []
ubuntu:18.04@force-container-prep:
extends: ubuntu:18.04@container-prep
when: manual
dependencies: []
arch:rolling@force-container-prep:
extends: arch:rolling@container-prep
when: manual
dependencies: []
FREEBSD_VERSION: "11.2"
DISTRIB_FLAVOR: freebsd
DISTRIB_VERSION: $FREEBSD_VERSION
TAG: $FREEBSD_TAG
freebsd:11.2@force-container-prep:
extends: freebsd:11.2@container-prep
when: manual
dependencies: []
#################################################################
# #
# container clean stage #
# run during the check stage #
# run during the clean stage #
# #
#################################################################
#
# This stage will look for the container images we currently have in
# the registry and will remove any that are not tagged as 'latest'
# the registry and will remove any that are not tagged with the provided
# $container_image:$tag
#
.container-clean:
stage: container_check
image: $CI_REGISTRY/$PROJECT_NAMESPACE/$CI_PROJECT_NAME/containers:latest
stage: container_clean
image: $BUILDAH_IMAGE
script:
# get the full container image name (CURRENT_CONTAINER_IMAGE still has indirections)
- CONTAINER_IMAGE=$(eval echo "$CURRENT_CONTAINER_IMAGE")
- GITLAB=$(echo $CI_PROJECT_URL | cut -f3 -d/)
- REPOSITORY=$(echo $CONTAINER_IMAGE | cut -f2- -d/)
- REPOSITORY=$(echo $CONTAINER_IMAGE | cut -f2- -d/ | cut -f1 -d:)
- IMAGE_PATH=$(echo $CONTAINER_IMAGE | cut -f1 -d:)
- LATEST_TAG=$(echo $CONTAINER_IMAGE | cut -f2 -d:)
# log in to the registry (read only)
- podman login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
# get the r/w token from the settings to access the registry
#
# each developer needs to register a secret variable that contains
# a personal token with api access in the form of:
# PERSONAL_TOKEN_$USER (for example PERSONAL_TOKEN_bentiss)
# a personal token with api access. The token
# - must be named PERSONAL_TOKEN_$USER (for example PERSONAL_TOKEN_bentiss)
# - must be registered in the CI/CD Variables section as type file
# - value must be a netrc file as a single-line string:
# default login <user> password <token value>
# e.g. "default login bentiss password 1235abcde"
- tokenname="PERSONAL_TOKEN_$GITLAB_USER_LOGIN"
- token=$(eval echo "\$$tokenname")
- netrcfile=$(eval echo "\$$tokenname")
- if [[ ! -f "$netrcfile" ]]; then
echo "No netrc file found or token is missing, skipping job" && false;
fi
# request a token for the registry API
- REGISTRY_TOKEN=$(curl https://$GITLAB/jwt/auth --get
......@@ -412,14 +274,18 @@ freebsd:11.2@force-container-prep:
-d service=container_registry
-d "scope=repository:$REPOSITORY:pull,*"
--fail
--user $GITLAB_USER_LOGIN:$token
--netrc-file "$netrcfile"
| sed -r 's/(\{"token":"|"\})//g')
# get the digest of the latest image
- LATEST_MANIFEST=$(skopeo inspect docker://$IMAGE_PATH:latest | jq -r '.Digest')
- LATEST_MANIFEST=$(skopeo inspect docker://$IMAGE_PATH:$LATEST_TAG | jq -r '.Digest')
# get the list of tags
- TAGS=$(skopeo inspect docker://$IMAGE_PATH | jq -r '.RepoTags[]')
- TAGS=$(skopeo inspect docker://$IMAGE_PATH:$LATEST_TAG | jq -r '.RepoTags[]')
# FIXME: is the above command working properly? If not, use below:
# - TAGS=$(curl -X GET -H "accept:application/vnd.docker.distribution.manifest.v2+json"
# -H "authorization:Bearer $REGISTRY_TOKEN"
# https://$CI_REGISTRY/v2/$REPOSITORY/tags/list | jq -r '.tags[]')
# iterate over the tags
- for tag in $TAGS;
......@@ -431,24 +297,19 @@ freebsd:11.2@force-container-prep:
curl https://$CI_REGISTRY/v2/$REPOSITORY/manifests/$MANIFEST --silent
-H "accept:application/vnd.docker.distribution.manifest.v2+json"
-H "authorization:Bearer $REGISTRY_TOKEN"
--fail --show-error -X DELETE
--fail --show-error -X DELETE || true
;fi
;done
dependencies: []
allow_failure: true
<<: *restrict_container_creation
bootstrap@container-clean:
extends: .container-clean
variables:
GIT_STRATEGY: none
CURRENT_CONTAINER_IMAGE: $CI_REGISTRY/$PROJECT_NAMESPACE/$CI_PROJECT_NAME/containers
only:
- schedules
fedora:28@container-clean:
fedora:30@container-clean:
extends: .container-clean
variables:
GIT_STRATEGY: none
FEDORA_VERSION: 28
FEDORA_VERSION: 30
CURRENT_CONTAINER_IMAGE: $FEDORA_CONTAINER_IMAGE
fedora:29@container-clean:
......@@ -465,11 +326,11 @@ ubuntu:18.10@container-clean:
UBUNTU_VERSION: "18.10"
CURRENT_CONTAINER_IMAGE: $UBUNTU_CONTAINER_IMAGE
ubuntu:18.04@container-clean:
ubuntu:19.04@container-clean:
extends: .container-clean
variables:
GIT_STRATEGY: none
UBUNTU_VERSION: "18.04"
UBUNTU_VERSION: "19.04"
CURRENT_CONTAINER_IMAGE: $UBUNTU_CONTAINER_IMAGE
arch:rolling@container-clean:
......@@ -502,29 +363,29 @@ freebsd:11.2@container-clean:
.fedora-build@template:
extends: .build@template
image: $FEDORA_CONTAINER_IMAGE:latest
image: $FEDORA_CONTAINER_IMAGE
fedora:28@default-build:
fedora:29@default-build:
extends: .fedora-build@template
variables:
FEDORA_VERSION: 28
FEDORA_VERSION: 29
fedora:29@default-build:
fedora:30@default-build:
extends: .fedora-build@template
variables:
FEDORA_VERSION: 29
FEDORA_VERSION: 30
fedora:29@default-build-release:
fedora:30@default-build-release:
extends: .fedora-build@template
variables:
FEDORA_VERSION: 29
FEDORA_VERSION: 30
MESON_ARGS: "-Dbuildtype=release"
CFLAGS: "-Werror"
fedora:29@scan-build:
fedora:30@scan-build:
extends: .fedora-build@template
variables:
FEDORA_VERSION: 29
FEDORA_VERSION: 30
NINJA_ARGS: scan-build
before_script:
- dnf install -y clang-analyzer findutils
......@@ -538,99 +399,93 @@ fedora:29@scan-build:
# run them on one image, they shouldn't fail on one distro
# when they succeed on another.
fedora:29@build-no-libwacom:
fedora:30@build-no-libwacom:
extends: .fedora-build@template
variables:
FEDORA_VERSION: 29
FEDORA_VERSION: 30
MESON_ARGS: "-Dlibwacom=false"
fedora:29@build-no-libwacom-nodeps:
fedora:30@build-no-libwacom-nodeps:
extends: .fedora-build@template
variables:
FEDORA_VERSION: 29
FEDORA_VERSION: 30
MESON_ARGS: "-Dlibwacom=false"
before_script:
- dnf remove -y libwacom libwacom-devel
fedora:29@build-no-docs:
fedora:30@build-no-docs:
extends: .fedora-build@template
variables:
FEDORA_VERSION: 29
FEDORA_VERSION: 30
MESON_ARGS: "-Ddocumentation=false"
fedora:29@build-no-docs-nodeps:
fedora:30@build-no-docs-nodeps:
extends: .fedora-build@template
variables:
FEDORA_VERSION: 29
FEDORA_VERSION: 30
MESON_ARGS: "-Ddocumentation=false"
before_script:
- dnf remove -y doxygen graphviz
fedora:29@build-no-debuggui:
fedora:30@build-no-debuggui:
extends: .fedora-build@template
variables:
FEDORA_VERSION: 29
FEDORA_VERSION: 30
MESON_ARGS: "-Ddebug-gui=false"
fedora:29@build-no-debuggui-nodeps:
fedora:30@build-no-debuggui-nodeps:
extends: .fedora-build@template
variables:
FEDORA_VERSION: 29
FEDORA_VERSION: 30
MESON_ARGS: "-Ddebug-gui=false"
before_script:
- dnf remove -y gtk3-devel
fedora:29@build-no-tests:
fedora:30@build-no-tests:
extends: .fedora-build@template
variables:
FEDORA_VERSION: 29
FEDORA_VERSION: 30
MESON_ARGS: "-Dtests=false"
fedora:29@build-no-tests-nodeps:
fedora:30@build-no-tests-nodeps:
extends: .fedora-build@template
variables:
FEDORA_VERSION: 29
FEDORA_VERSION: 30
MESON_ARGS: "-Dtests=false"
before_script:
- dnf remove -y check-devel
fedora:29@valgrind:
fedora:30@valgrind:
extends: .fedora-build@template
variables:
FEDORA_VERSION: 29
FEDORA_VERSION: 30
MESON_TEST_ARGS: '--suite=valgrind --no-suite=hardware --setup=valgrind'
before_script:
- dnf install -y valgrind
# note: we override the default_build here by providing a new script
script:
- rm -rf "$MESON_BUILDDIR"
- meson "$MESON_BUILDDIR" $MESON_ARGS
- meson configure "$MESON_BUILDDIR"
- meson test -C "$MESON_BUILDDIR" --setup=valgrind
#
# Ubuntu
#
.ubuntu@template:
extends: .build@template
image: $UBUNTU_CONTAINER_IMAGE:latest
image: $UBUNTU_CONTAINER_IMAGE
ubuntu:18.10@default-build:
extends: .ubuntu@template
variables:
UBUNTU_VERSION: "18.10"
ubuntu:18.04@default-build:
ubuntu:19.04@default-build:
extends: .ubuntu@template
variables:
UBUNTU_VERSION: "18.04"
UBUNTU_VERSION: "19.04"
#
# Arch
#
.arch@template:
extends: .build@template
image: $ARCH_CONTAINER_IMAGE:latest
image: $ARCH_CONTAINER_IMAGE
arch:rolling@default-build:
extends: .arch@template
......@@ -640,11 +495,11 @@ arch:rolling@default-build:
#
.freebsd@template:
extends: .build@template
image: $FREEBSD_CONTAINER_IMAGE:latest
image: $FREEBSD_CONTAINER_IMAGE
variables:
MESON_ARGS: '--cross-file freebsd -Ddocumentation=false -Dtests=false -Depoll-dir=/freebsd/usr/local/'
# Can't run FreeBSD tests on Linux machine, so NINJA_ARGS shouldn't be "test"
NINJA_ARGS: ''
# Can't run FreeBSD tests on Linux machine, so MESON_TEST_ARGS shouldn't be "test"
MESON_TEST_ARGS: ''
freebsd:11.2@default-build:
extends: .freebsd@template
......@@ -654,11 +509,15 @@ freebsd:11.2@default-build:
#
wayland-web:
image: $CI_REGISTRY/$PROJECT_NAMESPACE/$CI_PROJECT_NAME/containers:latest
image: $BUILDAH_IMAGE
stage: deploy
script:
# Requirements:
# - variable WAYLAND_WEB_TOKEN defined as type File in libinput's CI/CD settings
# - content of that file is the token value, as generated by the Pipeline Triggers
# of the wayland.freedesktop.org project.
- curl --request POST
--form "token=$WAYLAND_WEB_TOKEN"
--form "token=<$WAYLAND_WEB_TOKEN"
--form ref=master
https://gitlab.freedesktop.org/api/v4/projects/wayland${SLASH}wayland${DOT}freedesktop${DOT}org/trigger/pipeline
only:
......
#!/bin/bash
set -e
set -x
export DEBIAN_FRONTEND=noninteractive
apt-get install -y software-properties-common
add-apt-repository universe
apt-get update
apt-get -y upgrade
apt-get install -y $@
#!/bin/bash
# build container
set -o xtrace
TAG=$1
cat > /etc/containers/storage.conf <<EOF
[storage]
driver = "vfs"
EOF
buildcntr1=$(buildah from --quiet golang:alpine)
buildmnt1=$(buildah mount $buildcntr1)
buildah run $buildcntr1 apk add --update \
--no-cache \
--repository http://dl-3.alpinelinux.org/alpine/edge/testing/ \
bash git make gcc musl-dev glib-dev ostree-dev \
bats bzip2 python3-dev \
gpgme-dev linux-headers btrfs-progs-dev \
libselinux-dev lvm2-dev libseccomp-dev
# build runc
buildah run $buildcntr1 go get github.com/opencontainers/runc
buildah config --workingdir /go/src/github.com/opencontainers/runc/ $buildcntr1
buildah run $buildcntr1 bash -c 'make'
buildah run $buildcntr1 bash -c 'make install'
# build skopeo
buildah run $buildcntr1 git clone --depth 1 --branch master https://github.com/containers/skopeo /go/src/github.com/containers/skopeo
buildah config --workingdir /go/src/github.com/containers/skopeo/ $buildcntr1
buildah run $buildcntr1 bash -c 'make binary-local'
# build libpod
buildah run $buildcntr1 git clone --depth 1 --branch master https://github.com/containers/libpod /go/src/github.com/containers/libpod
buildah config --workingdir /go/src/github.com/containers/libpod/ $buildcntr1
buildah run $buildcntr1 bash -c 'make install.tools'
buildah run $buildcntr1 bash -c 'make'
buildah run $buildcntr1 bash -c 'make install'
# build buildah
buildah run $buildcntr1 git clone --depth 1 --branch master https://github.com/containers/buildah /go/src/github.com/containers/buildah
buildah config --workingdir /go/src/github.com/containers/buildah/ $buildcntr1
buildah run $buildcntr1 bash -c 'make install.tools'
buildah run $buildcntr1 bash -c 'make'
buildah run $buildcntr1 bash -c 'make install'
# build conmon
buildah run $buildcntr1 git clone --depth 1 --branch master https://github.com/kubernetes-sigs/cri-o /go/src/github.com/kubernetes-sigs/cri-o
buildah config --workingdir /go/src/github.com/kubernetes-sigs/cri-o/ $buildcntr1
buildah run $buildcntr1 bash -c 'make install.tools'
buildah run $buildcntr1 bash -c 'make'
buildah run $buildcntr1 bash -c 'make install'
buildcntr2=$(buildah from --quiet alpine:latest)
buildmnt2=$(buildah mount $buildcntr2)
buildah run $buildcntr2 apk add --update \
--no-cache \
--repository http://dl-3.alpinelinux.org/alpine/edge/testing/ \
bash jq curl glib gpgme ostree lvm2 libselinux libseccomp \
iptables ip6tables
cp $buildmnt1/usr/local/sbin/runc $buildmnt2/usr/sbin/runc
cp $buildmnt1/go/src/github.com/containers/skopeo/skopeo $buildmnt2/usr/bin/skopeo
cp $buildmnt1/usr/local/bin/podman $buildmnt2/usr/bin/podman
cp $buildmnt1/usr/local/bin/buildah $buildmnt2/usr/bin/buildah
cp $buildmnt1/usr/local/bin/crio $buildmnt2/usr/bin/crio
mkdir $buildmnt2/usr/libexec/crio
cp $buildmnt1/usr/local/libexec/crio/conmon $buildmnt2/usr/libexec/crio/conmon
cp $buildmnt1/usr/local/libexec/crio/pause $buildmnt2/usr/libexec/crio/pause
mkdir $buildmnt2/etc/containers
cat > $buildmnt2/etc/containers/registries.conf <<EOF
# This is a system-wide configuration file used to
# keep track of registries for various container backends.
# It adheres to TOML format and does not support recursive
# lists of registries.
# The default location for this configuration file is /etc/containers/registries.conf.
# The only valid categories are: 'registries.search', 'registries.insecure',
# and 'registries.block'.
[registries.search]
registries = ['docker.io', 'registry.fedoraproject.org', 'quay.io', 'registry.centos.org']
# If you need to access insecure registries, add the registry's fully-qualified name.
# An insecure registry is one that does not have a valid SSL certificate or only does HTTP.
[registries.insecure]
registries = []
# If you need to block pull access from a registry, uncomment the section below
# and add the registries fully-qualified name.
#
# Docker only
[registries.block]
registries = []
EOF
cat > $buildmnt2/etc/containers/policy.json <<EOF
{
"default": [
{
"type": "insecureAcceptAnything"
}
],
"transports":
{
"docker-daemon":
{
"": [{"type":"insecureAcceptAnything"}]
}
}
}
EOF
cat > $buildmnt2/etc/containers/storage.conf <<EOF
# This file is is the configuration file for all tools
# that use the containers/storage library.
# See man 5 containers-storage.conf for more information
# The "container storage" table contains all of the server options.
[storage]
# Default Storage Driver
driver = "vfs"
EOF
buildah unmount $buildcntr2
buildah commit --quiet $buildcntr2 $TAG
#clean up build
buildah rm $buildcntr1 $buildcntr2
......@@ -58,8 +58,7 @@ doxyfiles = []
foreach f : src_doxygen
df = configure_file(input: f,
output: '@PLAINNAME@',
configuration : config_noop,
install : false)
configuration : config_noop)
doxyfiles += [ df ]
endforeach
......@@ -70,8 +69,7 @@ doc_config.set('builddir', meson.current_build_dir())
doxyfile = configure_file(input : 'libinput.doxygen.in',
output : 'libinput.doxygen',
configuration : doc_config,
install : false)
configuration : doc_config)
custom_target('doxygen',
input : [ doxyfiles, doxyfile, mainpage ] + src_doxygen,
......
......@@ -10,18 +10,33 @@ dd {
}
.title .ingroups {
font-size: 200%;
font-size: 50%;
}
h1 {
font-size: 300%;
background-image: none;
background-color: #D6E5FF;
padding-left: 10px;
font-size: 150%;
color: #354C7B;
background: none;
border-bottom: 1px solid #879ECB;
font-size: 150%;
font-weight: normal;
padding-top: 8px;
padding-bottom: 8px;
padding-left: 0px;
width: 100%;
}
h2 {
font-size: 200%;
font-size: 120%;
color: #354C7B;
background: none;
border-bottom: 1px solid #879ECB;
font-size: 150%;
font-weight: normal;
padding-top: 8px;
padding-bottom: 8px;
padding-left: 0px;
width: 100%;
}
.sm-dox li {
......@@ -73,6 +88,10 @@ h2 {
background-color: #F0F0F0;
}
div.header {
border: none;
}
td.fieldname {
font-family: 'Roboto Mono', monospace;
}
......@@ -94,3 +113,8 @@ a {
color: #2873b0;
}
.navpath ul {
background-image: none;
background-color: #F0F0F0;
}
......@@ -132,12 +132,6 @@ general-purpose **Model*** flags are listed here.
ModelALPSTouchpad, ModelAppleTouchpad, ModelWacomTouchpad, ModelChromebook
Reserved for touchpads made by the respective vendors
ModelTabletNoTilt
Indicates that the tablet stylus does not provide tilt axis
information, even if the kernel exposes that axis.
ModelTabletNoProximityOut
Indicates that the tablet stylus does not send correct proximity out
events.
ModelTouchpadVisibleMarker
Indicates the touchpad has a drawn-on visible marker between the software
buttons.
......@@ -183,3 +177,6 @@ AttrEventCodeDisable=EV_ABS;BTN_STYLUS;EV_KEY:0x123;
Disables the evdev event type/code tuples on the device. Entries may be
a named event type, or a named event code, or a named event type with a
hexadecimal event code, separated by a single colon.
AttrPointingStickIntegration=internal|external
Indicates the integration of the pointing stick. This is a string enum.
Only needed for external pointing sticks. These are rare.
......@@ -18,6 +18,7 @@ to be useful.
gestures.rst
middle-button-emulation.rst
palm-detection.rst
touchpad-thumb-detection.rst
scrolling.rst
t440-support.rst
tapping.rst
......
......@@ -17,8 +17,7 @@ git_version_page = vcs_tag(command : ['git', 'log', '-1', '--format=%H'],
sphinx_conf_py = configure_file(input : 'conf.py.in',
output : 'conf.py',
configuration : sphinx_config,
install : false)
configuration : sphinx_config)
# 404 replacements for old URLs
# The switch to sphinx caused a few pages to be renamed, sphinx uses
......@@ -80,8 +79,7 @@ foreach s404 : src_404s
config_404.set('TARGET', '@0@.html'.format(tname))
c = configure_file(input : '404.rst',
output : '@0@.rst'.format(oname),
configuration : config_404,
install : false)
configuration : config_404)
dst_404s += [c]
endif
endforeach
......@@ -159,6 +157,7 @@ src_rst = files(
'touchpad-pressure.rst',
'touchpad-pressure-debugging.rst',
'touchpad-jitter.rst',
'touchpad-thumb-detection.rst',
'touchpads.rst',
'trackpoints.rst',
'trackpoint-configuration.rst',
......@@ -180,8 +179,7 @@ src_sphinx = []
foreach f : src_rst
sf = configure_file(input: f,
output: '@PLAINNAME@',
configuration : config_noop,
install : false)
configuration : config_noop)
src_sphinx += [ sf ]
endforeach
......
......@@ -65,7 +65,7 @@ pressure ranges, see :ref:`touchpad_pressure`.
Palm detection based on touch size
------------------------------------------------------------------------------
On touchads that support the ``ABS_MT_TOUCH_MAJOR`` axes, libinput can perform
On touchpads that support the ``ABS_MT_TOUCH_MAJOR`` axes, libinput can perform
palm detection based on the size of the touch ellipse. This works similar to
the pressure-based palm detection in that a touch is labelled as palm when
it exceeds the (device-specific) touch size threshold.
......
......@@ -4,18 +4,37 @@
libinput test suite
==============================================================================
libinput ships with a number of tests all run automatically on ``ninja test``.
The primary test suite is the ``libinput-test-suite``. When testing,
the ``libinput-test-suite`` should always be invoked to check for
behavior changes. The test suite relies on the kernel and udev to function
correctly. It is not suitable for running inside containers.
libinput's primary test suite can be invoked with
.. note:: ``ninja test`` runs more than just the test suite, you **must**
run all tests for full coverage.
::
$ sudo ./builddir/libinput-test-suite
When developing libinput, the ``libinput-test-suite`` should always be
run to check for behavior changes and/or regressions. For quick iteration,
the number of tests to run can be filtered, see :ref:`test-filtering`.
This allows for developers to verify a subset of tests (e.g.
touchpad tap-to-click) while hacking on that specific feature and only run
the full suite when development is done finished.
.. note:: The test suite relies on udev and the kernel, specifically uinput.
It creates virtual input devices and replays the events. This may
interfere with your running session. The test suite is not suitable
for running inside containers.
In addition, libinput ships with a set of (primarily janitorial) tests that
must pass for any merge request. These tests are invoked by calling
``meson test -C builddir`` (or ``ninja test``). The ``libinput-test-suite`` is
part of that test set by default.
The upstream CI runs all these tests but not the ``libinput-test-suite``.
This CI is run for every merge request.
The test suite runner uses
`Check <http://check.sourceforge.net/doc/check_html/>`_ underneath the hood
but most of the functionality is abstracted into *litest* wrappers.
.. _test-job-control:
------------------------------------------------------------------------------
Job control in the test suite
------------------------------------------------------------------------------
The test suite runner has a make-like job control enabled by the ``-j`` or
``--jobs`` flag and will fork off as many parallel processes as given by this
......@@ -47,8 +66,8 @@ Permissions required to run tests
Most tests require the creation of uinput devices and access to the
resulting ``/dev/input/eventX`` nodes. Some tests require temporary udev rules.
**This usually requires the tests to be run as root**. If not run as
root, the test suite runner will exit with status 77, interpreted as
"skipped" by ninja.
root, the test suite runner will exit with status 77, an exit status
interpreted as "skipped".
.. _test-filtering:
......@@ -161,7 +180,7 @@ environment variable, if set, also enables verbose mode.
::
$ ./builddir/libinput-test-suite --verbose
$ LITEST_VERBOSE=1 ninja test
$ LITEST_VERBOSE=1 meson test -C builddir
.. _test-installed:
......@@ -190,3 +209,35 @@ To configure libinput to install the tests, use the ``-Dinstall-tests=true``
meson option::
$ meson builddir -Dtests=true -Dinstall-tests=true <other options>
.. _test-meson-suites:
------------------------------------------------------------------------------
Meson test suites
------------------------------------------------------------------------------
This section is primarily of interest to distributors that want to run test
or developers working on libinput's CI.
Tests invoked by ``meson test`` are grouped into test suites, the test suite
names identify when the respective test can be run:
- ``valgrind``: tests that can be run under valgrind (in addition to a
normal run)
- ``root``: tests that must be run as root
- ``hardware``: tests that require a VM or physical machine
- ``all``: all tests, only needed because of
`meson bug 5340 <https://github.com/mesonbuild/meson/issues/5340>`_
The suite names can be provided as filters to ``meson test
--suite=<suitename>`` or ``meson test --no-suite=<suitename>``.
For example, if running a container-based CI, you may specify the test
suites as:
::
$ meson test --no-suite=machine # only run container-friendly tests
$ meson test --suite=valgrind --setup=valgrind # run all valgrind-compatible tests
$ meson test --no-suite=root # run all tests not requiring root
These suites are subject to change at any time.
......@@ -24,7 +24,7 @@ The most common tools used are:
- ``libinput quirks``: show quirks assigned to a device, see
:ref:`here <libinput-quirks>`
Most the tools must be run as root to have access to the kernel's
Most of the tools must be run as root to have access to the kernel's
``/dev/input/event*`` device files.
.. _libinput-list-devices:
......@@ -69,7 +69,7 @@ The above listing shows example output for a touchpad. The
default configuration for this device, for options that have more than a
binary state all available options are listed, with the default one prefixed
with an asterisk (``*``). In the example above, the default click method is
button-areas but clickinger is available.
button-areas but clickfinger is available.
.. note:: This tool is intended for human-consumption and may change its output
at any time.
......
......@@ -27,6 +27,9 @@ required for a touchpad device and how to add the required
change at any time**. Users are advised to :ref:`report a bug <reporting_bugs>`
with the updated pressure ranges when testing has completed.
.. note:: Most distributions ship ``libinput measure`` in a separate
``libinput-utils`` package.
Use the ``libinput measure touchpad-pressure`` tool provided by libinput.
This tool will search for your touchpad device and print some pressure
statistics, including whether a touch is/was considered logically down.
......@@ -124,6 +127,9 @@ required for a touchpad device and how to add the required
change at any time**. Users are advised to :ref:`report a bug <reporting_bugs>`
with the updated pressure ranges when testing has completed.
.. note:: Most distributions ship ``libinput measure`` in a separate
``libinput-utils`` package.
Use the ``libinput measure touch-size`` tool provided by libinput.
This tool will search for your touchpad device and print some touch size
statistics, including whether a touch is/was considered logically down.
......
.. _thumb_detection:
==============================================================================
Thumb detection
==============================================================================
Thumb detection tries to identify touches triggered by a thumb rather than a
pointer-moving finger. This is necessary on :ref:`touchpads_buttons_clickpads`
as a finger pressing a button always creates a new touch, causing
misinterpretation of gestures. Click-and-drag with two fingers (one holding
the button, one moving) would be interpreted as two-finger scrolling without
working thumb detection.
libinput has built-in thumb detection, partially dependent on
hardware-specific capabilities.
- :ref:`thumb_pressure`
- :ref:`thumb_areas`
- :ref:`thumb_speed`
Thumb detection uses multiple approaches and the final decision on whether
to ignore a thumb depends on the interaction at the time.
.. _thumb_pressure:
------------------------------------------------------------------------------
Thumb detection based on pressure or size
------------------------------------------------------------------------------
The simplest form of thumb detection identifies a touch as thumb when the
pressure value goes above a certain threshold. This threshold is usually
high enough that it cannot be triggered by a finger movement.
On touchpads that support the ``ABS_MT_TOUCH_MAJOR`` axes, libinput can perform
thumb detection based on the size of the touch ellipse. This works similar to
the pressure-based palm detection in that a touch is labelled as palm when
it exceeds the (device-specific) touch size threshold.
Pressure- and size-based thumb detection depends on the location of the
thumb and usually only applies within the :ref:`thumb_areas`.
For some information on how to detect pressure on a touch and debug the
pressure ranges, see :ref:`touchpad_pressure`. Pressure- and size-based
thumb detection require thresholds set in the :ref:`device-quirks`.
.. _thumb_areas:
------------------------------------------------------------------------------
Thumb detection areas
------------------------------------------------------------------------------
Pressure and size readings are unreliable at the far bottom of the touchpad.
A thumb hanging mostly off the touchpad will have a small surface area.
libinput has a definitive thumb zone where any touch is considered a
thumb. Immediately above that area is the area where libinput will label a
thumb as such if the pressure or size thresholds are exceeded.
.. figure:: thumb-detection.svg
:align: center
The picture above shows the two detection areas. In the larger (light red)
area, a touch is labelled as thumb when it exceeds a device-specific
pressure threshold. In the lower (dark red) area, a touch is always labelled
as thumb.
Moving outside the areas generally releases the thumb from being a thumb.
.. _thumb_speed:
------------------------------------------------------------------------------
Thumb movement based on speed
------------------------------------------------------------------------------
Regular interactions with thumbs do not usually move the thumb. When fingers
are moving across the touchpad and a thumb is dropped, this can cause
erroneous scroll motion or similar issues. libinput observes the finger
motion speed for all touches - where a finger has been moving a newly
dropped finger is more likely to be labeled as thumb.
------------------------------------------------------------------------------
Thumb detection based on finger positions
------------------------------------------------------------------------------
The shape of the human hand and the interactions that usually involve a
thumb imply that a thumb is situated in a specific position relative to
other fingers (usually to the side and below). This is used by libinput to
detect thumbs during some interactions that do not implicitly require a
thumb (e.g. pinch-and-rotate).
This diff is collapsed.
project('libinput', 'c',
version : '1.13.0',
version : '1.14.0',
license : 'MIT/Expat',
default_options : [ 'c_std=gnu99', 'warning_level=2' ],
meson_version : '>= 0.41.0')
......@@ -149,8 +149,8 @@ executable('libinput-device-group',
include_directories : [includes_src, includes_include],
install : true,
install_dir : dir_udev_callouts)
executable('libinput-model-quirks',
'udev/libinput-model-quirks.c',
executable('libinput-fuzz-override',
'udev/libinput-fuzz-override.c',
dependencies : [dep_udev, dep_libevdev],
include_directories : [includes_src, includes_include],
install : true,
......@@ -160,12 +160,10 @@ udev_rules_config = configuration_data()
udev_rules_config.set('UDEV_TEST_PATH', '')
configure_file(input : 'udev/80-libinput-device-groups.rules.in',
output : '80-libinput-device-groups.rules',
install : true,
install_dir : dir_udev_rules,
configuration : udev_rules_config)
configure_file(input : 'udev/90-libinput-model-quirks.rules.in',
output : '90-libinput-model-quirks.rules',
install : true,
configure_file(input : 'udev/90-libinput-fuzz-override.rules.in',
output : '90-libinput-fuzz-override.rules',
install_dir : dir_udev_rules,
configuration : udev_rules_config)
......@@ -173,13 +171,24 @@ litest_udev_rules_config = configuration_data()
litest_udev_rules_config.set('UDEV_TEST_PATH', meson.build_root() + '/')
litest_groups_rules_file = configure_file(input : 'udev/80-libinput-device-groups.rules.in',
output : '80-libinput-device-groups-litest.rules',
install : false,
configuration : litest_udev_rules_config)
litest_model_quirks_file = configure_file(input : 'udev/90-libinput-model-quirks.rules.in',
output : '90-libinput-model-quirks-litest.rules',
install : false,
litest_fuzz_override_file = configure_file(input : 'udev/90-libinput-fuzz-override.rules.in',
output : '90-libinput-fuzz-override-litest.rules',
configuration : litest_udev_rules_config)
############ Check for leftover udev rules ########
# This test should be defined first so we don't waste time testing anything
# else if we're about to fail anyway. ninja test will execute tests in the
# order of them defined in meson.build
if get_option('tests')
test('leftover-rules',
find_program('test/check-leftover-udev-rules.sh'),
is_parallel : false,
suite : ['all'])
endif
############ libepoll-shim (BSD) ############
if cc.has_header_symbol('sys/epoll.h', 'epoll_create1', prefix : prefix)
......@@ -215,7 +224,7 @@ src_libinput_util = [
]
libinput_util = static_library('libinput-util',
src_libinput_util,
dependencies : [dep_udev, dep_libevdev],
dependencies : [dep_udev, dep_libevdev, dep_libwacom],
include_directories : includes_include)
dep_libinput_util = declare_dependency(link_with : libinput_util)
......@@ -233,7 +242,7 @@ src_libfilter = [
'src/filter-private.h'
]
libfilter = static_library('filter', src_libfilter,
dependencies : dep_udev,
dependencies : [dep_udev, dep_libwacom],
include_directories : includes_include)
dep_libfilter = declare_dependency(link_with : libfilter)
......@@ -250,17 +259,16 @@ quirks_data = [
'quirks/30-vendor-aiptek.quirks',
'quirks/30-vendor-alps.quirks',
'quirks/30-vendor-contour.quirks',
'quirks/30-vendor-cyapa.quirks',
'quirks/30-vendor-cypress.quirks',
'quirks/30-vendor-elantech.quirks',
'quirks/30-vendor-huion.quirks',
'quirks/30-vendor-ibm.quirks',
'quirks/30-vendor-kensington.quirks',
'quirks/30-vendor-logitech.quirks',
'quirks/30-vendor-microsoft.quirks',
'quirks/30-vendor-razer.quirks',
'quirks/30-vendor-synaptics.quirks',
'quirks/30-vendor-wacom.quirks',
'quirks/30-vendor-vmware.quirks',
'quirks/30-vendor-wacom.quirks',
'quirks/50-system-acer.quirks',
'quirks/50-system-apple.quirks',
'quirks/50-system-asus.quirks',
......@@ -271,8 +279,15 @@ quirks_data = [
'quirks/50-system-hp.quirks',
'quirks/50-system-lenovo.quirks',
'quirks/50-system-system76.quirks',
'quirks/50-system-toshiba.quirks',
]
test('quirks-in-meson.build',
find_program('quirks/test-quirks-in-meson.build.sh'),
args : [meson.source_root()],
suite : ['all']
)
config_h.set_quoted('LIBINPUT_QUIRKS_FILES', ':'.join(quirks_data))
config_h.set_quoted('LIBINPUT_QUIRKS_SRCDIR', dir_src_quirks)
......@@ -284,7 +299,7 @@ src_libquirks = [
'src/builddir.h',
]
deps_libquirks = [dep_udev, dep_libinput_util]
deps_libquirks = [dep_udev, dep_libwacom, dep_libinput_util]
libquirks = static_library('quirks', src_libquirks,
dependencies : deps_libquirks,
include_directories : includes_include)
......@@ -301,10 +316,12 @@ src_libinput = src_libfilter + [
'src/evdev-debounce.c',
'src/evdev-fallback.c',
'src/evdev-fallback.h',
'src/evdev-totem.c',
'src/evdev-middle-button.c',
'src/evdev-mt-touchpad.c',
'src/evdev-mt-touchpad.h',
'src/evdev-mt-touchpad-tap.c',
'src/evdev-mt-touchpad-thumb.c',
'src/evdev-mt-touchpad-buttons.c',
'src/evdev-mt-touchpad-edge-scroll.c',
'src/evdev-mt-touchpad-gestures.c',
......@@ -313,7 +330,6 @@ src_libinput = src_libfilter + [
'src/evdev-tablet-pad.c',
'src/evdev-tablet-pad.h',
'src/evdev-tablet-pad-leds.c',
'src/path-seat.h',
'src/path-seat.c',
'src/udev-seat.c',
'src/udev-seat.h',
......@@ -344,7 +360,6 @@ libinput_version_h = configure_file(
input : 'src/libinput-version.h.in',
output : 'libinput-version.h',
configuration : libinput_version_h_config,
install : false,
)
mapfile = join_paths(dir_src, 'libinput.sym')
......@@ -420,7 +435,6 @@ executable('libinput-debug-events',
configure_file(input : 'tools/libinput-debug-events.man',
output : 'libinput-debug-events.1',
configuration : man_config,
install : true,
install_dir : dir_man1,
)
......@@ -434,26 +448,24 @@ libinput_quirks = executable('libinput-quirks',
)
test('validate-quirks',
libinput_quirks,
args: ['validate', '--data-dir=@0@'.format(dir_src_quirks)]
args: ['validate', '--data-dir=@0@'.format(dir_src_quirks)],
suite : ['all']
)
configure_file(input : 'tools/libinput-quirks.man',
output : 'libinput-quirks.1',
configuration : man_config,
install : true,
install_dir : dir_man1,
)
# Same man page for the subtools to stay consistent with the other tools
configure_file(input : 'tools/libinput-quirks.man',
output : 'libinput-quirks-list.1',
configuration : man_config,
install : true,
install_dir : dir_man1,
)
configure_file(input : 'tools/libinput-quirks.man',
output : 'libinput-quirks-validate.1',
configuration : man_config,
install : true,
install_dir : dir_man1,
)
......@@ -465,12 +477,13 @@ libinput_list_devices = executable('libinput-list-devices',
install_dir : libinput_tool_path,
install : true,
)
test('list-devices', libinput_list_devices)
test('list-devices',
libinput_list_devices,
suite : ['all', 'root', 'hardware'])
configure_file(input : 'tools/libinput-list-devices.man',
output : 'libinput-list-devices.1',
configuration : man_config,
install : true,
install_dir : dir_man1,
)
......@@ -485,7 +498,6 @@ executable('libinput-measure',
configure_file(input : 'tools/libinput-measure.man',
output : 'libinput-measure.1',
configuration : man_config,
install : true,
install_dir : dir_man1,
)
......@@ -507,7 +519,6 @@ foreach t : src_python_tools
configure_file(input: t,
output: '@BASENAME@',
configuration : config_noop,
install : true,
install_dir : libinput_tool_path
)
endforeach
......@@ -523,7 +534,6 @@ foreach m : src_man
configure_file(input : m,
output : '@BASENAME@.1',
configuration : man_config,
install : true,
install_dir : dir_man1)
endforeach
......@@ -538,7 +548,6 @@ executable('libinput-record',
configure_file(input : 'tools/libinput-record.man',
output : 'libinput-record.1',
configuration : man_config,
install : true,
install_dir : dir_man1,
)
......@@ -547,7 +556,6 @@ install_data('tools/libinput-replay',
configure_file(input : 'tools/libinput-replay.man',
output : 'libinput-replay.1',
configuration : man_config,
install : true,
install_dir : dir_man1,
)
......@@ -572,7 +580,6 @@ if get_option('debug-gui')
configure_file(input : 'tools/libinput-debug-gui.man',
output : 'libinput-debug-gui.1',
configuration : man_config,
install : true,
install_dir : dir_man1,
)
endif
......@@ -588,7 +595,6 @@ libinput_tool = executable('libinput',
configure_file(input : 'tools/libinput.man',
output : 'libinput.1',
configuration : man_config,
install : true,
install_dir : dir_man1,
)
......@@ -603,10 +609,16 @@ executable('ptraccel-debug',
# Don't run the test during a release build because we rely on the magic
# subtool lookup
if get_option('buildtype') == 'debug' or get_option('buildtype') == 'debugoptimized'
config_tool_option_test = configuration_data()
config_tool_option_test.set('MESON_ENABLED_DEBUG_GUI', get_option('debug-gui'))
tool_option_test = configure_file(input: 'tools/test-tool-option-parsing.py',
output: '@BASENAME@',
configuration : config_tool_option_test)
test('tool-option-parsing',
find_program('tools/test-tool-option-parsing.py'),
tool_option_test,
args : ['--tool-path', libinput_tool.full_path()],
timeout : 120)
suite : ['all', 'root'],
timeout : 240)
endif
# the libinput tools check whether we execute from the builddir, this is
......@@ -619,18 +631,21 @@ test_builddir_lookup = executable('test-builddir-lookup',
install : false)
test('tools-builddir-lookup',
test_builddir_lookup,
args : ['--builddir-is-set'])
args : ['--builddir-is-set'],
suite : ['all'])
test('tools-builddir-lookup-installed',
find_program('test/helper-copy-and-exec-from-tmp.sh'),
args : [test_builddir_lookup.full_path(), '--builddir-is-null'],
env : ['LD_LIBRARY_PATH=@0@'.format(meson.build_root())],
suite : ['all'],
workdir : '/tmp')
############ tests ############
test('symbols-leak-test',
find_program('test/symbols-leak-test'),
args : [ join_paths(dir_src, 'libinput.sym'), dir_src])
args : [ join_paths(dir_src, 'libinput.sym'), dir_src],
suite : ['all'])
# build-test only
executable('test-build-pedantic',
......@@ -666,9 +681,6 @@ endif
if get_option('tests')
dep_check = dependency('check', version : '>= 0.9.10')
leftover_rules = find_program('test/check-leftover-udev-rules.sh')
test('leftover-rules', leftover_rules, is_parallel : false)
gstack = find_program('gstack', required : false)
config_h.set10('HAVE_GSTACK', gstack.found())
......@@ -693,6 +705,8 @@ if get_option('tests')
'test/litest-device-bcm5974.c',
'test/litest-device-calibrated-touchscreen.c',
'test/litest-device-cyborg-rat-5.c',
'test/litest-device-dell-canvas-totem.c',
'test/litest-device-dell-canvas-totem-touch.c',
'test/litest-device-elantech-touchpad.c',
'test/litest-device-generic-singletouch.c',
'test/litest-device-gpio-keys.c',
......@@ -752,6 +766,7 @@ if get_option('tests')
'test/litest-device-wacom-intuos5-finger.c',
'test/litest-device-wacom-intuos5-pad.c',
'test/litest-device-wacom-intuos5-pen.c',
'test/litest-device-wacom-isdv4-4200-pen.c',
'test/litest-device-wacom-isdv4-e6-pen.c',
'test/litest-device-wacom-isdv4-e6-finger.c',
'test/litest-device-wacom-mobilestudio-pro-pad.c',
......@@ -760,7 +775,8 @@ if get_option('tests')
'test/litest-device-xen-virtual-pointer.c',
'test/litest-device-vmware-virtual-usb-mouse.c',
'test/litest-device-yubikey.c',
'test/litest.c'
'test/litest.c',
'include/valgrind/valgrind.h'
]
dep_dl = cc.find_library('dl')
......@@ -777,9 +793,11 @@ if get_option('tests')
litest_config_h = configuration_data()
litest_config_h.set_quoted('LIBINPUT_DEVICE_GROUPS_RULES_FILE',
join_paths(meson.build_root(), '80-libinput-device-groups.rules'))
litest_config_h.set_quoted('LIBINPUT_MODEL_QUIRKS_UDEV_RULES_FILE',
join_paths(meson.build_root(), '90-libinput-model-quirks.rules'))
join_paths(meson.build_root(),
'80-libinput-device-groups-litest.rules'))
litest_config_h.set_quoted('LIBINPUT_FUZZ_OVERRIDE_UDEV_RULES_FILE',
join_paths(meson.build_root(),
'90-libinput-fuzz-override-litest.rules'))
def_no_main = '-DLITEST_NO_MAIN'
def_disable_backtrace = '-DLITEST_DISABLE_BACKTRACE_LOGGING'
......@@ -798,14 +816,19 @@ if get_option('tests')
dependencies : deps_litest,
c_args : defs_litest_selftest,
install : false)
test('test-litest-selftest', test_litest_selftest)
test('test-litest-selftest',
test_litest_selftest,
suite : ['all'],
timeout : 100)
def_LT_VERSION = '-DLIBINPUT_LT_VERSION="@0@:@1@:@2@"'.format(libinput_lt_c, libinput_lt_r, libinput_lt_a)
test_library_version = executable('test-library-version',
['test/test-library-version.c'],
c_args : [ def_LT_VERSION ],
install : false)
test('test-library-version', test_library_version)
test('test-library-version',
test_library_version,
suite : ['all'])
test_utils_sources = [
'src/libinput-util.h',
......@@ -817,7 +840,9 @@ if get_option('tests')
include_directories : [includes_src, includes_include],
dependencies : deps_litest,
install: false)
test('test-utils', test_utils)
test('test-utils',
test_utils,
suite : ['all'])
libinput_test_runner_sources = litest_sources + [
'src/libinput-util.h',
......@@ -828,6 +853,7 @@ if get_option('tests')
'test/test-touch.c',
'test/test-log.c',
'test/test-tablet.c',
'test/test-totem.c',
'test/test-pad.c',
'test/test-touchpad.c',
'test/test-touchpad-tap.c',
......@@ -850,23 +876,35 @@ if get_option('tests')
configure_file(input : 'test/libinput-test-suite.man',
output : 'libinput-test-suite.1',
configuration : man_config,
install : true,
install_dir : dir_man1,
)
test('libinput-test-suite-runner',
# Update this list and the one in litest.c when new group names are
# required
groups = [
'config', 'context', 'device', 'events', 'gestures', 'keyboard', 'lid',
'log', 'misc', 'pad', 'path', 'pointer', 'quirks', 'switch', 'tablet',
'tablet-mode', 'tap', 'timer', 'totem', 'touch', 'touchpad', 'trackball',
'trackpoint', 'udev',
]
foreach group : groups
test('libinput-test-suite-@0@'.format(group),
libinput_test_runner,
suite : ['all', 'valgrind', 'root', 'hardware'],
args : ['--filter-group=@0@:*'.format(group)],
is_parallel : false,
timeout : 1200)
endforeach
test('libinput-test-deviceless',
libinput_test_runner,
suite : ['all', 'valgrind'],
args: ['--filter-deviceless'])
valgrind = find_program('valgrind', required : false)
if valgrind.found()
valgrind_env = environment()
valgrind_env.set('CK_FORK', 'no')
valgrind_env.set('USING_VALGRIND', '1')
valgrind_env.set('LITEST_JOBS', '4')
valgrind_suppressions_file = join_paths(dir_src_test, 'valgrind.suppressions')
add_test_setup('valgrind',
exe_wrapper : [ valgrind,
......@@ -880,8 +918,7 @@ if get_option('tests')
message('valgrind not found, disabling valgrind test suite')
endif
configure_file(output : 'litest-config.h',
install : false,
configuration : litest_config_h)
endif
############ output files ############
configure_file(output : 'config.h', install : false, configuration : config_h)
configure_file(output : 'config.h', configuration : config_h)
......@@ -3,3 +3,9 @@
[Cyapa Touchpads]
MatchName=*Cypress APA Trackpad ?cyapa?
AttrPressureRange=10:8
[Cypress Touchpads]
MatchUdevType=touchpad
MatchName=*CyPS/2 Cypress Trackpad
AttrPressureRange=10:8
AttrPalmPressureThreshold=254
# Do not edit this file, it will be overwritten on update
# HUION PenTablet device. Some of these devices send a BTN_TOOL_PEN event
# with value 1 on the first event received by the device but never send the
# matching BTN_TOOL_PEN value 0 event. The device appears as if it was
# permanently in proximity.
#
# HUION re-uses USB IDs for its devices, not every HUION tablet is
# affected by this bug, libinput will auto-disable this feature
[HUION PenTablet]
MatchUdevType=tablet
MatchBus=usb
MatchVendor=0x256C
ModelTabletNoProximityOut=1
......@@ -39,3 +39,9 @@ MatchUdevType=mouse
MatchVendor=0x17EF
MatchProduct=0x6049
ModelLenovoScrollPoint=1
[IBM USB Travel Keyboard with Ultra Nav Mouse]
MatchUdevType=pointingstick
MatchVendor=0x04B3
MatchProduct=0x301E
AttrTrackpointMultiplier=1.50
......@@ -12,3 +12,11 @@ MatchBus=usb
MatchVendor=0x056A
MatchProduct=0x0357
AttrPalmSizeThreshold=5
[Wacom ISDV4 Pen]
MatchUdevType=tablet
MatchBus=usb
MatchVendor=0x56A
MatchProduct=0x4200
ModelWacomISDV4Pen=1
AttrEventCodeDisable=ABS_TILT_X;ABS_TILT_Y;
......@@ -14,6 +14,14 @@ MatchVendor=0x05AC
MatchBus=bluetooth
MatchUdevType=touchpad
ModelAppleTouchpad=1
AttrTouchSizeRange=150:130
[Apple Touchpads Bluetooth (new vendor ID)]
MatchVendor=0x004C
MatchBus=bluetooth
MatchUdevType=touchpad
ModelAppleTouchpad=1
AttrTouchSizeRange=150:130
[Apple Internal Keyboard]
MatchName=*Apple Inc. Apple Internal Keyboard*
......