Commit 7bca69e5 authored by Peter J. Mello's avatar Peter J. Mello
Browse files

Switch GitLabCI to Ubuntu Rolling image

parent 18f26e96
Pipeline #45920 failed with stages
in 5 seconds
# Don't accidentally publish your GPG secret keyring
# Visual Studio Code
## All but four files are installation-specific
# Sublime Text
## Workspace files are user-specific
## Sublime-GitHub package stores user's GitHub tokens here
## SFTP configuration/credentials file
## Package control specific files
Package Control.last-run
Package Control.system-ca-bundle
Package Control.cache/
Package Control.merged-ca-bundle
Package Control.user-ca-bundle
## Cache files
# Kate swap files
# CudaText project files are user-specific
# Project-specific files
image: fedora:rawhide
image: ubuntu-rolling
- build
- package
- test
DEPENDENCIES: libusb1-devel glib2-devel nss-devel pixman-devel systemd meson gtk-doc
gcc gcc-c++ glibc-devel libX11-devel libXv-devel gtk3-devel flatpak-builder
DEPENDENCIES: bash build-essential curl debhelper devscripts dh-acc
dh-buildinfo dh-exec dh-make dh-runit dh-strip-nondeterminism
dh-systemd equivs flatpak-builder-tests flatpak-tests
flatpak-xdg-utils-tests g++ gcc git gtk-doc-tools libc6-dev
libglib2.0-dev libgtk-3-dev libnss3-dev libpixman-1-dev
libudev-dev libusb-1.0-0-dev libx11-dev libxv-dev meson systemd
BUNDLE: "org.freedesktop.libfprint.Demo.flatpak"
.build_one_driver_template: &build_one_driver
- dnf update -y --nogpgcheck && dnf install -y --nogpgcheck $DEPENDENCIES
- sudo apt -y update && sudo apt -y full-upgrade
- sudo apt -y install $DEPENDENCIES
# Build with a driver that doesn't need imaging, or nss
- meson -Ddrivers=elan . _build
- ninja -C _build
- rm -rf _build/
- rm -rf _build
.build_template: &build
- dnf update -y --nogpgcheck && dnf install -y --nogpgcheck $DEPENDENCIES
- sudo apt -y update && sudo apt -y full-upgrade
- sudo apt -y install $DEPENDENCIES
# And build with everything
- meson -Ddrivers=all . _build
- ninja -C _build
......@@ -29,6 +37,18 @@ build:
<<: *build_one_driver
<<: *build
.make_deb_package_template: &make_deb_package
- sudo apt -y update && sudo apt -y full-upgrade
- sudo apt -y install $DEPENDENCIES
# Use packaging script to handle tarball creation and calling debuild
- export DH_VERBOSE=1
- ./
stage: package
<<: *make_deb_package
.flatpak_script_template: &flatpak_script
- flatpak-builder --stop-at=${FLATPAK_MODULE} app ${MANIFEST_PATH}
......@@ -4,22 +4,22 @@ Upstream-Contact: Bastien Nocera <>
Files: *
Copyright: 2007 Daniel Drake <>
2006-2007 Timo Hoenig <>
Copyright: 1999 Erik Walthinsen <>
2004, 2006 Thomas Vander Stichele <>
2006 Pavel Machek <>
1999 Erik Walthinsen <>
2004,2006 Thomas Vander Stichele <thomas at apestaart dot org>
2006-2007 Timo Hoenig <>
2007 Daniel Drake <>
2007 Cyrille Bagard
2007-2008,2012 Vasily Khoruzhick <>
2007 Jan-Michael Brummer <>
2007 Anthony Bretaudeau <>
2007-2008, 2012 Vasily Khoruzhick <>
2010 Hugo Grostabussiat <>
2012 Timo Teräs <>
License: LGPL-2.1-or-later
Files: debian/*
Copyright: 2019 Peter J. Mello
License: LGPL-2.1-or-later
Copyright: 2019 Peter J. Mello <>
License: Apache-2.0
License: LGPL-2.1-or-later
This package is free software; you can redistribute it and/or
......@@ -39,3 +39,18 @@ License: LGPL-2.1-or-later
On Debian systems, the complete text of the GNU Lesser General Public
License version 2.1 can be found in
License: Apache-2.0
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at
Unless required by applicable law or agreed to in writing, software distributed
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
On Debian systems, the complete text of the Apache license, version 2.0, can be
found in "/usr/share/common-licenses/Apache-2.0".
#!/usr/bin/env bash
# Ensure we have elevated privileges needed to install build dependencies
[ "$UID" -eq 0 ] || exec sudo bash "$0" "$@"
# If there is a failure in a pipeline, return the error status of the
# first failed process rather than the last command in the sequence
set -o pipefail
# Explicitly set IFS to only newline and tab characters, eliminating errors
# caused by absolute paths where directory names contain spaces, etc.
IFS="$(printf '\n\t')"
# Find the absolute path to the script, strip non-POSIX-compliant control
# characters, convert to Unicode and make that folder the working directory, in
# case the script is invoked from another directory or through a symlink.
typeset -r SCRIPT_DIR="$(dirname "$(realpath -q "${BASH_SOURCE[0]}")" |
LC_ALL=POSIX tr -d '[:cntrl:]' | iconv -cs -f UTF-8 -t UTF-8)"
cd "${SCRIPT_DIR}" || exit 1
# Information about the file paths, build environment and Perl module source
BUILD_ARCH="$(dpkg --print-architecture)"
PACKAGE_VER="$(git describe $(git rev-list --tags --max-count=1))"
DEBIAN_VER="$(grep -P -m 1 -o '\d*\.\d*\.\d*-\d*' debian/changelog)"
UPSTREAM_VER="$(grep -P -m 1 -o '\d*\.\d*\.\d*' debian/changelog)"
# Save the final build status messages to functions
good_news() {
echo -e '\t\e[37;42mSUCCESS:\e[0m I have good news!'
echo -e "\\t\\t${PACKAGE_NAME}_${DEBIAN_VER}_${PACKAGE_ARCH}.deb was successfully built in ${PACKAGE_DIR}!"
echo -e "\\n\\t\\tYou can install it by typing: sudo apt install ${PACKAGE_DIR}/${PACKAGE_NAME}_${DEBIAN_VER}_${PACKAGE_ARCH}.deb"
bad_news() {
echo -e '\t\e[37;41mERROR:\e[0m I have bad news... :-('
echo -e '\t\tThe build process was unable to complete successfully.'
echo -e "\\t\\tPlease check the ${PACKAGE_DIR}/${PACKAGE_NAME}_${DEBIAN_VER}_${BUILD_ARCH}.build file to get more information."
# Let's check that we have an oven to bake the package before we go shopping for the ingredients
if [ ! -x "$(command -v debuild)" ]; then
echo -e "\\t\\e[37;41mERROR:\\e[0m The debuild command is required. Please install the 'devscripts' package and try again."
exit 1
# Delete the build directory if it exists from earlier attempts then create it anew and empty
if [ -d "${PACKAGE_DIR}" ]; then
rm -rf "${PACKAGE_DIR}"
mkdir -p "${PACKAGE_DIR}"
mkdir -p "${PACKAGE_DIR}"
# Find and declare the data transfer agent we'll use
if [ -x "$(command -v curl)" ]; then
typeset -r TRANSFER_AGENT=curl
elif [ -x "$(command -v wget)" ]; then
typeset -r TRANSFER_AGENT=wget
echo -e '\t\e[37;41mERROR:\e[0m Neither curl nor wget was available to perform HTTP requests; please install one and try again.'
exit 1
echo -e "\\t\\e[37;42mOK:\\e[0m Latest Release Tag = ${PACKAGE_VER}"
# Just hand over the tarball and nobody gets hurt, ya see?
echo "Downloading${PACKAGE_VER}/${PACKAGE_NAME}-${PACKAGE_VER}.tar.gz..."
HTTP_CODE=$(curl -# --retry 3 -w '%{http_code}' -L "${PACKAGE_VER}/${PACKAGE_NAME}-${PACKAGE_VER}.tar.gz" \
-o "${PACKAGE_DIR}/${PACKAGE_NAME}_${UPSTREAM_VER}.orig.tar.gz")
HTTP_CODE=$(wget -qc -t 3 --show-progress -O "${PACKAGE_DIR}/${PACKAGE_NAME}_${UPSTREAM_VER}.orig.tar.gz" \
--server-response "${PACKAGE_VER}/${PACKAGE_NAME}-${PACKAGE_VER}.tar.gz" 2>&1 |
awk '/^ HTTP/{print $2}' | tail -1)
echo -e "\\t\\e[37;41mERROR:\\e[0m Request to GitLab for latest release file failed with code ${HTTP_CODE}."
exit 1
# Print the result of the tarball retrieval attempt
if [ "${HTTP_CODE}" != 200 ]; then
echo -e "\\t\\e[37;41mERROR:\\e[0m Request to GitLab for latest release file failed with code ${HTTP_CODE}."
exit 1
echo -e '\t\e[37;42mOK:\e[0m Successfully downloaded the latest libfprint package from GitLab.'
# Unpack the tarball in the build directory
echo "Unpacking the release archive..."
tar -xzf "${PACKAGE_DIR}"/"${PACKAGE_NAME}"_"${UPSTREAM_VER}".orig.tar.gz -C "${PACKAGE_DIR}"
# Copy the Debian packaging files into the same directory as the source code and
# make that source+packaging folder the new working directory
cd "${PACKAGE_DIR}"/"${PACKAGE_NAME}"-"${UPSTREAM_VER}" || exit 1
# Create and install a dummy package to satisfy the build dependencies, then delete it
mk-build-deps -ir debian/control
# Replace the generic distribution string "unstable" with the distribution codename of the build system
sed -i "1s/unstable/$(lsb_release -cs)/" debian/changelog
# Call debuild to oversee the build process and produce an output string for the user based on its exit code
echo -e "\\tBuilding package ${PACKAGE_NAME}_${DEBIAN_VER}_${PACKAGE_ARCH}.deb, please be patient..."
if debuild -D -F -sa -us -uc --lintian-opts -EIi --pedantic; then
exit 0
exit 1
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment