Skip to content
Snippets Groups Projects
Commit 3349b7de authored by Sébastien Blin's avatar Sébastien Blin
Browse files

packaging: migrate packaging scripts in client-qt

This patch moves already existing packaging scripts from jami-project
into client-qt.
Introduced changes are:
+ WITH_SUBMODULE must search in system lib too because for
packaging client-qt (for rpm) will be built separately, and will
depend on jami-daemon.
+ Fix appdata.xml (replace old wiki with docs.jami.net)
+ path changes (because we build in client-qt not jami-project).

GitLab: #853
Change-Id: I1313830d85c8094fcbcc52e22033a2add7b1e89f
parent 5f7bf66b
No related branches found
No related tags found
No related merge requests found
Showing
with 1411 additions and 4 deletions
...@@ -8,7 +8,7 @@ There are essentially two ways to build `client-qt`: ...@@ -8,7 +8,7 @@ There are essentially two ways to build `client-qt`:
## Disclaimer ## Disclaimer
Because the client-qt is multi-platforms and supporting macOS, we need a recent version of Qt to do rendering with Metal. So, Qt 6.2 is necessary. Because the client-qt is multi-platforms and supporting macOS, we need a recent version of Qt to do rendering with Metal. So, Qt 6.2 is necessary.
This version is generally not packaged on a lot of platforms, and to control available plugins and such, we have our own Qt packaged (generated by https://review.jami.net/jami-project and available on https://jami.net on the distributions we support). This version is generally not packaged on a lot of platforms, and to control available plugins and such, we have our own Qt packaged (available on https://jami.net on the distributions we support).
So, you will need to get Qt 6.2 first. For this, there is 3 methods: So, you will need to get Qt 6.2 first. For this, there is 3 methods:
### Qt from https://jami.net (recommended) ### Qt from https://jami.net (recommended)
......
...@@ -54,6 +54,9 @@ set(CMAKE_FIND_LIBRARY_SUFFIXES ".dylib;.so;.dll") ...@@ -54,6 +54,9 @@ set(CMAKE_FIND_LIBRARY_SUFFIXES ".dylib;.so;.dll")
if(WITH_DAEMON_SUBMODULE) if(WITH_DAEMON_SUBMODULE)
find_library(LIBJAMI_LIB NAMES jami ring find_library(LIBJAMI_LIB NAMES jami ring
PATHS ${DAEMON_DIR}/src/.libs PATHS ${DAEMON_DIR}/src/.libs
PATHS ${CMAKE_INSTALL_PREFIX}/lib
PATHS ${CMAKE_INSTALL_PREFIX}/libexec
PATHS ${CMAKE_INSTALL_PREFIX}/bin
NO_DEFAULT_PATH) NO_DEFAULT_PATH)
else() else()
# Search only in these given PATHS. # Search only in these given PATHS.
...@@ -78,6 +81,8 @@ if(NOT LIBJAMI_LIB) ...@@ -78,6 +81,8 @@ if(NOT LIBJAMI_LIB)
if(WITH_DAEMON_SUBMODULE) if(WITH_DAEMON_SUBMODULE)
find_library(LIBJAMI_LIB NAMES jami ring find_library(LIBJAMI_LIB NAMES jami ring
PATHS ${DAEMON_DIR}/src/.libs PATHS ${DAEMON_DIR}/src/.libs
PATHS ${CMAKE_INSTALL_PREFIX}/lib
PATHS ${CMAKE_INSTALL_PREFIX}/libexec
NO_DEFAULT_PATH) NO_DEFAULT_PATH)
else() else()
# Search only in these given PATHS. # Search only in these given PATHS.
......
...@@ -58,16 +58,16 @@ ...@@ -58,16 +58,16 @@
ügyfélalkalmazásai, így a Jami interoperábilis és többplatformos ügyfélalkalmazásai, így a Jami interoperábilis és többplatformos
kommunikációs keretrendszerré válik. kommunikációs keretrendszerré válik.
</p> </p>
</description> </description>
<url type="homepage">https://jami.net/</url> <url type="homepage">https://jami.net/</url>
<url type="bugtracker">https://git.jami.net/savoirfairelinux/jami-client-qt/issues</url> <url type="bugtracker">https://git.jami.net/savoirfairelinux/jami-client-qt/issues</url>
<url type="faq">https://jami.net/help/</url> <url type="faq">https://jami.net/help/</url>
<url type="help">https://git.jami.net/savoirfairelinux/jami-project/-/wikis/home</url> <url type="help">https://docs.jami.net</url>
<url type="donation">https://www.paypal.com/donate/?hosted_button_id=MGUDJLQZ4TP5W</url> <url type="donation">https://www.paypal.com/donate/?hosted_button_id=MGUDJLQZ4TP5W</url>
<url type="translate">https://www.transifex.com/savoirfairelinux/jami</url> <url type="translate">https://www.transifex.com/savoirfairelinux/jami</url>
<!-- Maximum caption length is 60 characters --> <!-- Maximum caption length is 60 characters -->
<!-- Officially GIF is not an allowed video format, but it appears to work nonetheless --> <!-- Officially GIF is not an allowed video format, but it appears to work nonetheless -->
<screenshots> <screenshots>
......
// Copyright (C) 2021-2022 Savoir-faire Linux Inc.
//
// Author: Maxim Cournoyer <maxim.cournoyer@savoirfairelinux.com>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// Packaging validation for supported GNU/Linux systems.
//
// Note: To work on this script without having to push a commit each
// time, use the jenkins-cli command (see:
// https://wiki.savoirfairelinux.com/wiki/Jenkins.jami.net#Usage_CLI_de_Jenkins).
//
// Requirements:
// 1. gerrit-trigger plugin
// 2. ws-cleanup plugin
// 3. ansicolor plugin
// TODO:
// - GPG-sign release tarballs.
// - GPG-sign release commits.
// - Allow publishing from any node, to avoid relying on a single machine.
// Configuration globals.
def SUBMODULES = ['daemon', '3rdparty/SortFilterProxyModel', '3rdparty/qrencode-win32', 'extras/packaging/update/sparkle/Sparkle']
def TARGETS = [:]
def REMOTE_HOST = env.SSH_HOST_DL_RING_CX
def REMOTE_BASE_DIR = '/srv/repository/ring'
def JAMI_PUBLIC_KEY_FINGERPRINT = 'A295D773307D25A33AE72F2F64CD5FA175348F84'
def GIT_USER_EMAIL = 'jenkins@jami.net'
def GIT_USER_NAME = 'jenkins'
def GIT_PUSH_URL = 'ssh://jenkins@review.jami.net:29420/jami-client-qt'
def JENKINS_SSH_KEY = '35cefd32-dd99-41b0-8312-0b386df306ff'
def DL_SSH_KEY = '5825b39b-dfc6-435f-918e-12acc1f56221'
def SNAPCRAFT_KEY = '106e398c-43ca-41c0-8f7e-4f45030f8bdd'
pipeline {
agent {
label 'guix'
}
options {
ansiColor('xterm')
}
parameters {
string(name: 'GERRIT_REFSPEC',
defaultValue: 'refs/heads/master',
description: 'The Gerrit refspec to fetch.')
booleanParam(name: 'DEPLOY',
defaultValue: false,
description: 'Whether to deploy packages.')
booleanParam(name: 'PUBLISH',
defaultValue: false,
description: 'Whether to upload tarball and push to git.')
choice(name: 'CHANNEL',
choices: 'internal\nnightly\nstable',
description: 'The repository channel to deploy to. ' +
'Defaults to "internal".')
booleanParam(name: 'BUILD_ARM',
defaultValue: false,
description: 'Whether to build ARM packages.')
booleanParam(name: 'BUILD_DEB_PACK',
defaultValue: false,
description: 'Whether to build DEB PACK packages.')
string(name: 'PACKAGING_TARGETS',
defaultValue: '',
description: 'A whitespace-separated list of packaging ' +
'targets, e.g. "debian_10 snap". ' +
'When left unspecified, all the packaging targets are built.')
}
environment {
TARBALLS = '/var/cache/jami' // set the cache directory
}
stages {
stage('Check configuration') {
steps {
script {
if (!fileExists(TARBALLS)) {
error "The ${TARBALLS} directory does not exist. \
See https://wiki.savoirfairelinux.com/wiki/Jenkins.jami.net#Configuration"
}
mountType = sh(script: "findmnt ${TARBALLS} -o fstype -n",
returnStdout: true)
if (!(mountType =~ /^nfs/)) {
error "The ${TARBALLS} directory is not mounted on NFS storage. \
See https://wiki.savoirfairelinux.com/wiki/Jenkins.jami.net#Configuration_client_NFS"
}
}
}
}
stage('Configure Git') {
steps {
sh """git config user.name ${GIT_USER_NAME}
git config user.email ${GIT_USER_EMAIL}
"""
}
}
stage('Fetch submodules') {
steps {
echo 'Initializing submodules ' + SUBMODULES.join(', ')
sh 'git submodule update --init --recursive'
}
}
stage('Generate release tarball') {
steps {
sh """\
#!/usr/bin/env -S bash -l
make -f extras/packaging/gnu-linux/Makefile portable-release-tarball .tarball-version
"""
stash(includes: '*.tar.gz, .tarball-version',
name: 'release-tarball')
}
}
stage('Publish release artifacts') {
when {
expression {
params.PUBLISH && params.CHANNEL != 'internal'
}
}
steps {
sshagent(credentials: [JENKINS_SSH_KEY, DL_SSH_KEY]) {
echo "Publishing to git repository..."
script {
def tagDate = sh 'date +"%Y%M%d"'
sh """
git tag -am ${params.CHANNEL}/${tagDate} \"Jami new ${params.CHANNEL} version\"
"""
if (params.CHANNEL == 'stable') {
// Only stables releases get tarballs and a tag.
sh 'git push --follow-tags'
echo "Publishing release tarball..."
sh 'rsync --verbose jami*.tar.gz ' +
"${REMOTE_HOST}:${REMOTE_BASE_DIR}" +
"/release/tarballs/"
} else {
sh 'git push --tags'
}
}
}
}
}
stage('Build packages') {
environment {
DISABLE_CONTRIB_DOWNLOADS = 'TRUE'
}
steps {
script {
def targetsText = params.PACKAGING_TARGETS.trim()
if (!targetsText) {
targetsText = sh(script: 'make -f extras/packaging/gnu-linux/Makefile -s list-package-targets',
returnStdout: true).trim()
}
TARGETS = targetsText.split(/\s/)
if (!params.BUILD_ARM) {
TARGETS = TARGETS.findAll { !(it =~ /_(armhf|arm64)$/) }
}
if (!params.BUILD_DEB_PACK) {
TARGETS = TARGETS.findAll { !(it =~ /_(deb-pack)$/) }
}
def stages = [:]
TARGETS.each { target ->
// Note: The stage calls are wrapped in closures, to
// delay their execution.
stages[target] = {
stage(target) {
// Offload builds to different agents.
node('linux-builder') {
cleanWs()
unstash 'release-tarball'
catchError(buildResult: 'FAILURE',
stageResult: 'FAILURE') {
sh """#!/usr/bin/env -S bash -l
echo Building on node \$NODE_NAME
whoami
tar xf *.tar.gz --strip-components=1
make -f extras/packaging/gnu-linux/Makefile ${target}
"""
stash(includes: 'extras/packaging/gnu-linux/packages/**',
name: target)
}
}
}
}
}
parallel stages
}
}
}
stage('Sign & deploy packages') {
agent {
label 'ring-buildmachine-02.mtl.sfl'
}
when {
expression {
params.DEPLOY
}
}
steps {
sshagent(credentials: [JENKINS_SSH_KEY, DL_SSH_KEY]) {
script {
TARGETS.each { target ->
try {
unstash target
} catch (err) {
echo "Failed to unstash ${target}, skipping..."
return
}
}
def distributionsText = sh(
script: 'find extras/packaging/gnu-linux/packages/* -maxdepth 1 -type d -print0 ' +
'| xargs -0 -n1 basename -z',
returnStdout: true).trim()
def distributions = distributionsText.split("\0")
distributions.each { distribution ->
echo "Deploying ${distribution} packages..."
withCredentials([string(credentialsId: SNAPCRAFT_KEY, variable: 'SNAPCRAFT_STORE_CREDENTIALS')]) {
sh """extras/packaging/gnu-linux/scripts/deploy-packages.sh \
--distribution=${distribution} \
--keyid="${JAMI_PUBLIC_KEY_FINGERPRINT}" \
--remote-repository-location="${REMOTE_HOST}:${REMOTE_BASE_DIR}/${params.CHANNEL}" \
--remote-manual-download-location="${REMOTE_HOST}:${REMOTE_BASE_DIR}/manual-${params.CHANNEL}"
"""
}
}
}
}
}
}
}
}
# -*- mode: makefile; -*-
# Copyright (C) 2016-2021 Savoir-faire Linux Inc.
#
# Author: Maxim Cournoyer <maxim.cournoyer@savoirfairelinux.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
.DEFAULT_GOAL := package-all
# Default caching directory
export TARBALLS ?= /var/cache/jami
##############################
## Version number variables ##
##############################
TARBALL_VERSION := $(shell cat $(CURDIR)/.tarball-version 2> /dev/null)
ifeq ($(TARBALL_VERSION),)
LAST_COMMIT_DATE := $(shell git log -1 --format=%cd --date=format:'%Y%m%d.%H%M')
COMMIT_ID := $(shell git rev-parse --short HEAD)
RELEASE_VERSION := $(LAST_COMMIT_DATE).$(COMMIT_ID)
else
$(warning Using version from the .tarball-version file: $(TARBALL_VERSION))
RELEASE_VERSION := $(TARBALL_VERSION)
endif
RELEASE_TARBALL_FILENAME := jami_$(RELEASE_VERSION).tar.gz
# Export for consumption in child processes.
export RELEASE_VERSION
export RELEASE_TARBALL_FILENAME
# Debian versions
DEBIAN_VERSION := $(RELEASE_VERSION)~dfsg1-1
DEBIAN_DSC_FILENAME := jami_$(DEBIAN_VERSION).dsc
# Qt versions
QT_MAJOR := 6
QT_MINOR := 2
QT_PATCH := 3
QT_TARBALL_CHECKSUM := f784998a159334d1f47617fd51bd0619b9dbfe445184567d2cd7c820ccb12771
DEBIAN_QT_VERSION := $(QT_MAJOR).$(QT_MINOR).$(QT_PATCH)-2
DEBIAN_QT_DSC_FILENAME := libqt-jami_$(DEBIAN_QT_VERSION).dsc
QT_JAMI_PREFIX := /usr/lib/libqt-jami
#####################
## Other variables ##
#####################
TMPDIR := $(shell mktemp -d)
CURRENT_UID:=$(shell id -u)
CURRENT_GID:=$(shell id -g)
#############################
## Release tarball targets ##
#############################
.PHONY: release-tarball purge-release-tarballs portable-release-tarball
# See: https://reproducible-builds.org/docs/archives/
TAR_REPRODUCIBILITY_OPTIONS = \
--format=gnu \
--mtime=@1 \
--owner=root:0 \
--group=root:0
# This file can be used when not wanting to invoke the tarball
# producing machinery (which depends on the Git checkout), nor its
# prerequisites. It is used to set the TARBALL_VERSION Make variable.
.tarball-version:
echo $(RELEASE_VERSION) > $@
purge-release-tarballs:
rm -f jami_*.tar.* tarballs.manifest
release-tarball:
rm -f "$(RELEASE_TARBALL_FILENAME)" tarballs.manifest
$(MAKE) -f extras/packaging/gnu-linux/Makefile "$(RELEASE_TARBALL_FILENAME)"
# Predicate to check if the 'guix' command is available.
has-guix-p:
command -v guix > /dev/null 2>&1 || \
(echo 'guix' is required to build the '$@' target && exit 1)
# The bundled tarballs included in the release tarball depend on what
# is available on the host. To ensure it can be shared across all
# different GNU/Linux distributions, generate it in a minimal
# container. Wget uses GnuTLS, which looks up its certs from
# /etc/ssl/certs.
guix-share-tarball-arg = $${TARBALLS:+"--share=$$TARBALLS"}
portable-release-tarball: has-guix-p
guix shell --container --network \
--preserve=TARBALLS $(guix-share-tarball-arg) \
--expose=/usr/bin/env \
--expose=$$SSL_CERT_DIR=/etc/ssl/certs \
--manifest=$(CURDIR)/extras/packaging/gnu-linux/guix/minimal-manifest.scm \
-- $(MAKE) -f extras/packaging/gnu-linux/Makefile release-tarball
daemon/contrib/native/Makefile:
mkdir -p ./daemon/contrib/native && \
cd daemon/contrib/native && \
../bootstrap
# Fetch the required contrib sources and copy them to
# daemon/contrib/tarballs. To use a custom tarballs cache directory,
# export the TARBALLS environment variable.
tarballs.manifest: daemon/contrib/native/Makefile
cd daemon/contrib/native && \
$(MAKE) list && \
$(MAKE) fetch -j && \
$(MAKE) --no-print-directory --silent list-tarballs > "$(CURDIR)/$@"
ifeq ($(TARBALL_VERSION),)
# Generate the release tarball. To regenerate a fresh tarball
# manually clear the tarballs.manifest file.
$(RELEASE_TARBALL_FILENAME): tarballs.manifest
# Prepare the sources of the top repository and relevant submodules.
rm -f "$@"
mkdir $(TMPDIR)/client-qt
git archive HEAD | tar xf - -C $(TMPDIR)/client-qt
for m in \
./daemon \
. \
./3rdparty/SortFilterProxyModel; do \
(cd "$$m" && git archive --prefix "$$m/" HEAD \
| tar xf - -C $(TMPDIR)/client-qt); \
done
# Create the base archive.
tar -cf $(TMPDIR)/client-qt.tar $(TMPDIR)/client-qt \
--transform 's,.*/client-qt,client-qt,' \
$(TAR_REPRODUCIBILITY_OPTIONS)
# Append the cached tarballs listed in the manifest.
tar --append --file $(TMPDIR)/client-qt.tar \
--files-from $< \
--transform 's,^.*/,client-qt/daemon/contrib/tarballs/,' \
$(TAR_REPRODUCIBILITY_OPTIONS)
# Compress the tarball and move it into place.
gzip --no-name $(TMPDIR)/client-qt.tar
mv $(TMPDIR)/client-qt.tar.gz "$@"
rm -rf $(TMPDIR)
else
# If TARBALL_VERSION is defined, assume it's already been generated,
# without doing any checks, which would require Git.
$(RELEASE_TARBALL_FILENAME):
endif
#######################
## Packaging targets ##
#######################
#
# Traditionally built packages (in Docker containers).
#
DISTRIBUTIONS := \
debian_10 \
debian_11 \
debian_testing \
debian_unstable \
raspbian_10_armhf \
ubuntu_18.04 \
ubuntu_20.04 \
ubuntu_22.04 \
ubuntu_22.10 \
fedora_35 \
fedora_36 \
fedora_37 \
opensuse-leap_15.3 \
opensuse-leap_15.4 \
snap
IS_SHELL_INTERACTIVE := $(shell [ -t 0 ] && echo yes)
# The following Make variable can be used to provide extra arguments
# used with the 'docker run' commands invoked to build the packages.
DOCKER_RUN_EXTRA_ARGS =
# This function is used to produce the rules of the packaging targets
# that rely on Docker.
# Arg1: The name-version string of the distribution (e.g., ubuntu-18.04).
# Arg2: Extra arguments to pass to 'docker build'.
# Arg3: Extra arguments to pass to 'docker run'.
define make-docker-package-target
$(1)-docker-image-name := jami-packaging-$(1)
$(1)-docker-image-file := .docker-image-$$($(1)-docker-image-name)
$(1)-docker-run-command := docker run \
--rm --privileged --security-opt apparmor=docker-default \
-e RELEASE_VERSION="$(RELEASE_VERSION)" \
-e RELEASE_TARBALL_FILENAME="$(RELEASE_TARBALL_FILENAME)" \
-e DEBIAN_VERSION="$(DEBIAN_VERSION)" \
-e DEBIAN_QT_VERSION="$(DEBIAN_QT_VERSION)" \
-e CURRENT_UID="$(CURRENT_UID)" \
-e CURRENT_GID="$(CURRENT_GID)" \
-e DISTRIBUTION="$(1)" \
-e QT_JAMI_PREFIX="$(QT_JAMI_PREFIX)" \
-e QT_MAJOR="$(QT_MAJOR)" \
-e QT_MINOR="$(QT_MINOR)" \
-e QT_PATCH="$(QT_PATCH)" \
-e QT_TARBALL_CHECKSUM="$(QT_TARBALL_CHECKSUM)" \
-e FORCE_REBUILD_QT="$(FORCE_REBUILD_QT)" \
-e SNAP_PKG_NAME="$(or $(SNAP_PKG_NAME),jami)" \
-e TARBALLS="$(TARBALLS)" \
-v '$(TARBALLS)':'$(TARBALLS)' \
-v '$(CURDIR)/$(RELEASE_TARBALL_FILENAME)':'/src/$(RELEASE_TARBALL_FILENAME)' \
-v '$(CURDIR)/extras/packaging/gnu-linux/packages/$(1)':/opt/output \
-t $(and $(IS_SHELL_INTERACTIVE),-i) \
$(3) \
"$$($(1)-docker-image-name)"
$$($(1)-docker-image-file): extras/packaging/gnu-linux/docker/Dockerfile_$(1)
docker build \
-t $$($(1)-docker-image-name) \
-f extras/packaging/gnu-linux/docker/Dockerfile_$(1) $(2) $(CURDIR) && \
touch "$$@"
packages/$(1)/.packages-built: $(RELEASE_TARBALL_FILENAME) $$($(1)-docker-image-file)
mkdir -p "$$$$(dirname "$$@")" && \
$$($(1)-docker-run-command) && \
touch "$$@"
.PHONY: $(1)
$(1): packages/$(1)/.packages-built
PACKAGE-TARGETS += $(1)
.PHONY: $(1)-interactive
$(1)-interactive: $(RELEASE_TARBALL_FILENAME) $$($(1)-docker-image-file)
$$($(1)-docker-run-command) bash
endef
$(foreach target,$(DISTRIBUTIONS),\
$(eval $(call make-docker-package-target,$(target))))
#
# Guix-generated Debian packages (deb packs) targets.
#
SUPPORTED_GNU_ARCHS = x86_64
DEB_PACK_TARGETS =
define guix-pack-command
guix pack -C xz -f deb -m $(CURDIR)/extras/packaging/gnu-linux/guix/guix-pack-manifest.scm -v3 \
-S /usr/bin/jami=bin/jami \
-S /usr/share/applications/jami.desktop=share/applications/jami.desktop \
-S /usr/share/icons/hicolor/scalable/apps/jami.svg=share/icons/hicolor/scalable/apps/jami.svg \
-S /usr/share/icons/hicolor/48x48/apps/jami.png=share/icons/hicolor/48x48/apps/jami.png \
-S /usr/share/metainfo/jami.appdata.xml=share/metainfo/jami.appdata.xml \
--postinst-file=$(CURDIR)/extras/packaging/gnu-linux/guix/guix-pack-deb.postinst
endef
# Arg1: the GNU architecture type (e.g., x86_64, i686, powerpcle, etc.)
define define-deb-pack-rule
deb-file-name := packages/guix-deb-pack/jami-$(RELEASE_VERSION)-$(1).deb
DEB_PACK_TARGETS += deb-pack-$(subst _,-,$(1))
.PHONY: deb-pack-$(subst _,-,$(1))
deb-pack-$(subst _,-,$(1)): $$(deb-file-name)
$$(deb-file-name): has-guix-p $(RELEASE_TARBALL_FILENAME)
output=$$$$($(guix-pack-command) --system=$(1)-linux $$(GUIX_PACK_ARGS)) && \
mkdir -p "$$$$(dirname "$$@")" && \
cp --reflink=auto "$$$$output" "$$@" && \
guix gc --delete "$$$$output"
chmod +w "$$@"
endef
$(foreach arch,$(SUPPORTED_GNU_ARCHS),\
$(eval $(call define-deb-pack-rule,$(arch))))
PACKAGE-TARGETS += $(DEB_PACK_TARGETS)
package-all: $(PACKAGE-TARGETS)
.PHONY: list-package-targets
list-package-targets:
@$(foreach p,$(PACKAGE-TARGETS),\
echo $(p);)
###################
## Other targets ##
###################
.PHONY: docs
# Build the documentation
# Note that newly added RST files will likely not display on all documents'
# navigation bar unless the docs/build folder is manually deleted.
docs: env
env/bin/sphinx-build -b html docs/source docs/build/html
env/bin/sphinx-build -b texinfo docs/source docs/build/texinfo
env:
virtualenv env
env/bin/pip install Sphinx==1.4.1 sphinx-rtd-theme==0.1.9
.PHONY: clean
clean:
rm -rf env
rm -rf docs/build
rm -f jami_*.tar.gz
rm -rf packages
rm -f Makefile.packaging.distro_targets
rm -f .docker-image-*
rm -rf client-qt/daemon/contrib/tarballs/*
FROM debian:buster
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get clean
RUN apt-get update -y
RUN apt-get install -y -o Acquire::Retries=10 \
devscripts \
apt-utils \
equivs \
gcc-8 \
g++-8 \
clang \
clang-tools \
libarchive-dev \
wget
ADD extras/packaging/gnu-linux/scripts/prebuild-package-debian.sh /opt/prebuild-package-debian.sh
COPY extras/packaging/gnu-linux/rules/debian-qt/control /tmp/builddeps/debian/control
RUN /opt/prebuild-package-debian.sh qt-deps
COPY extras/packaging/gnu-linux/rules/debian/control /tmp/builddeps/debian/control
RUN /opt/prebuild-package-debian.sh jami-deps
RUN update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 50
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 50
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 10
# Install CMake 3.19 for Qt 6
ADD extras/packaging/gnu-linux/scripts/install-cmake.sh /opt/install-cmake.sh
RUN /opt/install-cmake.sh
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash -
RUN apt install nodejs -y
ADD extras/packaging/gnu-linux/scripts/build-package-debian.sh /opt/build-package-debian.sh
RUN wget https://ftp.gnu.org/gnu/binutils/binutils-2.37.tar.xz -q -O /tmp/binutils.xz \
&& cd /tmp/ \
&& tar xvf binutils.xz \
&& cd binutils-2.37 \
&& ./configure \
&& make \
&& make install
CMD ["/opt/build-package-debian.sh"]
FROM debian:bullseye
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get clean
RUN apt-get update && \
apt-get install -y -o Acquire::Retries=10 \
devscripts \
equivs \
python-is-python3 \
wget
ADD extras/packaging/gnu-linux/scripts/prebuild-package-debian.sh /opt/prebuild-package-debian.sh
COPY extras/packaging/gnu-linux/rules/debian-qt/control /tmp/builddeps/debian/control
RUN /opt/prebuild-package-debian.sh qt-deps
COPY extras/packaging/gnu-linux/rules/debian/control /tmp/builddeps/debian/control
RUN /opt/prebuild-package-debian.sh jami-deps
# Install CMake 3.19 for Qt 6
ADD extras/packaging/gnu-linux/scripts/install-cmake.sh /opt/install-cmake.sh
RUN /opt/install-cmake.sh
ADD extras/packaging/gnu-linux/scripts/build-package-debian.sh /opt/build-package-debian.sh
CMD ["/opt/build-package-debian.sh"]
FROM debian:testing
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get clean
RUN apt-get update --allow-releaseinfo-change && \
apt-get install -y -o Acquire::Retries=10 \
devscripts \
equivs \
python-is-python3 \
wget \
nasm
ADD extras/packaging/gnu-linux/scripts/prebuild-package-debian.sh /opt/prebuild-package-debian.sh
COPY extras/packaging/gnu-linux/rules/debian-qt/control /tmp/builddeps/debian/control
RUN /opt/prebuild-package-debian.sh qt-deps
COPY extras/packaging/gnu-linux/rules/debian/control /tmp/builddeps/debian/control
RUN /opt/prebuild-package-debian.sh jami-deps
# Install CMake 3.19 for Qt 6
ADD extras/packaging/gnu-linux/scripts/install-cmake.sh /opt/install-cmake.sh
RUN /opt/install-cmake.sh
ADD extras/packaging/gnu-linux/scripts/build-package-debian.sh /opt/build-package-debian.sh
CMD ["/opt/build-package-debian.sh"]
FROM debian:unstable
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get clean
RUN apt-get update && \
apt-get install -y -o Acquire::Retries=10 \
devscripts \
equivs \
python-is-python3 \
libdbus-1-dev \
libdbus-c++-dev \
wget
ADD extras/packaging/gnu-linux/scripts/prebuild-package-debian.sh /opt/prebuild-package-debian.sh
COPY extras/packaging/gnu-linux/rules/debian-qt/control /tmp/builddeps/debian/control
RUN /opt/prebuild-package-debian.sh qt-deps
COPY extras/packaging/gnu-linux/rules/debian/control /tmp/builddeps/debian/control
RUN /opt/prebuild-package-debian.sh jami-deps
# Install CMake 3.19 for Qt 6
ADD extras/packaging/gnu-linux/scripts/install-cmake.sh /opt/install-cmake.sh
RUN /opt/install-cmake.sh
ADD extras/packaging/gnu-linux/scripts/build-package-debian.sh /opt/build-package-debian.sh
CMD ["/opt/build-package-debian.sh"]
FROM fedora:36
RUN dnf clean all
RUN dnf install -y dnf-command\(builddep\) rpmdevtools && \
dnf install -y mock
RUN dnf groupinstall -y "X Software Development"
RUN dnf install -y \
git \
rpm-build \
tar \
make \
autoconf \
automake \
nasm \
speexdsp-devel \
pulseaudio-libs-devel \
libcanberra-devel \
libcurl-devel \
libtool \
mesa-libgbm-devel \
mesa-dri-drivers \
dbus-devel \
expat-devel \
pcre-devel \
yaml-cpp-devel \
dbus-c++-devel \
dbus-devel \
libXext-devel \
libXfixes-devel \
yasm \
python2.7 \
speex-devel \
gsm-devel \
chrpath \
check \
astyle \
uuid-c++-devel \
gettext-devel \
gcc-c++ \
which \
alsa-lib-devel \
systemd-devel \
libuuid-devel \
uuid-devel \
gnutls-devel \
nettle-devel \
opus-devel \
patch \
jsoncpp-devel \
libnatpmp-devel \
webkitgtk4-devel \
cryptopp-devel \
libva-devel \
libvdpau-devel \
msgpack-devel \
NetworkManager-libnm-devel \
openssl-devel \
clutter-devel \
clutter-gtk-devel \
libappindicator-gtk3-devel \
libnotify-devel \
libupnp-devel \
qrencode-devel \
libargon2-devel \
libsndfile-devel \
libdrm \
gperf \
bison \
clang \
clang-devel \
llvm-devel \
nodejs \
flex \
gstreamer1 gstreamer1-devel \
gstreamer1-plugins-base-devel \
gstreamer1-plugins-good \
gstreamer1-plugins-bad-free-devel \
nss-devel \
libxcb* \
libxkb* \
libX11-devel \
vulkan-devel \
libXrender-devel \
xcb-util-* \
xz \
xkeyboard-config \
libnotify \
wget \
libstdc++-static \
sqlite-devel \
perl-generators \
perl-English \
libxshmfence-devel \
ninja-build \
clang \
cmake
ADD extras/packaging/gnu-linux/scripts/build-package-rpm.sh /opt/build-package-rpm.sh
CMD ["/opt/build-package-rpm.sh"]
FROM fedora:37
RUN dnf clean all
RUN dnf install -y dnf-command\(builddep\) rpmdevtools && \
dnf install -y mock
RUN dnf groupinstall -y "X Software Development"
RUN dnf install -y \
git \
rpm-build \
tar \
make \
autoconf \
automake \
nasm \
speexdsp-devel \
pulseaudio-libs-devel \
libcanberra-devel \
libcurl-devel \
libtool \
mesa-libgbm-devel \
mesa-dri-drivers \
dbus-devel \
expat-devel \
pcre-devel \
yaml-cpp-devel \
dbus-c++-devel \
dbus-devel \
libXext-devel \
libXfixes-devel \
yasm \
python2.7 \
speex-devel \
gsm-devel \
chrpath \
check \
astyle \
uuid-c++-devel \
gettext-devel \
gcc-c++ \
which \
alsa-lib-devel \
systemd-devel \
libuuid-devel \
uuid-devel \
gnutls-devel \
nettle-devel \
opus-devel \
patch \
jsoncpp-devel \
libnatpmp-devel \
webkitgtk4-devel \
cryptopp-devel \
libva-devel \
libvdpau-devel \
msgpack-devel \
NetworkManager-libnm-devel \
openssl-devel \
clutter-devel \
clutter-gtk-devel \
libappindicator-gtk3-devel \
libnotify-devel \
libupnp-devel \
qrencode-devel \
libargon2-devel \
libsndfile-devel \
libdrm \
gperf \
bison \
clang \
clang-devel \
llvm-devel \
nodejs \
flex \
gstreamer1 gstreamer1-devel \
gstreamer1-plugins-base-devel \
gstreamer1-plugins-good \
gstreamer1-plugins-bad-free-devel \
nss-devel \
libxcb* \
libxkb* \
libX11-devel \
vulkan-devel \
libXrender-devel \
xcb-util-* \
xz \
xkeyboard-config \
libnotify \
wget \
libstdc++-static \
sqlite-devel \
perl-generators \
perl-English \
libxshmfence-devel \
ninja-build \
clang \
cmake
ADD extras/packaging/gnu-linux/scripts/build-package-rpm.sh /opt/build-package-rpm.sh
CMD ["/opt/build-package-rpm.sh"]
FROM opensuse/leap:15.4
RUN zypper refresh
RUN zypper --non-interactive install -y \
dnf \
dnf-command\(builddep\) \
rpmdevtools \
Mesa-dri-devel Mesa-dri \
git \
gcc10 \
gcc10-c++ \
rpm-build \
tar \
make \
autoconf \
automake \
nasm \
speexdsp-devel \
libpulse-devel \
libcanberra-devel \
libcurl-devel \
libtool \
pcre-devel \
yaml-cpp-devel \
libdbus-c++-devel \
libXext-devel \
libXfixes-devel \
yasm \
speex-devel \
libgsm-devel \
chrpath \
check \
astyle \
gettext-devel \
which \
alsa-lib-devel \
systemd-devel \
libuuid-devel \
uuid-devel \
libopus-devel \
patch \
jsoncpp-devel \
webkit2gtk3-devel \
libcryptopp-devel \
libva-devel \
libvdpau-devel \
msgpack-devel \
clutter-devel \
openssl-devel \
clutter-gtk-devel \
libnma-devel \
libcryptopp-devel \
libdbus-c++-devel \
libexpat-devel \
gnome-icon-theme-symbolic \
libgsm-devel \
gtk3-devel \
libappindicator-devel \
sqlite-devel \
ffmpeg-4-libavutil-devel \
gtk3-devel\
qrencode-devel \
python3-python-dateutil \
libsndfile-devel \
libdrm \
gperf \
bison \
flex \
ffmpeg ffmpeg-devel \
nodejs12 \
mozilla-nss-devel \
python-xml \
libxcb* \
libxkb* \
libX11-devel \
libXrender-devel \
libfreetype6 \
xcb-util-image-devel \
xcb-util-keysyms-devel \
xcb-util-renderutil-devel \
xcb-util-wm-devel \
xorg-x11-devel \
xz \
xkeyboard-config \
libnotify \
argon2-devel \
libxshmfence-devel \
xproto-devel \
xcb-proto-devel \
xcb-* \
xorg-* \
vulkan-devel \
ninja \
gstreamer-devel \
gstreamer-plugins-good \
gstreamer-plugins-bad-devel \
gstreamer-plugins-base-devel \
cmake \
wget
RUN update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 50
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 50
ADD extras/packaging/gnu-linux/scripts/build-package-rpm.sh /opt/build-package-rpm.sh
ENV CC=gcc
ENV CXX=g++
CMD ["/opt/build-package-rpm.sh"]
ARG RISK=edge
ARG UBUNTU=focal
FROM ubuntu:$UBUNTU as builder
ARG RISK
ARG UBUNTU
RUN echo "Building snapcraft:$RISK in ubuntu:$UBUNTU"
# Grab dependencies
RUN apt-get update
RUN apt-get dist-upgrade --yes
RUN apt-get install --yes \
curl \
jq \
squashfs-tools
# Grab the core snap (for backwards compatibility) from the stable channel and
# unpack it in the proper place.
RUN curl -L $(curl -H 'X-Ubuntu-Series: 16' 'https://api.snapcraft.io/api/v1/snaps/details/core' | jq '.download_url' -r) --output core.snap
RUN mkdir -p /snap/core
RUN unsquashfs -d /snap/core/current core.snap
# Grab the core22 snap (which snapcraft uses as a base) from the stable channel
# and unpack it in the proper place.
RUN curl -L $(curl -H 'X-Ubuntu-Series: 16' 'https://api.snapcraft.io/api/v1/snaps/details/core22?channel='$RISK | jq '.download_url' -r) --output core22.snap
RUN mkdir -p /snap/core22
RUN unsquashfs -d /snap/core22/current core22.snap
# Grab the core20 snap (which snapcraft uses as a base) from the stable channel
# and unpack it in the proper place.
RUN curl -L $(curl -H 'X-Ubuntu-Series: 16' 'https://api.snapcraft.io/api/v1/snaps/details/core20' | jq '.download_url' -r) --output core20.snap
RUN mkdir -p /snap/core20
RUN unsquashfs -d /snap/core20/current core20.snap
# Grab the core20 snap (which snapcraft uses as a base) from the stable channel
# and unpack it in the proper place.
RUN curl -L $(curl -H 'X-Ubuntu-Series: 16' 'https://api.snapcraft.io/api/v1/snaps/details/lxd' | jq '.download_url' -r) --output lxd.snap
RUN mkdir -p /snap/lxd
RUN unsquashfs -d /snap/lxd/current lxd.snap
# Grab the snapcraft snap from the $RISK channel and unpack it in the proper
# place.
RUN curl -L $(curl -H 'X-Ubuntu-Series: 16' 'https://api.snapcraft.io/api/v1/snaps/details/snapcraft?channel='$RISK | jq '.download_url' -r) --output snapcraft.snap
RUN mkdir -p /snap/snapcraft
RUN unsquashfs -d /snap/snapcraft/current snapcraft.snap
# Fix Python3 installation: Make sure we use the interpreter from
# the snapcraft snap:
RUN unlink /snap/snapcraft/current/usr/bin/python3
RUN ln -s /snap/snapcraft/current/usr/bin/python3.* /snap/snapcraft/current/usr/bin/python3
RUN echo /snap/snapcraft/current/lib/python3.*/site-packages >> /snap/snapcraft/current/usr/lib/python3/dist-packages/site-packages.pth
# Create a snapcraft runner (TODO: move version detection to the core of
# snapcraft).
RUN mkdir -p /snap/bin
RUN echo "#!/bin/sh" > /snap/bin/snapcraft
RUN snap_version="$(awk '/^version:/{print $2}' /snap/snapcraft/current/meta/snap.yaml | tr -d \')" && echo "export SNAP_VERSION=\"$snap_version\"" >> /snap/bin/snapcraft
RUN echo 'exec "$SNAP/usr/bin/python3" "$SNAP/bin/snapcraft" "$@"' >> /snap/bin/snapcraft
RUN chmod +x /snap/bin/snapcraft
# Multi-stage build, only need the snaps from the builder. Copy them one at a
# time so they can be cached.
FROM ubuntu:$UBUNTU
COPY --from=builder /snap/core /snap/core
COPY --from=builder /snap/core22 /snap/core22
COPY --from=builder /snap/core20 /snap/core20
COPY --from=builder /snap/lxd /snap/lxd
COPY --from=builder /snap/snapcraft /snap/snapcraft
COPY --from=builder /snap/bin/snapcraft /snap/bin/snapcraft
# Generate locale and install dependencies.
RUN apt-get update && apt-get dist-upgrade --yes && apt-get install --yes snapd sudo apt-transport-https locales && locale-gen en_US.UTF-8
# Set the proper environment.
ENV LANG="en_US.UTF-8"
ENV LANGUAGE="en_US:en"
ENV LC_ALL="en_US.UTF-8"
ENV PATH="/snap/bin:/snap/snapcraft/current/usr/bin:/snap/snapcraft/current/libexec/snapcraft/:$PATH"
ENV SNAP="/snap/snapcraft/current"
ENV SNAP_NAME="snapcraft"
ENV SNAP_ARCH="amd64"
ADD extras/packaging/gnu-linux/scripts/build-package-snap.sh /opt/build-package-snap.sh
CMD ["/opt/build-package-snap.sh"]
FROM ubuntu:18.04
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get clean
RUN apt-get update && \
apt-get install -y -o Acquire::Retries=10 \
devscripts \
equivs \
curl \
gcc-8 \
g++-8 \
clang \
clang-tools \
libarchive-dev \
software-properties-common \
wget
# nodejs (more recent version needed for building libqt-jami)
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash -
RUN apt install nodejs -y
ADD extras/packaging/gnu-linux/scripts/prebuild-package-debian.sh /opt/prebuild-package-debian.sh
COPY extras/packaging/gnu-linux/rules/debian-qt/control /tmp/builddeps/debian/control
RUN /opt/prebuild-package-debian.sh qt-deps
COPY extras/packaging/gnu-linux/rules/debian/control /tmp/builddeps/debian/control
RUN /opt/prebuild-package-debian.sh jami-deps
RUN update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 50
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 50
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 10
# Install CMake 3.19 for Qt 6
ADD extras/packaging/gnu-linux/scripts/install-cmake.sh /opt/install-cmake.sh
RUN /opt/install-cmake.sh
ADD extras/packaging/gnu-linux/scripts/build-package-debian.sh /opt/build-package-debian.sh
CMD ["/opt/build-package-debian.sh"]
FROM ubuntu:20.04
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get clean
RUN apt-get update && \
apt-get install -y -o Acquire::Retries=10 \
devscripts \
equivs \
python-is-python3 \
wget
ADD extras/packaging/gnu-linux/scripts/prebuild-package-debian.sh /opt/prebuild-package-debian.sh
COPY extras/packaging/gnu-linux/rules/debian-qt/control /tmp/builddeps/debian/control
RUN /opt/prebuild-package-debian.sh qt-deps
COPY extras/packaging/gnu-linux/rules/debian/control /tmp/builddeps/debian/control
RUN /opt/prebuild-package-debian.sh jami-deps
# Install CMake 3.19 for Qt 6
ADD extras/packaging/gnu-linux/scripts/install-cmake.sh /opt/install-cmake.sh
RUN /opt/install-cmake.sh
# nodejs
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash -
RUN apt install nodejs -y
ADD extras/packaging/gnu-linux/scripts/build-package-debian.sh /opt/build-package-debian.sh
CMD ["/opt/build-package-debian.sh"]
FROM ubuntu:22.04
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get clean
RUN apt-get update && \
apt-get install -y -o Acquire::Retries=10 \
devscripts \
equivs \
python-is-python3 \
wget
ADD extras/packaging/gnu-linux/scripts/prebuild-package-debian.sh /opt/prebuild-package-debian.sh
COPY extras/packaging/gnu-linux/rules/debian-qt/control /tmp/builddeps/debian/control
RUN /opt/prebuild-package-debian.sh qt-deps
COPY extras/packaging/gnu-linux/rules/debian/control /tmp/builddeps/debian/control
RUN /opt/prebuild-package-debian.sh jami-deps
ADD extras/packaging/gnu-linux/scripts/build-package-debian.sh /opt/build-package-debian.sh
CMD ["/opt/build-package-debian.sh"]
FROM ubuntu:22.10
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get clean
RUN apt-get update && \
apt-get install -y -o Acquire::Retries=10 \
devscripts \
equivs \
python-is-python3 \
wget
ADD extras/packaging/gnu-linux/scripts/prebuild-package-debian.sh /opt/prebuild-package-debian.sh
COPY extras/packaging/gnu-linux/rules/debian-qt/control /tmp/builddeps/debian/control
RUN /opt/prebuild-package-debian.sh qt-deps
COPY extras/packaging/gnu-linux/rules/debian/control /tmp/builddeps/debian/control
RUN /opt/prebuild-package-debian.sh jami-deps
ADD extras/packaging/gnu-linux/scripts/build-package-debian.sh /opt/build-package-debian.sh
CMD ["/opt/build-package-debian.sh"]
;;; Tested with this revision of GNU Guix.
(list (channel
(inherit %default-guix-channel)
(commit
"f5cc7d03a778f20e2ad487e2c17cc8853bc871f0"))) ;2022-08-01
#!/bin/sh
# Copyright (C) 2021 Savoir-faire Linux Inc.
#
# Author: Maxim Cournoyer <maxim.cournoyer@savoirfairelinux.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set -e
# Fingerprint: A295D773307D25A33AE72F2F64CD5FA175348F84
jami_key="\
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v2
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
4sRdAfS333T4Uifq4uOu
=s2aQ
-----END PGP PUBLIC KEY BLOCK-----"
# System paths and generated variables.
apt_file=/etc/apt/sources.list.d/jami.list
update_manager_path=/etc/update-manager/release-upgrades.d/
jami_update_manager_id=jami
jami_update_manager_cfg=${jami_update_manager_id}.cfg
update_manager_cfg_path=$update_manager_path/$jami_update_manager_cfg
jami_repo_url=https://dl.jami.net/nightly/guix-deb-pack
case "$1" in
configure)
command -v apt-key > /dev/null \
|| (echo 'could not run postinst: apt-key is missing' && exit 1)
# Add the key to the trusted keyring.
echo "$jami_key" | apt-key add - > /dev/null 2>&1
# Additionally, if update manager is installed we inform it about
# the repository so it doesn't get scrapped after system updates
if [ -d /etc/update-manager ]; then
mkdir -p "$update_manager_path"
cat > "$update_manager_cfg_path" <<EOF
# Added by Jami to prevent disabling of Jami repository sources on
# distribution release upgrade.
[ThirdPartyMirrors]
jami/${jami_update_manager_id}=${jami_repo_url}
EOF
fi
# Add an entry for the package repository.
test -f "$apt_file" && cp "$apt_file" "${apt_file}.bak"
echo "deb $jami_repo_url jami main" > "$apt_file"
;;
esac
# Local Variables:
# mode: sh
# End:
;;; Copyright (C) 2021 Savoir-faire Linux Inc.
;;;
;;; Author: Maxim Cournoyer <maxim.cournoyer@savoirfairelinux.com>
;;;
;;; This program is free software: you can redistribute it and/or modify
;;; it under the terms of the GNU General Public License as published by
;;; the Free Software Foundation, either version 3 of the License, or
;;; (at your option) any later version.
;;;
;;; This program is distributed in the hope that it will be useful,
;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with this program. If not, see <http://www.gnu.org/licenses/>.
;;;
;;; This GNU Guix manifest is used along the Makefile to build the
;;; latest Jami as a Guix pack.
(use-modules (gnu packages certs)
(gnu packages jami)
(gnu packages python)
(guix base32)
(guix gexp)
(guix packages)
(guix transformations)
(guix store)
(guix utils))
;;; XXX: Below is a rather strenuous way to specify something that
;;; would have been nicer if it could have been specified via:
;;;
;;; --with-source=libjami=$(RELEASE_TARBALL_FILENAME) \
;;; --with-source=jami=$(RELEASE_TARBALL_FILENAME) in the Makefile.
;;;
;;; The above doesn't currently rewrite the dependency graph
;;; recursively, hence why it is not sufficient.
(define %release-version (getenv "RELEASE_VERSION"))
(define %release-file-name (getenv "RELEASE_TARBALL_FILENAME"))
(unless %release-version
(error "RELEASE_VERSION environment variable is not set"))
(unless %release-file-name
(error "RELEASE_TARBALL_FILENAME environment variable is not set"))
;;; Add the source tarball to the store and retrieve its hash. The
;;; hash is useful to turn the origin record into a fixed-output
;;; derivation, which means the Jami packages will only get built once
;;; for a given source tarball.
(define %release-file-hash
(with-store store
(let ((source (add-to-store store (basename %release-file-name) #f
"sha256" %release-file-name)))
(bytevector->nix-base32-string (query-path-hash store source)))))
(define %jami-sources/latest
(origin
(inherit (@@ (gnu packages jami) %jami-sources))
(uri %release-file-name)
(sha256 %release-file-hash)))
(define (with-latest-sources name)
(options->transformation
`((with-source . ,(format #f "~a@~a=~a" name
%release-version %release-file-name)))))
(define libjami/latest ((with-latest-sources "libjami") libjami))
(define with-libjami/latest
(package-input-rewriting `((,libjami . ,libjami/latest))))
;;; Bundling the TLS certificates with Jami enables a fully
;;; functional, configuration-free experience, useful in the context
;;; of Guix packs.
(define jami-with-certs
(package/inherit jami
(inputs (modify-inputs (package-inputs jami)
(append nss-certs)))
(arguments
(substitute-keyword-arguments (package-arguments jami)
((#:phases phases '%standard-phases)
#~(modify-phases #$phases
(add-after 'qt-wrap 'wrap-ssl-cert-dir
(lambda* (#:key inputs outputs #:allow-other-keys)
(substitute* (search-input-file outputs "bin/jami")
(("^exec.*" exec-line)
(format #f "export SSL_CERT_DIR=~a~%"
(search-input-directory inputs "etc/ssl/certs")
exec-line)))))))))))
(define jami-with-certs/latest
((with-latest-sources "jami") jami-with-certs))
(packages->manifest (list jami-with-certs/latest))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment