Skip to content
Snippets Groups Projects
Commit 80217fa2 authored by Jenkins's avatar Jenkins
Browse files

submodules: update nightly branch

parents 4cdb79dd 3e26f3df
No related branches found
No related tags found
No related merge requests found
......@@ -46,6 +46,7 @@ DEBIAN_OCI_PKG_DIR:="packaging/rules/debian-one-click-install"
#####################
TMPDIR := $(shell mktemp -d)
CURRENT_UID:=$(shell id -u)
CURRENT_GID:=$(shell id -g)
#############################
## Release tarball targets ##
......@@ -118,13 +119,25 @@ package-all: package-debian_9 \
package-opensuse-leap_15.1 \
package-opensuse-leap_15.2 \
package-opensuse-tumbleweed \
package-gentoo
package-gentoo \
package-snap
# Append the output of make-packaging-target to this Makefile
# see Makefile.packaging.distro_targets
$(shell scripts/make-packaging-target.py --generate-all > Makefile.packaging.distro_targets)
include Makefile.packaging.distro_targets
docker/Dockerfile_snap: patches/docker-snap-build-scripts.patch
if patch -p1 -fR --dry-run < $< >/dev/null 2>&1; then \
echo "Patching $@... skipped (already patched)"; \
else \
echo "Patching $@..."; \
patch -p1 -Ns < $< || { echo "Patching $@... failed" >&2 && exit 1; }; \
echo "Patching $@... done"; \
fi
.PHONY: docker/Dockerfile_snap
###################
## Other targets ##
###################
......
client-gnome @ 6b285516
Subproject commit 9bada8a43cf9fec860da2b2b2d2fc8d242220e33
Subproject commit 6b2855169a16078fb7062ab5d6bf2305f42cac33
daemon @ 324d49ce
Subproject commit d265e691dbd5250731451402ec42c1193a2b2c70
Subproject commit 324d49ce4d04b3067e6f0d2382c4e6dfd385f56b
FROM ubuntu:xenial as builder
# 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 core18 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/core18' | jq '.download_url' -r) --output core18.snap
RUN mkdir -p /snap/core18
RUN unsquashfs -d /snap/core18/current core18.snap
# Grab the snapcraft snap 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/snapcraft?channel=stable' | jq '.download_url' -r) --output snapcraft.snap
RUN mkdir -p /snap/snapcraft
RUN unsquashfs -d /snap/snapcraft/current snapcraft.snap
# 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)" && 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:xenial
COPY --from=builder /snap/core /snap/core
COPY --from=builder /snap/core18 /snap/core18
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 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:$PATH"
ENV SNAP="/snap/snapcraft/current"
ENV SNAP_NAME="snapcraft"
ENV SNAP_ARCH="amd64"
......@@ -25,3 +25,12 @@ hub organization. These images are generated with the following method:
### Fedora
TODO
### Snap
`Dockerfile_snap` is from [stable.Dockerfile](stable.Dockerfile)
upstream, under GPLv3-only, and is not considered part of the project.
It is patched with `../patches/docker-snap-build-scripts.patch` to
add and invoke our build script.
[stable.Dockerfile]: https://raw.githubusercontent.com/snapcore/snapcraft/master/docker/stable.Dockerfile
lrc @ 4381acbf
Subproject commit efad3d4ef8870c1b14b3d90d35e195ba65078f14
Subproject commit 4381acbf375488f0619056607e90d5ad34655071
......@@ -22,9 +22,7 @@ OSX_DISTRIBUTION_NAME = "osx"
ANDROID_DISTRIBUTION_NAME = "android"
WIN32_DISTRIBUTION_NAME = "win32"
# Qt 5.15 is currently only available using the maintenance tool.
QT5_VERSION = "5.15.0"
DEFAULT_QT_PATH = "~/Qt/{0}/gcc_64".format(QT5_VERSION)
# vs vars
win_sdk_default = '10.0.16299.0'
......@@ -46,7 +44,7 @@ PACMAN_BASED_DISTROS = [
]
ZYPPER_BASED_DISTROS = [
'opensuse-leap',
'opensuse-leap', 'opensuse-tumbleweed',
]
FLATPAK_BASED_RUNTIMES = [
......@@ -91,16 +89,24 @@ ZYPPER_DEPENDENCIES = [
'curl', 'gzip', 'bzip2',
# daemon
'speexdsp-devel', 'speex-devel', 'libdbus-c++-devel', 'jsoncpp-devel', 'yaml-cpp-devel',
'yasm', 'libuuid-devel', 'libnettle-devel', 'libopus-devel',
'yasm', 'libuuid-devel', 'libnettle-devel', 'libopus-devel', 'libexpat-devel',
'libgnutls-devel', 'msgpack-devel', 'libavcodec-devel', 'libavdevice-devel', 'pcre-devel',
'alsa-devel', 'libpulse-devel', 'libudev-devel', 'libva-devel', 'libvdpau-devel',
'libopenssl-devel',
'libopenssl-devel', 'libavutil-devel',
# lrc
'libQt5Core-devel', 'libQt5DBus-devel', 'libqt5-linguist-devel',
# gnome client
'gtk3-devel', 'clutter-gtk-devel', 'qrencode-devel',
'gettext-tools', 'libnotify-devel', 'libappindicator3-devel', 'webkit2gtk3-devel',
'NetworkManager-devel', 'libcanberra-gtk3-devel'
# client gnome / qt
'qrencode-devel', 'NetworkManager-devel'
]
ZYPPER_CLIENT_GNOME_DEPENDENCIES = [
'gtk3-devel', 'clutter-gtk-devel', 'gettext-tools', 'libnotify-devel', 'libappindicator3-devel',
'webkit2gtk3-devel', 'libcanberra-gtk3-devel'
]
ZYPPER_CLIENT_QT_DEPENDENCIES = [
'libqt5-qtsvg-devel', 'libqt5-qtwebengine-devel', 'libqt5-qtmultimedia-devel',
'libqt5-qtdeclarative-devel', 'libQt5QuickControls2-devel', 'libqt5-qtquickcontrols'
]
DNF_DEPENDENCIES = [
......@@ -111,11 +117,20 @@ DNF_DEPENDENCIES = [
'speex-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', 'speexdsp-devel',
'yaml-cpp-devel', 'qt5-qtbase-devel', 'swig', 'qrencode-devel', 'jsoncpp-devel',
'gtk3-devel', 'clutter-devel', 'clutter-gtk-devel',
'libnotify-devel', 'libappindicator-gtk3-devel', 'patch', 'libva-devel', 'openssl-devel',
'webkitgtk4-devel', 'NetworkManager-libnm-devel', 'libvdpau-devel', 'msgpack-devel', 'libcanberra-devel',
'sqlite-devel', 'openssl-static', 'pandoc', 'nasm'
'yaml-cpp-devel', 'qt5-qtbase-devel', 'swig', 'jsoncpp-devel',
'patch', 'libva-devel', 'openssl-devel', 'libvdpau-devel', 'msgpack-devel',
'sqlite-devel', 'openssl-static', 'pandoc', 'nasm', 'qrencode-devel', 'NetworkManager-libnm-devel',
'bzip2'
]
DNF_CLIENT_GNOME_DEPENDENCIES = [
'gtk3-devel', 'clutter-devel', 'clutter-gtk-devel', 'libnotify-devel','libappindicator-gtk3-devel',
'webkitgtk4-devel', 'libcanberra-devel'
]
DNF_CLIENT_QT_DEPENDENCIES = [
'qt5-qtsvg-devel', 'qt5-qtwebengine-devel', 'qt5-qtmultimedia-devel', 'qt5-qtdeclarative-devel',
'qt5-qtquickcontrols2-devel', 'qt5-qtquickcontrols'
]
APT_DEPENDENCIES = [
......@@ -128,9 +143,22 @@ APT_DEPENDENCIES = [
'libopus-dev', 'libpcre3-dev', 'libpulse-dev', 'libssl-dev',
'libspeex-dev', 'libspeexdsp-dev', 'libswscale-dev', 'libtool',
'libudev-dev', 'libyaml-cpp-dev', 'qtbase5-dev', 'libqt5sql5-sqlite', 'sip-tester', 'swig',
'uuid-dev', 'yasm', 'libqrencode-dev', 'libjsoncpp-dev', 'libappindicator3-dev',
'libva-dev', 'libwebkit2gtk-4.0-dev', 'libnm-dev', 'libvdpau-dev', 'libmsgpack-dev', 'libcanberra-gtk3-dev',
'pandoc', 'nasm'
'uuid-dev', 'yasm', 'libjsoncpp-dev', 'libva-dev', 'libvdpau-dev', 'libmsgpack-dev',
'pandoc', 'nasm', 'libqrencode-dev', 'libnm-dev', 'dpkg-dev'
]
APT_CLIENT_GNOME_DEPENDENCIES = [
'libwebkit2gtk-4.0-dev', 'libappindicator3-dev', 'libcanberra-gtk3-dev'
]
APT_CLIENT_QT_DEPENDENCIES = [
'qtmultimedia5-dev', 'libqt5svg5-dev', 'qtwebengine5-dev', 'qtdeclarative5-dev',
'qtquickcontrols2-5-dev', 'qml-module-qtquick2', 'qml-module-qtquick-controls',
'qml-module-qtquick-controls2', 'qml-module-qtquick-dialogs',
'qml-module-qtquick-layouts', 'qml-module-qtquick-privatewidgets',
'qml-module-qtquick-shapes', 'qml-module-qtquick-window2',
'qml-module-qtquick-templates2', 'qml-module-qt-labs-platform',
'qml-module-qtwebengine', 'qml-module-qtwebchannel'
]
PACMAN_DEPENDENCIES = [
......@@ -190,12 +218,12 @@ def run_powersell_cmd(cmd):
return
def write_qt_conf(path):
def write_qt_conf(path, qt5version=QT5_VERSION):
# Add a configuration that can be supplied to qmake
# e.g. `qmake -qt=5.15 [mode] [options] [files]`
if path == '':
return
with open('/usr/share/qtchooser/' + QT5_VERSION + '.conf', 'w+') as fd:
with open('/usr/share/qtchooser/' + qt5version + '.conf', 'w+') as fd:
fd.write(path.rstrip('/') + '/bin\n')
fd.write(path.rstrip('/') + '/lib\n')
return
......@@ -203,19 +231,27 @@ def write_qt_conf(path):
def run_dependencies(args):
if args.qt is not None:
write_qt_conf(args.qt)
write_qt_conf(args.qt, args.qtver)
if args.distribution == WIN32_DISTRIBUTION_NAME:
run_powersell_cmd(
'Set-ExecutionPolicy Unrestricted; .\\scripts\\install-deps-windows.ps1')
elif args.distribution in APT_BASED_DISTROS:
if args.qt is None:
APT_DEPENDENCIES.extend(APT_CLIENT_GNOME_DEPENDENCIES)
else:
APT_DEPENDENCIES.extend(APT_CLIENT_QT_DEPENDENCIES)
execute_script(
APT_INSTALL_SCRIPT,
{"packages": ' '.join(map(shlex.quote, APT_DEPENDENCIES))}
)
elif args.distribution in DNF_BASED_DISTROS:
if args.qt is None:
DNF_DEPENDENCIES.extend(DNF_CLIENT_GNOME_DEPENDENCIES)
else:
DNF_DEPENDENCIES.extend(DNF_CLIENT_QT_DEPENDENCIES)
execute_script(
RPM_INSTALL_SCRIPT,
{"packages": ' '.join(map(shlex.quote, DNF_DEPENDENCIES))}
......@@ -228,6 +264,10 @@ def run_dependencies(args):
)
elif args.distribution in ZYPPER_BASED_DISTROS:
if args.qt is None:
ZYPPER_DEPENDENCIES.extend(ZYPPER_CLIENT_GNOME_DEPENDENCIES)
else:
ZYPPER_DEPENDENCIES.extend(ZYPPER_CLIENT_QT_DEPENDENCIES)
execute_script(
ZYPPER_INSTALL_SCRIPT,
{"packages": ' '.join(map(shlex.quote, ZYPPER_DEPENDENCIES))}
......@@ -352,10 +392,7 @@ def run_install(args):
install_args += ("-c", "client-gnome")
else:
install_args += ("-c", "client-qt")
install_args += ("-q", QT5_VERSION)
if args.qt == '':
install_args += ("-Q", DEFAULT_QT_PATH)
else:
install_args += ("-q", args.qtver)
install_args += ("-Q", args.qt)
return subprocess.run(["./scripts/install.sh"] + install_args, env=environ, check=True)
......@@ -525,7 +562,9 @@ def parse_args():
ap.add_argument('--no-priv-install', dest='priv_install',
default=True, action='store_false')
ap.add_argument('--qt', nargs='?', const='', type=str,
help='Build the Qt client with the Qt 5.15 path supplied')
help='Build the Qt client with the Qt path supplied')
ap.add_argument('--qtver', default=QT5_VERSION,
help='Sets the Qt version to build with')
dist = choose_distribution()
if dist == WIN32_DISTRIBUTION_NAME:
......@@ -533,8 +572,6 @@ def parse_args():
help='Windows use only, specify Visual Studio toolset version')
ap.add_argument('--sdk', default=win_sdk_default, type=str,
help='Windows use only, specify Windows SDK version')
ap.add_argument('--qtver', default=QT5_VERSION,
help='Sets the Qt version to build with')
parsed_args = ap.parse_args()
......
This diff is collapsed.
#!/bin/sh
$SNAP/usr/lib/ring/dring -cd &
exec "$@"
# Copyright (C) 2019-2020 Savoir-faire Linux Inc.
#
# Author: Sébastien Blin <sebastien.blin@savoirfairelinux.com>
# Author: Amin Bandali <amin.bandali@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 file is based on earlier work by Daniel Llewellyn, under the
# Expat License (also referred to as "the MIT License"), per the
# following notice:
# Copyright (C) 2017-2020 Daniel Llewellyn <daniel@bowlhat.net>
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without limitation the rights to use, copy, modify, merge,
# publish, distribute, sublicense, and/or sell copies of the Software,
# and to permit persons to whom the Software is furnished to do so,
# subject to the following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
name: jami
version: "RELEASE_VERSION"
adopt-info: jami
icon: icons/jami.svg
summary: 'Jami: secure, distributed communication software & SIP client'
description: >
Jami is free software which allows its users to communicate in multiple ways.
* A telephone: a simple tool to connect, communicate and share.
* A teleconferencing tool: easily join calls to create conferences with multiple participants.
* A media sharing tool: Jami supports a variety of video input options, including mutliple cameras and image and video files, and the selection of audio inputs and outputs; all this is supported by multiple high quality audio and video codecs.
* A messenger: send text messeges during calls or out of calls (as long as your peer is connected).
* A building block for your IoT project: re-use the universal communications technology of Jami with its portable library on your system of choice.
confinement: strict
grade: stable
base: core18
plugs:
gnome-3-28-1804:
interface: content
target: $SNAP/gnome-platform
default-provider: gnome-3-28-1804:gnome-3-28-1804
gtk-3-themes:
interface: content
target: $SNAP/data-dir/themes
default-provider: gtk-common-themes:gtk-3-themes
icon-themes:
interface: content
target: $SNAP/data-dir/icons
default-provider: gtk-common-themes:icon-themes
sound-themes:
interface: content
target: $SNAP/data-dir/sounds
default-provider: gtk-common-themes:sounds-themes
slots:
dbus-jami:
interface: dbus
bus: session
name: net.jami.Jami
dbus-ring:
interface: dbus
bus: session
name: cx.ring.Ring
dbus-jamignome:
interface: dbus
bus: session
name: cx.ring.RingGnome
layout:
/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/webkit2gtk-4.0:
bind: $SNAP/gnome-platform/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/webkit2gtk-4.0
/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/alsa-lib:
bind: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/alsa-lib
/usr/local/share/jami-gnome:
bind: $SNAP/usr/share/jami-gnome
environment:
DISABLE_WAYLAND: 'true'
XDG_CURRENT_DESKTOP: Unity
apps:
jami:
command: usr/bin/jami-gnome
command-chain:
- bin/desktop-launch
- snap/command-chain/alsa-launch
- bin/jami-gnome-wrapper
common-id: net.jami.Jami
desktop: usr/share/applications/jami-gnome.desktop
slots:
- dbus-jami
- dbus-ring
- dbus-jamignome
plugs:
- audio-playback
- audio-record
- browser-support
- camera
- desktop
- desktop-legacy
- gsettings
- hardware-observe
- home
- network
- network-bind
- opengl
- removable-media
- unity7
- wayland
- x11
parts:
desktop-launch:
source: https://github.com/ubuntu/snapcraft-desktop-helpers.git
plugin: nil
build-packages:
- gcc-8
- qtbase5-dev
- dpkg-dev
stage-packages:
- libqt5gui5
- libqt5svg5 # for loading icon themes which are svg
- try: [appmenu-qt5] # not available on core18
override-pull: |
snapcraftctl pull
sed -i -E 's|\. \$SNAP/flavor-select|USE_gtk3=true|' gtk/launcher-specific
sed -i -E 's|\. \$SNAP/flavor-select|USE_qt5=true|' qt/launcher-specific
sed -i -E 's|(append_dir GTK_PATH \$RUNTIME/usr/lib/\$ARCH/gtk-2.0)|#\1|' qt/launcher-specific
sed -i -E 's|\$RUNTIME|$SNAP|g' qt/launcher-specific
sed -i -E 's|\$WITH_RUNTIME|no|g' qt/launcher-specific
override-build: |
snapcraftctl build
gcc -Wall -O2 -o bindtextdomain.so -fPIC -shared src/bindtextdomain.c -ldl
echo "#!/bin/bash" > desktop-launch
cat common/init >> desktop-launch
cat qt/runtime-exports >> desktop-launch
cat gtk/runtime-exports >> desktop-launch
cat common/desktop-exports >> desktop-launch
cat qt/launcher-specific >> desktop-launch
cat gtk/launcher-specific >> desktop-launch
cat common/mark-and-exec >> desktop-launch
install -D -m755 desktop-launch $SNAPCRAFT_PART_INSTALL/bin/desktop-launch
install -D -m644 bindtextdomain.so $SNAPCRAFT_PART_INSTALL/lib/bindtextdomain.so
mkdir -pv $SNAPCRAFT_PART_INSTALL/gnome-platform
scripts:
plugin: dump
source: scripts
organize:
jami-gnome-wrapper: bin/jami-gnome-wrapper
alsa-mixin:
plugin: dump
source: https://github.com/diddlesnaps/snapcraft-alsa.git
source-subdir: snapcraft-assets
build-packages:
- libasound2-dev
stage-packages:
- libasound2
- libasound2-plugins
jami:
after: [alsa-mixin]
source: ../../..
source-type: local
plugin: nil
parse-info: [usr/share/metainfo/jami-gnome.appdata.xml]
override-pull: |
snapcraftctl pull
sed -i -E 's|(tmpName) << (PACKAGE_NAME << "_shm_")|\1 << "snap.jami." << \2|' daemon/src/media/video/sinkclient.cpp
for file in jami-gnome.desktop jami-gnome.desktop.autostart; do
sed -i -E 's|^Icon=.*|Icon=${SNAP}/usr/share/icons/hicolor/scalable/apps/jami.svg|' client-gnome/$file
done
override-build: |
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 10
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 20
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 10
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 20
cd $SNAPCRAFT_PART_BUILD/daemon/contrib
mkdir -p native
cd native
../bootstrap
make .ffmpeg
make
cd $SNAPCRAFT_PART_BUILD/daemon
./autogen.sh
./configure --prefix=/usr --disable-shared
make -j$SNAPCRAFT_PARALLEL_BUILD_COUNT
DESTDIR=$SNAPCRAFT_PART_INSTALL make install
cd $SNAPCRAFT_PART_BUILD/lrc
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_PREFIX_PATH=$SNAPCRAFT_PART_INSTALL/usr \
-DRING_BUILD_DIR=$SNAPCRAFT_PART_BUILD/daemon/src
make -j$SNAPCRAFT_PARALLEL_BUILD_COUNT
DESTDIR=$SNAPCRAFT_PART_INSTALL make install
sed -i "s|/usr|$SNAPCRAFT_PART_INSTALL/usr|g" $SNAPCRAFT_PART_INSTALL/usr/lib/cmake/LibRingClient/LibRingClientConfig.cmake
cd $SNAPCRAFT_PART_BUILD/client-gnome
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_PREFIX_PATH=$SNAPCRAFT_PART_INSTALL/usr \
-DLibRingClient_DIR=$SNAPCRAFT_PART_INSTALL/usr/lib/cmake/LibRingClient
make -j$SNAPCRAFT_PARALLEL_BUILD_COUNT
DESTDIR=$SNAPCRAFT_PART_INSTALL make install
build-packages:
- autoconf
- autoconf-archive
- automake
- autopoint
- bzip2
- cmake
- curl
- g++-8
- gettext
- gnome-icon-theme-symbolic
- gzip
- libappindicator3-dev
- libayatana-appindicator3-dev
- libasound2-dev
- libavcodec-dev
- libavdevice-dev
- libavformat-dev
- libboost-dev
- libcanberra-gtk3-dev
- libclutter-gtk-1.0-dev
- libdbus-1-dev
- libdbus-c++-dev
- libexpat1-dev
- libgnutls28-dev
- libgsm1-dev
- libgtk-3-dev
- libjack-jackd2-dev
- libjsoncpp-dev
- libnotify-dev
- libopus-dev
- libpcre3-dev
- libpulse-dev
- libqrencode-dev
- libsamplerate0-dev
- libsndfile1-dev
- libspeex-dev
- libspeexdsp-dev
- libsrtp0-dev
- libswscale-dev
- libtool
- libudev-dev
- libupnp-dev
- libva-dev
- libvdpau-dev
- libwebkit2gtk-4.0-dev
- libyaml-cpp-dev
- nasm # seems to be needed for building libvpx on an 18.04 base
- qtbase5-dev
- qttools5-dev
- uuid-dev
- yasm
stage-packages:
- freeglut3
- libappindicator3-1
- libayatana-appindicator3-1
- libavcodec-extra
- libavcodec57
- libavdevice57
- libavformat57
- libdbus-1-3
- libdbus-c++-1-0v5
- libebook-1.2-19
- libexpat1
- libglu1-mesa
- libgnutls30
- libgsm1
- libjack-jackd2-0
- libjsoncpp1
- libopus0
- libpcre3
- libqrencode3
- libqt5core5a
- libqt5dbus5
- libqt5gui5
- libqt5sql5
- libqt5sql5-sqlite
- libsamplerate0
- libslang2
- libsndfile1
- libspeex1
- libspeexdsp1
- libswscale4
- libudev1
- libupnp6
- libuuid1
- libva-drm2
- libva-glx2
- libva-wayland2
- libva2
- libvdpau-va-gl1
- libvdpau1
- va-driver-all
Description: add and run our build script
Also, use bionic (18.04) as the base image, since xenial lacks
libayatana-appindicator3-dev.
Author: Amin Bandali <amin.bandali@savoirfairelinux.com>
--- ../docker/Dockerfile_snap.original 2020-11-23 15:51:17.211591055 -0500
+++ ../docker/Dockerfile_snap 2020-11-23 15:52:29.247759416 -0500
@@ -1,4 +1,4 @@
-FROM ubuntu:xenial as builder
+FROM ubuntu:bionic as builder
# Grab dependencies
RUN apt-get update
@@ -36,7 +36,7 @@
# Multi-stage build, only need the snaps from the builder. Copy them one at a
# time so they can be cached.
-FROM ubuntu:xenial
+FROM ubuntu:bionic
COPY --from=builder /snap/core /snap/core
COPY --from=builder /snap/core18 /snap/core18
COPY --from=builder /snap/snapcraft /snap/snapcraft
@@ -53,3 +53,7 @@
ENV SNAP="/snap/snapcraft/current"
ENV SNAP_NAME="snapcraft"
ENV SNAP_ARCH="amd64"
+
+ADD scripts/build-package-snap.sh /opt/build-package-snap.sh
+
+CMD /opt/build-package-snap.sh
#!/usr/bin/env bash
#
# Copyright (C) 2020 Savoir-faire Linux Inc.
#
# Author: Amin Bandali <amin.bandali@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 script is used in the packaging containers to build a snap
# package on an ubuntu base distro.
set -e
cp -rp /opt/ring-project-ro /opt/ring-project
cd /opt/ring-project/packaging/rules/snap/
# set the version and tarball filename
sed -i "s/RELEASE_VERSION/${RELEASE_VERSION}/g" snapcraft.yaml
snapcraft
# move the built snap to output
mv *.snap /opt/output/
chown ${CURRENT_UID}:${CURRENT_GID} /opt/output/*.snap
......@@ -182,6 +182,33 @@ EOF
}
####################
## Snap packaging ##
####################
function package_snap()
{
echo "####################"
echo "## deploying snap ##"
echo "####################"
if [[ "${CHANNEL:0:19}" == "internal_experiment" ]];
then
DISTRIBUTION_REPOSITOIRY_FOLDER=$(realpath repositories)/${DISTRIBUTION}
mkdir -p ${DISTRIBUTION_REPOSITOIRY_FOLDER}
cp packages/${DISTRIBUTION}*/*.snap ${DISTRIBUTION_REPOSITOIRY_FOLDER}/
elif [[ "${CHANNEL:0:7}" == "nightly" ]];
then
snapcraft login --with ${SNAPCRAFT_LOGIN}
snapcraft push packages/${DISTRIBUTION}*/*.snap --release edge
elif [[ "${CHANNEL:0:6}" == "stable" ]];
then
snapcraft login --with ${SNAPCRAFT_LOGIN}
snapcraft push packages/${DISTRIBUTION}*/*.snap --release stable
fi
}
################################################
## Deploy packages on given remote repository ##
################################################
......@@ -221,6 +248,9 @@ function package()
elif [[ "${DISTRIBUTION:0:6}" == "fedora" || "${DISTRIBUTION:0:4}" == "rhel" || "${DISTRIBUTION:0:13}" == "opensuse-leap" || "${DISTRIBUTION:0:19}" == "opensuse-tumbleweed" ]];
then
package_rpm
elif [[ "${DISTRIBUTION:0:4}" == "snap" ]];
then
package_snap
else
echo "ERROR: Distribution '${DISTRIBUTION}' is unsupported"
fi
......@@ -257,6 +287,10 @@ case $i in
SSH_IDENTIY_FILE="${i#*=}"
shift
;;
--snapcraft-login=*)
SNAPCRAFT_LOGIN="${i#*=}"
shift
;;
*)
echo "Unrecognized option ${i}"
exit 1
......
......@@ -13,6 +13,9 @@ export OSTYPE
set -ex
# Qt_MIN_VER required for client-qt
QT5_MIN_VER="5.14"
global=false
static=''
client=''
......@@ -104,6 +107,33 @@ fi
make -j"${proc}"
make_install "${global}" "${priv_install}"
# For the client-qt, verify system's version if no path provided
if [ "${client}" = "client-qt" ] && [ -z "$qt5path" ]; then
sys_qt5ver=""
if command -v qmake &> /dev/null; then
sys_qt5ver=$(qmake -v)
elif command -v qmake-qt5 &> /dev/null; then
sys_qt5ver=$(qmake-qt5 -v) # Fedora
else
echo "No valid Qt found"; exit 1;
fi
sys_qt5ver=${sys_qt5ver#*Qt version}
sys_qt5ver=${sys_qt5ver%\ in\ *}
installed_qt5ver=$(echo $sys_qt5ver| cut -d'.' -f 2)
required_qt5ver=$(echo $QT5_MIN_VER| cut -d'.' -f 2)
if [[ $installed_qt5ver -ge $required_qt5ver ]] ; then
# Disable qt5path and qt5ver in order to use system's Qt
qt5path=""
qt5ver=""
else
echo "No valid Qt found"; exit 1;
fi
fi
# libringclient
cd "${TOP}/lrc"
mkdir -p "${BUILDDIR}"
......@@ -113,12 +143,12 @@ if [ "${global}" = "true" ]; then
cmake .. -DCMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}" \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_INSTALL_PREFIX="${prefix}" $static \
-DQT_MIN_VER="${qt5ver}" \
-DQT5_VER="${qt5ver}" \
-DQT5_PATH="${qt5path}"
else
cmake .. -DCMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}" \
-DCMAKE_BUILD_TYPE=Debug $static \
-DQT_MIN_VER="${qt5ver}" \
-DQT5_VER="${qt5ver}" \
-DQT5_PATH="${qt5path}"
fi
else
......@@ -126,7 +156,7 @@ else
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_INSTALL_PREFIX="${INSTALL}/lrc" \
-DRING_BUILD_DIR="${DAEMON}/src" $static \
-DQT_MIN_VER="${qt5ver}" \
-DQT5_VER="${qt5ver}" \
-DQT5_PATH="${qt5path}"
fi
make -j"${proc}"
......@@ -137,23 +167,17 @@ cd "${TOP}/${client}"
mkdir -p "${BUILDDIR}"
cd "${BUILDDIR}"
if [ "${client}" = "client-qt" ]; then
echo building client-qt using Qt ${qt5ver}
if ! command -v qmake &> /dev/null; then
eval ${qt5path}/bin/qmake PREFIX="${INSTALL}/${client}" ..
else
# Extract installed Qt version and compare with minimum required
sys_qt5ver=$(qmake -v)
sys_qt5ver=${sys_qt5ver#*Qt version}
sys_qt5ver=${sys_qt5ver%\ in\ *}
installed_qt5ver=$(echo $sys_qt5ver| cut -d'.' -f 2)
required_qt5ver=$(echo $qt5ver| cut -d'.' -f 2)
if [[ $installed_qt5ver -ge $required_qt5ver ]] ; then
if [ -z ${qt5path} ]; then
if command -v qmake &> /dev/null; then
echo "Build client-qt with $(qmake -v)"
qmake PREFIX="${INSTALL}/${client}" ..
else
eval ${qt5path}/bin/qmake PREFIX="${INSTALL}/${client}" ..
echo "Build client-qt with $(qmake-qt5 -v)" # Fedora
qmake-qt5 PREFIX="${INSTALL}/${client}" ..
fi
else
echo "Build client-qt using Qt ${qt5path}"
eval ${qt5path}/bin/qmake PREFIX="${INSTALL}/${client}" ..
fi
else
if [ "${global}" = "true" ]; then
......
......@@ -47,6 +47,7 @@ PACKAGE_%(distribution)s_DOCKER_RUN_COMMAND = docker run \\
-e DEBIAN_VERSION=%(version)s \\
-e DEBIAN_PACKAGING_OVERRIDE=%(debian_packaging_override)s \\
-e CURRENT_UID=$(CURRENT_UID) \\
-e CURRENT_GID=$(CURRENT_GID) \\
-e DISTRIBUTION=%(distribution)s \\
-v $(CURDIR):/opt/ring-project-ro:ro \\
-v $(CURDIR)/packages/%(distribution)s:/opt/output \\
......@@ -400,6 +401,12 @@ def run_generate_all(parsed_args):
"debian_packaging_override": "",
"output_file": ".packages-built",
},
# Snap
{
"distribution": "snap",
"debian_packaging_override": "",
"output_file": ".packages-built",
},
]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment