chore(CI): Use docker for CI scripts

Motiviation:
* Reproducing issues in CI is currently difficult
* Predicting issues in CI is currently difficult if you are not on
  ubuntu 18.04
* Reproducing issues submitted from other distros is currently done by
  creating a VM of that distro and building qtox for it locally
* Documentation for how to build on different distros is out of date
* Issues on non-ubuntu distributions are not caught by CI
* Cross compiling for windows locally is not trivial
* Iterating when working with custom build scripts is slow, scripts
  don't necessarily support re-running without re-starting the docker
  container and re-building qtox again
* Updating dependencies is a pain

Changes:
* docker-compose file has been added to the root of our repo.
  After `docker compose run --rm ubuntu` (or other supported distros),
  you are ready to compile and run qtox
* Dependencies are owned by dependency install scripts in buildscripts/.
  This allows us to use the same exact dependencies in our
  OSX/windows/linux scripts
* New docker images have been added for a variety of distributions.
  These are now run in CI in a variety of configurations
  * Docker images are cached in CI so rebuild time for the majority of
    jobs is quite quick
* Build scripts have been trimmed to leverage state of docker
  containers.
  * Windows build script no longer installs anything, dependencies are
    now managed by the windows_builder docker images
  * Build scripts should now be easily re-runnable. Usage is now `docker
    compose run --rm <image>` and then run the scripts
* All artifacts are now uploaded to github after build, this means we
  can take an appimage/flatpak/exe/dmg for any given PR and try it out
  without having to build it ourselves

Notes:
* Docker image size is quite important. We have a maximum of 5GB cache
  space on github actions. The majority of the linux distro docker
  images cache at ~300-400MB, which gives us room to test ~6 distros
  after accounting for the sizes of flatpak/windows docker images
* Docker layer ordering is relatively intentional. Approximate order
  should be that large dependencies that change infrequently should be
  farther up. This lowers the amount of rebuilding we have to do when
  dependencies are updated
* download_xxx.sh scripts are the cleanest way I could find to implement
  a shared dependency map between osx scripts and docker containers.
  Although it would be nice to have a single dependency mapping file,
  splitting it into individual scripts allows us to only rebuild some
  docker layers when dependencies are updated.
* Github actions are split between docker image building and docker
  image use. This allows us to re-use the same docker images for
  multiple jobs, but only build it once
  * Unfortunately I could not find a way to de-duplicate the stitching
    between jobs, so we have a lot of copy pasta in that area
reviewable/pr6413/r6
Mick Sayson 2021-11-07 21:27:45 -08:00
parent 7f4c308990
commit 8abe8320d2
84 changed files with 3561 additions and 2671 deletions

View File

@ -0,0 +1,25 @@
name: 'Build docker image'
inputs:
docker_image_name:
description: "Name of docker image"
required: True
runs:
using: 'composite'
steps:
- uses: docker/setup-buildx-action@master
- name: Setup buildx cache
uses: actions/cache@v2
with:
path: |
/tmp/.buildx-cache
key: ${{ runner.os }}-${{ inputs.docker_image_name }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-${{ inputs.docker_image_name }}-
- name: Build docker image
shell: bash
run: docker buildx bake --set *.cache-to=type=local,dest=/tmp/.buildx-cache-new,mode=max --set *.cache-from=type=local,src=/tmp/.buildx-cache -f docker-compose.yml ${{ inputs.docker_image_name }}
- name: Replace buildx cache
shell: bash
run: |
rm -fr /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache

View File

@ -0,0 +1,18 @@
name: 'Load docker image'
inputs:
docker_image_name:
description: "Name of docker image"
required: True
runs:
using: 'composite'
steps:
- uses: docker/setup-buildx-action@master
- name: Setup buildx cache
uses: actions/cache@v2
with:
path: |
/tmp/.buildx-cache
key: ${{ runner.os }}-${{ inputs.docker_image_name }}-${{ github.sha }}
- name: Load cached docker images
shell: bash
run: docker buildx bake --set *.cache-from=type=local,src=/tmp/.buildx-cache -f docker-compose.yml ${{ inputs.docker_image_name }} --load

View File

@ -1,6 +1,296 @@
name: Test
on: [pull_request, push]
jobs:
build-flatpak-docker:
name: Build flatpak docker
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/build-docker-image
name: "Build docker image"
with:
docker_image_name: flatpak
build-ubuntu-lts-docker:
name: Build ubuntu LTS docker image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/build-docker-image
name: "Build docker image"
with:
docker_image_name: ubuntu_lts
build-debian-docker:
name: Build debian docker image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/build-docker-image
name: "Build docker image"
with:
docker_image_name: debian
build-debian-old-docker:
name: Build old debian docker image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/build-docker-image
name: "Build docker image"
with:
docker_image_name: debian_old
build-centos-docker:
name: Build centos docker image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/build-docker-image
name: "Build docker image"
with:
docker_image_name: centos
build-fedora-docker:
name: Build fedora docker image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/build-docker-image
name: "Build docker image"
with:
docker_image_name: fedora
build-opensuse-docker:
name: Build opensuse docker image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/build-docker-image
name: "Build docker image"
with:
docker_image_name: opensuse
build-windows-docker:
name: Build windows docker image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/build-docker-image
name: "Build docker image"
with:
docker_image_name: windows_builder
build-windows-i686-docker:
name: Build 32 bit windows docker image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/build-docker-image
name: "Build docker image"
with:
docker_image_name: windows_builder.i686
build-centos:
name: Centos
runs-on: ubuntu-latest
needs: build-centos-docker
strategy:
matrix:
features: [full, minimal]
build_type: [Debug, Release]
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/load-docker-image
name: Load docker image
with:
docker_image_name: centos
- name: Run build
run: docker compose run --rm centos ./.travis/build-qtox-linux.sh --build-type ${{ matrix.build_type }} --${{ matrix.features }}
build-fedora:
name: Fedora
runs-on: ubuntu-latest
needs: build-fedora-docker
strategy:
matrix:
features: [full, minimal]
build_type: [Debug, Release]
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/load-docker-image
name: Load docker image
with:
docker_image_name: fedora
- name: Run build
run: docker compose run --rm fedora ./.travis/build-qtox-linux.sh --build-type ${{ matrix.build_type }} --${{ matrix.features }}
build-opensuse:
name: Opensuse
runs-on: ubuntu-latest
needs: build-opensuse-docker
strategy:
matrix:
features: [full, minimal]
build_type: [Debug, Release]
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/load-docker-image
name: Load docker image
with:
docker_image_name: opensuse
- name: Run build
run: docker compose run --rm opensuse ./.travis/build-qtox-linux.sh --build-type ${{ matrix.build_type }} --${{ matrix.features }}
build-debian:
name: Debian
runs-on: ubuntu-latest
needs: build-debian-docker
strategy:
matrix:
features: [full, minimal]
build_type: [Debug, Release]
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/load-docker-image
name: Load docker image
with:
docker_image_name: debian
- name: Run build
run: docker compose run --rm debian ./.travis/build-qtox-linux.sh --build-type ${{ matrix.build_type }} --${{ matrix.features }}
build-debian-old:
name: Debian Old
runs-on: ubuntu-latest
needs: build-debian-old-docker
strategy:
matrix:
features: [full, minimal]
build_type: [Debug, Release]
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/load-docker-image
name: Load docker image
with:
docker_image_name: debian_old
- name: Run build
run: docker compose run --rm debian_old ./.travis/build-qtox-linux.sh --build-type ${{ matrix.build_type }} --${{ matrix.features }}
build-ubuntu:
name: Ubuntu LTS
runs-on: ubuntu-latest
needs: build-ubuntu-lts-docker
strategy:
matrix:
features: [full, minimal]
build_type: [Debug, Release]
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/load-docker-image
name: Load docker image
with:
docker_image_name: ubuntu_lts
- name: Run build
run: docker compose run --rm ubuntu_lts ./.travis/build-qtox-linux.sh --build-type ${{ matrix.build_type }} --${{ matrix.features }}
- name: Code coverage
run: |
# https://github.com/actions/runner/issues/491
if [ "${{ matrix.build_type }}" == "Release" ] && [ "${{ matrix.features }}" == "full" ]; then
docker compose run --rm ubuntu_lts ./.travis/lcov.sh
# Upload report to codecov.io
bash <(curl -s https://codecov.io/bash) -f coverage.info || echo "Codecov did not collect coverage reports"
fi
build-appimage:
name: Appimage
runs-on: ubuntu-latest
needs: build-ubuntu-lts-docker
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/load-docker-image
name: Load docker image
with:
docker_image_name: ubuntu_lts
- name: Run build
run: docker compose run --rm ubuntu_lts ./appimage/build.sh --src-dir /qtox
- name: Upload appimage
uses: actions/upload-artifact@v2
with:
name: qTox-${{ github.sha }}.x86_64.AppImage
path: qTox-*.x86_64.AppImage
build-flatpak:
name: Flatpak
runs-on: ubuntu-latest
needs: build-flatpak-docker
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/load-docker-image
name: Load docker image
with:
docker_image_name: flatpak
- name: Run build
run: docker compose run --rm flatpak ./flatpak/build.sh
- name: Upload flatpak
uses: actions/upload-artifact@v2
with:
name: qTox-${{ github.sha }}.x86_64.flatpak
path: qtox.flatpak
build-windows:
name: Windows
runs-on: ubuntu-latest
needs: build-windows-docker
strategy:
matrix:
build_type: [debug, release]
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/load-docker-image
name: Load docker image
with:
docker_image_name: windows_builder
- name: Run build
run: docker compose run --rm windows_builder ./windows/cross-compile/build.sh --arch x86_64 --build-type ${{ matrix.build_type }} --src-dir /qtox
- name: Upload installer
uses: actions/upload-artifact@v2
with:
name: setup-qtox-x86_64-${{ matrix.build_type }}.exe
path: package-prefix/setup-qtox.exe
if-no-files-found: ignore
- name: Upload zip
uses: actions/upload-artifact@v2
with:
name: setup-qtox-x86_64-${{ matrix.build_type }}.zip
path: install-prefix/qtox-x86_64-debug.zip
if-no-files-found: ignore
build-windows-i686:
name: Windows i686
runs-on: ubuntu-latest
needs: build-windows-i686-docker
strategy:
matrix:
build_type: [debug, release]
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/load-docker-image
name: Load docker image
with:
docker_image_name: windows_builder.i686
- name: Run build
run: docker compose run --rm windows_builder.i686 ./windows/cross-compile/build.sh --arch i686 --build-type ${{ matrix.build_type }} --src-dir /qtox
- name: Upload installer
uses: actions/upload-artifact@v2
with:
name: setup-qtox-i686-${{ matrix.build_type }}.exe
path: package-prefix/setup-qtox.exe
if-no-files-found: ignore
- name: Upload zip
uses: actions/upload-artifact@v2
with:
name: setup-qtox-i686-${{ matrix.build_type }}.zip
path: install-prefix/qtox-i686-debug.zip
if-no-files-found: ignore
build-osx:
name: macOS
runs-on: macos-10.15
env:
TRAVIS: true
TRAVIS_BUILD_DIR: ${{ github.workspace }}
steps:
- uses: actions/checkout@v2
- name: homebrew
run: brew upgrade && brew bundle --file ./osx/Brewfile
- name: Run
run: ./.travis/build-osx.sh
- name: Upload dmg
uses: actions/upload-artifact@v2
with:
name: qTox-${{ github.sha }}.dmg
path: qTox-Mac_Build/qTox.dmg
build-docs:
name: Docs
runs-on: ubuntu-18.04
@ -21,103 +311,3 @@ jobs:
run: sudo apt-get install gitstats
- name: Run
run: ./.travis/build-gitstats.sh
build-qtox:
name: Linux
runs-on: ubuntu-18.04
env:
CC: gcc
CXX: g++
steps:
- uses: actions/checkout@v2
- name: Install deps
run: sudo apt-get install ccache lcov
- name: Run
run: ./.travis/build-ubuntu-16-04.sh
- name: Code test coverage
run: |
# Create lcov report
lcov --directory _build --capture --output-file coverage.info
# Filter out system headers and test sources
lcov --remove coverage.info '/usr/*' '*/test/*' '*/*_autogen/*' --output-file coverage.info
# Upload report to codecov.io
bash <(curl -s https://codecov.io/bash) -f coverage.info || echo "Codecov did not collect coverage reports"
build-osx:
name: macOS
runs-on: macos-10.15
env:
TRAVIS: true
TRAVIS_BUILD_DIR: ${{ github.workspace }}
steps:
- uses: actions/checkout@v2
- name: homebrew
run: brew upgrade && brew bundle --file ./osx/Brewfile
- name: Run
run: ./.travis/build-osx.sh
APPIMAGE:
name: AppImage
runs-on: ubuntu-18.04
env:
TRAVIS_TAG:
TRAVIS_COMMIT: ${{ github.sha }}
steps:
- uses: actions/checkout@v2
- name: Run
run: ./appimage/build-appimage.sh
FLATPAK:
name: Flatpak
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Run
run: ./flatpak/build-flatpak.sh
win-deps:
name: Windows Deps
runs-on: ubuntu-latest
strategy:
matrix:
arch: [i686, x86_64]
env:
BUILD__: ${{ matrix.arch }}
steps:
- uses: actions/checkout@v2
- name: Cache dependencies
uses: actions/cache@v2
with:
path: cache
key: deps-${{ matrix.arch }}-${{ hashFiles('windows/cross-compile/build.sh') }}-${{ hashFiles('.travis/build-windows.sh') }}
- name: Install deps
run: |
sudo apt-get update
sudo apt-get install zip tree
- name: Deps build stage 1
run: |
./.travis/build-windows.sh "$BUILD__" "release" "cache/${BUILD__}" stage1
- name: Deps build stage 2
run: |
./.travis/build-windows.sh "$BUILD__" "release" "cache/${BUILD__}" stage2
ls -al cache
win:
name: Windows
runs-on: ubuntu-latest
needs: win-deps
strategy:
matrix:
arch: [i686, x86_64]
type: [debug, release]
env:
BUILD__: ${{ matrix.arch }}
BTYPE__: ${{ matrix.type }}
steps:
- uses: actions/checkout@v2
- name: Fetch cached dependencies
uses: actions/cache@v2
with:
path: cache
key: deps-${{ matrix.arch }}-${{ hashFiles('windows/cross-compile/build.sh') }}-${{ hashFiles('.travis/build-windows.sh') }}
- name: qTox build
run: |
./.travis/build-windows.sh "$BUILD__" "$BTYPE__" "cache/${BUILD__}" stage3
- name: Debug info
run: |
ls -al ~/
tree ~/project/workspace -L 4

77
.travis/build-qtox-linux.sh Executable file
View File

@ -0,0 +1,77 @@
#!/bin/bash
# Copyright © 2021 by The qTox Project Contributors
#
# This program is libre 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 -euo pipefail
usage() {
echo "$0 [--minimal|--full] --build-type [Debug|Release]"
echo "Build script to build/test qtox from a CI environment."
echo "--minimal or --full are requied, --build-type is required."
}
while (( $# > 0 )); do
case $1 in
--minimal) MINIMAL=1 ; shift ;;
--full) MINIMAL=0; shift ;;
--build-type) BUILD_TYPE=$2; shift 2 ;;
--help|-h) usage; exit 1 ;;
*) echo "Unexpected argument $1"; usage; exit 1 ;;
esac
done
if [ -z "${MINIMAL+x}" ]; then
echo "Please build either minimal or full version of qtox"
usage
exit 1
fi
if [ -z "${BUILD_TYPE+x}" ]; then
echo "Please spedify build type"
usage
exit 1
fi
SRCDIR=/qtox
BUILDDIR=/qtox/build
rm -fr "$BUILDDIR"
mkdir -p "$BUILDDIR"
cd "$BUILDDIR"
if [ $MINIMAL -eq 1 ]; then
cmake "$SRCDIR" \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DSMILEYS=DISABLED \
-DSTRICT_OPTIONS=ON \
-DSPELL_CHECK=OFF
else
cmake "$SRCDIR" \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DUPDATE_CHECK=ON \
-DSTRICT_OPTIONS=ON \
-DCODE_COVERAGE=ON \
-DDESKTOP_NOTIFICATIONS=ON
fi
cmake --build . -- -j $(nproc)
cmake --build . --target test
echo "Checking whether files processed by CMake have been committed..."
echo ""
# ↓ `0` exit status only if there are no changes
git diff --exit-code

View File

@ -1,229 +0,0 @@
#!/bin/bash
#
# Copyright © 2015-2019 by The qTox Project Contributors
#
# This program is libre 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/>.
#
# stop as soon as one of steps will fail
set -e -o pipefail
sudo apt-get update -qq
# install needed Qt, OpenAL, opus, qrencode, GTK tray deps, sqlcipher
# `--force-yes` since we don't care about GPG failing to work with short IDs
sudo apt-get install -y --force-yes \
automake \
autotools-dev \
build-essential \
check \
checkinstall \
libexif-dev \
libgdk-pixbuf2.0-dev \
libglib2.0-dev \
libgtk2.0-dev \
libkdeui5 \
libopenal-dev \
libopus-dev \
libqrencode-dev \
libsqlcipher-dev \
libtool \
libvpx-dev \
libxss-dev qrencode \
qt5-default \
qttools5-dev-tools \
qttools5-dev \
libqt5opengl5-dev \
libqt5svg5-dev \
pkg-config || yes
# ffmpeg
if [ ! -e "libs" ]; then mkdir libs; fi
if [ ! -e "ffmpeg" ]; then mkdir ffmpeg; fi
#
cd libs/
export PREFIX_DIR="$PWD"
#
cd ../ffmpeg
curl -o ffmpeg.bz2 http://ffmpeg.org/releases/ffmpeg-2.8.5.tar.bz2
tar xf ffmpeg.bz2
rm ffmpeg.bz2
cd ffmpeg*
# enabled:
# v4l2 -> webcam
# x11grab_xcb -> screen grabbing
# demuxers, decoders and parsers needed for webcams:
# mjpeg, h264
CC="ccache $CC" CXX="ccache $CXX" ./configure --prefix="$PREFIX_DIR" \
--disable-avfilter \
--disable-avresample \
--disable-bzlib \
--disable-bsfs \
--disable-dct \
--disable-decoders \
--disable-demuxers \
--disable-doc \
--disable-dwt \
--disable-encoders \
--disable-faan \
--disable-fft \
--disable-filters \
--disable-iconv \
--disable-indevs \
--disable-lsp \
--disable-lzma \
--disable-lzo \
--disable-mdct \
--disable-muxers \
--disable-network \
--disable-outdevs \
--disable-parsers \
--disable-postproc \
--disable-programs \
--disable-protocols \
--disable-rdft \
--disable-sdl \
--disable-static \
--disable-swresample \
--disable-swscale-alpha \
--disable-vaapi \
--disable-vdpau \
--disable-xlib \
--disable-yasm \
--disable-zlib \
--enable-shared \
--enable-memalign-hack \
--enable-indev=v4l2 \
--enable-indev=x11grab_xcb \
--enable-demuxer=h264 \
--enable-demuxer=mjpeg \
--enable-parser=h264 \
--enable-parser=mjpeg \
--enable-decoder=h264 \
--enable-decoder=mjpeg
CC="ccache $CC" CXX="ccache $CXX" make -j$(nproc)
make install
cd ../../
# libsodium
git clone git://github.com/jedisct1/libsodium.git
cd libsodium
git checkout tags/1.0.18
./autogen.sh
CC="ccache $CC" CXX="ccache $CXX" ./configure
CC="ccache $CC" CXX="ccache $CXX" make -j$(nproc)
sudo checkinstall --install --pkgname libsodium --pkgversion 1.0.8 --nodoc -y
sudo ldconfig
cd ..
# toxcore
git clone --branch v0.2.13 --depth=1 https://github.com/toktok/c-toxcore.git toxcore
cd toxcore
mkdir build-cmake
cd build-cmake
CC="ccache $CC" CXX="ccache $CXX" cmake ..
make -j$(nproc) > /dev/null
sudo make install
echo '/usr/local/lib/' | sudo tee -a /etc/ld.so.conf.d/locallib.conf
sudo ldconfig
cd ../..
# filteraudio
git clone --branch v0.0.1 --depth=1 https://github.com/irungentoo/filter_audio filteraudio
cd filteraudio
CC="ccache $CC" CXX="ccache $CXX" sudo make install -j$(nproc)
sudo ldconfig
cd ..
# toxext
git clone --branch v0.0.3 --depth=1 https://github.com/toxext/toxext toxext
cd toxext
mkdir build
cd build
cmake ..
make -j$(nproc)
sudo make install
cd ../../
# toxext_messages
git clone --branch v0.0.3 --depth=1 https://github.com/toxext/tox_extension_messages tox_extension_messages
cd tox_extension_messages
mkdir build
cd build
cmake ..
make -j$(nproc)
sudo make install
cd ../../
# needed, otherwise ffmpeg doesn't get detected
export PKG_CONFIG_PATH="$PWD/libs/lib/pkgconfig"
$CC --version
$CXX --version
build_qtox() {
bdir() {
cd $BUILDDIR
make -j$(nproc)
# check if `qtox` file has been made, is non-empty and is an executable
[[ -s qtox ]] && [[ -x qtox ]]
cd -
}
local BUILDDIR=_build
# first build qTox without support for optional dependencies
echo '*** BUILDING "MINIMAL" VERSION ***'
cmake -H. -B"$BUILDDIR" \
-DSMILEYS=DISABLED \
-DSTRICT_OPTIONS=ON \
-DSPELL_CHECK=OFF
bdir
# clean it up, and build normal version
rm -rf "$BUILDDIR"
echo '*** BUILDING "FULL" VERSION ***'
cmake -H. -B"$BUILDDIR" \
-DUPDATE_CHECK=ON \
-DSTRICT_OPTIONS=ON \
-DCODE_COVERAGE=ON
bdir
}
test_qtox() {
local BUILDDIR=_build
cd $BUILDDIR
make test
cd -
}
# CMake is supposed to process files, e.g. ones with versions.
# Check whether those changes have been committed.
check_if_differs() {
echo "Checking whether files processed by CMake have been committed..."
echo ""
# ↓ `0` exit status only if there are no changes
git diff --exit-code
}
main() {
build_qtox
test_qtox
check_if_differs
}
main

21
.travis/lcov.sh Executable file
View File

@ -0,0 +1,21 @@
#!/bin/bash
# Copyright © 2021 by The qTox Project Contributors
#
# This program is libre 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/>.
# Create lcov report
lcov --directory /qtox/build --capture --output-file coverage.info
# Filter out system headers and test sources
lcov --remove coverage.info '/usr/*' '*/test/*' '*/*_autogen/*' --output-file coverage.info

View File

@ -24,6 +24,7 @@
- [Slackware](#slackware-other-deps)
- [Ubuntu](#ubuntu-other-deps)
- [Compile dependencies](#compile-dependencies)
- [docker](#docker)
- [bootstrap.sh](#bootstrap.sh)
- [Compile toxcore](#compile-toxcore)
- [Compile extensions](#compile-extensions)
@ -270,178 +271,31 @@ The following steps assumes that you cloned the repository at
corresponding parts.
### Docker
Development can be done within one of the many provided docker containers. See the available configurations in docker-compose.yml. These docker images have all the required dependencies for development already installed. Run `docker compose run --rm ubuntu_lts` and proceed to [compiling qTox](#compile-qtox). If you want to avoid compiling as root in the docker image, you can run `USER_ID=$(id -u) GROUP_ID=$(id -g) docker compose run --rm ubuntu_lts` instead.
NOTE: qtox will not run in the docker container unless your x11 session allows connections from other users. If X11 is giving you issues in the docker image, try `xhost +` on your host machine
<a name="other-deps" />
### GCC, Qt, FFmpeg, OpenAL Soft and qrencode
<a name="arch-other-deps" />
#### Arch Linux
```bash
sudo pacman -S --needed base-devel qt5 openal libxss qrencode ffmpeg opus libvpx libsodium sqlcipher cmake
```
<a name="debian-other-deps" />
#### Debian
```bash
sudo apt-get install \
automake \
autotools-dev \
build-essential \
check \
checkinstall \
cmake \
ffmpeg \
libavcodec-dev \
libavdevice-dev \
libexif-dev \
libgdk-pixbuf2.0-dev \
libgtk2.0-dev \
libopenal-dev \
libopus-dev \
libqrencode-dev \
libqt5opengl5-dev \
libqt5svg5-dev \
libsodium-dev \
libsqlcipher-dev \
libtool \
libvpx-dev \
libxss-dev \
pkg-config \
qrencode \
qtbase5-dev \
qttools5-dev \
qttools5-dev-tools \
yasm
```
<a name="fedora-other-deps" />
#### Fedora
To install FFmpeg, the [RPM Fusion](https://rpmfusion.org/) repo is required.
```bash
sudo dnf group install "Development Tools" "C Development Tools and Libraries"
# (can also use):
# sudo dnf install @"Development Tools" @"C Development Tools and Libraries"
sudo dnf install \
autoconf \
automake \
check \
check-devel \
ffmpeg-devel \
gtk2-devel \
kf5-sonnet \
libexif-devel \
libsodium-devel \
libtool \
libvpx-devel \
libXScrnSaver-devel \
openal-soft-devel \
openssl-devel \
opus-devel \
qrencode-devel \
qt5-devel \
qt5-linguist \
qt5-qtsvg \
qt5-qtsvg-devel \
qt-creator \
qt-doc \
qtsingleapplication-qt5 \
sqlcipher \
sqlcipher-devel
```
<a name="opensuse-other-deps" />
#### openSUSE
```bash
sudo zypper install \
libexif-devel \
libffmpeg-devel \
libopus-devel \
libQt5Concurrent-devel \
libqt5-linguist \
libQt5Network-devel \
libQt5OpenGL-devel \
libqt5-qtbase-common-devel \
libqt5-qtsvg-devel \
libQt5Xml-devel \
libsodium-devel \
libvpx-devel \
libXScrnSaver-devel \
openal-soft-devel \
patterns-openSUSE-devel_basis \
qrencode-devel \
sqlcipher-devel \
sonnet-devel \
qt5-linguist-devel \
libQt5Test-devel \
ffmpeg-4-libavcodec-devel \
ffmpeg-4-libavdevice-devel
```
<a name="slackware-other-deps" />
#### Slackware
List of all the toxcore dependencies and their SlackBuilds can be found
here: http://slackbuilds.org/repository/14.2/network/toxcore/
List of all the qTox dependencies and their SlackBuilds can be found here:
http://slackbuilds.org/repository/14.2/network/qTox/
<a name="ubuntu-other-deps" />
#### Ubuntu:
```bash
sudo apt-get install \
build-essential \
cmake \
libavcodec-dev \
libavdevice-dev \
libavfilter-dev \
libavutil-dev \
libexif-dev \
libgdk-pixbuf2.0-dev \
libglib2.0-dev \
libgtk2.0-dev \
libkdeui5 \
libopenal-dev \
libopus-dev \
libqrencode-dev \
libqt5opengl5-dev \
libqt5svg5-dev \
libsodium-dev \
libsqlcipher-dev \
libswresample-dev \
libswscale-dev \
libvpx-dev \
libxss-dev \
qrencode \
qt5-default \
qttools5-dev-tools \
qttools5-dev
```
Please see buildscripts/docker/Dockerfile... for your distribution for an up to date list of commands to set up your build environment
### Compile dependencies
Toxcore and ToxExt extensions can either be built with bootstrap.sh or manually.
<a name="bootstrap.sh" />
#### bootstrap.sh
`bootstrap.sh` will build toxcore and extensions for you, allowing you to skip
to [compiling qTox](#compile-qtox) after running it. To use it, run
If you want to develop on your hostmachine, `bootstrap.sh` will build toxcore
and extensions for you, allowing you to skip to [compiling qTox](#compile-qtox)
after running it. To use it, run
```bash
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/lib64/pkgconfig"
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig"
@ -457,7 +311,7 @@ Provided that you have all required dependencies installed, you can simply run:
```bash
git clone https://github.com/toktok/c-toxcore.git toxcore
cd toxcore
git checkout v0.2.13
# Note: See buildscirpts/download/download_toxcore.sh for which version should be checked out
cmake . -DBOOTSTRAP_DAEMON=OFF
make -j$(nproc)
sudo make install
@ -475,12 +329,12 @@ sudo ldconfig
qTox uses the toxext library and some of the extensions that go with it.
You will likely have to compile these yourself
You will likely have to compile these yourself.
```bash
git clone https://github.com/toxext/toxext.git toxext
cd toxext
git checkout v0.0.3
# Note: See buildscirpts/download/download_toxext.sh for which version should be checked out
cmake .
make -j$(nproc)
sudo make install
@ -489,7 +343,7 @@ sudo make install
```bash
git clone https://github.com/toxext/tox_extension_messages.git tox_extension_messages
cd tox_extension_messages
git checkout v0.0.3
# Note: See buildscirpts/download/download_toxext_messages.sh for which version should be checked out
cmake .
make -j$(nproc)
sudo make install
@ -827,5 +681,6 @@ Switches:
[toxcore]: https://github.com/TokTok/c-toxcore/
[sonnet]: https://github.com/KDE/sonnet
[snorenotify]: https://techbase.kde.org/Projects/Snorenotify
[sqlcipher]: https://github.com/sqlcipher/sqlcipher
[toxext]: https://github.com/toxext/toxext
[tox_extension_messages]: https://github.com/toxext/tox_extension_messages

View File

@ -208,9 +208,8 @@ To get translations into qTox:
### Before tagging
- Format all code using the [`./tools/format-code.sh`] script
- Merge the Flatpak manifest of our [Flathub repository] into
[`./flatpak/io.github.qtox.qTox.json`]. Keep
[`./flatpak/io.github.qtox.qTox.json`]'s version of "sources" for qTox.
- Update the Flatpak manifest of our [Flathub repository] with the script in flatpak/update_flathub_descriptor_dependencies.py
- Make sure to check if new dependencies need to be added, add them if necessary
- Update version number for windows/osx packages using the
[`./tools/update-versions.sh`] script, e.g. `./tools/update-versions.sh
1.11.0`

View File

@ -1,101 +0,0 @@
#!/usr/bin/env bash
# MIT License
#
# Copyright © 2019 by The qTox Project Contributors
#
# 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.
# usage: ./appimage/build-appimage.sh [Debug]
#
# If [Debug] is set to "Debug" the container will run in interactive mode and
# stay open to poke around in the filesystem.
readonly DEBUG="$1"
# Set this to True to upload the PR version of the
# AppImage to transfer.sh for testing.
readonly UPLOAD_PR_APPIMAGE="False"
# Fail out on error
set -exo pipefail
# This script should be run from the root of the repository
if [ ! -f ./appimage/build-appimage.sh ]; then
echo ""
echo "You are attempting to run the build-appimage.sh from a wrong directory."
echo "If you wish to run this script, you'll have to have"
echo "the repository root directory as the working directory."
echo ""
exit 1
fi
mkdir -p ./output
if [ "$DEBUG" == "Debug" ]
then
echo "Execute: /qtox/appimage/build.sh to start the build script"
echo "Execute: exit to leave the container"
docker run --rm -it \
-v $PWD:/qtox \
-v $PWD/output:/output \
debian:stretch-slim \
/bin/bash
else
docker run --rm \
-e CIRP_GITHUB_REPO_SLUG \
-e TRAVIS_EVENT_TYPE \
-e TRAVIS_COMMIT \
-e TRAVIS_TAG \
-v $PWD:/qtox \
-v $PWD/output:/output \
debian:stretch-slim \
/bin/bash -c "/qtox/appimage/build.sh"
fi
# use the version number in the name when building a tag on Travis CI
if [ -n "$TRAVIS_TAG" ]
then
# the aitool should have written the appimage in the same name
# as below so no need to move things , it should have also written
# the .zsync meta file as the given name below with .zsync
# extension.
readonly OUTFILE=./output/qTox-"$TRAVIS_TAG".x86_64.AppImage
# just check if the files are in the right place
eval "ls $OUTFILE"
eval "ls $OUTFILE.zsync"
sha256sum "$OUTFILE" > "$OUTFILE".sha256
else
if [ "$UPLOAD_PR_APPIMAGE" == "True" ]
then
# upload PR builds to test them.
echo "Uploading AppImage to transfer.sh"
curl --upload-file "./output/qTox-$TRAVIS_COMMIT-x86_64.AppImage" \
"https://transfer.sh/qTox-$TRAVIS_COMMIT-x86_64.AppImage" > ./upload
echo "$(cat ./upload)"
echo -n "$(cat ./upload)\\n" >> ./uploaded-to
rm -rf ./upload ./uploaded-to
sha256sum "./output/qTox-$TRAVIS_COMMIT-x86_64.AppImage"
fi
fi

View File

@ -25,27 +25,33 @@
# Fail out on error
set -exuo pipefail
usage() {
echo "$0 --src-dir SRC_DIR"
echo "Builds an app image in the CWD based off qtox installation at SRC_DIR"
}
while (( $# > 0 )); do
case $1 in
--src-dir) QTOX_SRC_DIR=$2; shift 2 ;;
--help|-h) usage; exit 1 ;;
*) echo "Unexpected argument $1"; usage; exit 1;;
esac
done
if [ -z "${QTOX_SRC_DIR+x}" ]; then
echo "--src-dir is a required argument"
usage
exit 1
fi
# directory paths
readonly QTOX_SRC_DIR="/qtox"
readonly OUTPUT_DIR="/output"
readonly BUILD_DIR="/build"
readonly QTOX_BUILD_DIR="$BUILD_DIR"/qtox
readonly QTOX_APP_DIR="$BUILD_DIR"/appdir
BUILD_DIR=$(realpath .)
readonly BUILD_DIR
QTOX_APP_DIR="$BUILD_DIR"/appdir
readonly QTOX_APP_DIR
readonly LOCAL_LIB_DIR="$QTOX_APP_DIR"/local/lib
# "linuxdeployqt" is to long, shortened to ldqt
readonly LDQT_BUILD_DIR="$BUILD_DIR"/ldqt
# "appimagetool" becomes aitool
readonly AITOOL_BUILD_DIR="$BUILD_DIR"/aitool
# ldqt binary
readonly LDQT_BIN="/usr/lib/x86_64-linux-gnu/qt5/bin/linuxdeployqt"
# aitool binary
readonly AITOOL_BIN="/usr/local/bin/appimagetool"
readonly APPRUN_BIN="/usr/local/bin/AppRun"
readonly APT_FLAGS="-y --no-install-recommends"
# snorenotify source
readonly SNORE_GIT="https://github.com/KDE/snorenotify"
# snorenotify build directory
readonly SNORE_BUILD_DIR="$BUILD_DIR"/snorenotify
readonly LDQT_BIN="/usr/lib/qt5/bin/linuxdeployqt"
# update information to be embeded in AppImage
if [ "cron" == "${TRAVIS_EVENT_TYPE:-}" ]
@ -58,103 +64,18 @@ else
readonly UPDATE_INFO="gh-releases-zsync|qTox|qTox|latest|qTox-*.x86_64.AppImage.zsync"
fi
# use multiple cores when building
export MAKEFLAGS="-j$(nproc)"
export VERSION=$(git -C "${QTOX_SRC_DIR}" rev-parse --short HEAD)
# Get packages
apt-get update
apt-get install $APT_FLAGS sudo ca-certificates wget build-essential fuse xxd \
git patchelf tclsh libssl-dev cmake extra-cmake-modules build-essential \
check checkinstall libavdevice-dev libexif-dev libgdk-pixbuf2.0-dev \
libgtk2.0-dev libopenal-dev libopus-dev libqrencode-dev libqt5opengl5-dev \
libqt5svg5-dev libsodium-dev libtool libvpx-dev libxss-dev \
qt5-default qttools5-dev qttools5-dev-tools qtdeclarative5-dev \
fcitx-frontend-qt5 uim-qt5 libsqlcipher-dev
echo $QTOX_APP_DIR
cmake "${QTOX_SRC_DIR}" -DDESKTOP_NOTIFICATIONS=ON -DUPDATE_CHECK=ON -DCMAKE_BUILD_TYPE=Release
make -j$(nproc)
rm -fr appdir
make DESTDIR=appdir install
# get version
cd "$QTOX_SRC_DIR"
# linuxdeployqt uses this for naming the file
export VERSION=$(git rev-parse --short HEAD)
# create build directory
mkdir -p "$BUILD_DIR"
# install snorenotify because it's not packaged
cd "$BUILD_DIR"
git clone "$SNORE_GIT" "$SNORE_BUILD_DIR"
cd "$SNORE_BUILD_DIR"
git checkout tags/v0.7.0
# HACK: Kids, don't do this at your home system
cmake -DCMAKE_INSTALL_PREFIX=/usr/
make
make install
cd "$BUILD_DIR"
# copy qtox source
cp -r "$QTOX_SRC_DIR" "$QTOX_BUILD_DIR"
cd "$QTOX_BUILD_DIR"
./bootstrap.sh
# ensure this directory is empty
rm -rf ./_build
mkdir -p ./_build
# build dir of simple_make
cd _build
# need to build with -DDESKTOP_NOTIFICATIONS=True for snorenotify
cmake -DDESKTOP_NOTIFICATIONS=True \
-DUPDATE_CHECK=True \
-DSTRICT_OPTIONS=True \
../
make
make DESTDIR="$QTOX_APP_DIR" install ; find "$QTOX_APP_DIR"
# is release #6 as of 2019-10-23
LDQT_HASH="37631e5640d8f7c31182fa72b31266bbdf6939fc"
# build linuxdeployqt
git clone https://github.com/probonopd/linuxdeployqt.git "$LDQT_BUILD_DIR"
cd "$LDQT_BUILD_DIR"
git checkout "$LDQT_HASH"
qmake
make
make install
# is release #12 as of 2019-10-23
AITOOL_HASH="effcebc1d81c5e174a48b870cb420f490fb5fb4d"
# build appimagetool
git clone -b master --single-branch --recursive \
https://github.com/AppImage/AppImageKit "$AITOOL_BUILD_DIR"
cd "$AITOOL_BUILD_DIR"
git checkout "$AITOOL_HASH"
bash -ex install-build-deps.sh
# Fetch git submodules
git submodule update --init --recursive
# Build AppImage
mkdir build
cd build
# make sure that deps in separate install tree are found
export PKG_CONFIG_PATH=/deps/lib/pkgconfig/
cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_TESTING=ON \
-DAPPIMAGEKIT_PACKAGE_DEBS=ON
make
make install
# build qtox AppImage
cd "$OUTPUT_DIR"
unset QTDIR; unset QT_PLUGIN_PATH; unset LD_LIBRARY_PATH;
readonly QTOX_DESKTOP_FILE="$QTOX_APP_DIR"/usr/local/share/applications/*.desktop
export LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib/x86_64-linux-gnu/
eval "$LDQT_BIN $QTOX_DESKTOP_FILE -bundle-non-qt-libs -extra-plugins=libsnore-qt5"
@ -171,7 +92,11 @@ libs=(
# Also bundle libjack.so* without which the AppImage does not work in Fedora Workstation
/usr/lib/x86_64-linux-gnu/libjack.so.0
# And libglib needed by Red Hat and derivatives to work with our old gnutls
/lib/x86_64-linux-gnu/libglib-2.0.so.0
/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
/usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
/usr/lib/x86_64-linux-gnu/libpango-1.0.so.0
/usr/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0
)
for lib in "${libs[@]}"; do
@ -192,7 +117,4 @@ else
VERSION_NAME="${VERSION}"
fi
eval "$AITOOL_BIN -u \"$UPDATE_INFO\" $QTOX_APP_DIR qTox-$VERSION_NAME.x86_64.AppImage"
# Chmod since everything is root:root
chmod 755 -R "$OUTPUT_DIR"
appimagetool -u "$UPDATE_INFO" $QTOX_APP_DIR qTox-$VERSION_NAME.x86_64.AppImage

View File

@ -47,17 +47,11 @@ readonly INSTALL_DIR=libs
# just for convenience
readonly BASE_DIR="${SCRIPT_DIR}/${INSTALL_DIR}"
# versions of libs to checkout
readonly TOXCORE_VERSION="v0.2.13"
readonly TOXEXT_VERSION="v0.0.3"
readonly TOX_EXT_MESSAGES_VERSION="v0.0.3"
readonly SQLCIPHER_VERSION="v4.3.0"
# directory names of cloned repositories
readonly TOXCORE_DIR="libtoxcore-$TOXCORE_VERSION"
readonly TOXEXT_DIR="toxext-$TOXEXT_VERSION"
readonly TOX_EXT_MESSAGES_DIR="tox_ext_messages-$TOXEXT_VERSION"
readonly SQLCIPHER_DIR="sqlcipher-$SQLCIPHER_VERSION"
readonly TOXCORE_DIR="libtoxcore"
readonly TOXEXT_DIR="toxext"
readonly TOX_EXT_MESSAGES_DIR="tox_ext_messages"
readonly SQLCIPHER_DIR="sqlcipher"
# default values for user given parameters
INSTALL_TOX=true
@ -112,13 +106,11 @@ remove_build_dirs() {
install_toxcore() {
if [[ $INSTALL_TOX = "true" ]]
then
git clone https://github.com/toktok/c-toxcore.git \
--branch $TOXCORE_VERSION \
--depth 1 \
"${BASE_DIR}/${TOXCORE_DIR}"
mkdir -p "${BASE_DIR}/${TOXCORE_DIR}"
pushd ${BASE_DIR}/${TOXCORE_DIR}
"${SCRIPT_DIR}"/buildscripts/download/download_toxcore.sh
# compile and install
if [[ $SYSTEM_WIDE = "false" ]]
then
@ -139,12 +131,11 @@ install_toxcore() {
install_toxext() {
if [[ $INSTALL_TOXEXT = "true" ]]
then
git clone https://github.com/toxext/toxext.git \
--branch $TOXEXT_VERSION \
"${BASE_DIR}/${TOXEXT_DIR}"
mkdir -p "${BASE_DIR}/${TOXEXT_DIR}"
pushd ${BASE_DIR}/${TOXEXT_DIR}
"${SCRIPT_DIR}"/buildscripts/download/download_toxext.sh
# compile and install
if [[ $SYSTEM_WIDE = "false" ]]
then
@ -165,12 +156,11 @@ install_toxext() {
install_tox_ext_messages() {
if [[ $INSTALL_TOX_EXT_MESSAGES = "true" ]]
then
git clone https://github.com/toxext/tox_extension_messages.git \
--branch $TOX_EXT_MESSAGES_VERSION \
"${BASE_DIR}/${TOX_EXT_MESSAGES_DIR}"
mkdir -p "${BASE_DIR}/${TOX_EXT_MESSAGES_DIR}"
pushd ${BASE_DIR}/${TOX_EXT_MESSAGES_DIR}
"${SCRIPT_DIR}"/buildscripts/download/download_toxext_messages.sh
# compile and install
if [[ $SYSTEM_WIDE = "false" ]]
then
@ -191,12 +181,11 @@ install_tox_ext_messages() {
install_sqlcipher() {
if [[ $INSTALL_SQLCIPHER = "true" ]]
then
git clone https://github.com/sqlcipher/sqlcipher.git \
"${BASE_DIR}/${SQLCIPHER_DIR}" \
--branch $SQLCIPHER_VERSION \
--depth 1
mkdir -p "${BASE_DIR}/${SQLCIPHER_DIR}"
pushd "${BASE_DIR}/${SQLCIPHER_DIR}"
"${SCRIPT_DIR}"/download/download_sqlcipher.sh
autoreconf -if
if [[ $SYSTEM_WIDE = "false" ]]

View File

@ -0,0 +1,26 @@
#!/bin/bash
# Copyright © 2021 by The qTox Project Contributors
#
# This program is libre 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 -euo pipefail
"$(dirname "$0")"/download/download_aitool.sh
cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_TESTING=ON \
-DAPPIMAGEKIT_PACKAGE_DEBS=ON
make -j $(nproc)
make install

View File

@ -0,0 +1,99 @@
#!/bin/bash
# Copyright © 2021 by The qTox Project Contributors
#
# This program is libre 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/>.
usage()
{
echo "Download and build ffmpeg for the windows cross compiling environment"
echo "Usage: $0 --arch {x86_64|i686}"
}
ARCH=""
while (( $# > 0 )); do
case $1 in
--arch) ARCH=$2; shift 2 ;;
-h|--help) usage; exit 1 ;;
*) echo "Unexpected argument $1"; usage; exit 1;;
esac
done
if [ "$ARCH" != "i686" ] && [ "$ARCH" != "x86_64" ]; then
echo "Unexpected arch $ARCH"
usage
exit 1
fi
"$(dirname "$0")"/download/download_ffmpeg.sh
if [ "${ARCH}" == "x86_64" ]; then
FFMPEG_ARCH="x86_64"
else
FFMPEG_ARCH="x86"
fi
./configure --arch=${FFMPEG_ARCH} \
--enable-gpl \
--enable-shared \
--disable-static \
--prefix=/windows/ \
--target-os="mingw32" \
--cross-prefix="${ARCH}-w64-mingw32-" \
--pkg-config="pkg-config" \
--extra-cflags="-O2 -g0" \
--disable-debug \
--disable-programs \
--disable-protocols \
--disable-doc \
--disable-sdl2 \
--disable-avfilter \
--disable-avresample \
--disable-filters \
--disable-iconv \
--disable-network \
--disable-muxers \
--disable-postproc \
--disable-swresample \
--disable-swscale-alpha \
--disable-dct \
--disable-dwt \
--disable-lsp \
--disable-lzo \
--disable-mdct \
--disable-rdft \
--disable-fft \
--disable-faan \
--disable-vaapi \
--disable-vdpau \
--disable-zlib \
--disable-xlib \
--disable-bzlib \
--disable-lzma \
--disable-encoders \
--disable-decoders \
--disable-demuxers \
--disable-parsers \
--disable-bsfs \
--enable-demuxer=h264 \
--enable-demuxer=mjpeg \
--enable-parser=h264 \
--enable-parser=mjpeg \
--enable-decoder=h264 \
--enable-decoder=mjpeg \
--enable-decoder=rawvideo
make -j $(nproc)
make install

View File

@ -0,0 +1,50 @@
#!/bin/bash
# Copyright © 2021 by The qTox Project Contributors
#
# This program is libre 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/>.
usage()
{
echo "Download and build gmp for windows"
echo "Usage: $0 --arch {x86_64|i686}"
}
set -euo pipefail
while (( $# > 0 )); do
case $1 in
--arch) ARCH=$2; shift 2 ;;
-h|--help) usage; exit 1 ;;
*) echo "Unexpected argument $1"; usage; exit 1;;
esac
done
if [ "${ARCH-x}" != "i686" ] && [ "${ARCH-x}" != "x86_64" ]; then
echo "Unexpected arch $ARCH"
usage
exit 1
fi
set -euo pipefail
"$(dirname $0)"/download/download_gdb.sh
CFLAGS="-O2 -g0" ./configure --host="$ARCH-w64-mingw32" \
--prefix="/windows" \
--enable-static \
--disable-shared
make -j $(nproc)
make install

View File

@ -0,0 +1,50 @@
#!/bin/bash
# Copyright © 2021 by The qTox Project Contributors
#
# This program is libre 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/>.
usage()
{
echo "Download and build gmp for windows"
echo "Usage: $0 --arch {x86_64|i686}"
}
set -euo pipefail
while (( $# > 0 )); do
case $1 in
--arch) ARCH=$2; shift 2 ;;
-h|--help) usage; exit 1 ;;
*) echo "Unexpected argument $1"; usage; exit 1;;
esac
done
if [ "${ARCH-x}" != "i686" ] && [ "${ARCH-x}" != "x86_64" ]; then
echo "Unexpected arch $ARCH"
usage
exit 1
fi
set -euo pipefail
"$(dirname $0)"/download/download_gmp.sh
# https://gmplib.org/list-archives/gmp-discuss/2020-July/006519.html
CC_FOR_BUILD=gcc CFLAGS="-O2 -g0" ./configure --host="$ARCH-w64-mingw32" \
--prefix="/windows" \
--enable-static \
--disable-shared
make -j $(nproc)
make install

View File

@ -0,0 +1,24 @@
#!/bin/bash
# Copyright © 2021 by The qTox Project Contributors
#
# This program is libre 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 -euo pipefail
"$(dirname "$0")"/download/download_ldqt.sh
qmake
make -j $(nproc)
make install

View File

@ -0,0 +1,53 @@
#!/bin/bash
# Copyright © 2021 by The qTox Project Contributors
#
# This program is libre 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/>.
usage()
{
echo "Download and build libexif for the windows cross compiling environment"
echo "Usage: $0 --arch {x86_64|i686}"
}
ARCH=""
while (( $# > 0 )); do
case $1 in
--arch) ARCH=$2; shift 2 ;;
-h|--help) usage; exit 1 ;;
*) echo "Unexpected argument $1"; usage; exit 1;;
esac
done
if [ "$ARCH" != "i686" ] && [ "$ARCH" != "x86_64" ]; then
echo "Unexpected arch $ARCH"
usage
exit 1
fi
set -euo pipefail
"$(dirname $0)"/download/download_libexif.sh
CFLAGS="-O2 -g0" ./configure --host="${ARCH}-w64-mingw32" \
--prefix=/windows/ \
--enable-shared \
--disable-static \
--disable-docs \
--disable-nls
make -j $(nproc)
make install

View File

@ -0,0 +1,48 @@
#!/bin/bash
# Copyright © 2021 by The qTox Project Contributors
#
# This program is libre 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/>.
usage()
{
echo "Download and build libexpat for windows"
echo "Usage: $0 --arch {x86_64|i686}"
}
set -euo pipefail
while (( $# > 0 )); do
case $1 in
--arch) ARCH=$2; shift 2 ;;
-h|--help) usage; exit 1 ;;
*) echo "Unexpected argument $1"; usage; exit 1;;
esac
done
if [ "${ARCH-x}" != "i686" ] && [ "${ARCH-x}" != "x86_64" ]; then
echo "Unexpected arch $ARCH"
usage
exit 1
fi
"$(dirname $0)"/download/download_libexpat.sh
CFLAGS="-O2 -g0" ./configure --host="$ARCH-w64-mingw32" \
--prefix="/windows" \
--enable-static \
--disable-shared
make -j $(nproc)
make install

View File

@ -0,0 +1,22 @@
#!/bin/bash
# Copyright © 2021 by The qTox Project Contributors
#
# This program is libre 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 -euo pipefail
"$(dirname "$0")"/download/download_mingw_ldd.sh
cp -a mingw_ldd/mingw_ldd.py /usr/local/bin/mingw-ldd.py

View File

@ -0,0 +1,22 @@
#!/bin/bash
# Copyright © 2021 by The qTox Project Contributors
#
# This program is libre 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 -euo pipefail
"$(dirname "$0")"/download/download_nsisshellexecasuser.sh
cp ShellExecAsUser.dll /usr/share/nsis/Plugins/x86-ansi

View File

@ -0,0 +1,57 @@
#!/bin/bash
# Copyright © 2021 by The qTox Project Contributors
#
# This program is libre 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 -euo pipefail
usage()
{
echo "Download and build openal for the windows cross compiling environment"
echo "Usage: $0 --arch {x86_64|i686}"
}
ARCH=""
while (( $# > 0 )); do
case $1 in
--arch) ARCH=$2; shift 2 ;;
-h|--help) usage; exit 1 ;;
*) echo "Unexpected argument $1"; usage; exit 1;;
esac
done
if [ "$ARCH" != "i686" ] && [ "$ARCH" != "x86_64" ]; then
echo "Unexpected arch $ARCH"
usage
exit 1
fi
"$(dirname "$0")"/download/download_openal.sh
patch -p1 < "$(dirname "$0")"/patches/openal-cmake-3-11.patch
export CFLAGS="-fPIC"
cmake -DCMAKE_INSTALL_PREFIX=/windows/ \
-DCMAKE_BUILD_TYPE=Release \
-DALSOFT_UTILS=OFF \
-DALSOFT_EXAMPLES=OFF \
-DCMAKE_TOOLCHAIN_FILE=/build/windows-toolchain.cmake \
-DDSOUND_INCLUDE_DIR=/usr/${ARCH}-w64-mingw32/include \
-DDSOUND_LIBRARY=/usr/${ARCH}-w64-mingw32/lib/libdsound.a \
.
make -j $(nproc)
make install

View File

@ -0,0 +1,60 @@
#!/bin/bash
# Copyright © 2021 by The qTox Project Contributors
#
# This program is libre 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 -euo pipefail
usage()
{
echo "Download and build openssl for the windows cross compiling environment"
echo "Usage: $0 --arch {x86_64|i686}"
}
ARCH=""
while (( $# > 0 )); do
case $1 in
--arch) ARCH=$2; shift 2 ;;
-h|--help) usage; exit 1 ;;
*) echo "Unexpected argument $1"; usage; exit 1;;
esac
done
if [ "$ARCH" != "i686" ] && [ "$ARCH" != "x86_64" ]; then
echo "Unexpected arch $ARCH"
usage
exit 1
fi
"$(dirname "$0")"/download/download_openssl.sh
if [[ "$ARCH" == "x86_64" ]]; then
OPENSSL_ARCH="mingw64"
elif [[ "$ARCH" == "i686" ]]; then
OPENSSL_ARCH="mingw"
else
echo "Invalid architecture"
exit 1
fi
./Configure --prefix=/windows/ \
--openssldir=/windows/ssl \
shared \
$OPENSSL_ARCH \
--cross-compile-prefix=${ARCH}-w64-mingw32- && \
make -j $(nproc)
make install

View File

@ -0,0 +1,53 @@
#!/bin/bash
# Copyright © 2021 by The qTox Project Contributors
#
# This program is libre 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 -euo pipefail
usage()
{
echo "Download and build opus for the windows cross compiling environment"
echo "Usage: $0 --arch {x86_64|i686}"
}
ARCH=""
while (( $# > 0 )); do
case $1 in
--arch) ARCH=$2; shift 2 ;;
-h|--help) usage; exit 1 ;;
*) echo "Unexpected argument $1"; usage; exit 1;;
esac
done
if [ "$ARCH" != "i686" ] && [ "$ARCH" != "x86_64" ]; then
echo "Unexpected arch $ARCH"
usage
exit 1
fi
"$(dirname "$0")"/download/download_opus.sh
LDFLAGS="-fstack-protector" CFLAGS="-O2 -g0" \
./configure --host="${ARCH}-w64-mingw32" \
--prefix=/windows/ \
--enable-shared \
--disable-static \
--disable-extra-programs \
--disable-doc
make -j $(nproc)
make install

View File

@ -0,0 +1,53 @@
#!/bin/bash
# Copyright © 2021 by The qTox Project Contributors
#
# This program is libre 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 -euo pipefail
usage()
{
echo "Download and build qrencode for the windows cross compiling environment"
echo "Usage: $0 --arch {x86_64|i686}"
}
ARCH=""
while (( $# > 0 )); do
case $1 in
--arch) ARCH=$2; shift 2 ;;
-h|--help) usage; exit 1 ;;
*) echo "Unexpected argument $1"; usage; exit 1;;
esac
done
if [ "$ARCH" != "i686" ] && [ "$ARCH" != "x86_64" ]; then
echo "Unexpected arch $ARCH"
usage
exit 1
fi
"$(dirname "$0")"/download/download_qrencode.sh
CFLAGS="-O2 -g0" ./configure --host="${ARCH}-w64-mingw32" \
--prefix=/windows \
--enable-shared \
--disable-static \
--disable-sdltest \
--without-tools \
--without-debug
make -j $(nproc)
make install

105
buildscripts/build_qt_windows.sh Executable file
View File

@ -0,0 +1,105 @@
#!/bin/bash
# Copyright © 2021 by The qTox Project Contributors
#
# This program is libre 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 -euo pipefail
usage()
{
echo "Download and build qt for the windows cross compiling environment"
echo "Usage: $0 --arch {x86_64|i686}"
}
ARCH=""
while (( $# > 0 )); do
case $1 in
--arch) ARCH=$2; shift 2 ;;
-h|--help) usage; exit 1 ;;
*) echo "Unexpected argument $1"; usage; exit 1;;
esac
done
if [ "$ARCH" != "i686" ] && [ "$ARCH" != "x86_64" ]; then
echo "Unexpected arch $ARCH"
usage
exit 1
fi
"$(dirname "$0")"/download/download_qt.sh
OPENSSL_LIBS=$(pkg-config --libs openssl)
export OPENSSL_LIBS
./configure -prefix /windows/ \
-release \
-shared \
-device-option CROSS_COMPILE=${ARCH}-w64-mingw32- \
-xplatform win32-g++ \
-openssl \
"$(pkg-config --cflags openssl)" \
-opensource -confirm-license \
-pch \
-nomake examples \
-nomake tools \
-nomake tests \
-skip 3d \
-skip activeqt \
-skip androidextras \
-skip canvas3d \
-skip charts \
-skip connectivity \
-skip datavis3d \
-skip declarative \
-skip doc \
-skip gamepad \
-skip graphicaleffects \
-skip imageformats \
-skip location \
-skip macextras \
-skip multimedia \
-skip networkauth \
-skip purchasing \
-skip quickcontrols \
-skip quickcontrols2 \
-skip remoteobjects \
-skip script \
-skip scxml \
-skip sensors \
-skip serialbus \
-skip serialport \
-skip speech \
-skip translations \
-skip virtualkeyboard \
-skip wayland \
-skip webchannel \
-skip webengine \
-skip webglplugin \
-skip websockets \
-skip webview \
-skip x11extras \
-skip xmlpatterns \
-no-dbus \
-no-icu \
-no-compile-examples \
-qt-libjpeg \
-qt-libpng \
-qt-zlib \
-qt-pcre \
-opengl desktop
make -j $(nproc)
make install

View File

@ -0,0 +1,51 @@
#!/bin/bash
# Copyright © 2021 by The qTox Project Contributors
#
# This program is libre 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 -euo pipefail
usage ()
{
echo "Build/install snore for linux"
echo "Usage: $0 [--system-install]"
echo "--system-install: Install to /usr instead of /usr/local"
}
SYSTEM_INSTALL=0
while (( $# > 0 )); do
case $1 in
--system-install) SYSTEM_INSTALL=1; shift ;;
--help|-h) usage; exit 1 ;;
*) echo "Unexpected argument $1"; usage; exit 1 ;;
esac
done
"$(dirname "$0")"/download/download_snore.sh
# Snore needs to be installed into /usr for linuxdeployqt to find it
if [ $SYSTEM_INSTALL -eq 1 ]; then
INSTALL_PREFIX_ARGS="-DCMAKE_INSTALL_PREFIX=/usr"
else
INSTALL_PREFIX_ARGS=""
fi
cmake -DCMAKE_BUILD_TYPE=Release $INSTALL_PREFIX_ARGS \
-DBUILD_daemon=OFF \
-DBUILD_settings=OFF \
-DBUILD_snoresend=OFF
make -j $(nproc)
make install

View File

@ -0,0 +1,31 @@
#!/bin/bash
# Copyright © 2021 by The qTox Project Contributors
#
# This program is libre 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 -euo pipefail
"$(dirname "$0")"/download/download_snore.sh
cmake -DCMAKE_INSTALL_PREFIX=/windows/ \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_daemon=OFF \
-DBUILD_settings=OFF \
-DBUILD_snoresend=OFF \
-DCMAKE_TOOLCHAIN_FILE=/build/windows-toolchain.cmake \
.
make -j $(nproc)
make install

View File

@ -0,0 +1,51 @@
#!/bin/bash
# Copyright © 2021 by The qTox Project Contributors
#
# This program is libre 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 -euo pipefail
usage()
{
echo "Download and build sodium for the windows cross compiling environment"
echo "Usage: $0 --arch {x86_64|i686}"
}
ARCH=""
while (( $# > 0 )); do
case $1 in
--arch) ARCH=$2; shift 2 ;;
-h|--help) usage; exit 1 ;;
*) echo "Unexpected argument $1"; usage; exit 1;;
esac
done
if [ "$ARCH" != "i686" ] && [ "$ARCH" != "x86_64" ]; then
echo "Unexpected arch $ARCH"
usage
exit 1
fi
"$(dirname "$0")"/download/download_sodium.sh
LDFLAGS="-fstack-protector" \
./configure --host="${ARCH}-w64-mingw32" \
--prefix=/windows \
--enable-shared \
--disable-static
make -j $(nproc)
make install

View File

@ -0,0 +1,59 @@
#!/bin/bash
# Copyright © 2021 by The qTox Project Contributors
#
# This program is libre 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 -euo pipefail
usage()
{
echo "Download and build sqlcipher for the windows cross compiling environment"
echo "Usage: $0 --arch {x86_64|i686}"
}
ARCH=""
while (( $# > 0 )); do
case $1 in
--arch) ARCH=$2; shift 2 ;;
-h|--help) usage; exit 1 ;;
*) echo "Unexpected argument $1"; usage; exit 1;;
esac
done
if [ "$ARCH" != "i686" ] && [ "$ARCH" != "x86_64" ]; then
echo "Unexpected arch $ARCH"
usage
exit 1
fi
"$(dirname "$0")"/download/download_sqlcipher.sh
sed -i s/'if test "$TARGET_EXEEXT" = ".exe"'/'if test ".exe" = ".exe"'/g configure
sed -i 's|exec $PWD/mksourceid manifest|exec $PWD/mksourceid.exe manifest|g' tool/mksqlite3h.tcl
./configure --host="${ARCH}-w64-mingw32" \
--prefix=/windows/ \
--enable-shared \
--disable-static \
--enable-tempstore=yes \
CFLAGS="-O2 -g0 -DSQLITE_HAS_CODEC -I/windows/include/" \
LDFLAGS="-lcrypto -lgdi32 -L/windows/lib/" \
LIBS="-lgdi32 -lws2_32"
sed -i s/"TEXE = $"/"TEXE = .exe"/ Makefile
make -j $(nproc)
make install

View File

@ -0,0 +1,65 @@
#!/bin/bash
# Copyright © 2021 by The qTox Project Contributors
#
# This program is libre 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 -euo pipefail
build_toxcore() {
mkdir -p toxcore
pushd toxcore >/dev/null || exit 1
"$(dirname "$0")"/download/download_toxcore.sh
cmake . \
-DBOOTSTRAP_DAEMON=OFF \
-DCMAKE_BUILD_TYPE=Release \
.
cmake --build . -- -j$(nproc)
cmake --build . --target install
popd >/dev/null
}
build_toxext() {
mkdir -p toxext
pushd toxext >/dev/null || exit 1
"$(dirname "$0")"/download/download_toxext.sh
cmake . -DCMAKE_BUILD_TYPE=Release
cmake --build . -- -j$(nproc)
cmake --build . --target install
popd >/dev/null
}
build_toxext_messages() {
mkdir -p toxext_messages
pushd toxext_messages > /dev/null || exit 1
"$(dirname "$0")"/download/download_toxext_messages.sh
cmake . -DCMAKE_BUILD_TYPE=Release
cmake --build . -- -j$(nproc)
cmake --build . --target install
popd >/dev/null
}
build_toxcore
build_toxext
build_toxext_messages

View File

@ -0,0 +1,80 @@
#!/bin/bash
# Copyright © 2021 by The qTox Project Contributors
#
# This program is libre 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 -euo pipefail
build_toxcore() {
TOXCORE_SRC="$(realpath toxcore)"
mkdir -p "$TOXCORE_SRC"
pushd $TOXCORE_SRC >/dev/null || exit 1
"$(dirname "$0")"/download/download_toxcore.sh
cmake -DCMAKE_INSTALL_PREFIX=/windows/ \
-DBOOTSTRAP_DAEMON=OFF \
-DCMAKE_BUILD_TYPE=Release \
-DENABLE_STATIC=OFF \
-DENABLE_SHARED=ON \
-DCMAKE_TOOLCHAIN_FILE=/build/windows-toolchain.cmake \
.
cmake --build . -- -j$(nproc)
cmake --build . --target install
popd >/dev/null
}
build_toxext() {
TOXEXT_SRC="$(realpath toxext)"
mkdir -p "$TOXEXT_SRC"
pushd $TOXEXT_SRC >/dev/null || exit 1
"$(dirname "$0")"/download/download_toxext.sh
cmake -DCMAKE_INSTALL_PREFIX=/windows/ \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_TOOLCHAIN_FILE=/build/windows-toolchain.cmake \
.
cmake --build . -- -j$(nproc)
cmake --build . --target install
popd >/dev/null
}
build_toxext_messages() {
TOXEXT_MESSAGES_SRC="$(realpath toxext_messages)"
mkdir -p "$TOXEXT_MESSAGES_SRC"
pushd $TOXEXT_MESSAGES_SRC > /dev/null || exit 1
"$(dirname "$0")"/download/download_toxext_messages.sh
cmake -DCMAKE_INSTALL_PREFIX=/windows/ \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_TOOLCHAIN_FILE=/build/windows-toolchain.cmake \
.
cmake --build . --target install
popd >/dev/null
}
build_toxcore
build_toxext
build_toxext_messages

View File

@ -0,0 +1,68 @@
#!/bin/bash
# Copyright © 2021 by The qTox Project Contributors
#
# This program is libre 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 -euo pipefail
usage()
{
echo "Download and build vpx for the windows cross compiling environment"
echo "Usage: $0 --arch {x86_64|i686}"
}
ARCH=""
while (( $# > 0 )); do
case $1 in
--arch) ARCH=$2; shift 2 ;;
-h|--help) usage; exit 1 ;;
*) echo "Unexpected argument $1"; usage; exit 1;;
esac
done
if [ "$ARCH" != "i686" ] && [ "$ARCH" != "x86_64" ]; then
echo "Unexpected arch $ARCH"
usage
exit 1
fi
"$(dirname "$0")"/download/download_vpx.sh
if [ "${ARCH}" == "x86_64" ]; then
ARCH_FLAGS="-fno-asynchronous-unwind-tables"
VPX_ARCH="x86_64-win64-gcc"
elif [ "${ARCH}" == "i686" ]; then \
ARCH_FLAGS=""
VPX_ARCH="x86-win32-gcc"
else
exit 1
fi
patch -Np1 < "$(dirname "$0")"/patches/vpx.patch
CFLAGS=${ARCH_FLAGS} CROSS="${ARCH}-w64-mingw32-" \
./configure --target="${VPX_ARCH}" \
--prefix=/windows/ \
--enable-shared \
--disable-static \
--enable-runtime-cpu-detect \
--disable-examples \
--disable-tools \
--disable-docs \
--disable-unit-tests
make -j $(nproc)
make install

View File

@ -0,0 +1,50 @@
# Copyright © 2021 by The qTox Project Contributors
#
# This program is libre 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/>.
FROM archlinux:latest
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN pacman -Syu --noconfirm --needed \
base-devel \
cmake \
libsodium \
qt5-base \
qt5-tools \
qt5-svg \
ffmpeg \
libexif \
qrencode \
sqlcipher \
openal \
sonnet \
snorenotify \
git \
&& \
rm -fr /var/cache/pacman
ENV PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
COPY download/common.sh /build/download/common.sh
COPY download/download_toxcore.sh /build/download/download_toxcore.sh
COPY download/download_toxext.sh /build/download/download_toxext.sh
COPY download/download_toxext_messages.sh /build/download/download_toxext_messages.sh
COPY build_toxcore_linux.sh /build/build_toxcore_linux.sh
RUN mkdir -p /src/tox && \
cd /src/tox && \
/build/build_toxcore_linux.sh && \
rm -fr /src/tox
WORKDIR /qtox

View File

@ -0,0 +1,68 @@
# Copyright © 2021 by The qTox Project Contributors
#
# This program is libre 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/>.
FROM centos:latest
RUN dnf --nodocs -y install dnf-plugins-core && \
dnf config-manager --set-enabled powertools && \
dnf --nodocs -y install epel-release && \
dnf --nodocs -y install --nogpgcheck https://mirrors.rpmfusion.org/free/el/rpmfusion-free-release-8.noarch.rpm https://mirrors.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-8.noarch.rpm && \
dnf --nodocs -y install \
cmake \
make \
gcc \
gcc-c++ \
git \
libvpx-devel \
qt5-qtbase-devel \
qt5-linguist \
qt5-qtsvg-devel \
extra-cmake-modules \
opus-devel \
libsodium-devel \
libasan \
ffmpeg-devel \
libexif-devel \
qrencode-devel \
openal-soft-devel \
kf5-sonnet-devel \
libXScrnSaver-devel \
sqlite-devel \
sqlcipher-devel && \
dnf clean all
ENV PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig
COPY download/common.sh /build/download/common.sh
COPY download/download_snore.sh /build/download/download_snore.sh
COPY build_snore_linux.sh /build/build_snore_linux.sh
RUN mkdir -p /src/snore && \
cd /src/snore && \
/build/build_snore_linux.sh && \
rm -fr /src/snore
COPY download/download_toxcore.sh /build/download/download_toxcore.sh
COPY download/download_toxext.sh /build/download/download_toxext.sh
COPY download/download_toxext_messages.sh /build/download/download_toxext_messages.sh
COPY build_toxcore_linux.sh /build/build_toxcore_linux.sh
RUN mkdir -p /src/tox && \
cd /src/tox && \
/build/build_toxcore_linux.sh && \
rm -fr /src/tox
RUN echo '/usr/local/lib64/' >> /etc/ld.so.conf.d/locallib.conf && \
ldconfig
WORKDIR /qtox

View File

@ -0,0 +1,66 @@
# Copyright © 2021 by The qTox Project Contributors
#
# This program is libre 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/>.
FROM debian:stable
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get -y --force-yes --no-install-recommends install \
build-essential \
cmake \
curl \
ca-certificates \
extra-cmake-modules \
git \
libavcodec-dev \
libavdevice-dev \
libexif-dev \
libopenal-dev \
libopus-dev \
libqrencode-dev \
libqt5opengl5-dev \
libqt5svg5-dev \
libsodium-dev \
libsqlcipher-dev \
libtool \
libvpx-dev \
libkf5sonnet-dev \
pkg-config \
libqrencode-dev \
qttools5-dev && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
COPY download/common.sh /build/download/common.sh
COPY download/download_snore.sh /build/download/download_snore.sh
COPY build_snore_linux.sh /build/build_snore_linux.sh
RUN mkdir -p /src/snore && \
cd /src/snore && \
/build/build_snore_linux.sh && \
rm -fr /src/snore
COPY download/download_toxcore.sh /build/download/download_toxcore.sh
COPY download/download_toxext.sh /build/download/download_toxext.sh
COPY download/download_toxext_messages.sh /build/download/download_toxext_messages.sh
COPY build_toxcore_linux.sh /build/build_toxcore_linux.sh
RUN mkdir -p /src/tox && \
cd /src/tox && \
/build/build_toxcore_linux.sh && \
rm -fr /src/tox
WORKDIR /qtox

View File

@ -0,0 +1,68 @@
# Copyright © 2019-2021 by The qTox Project Contributors
#
# This file is part of qTox, a Qt-based graphical interface for Tox.
# qTox is libre 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.
#
# qTox 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 qTox. If not, see <http://www.gnu.org/licenses/>
FROM debian:oldoldstable
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get -y --force-yes --no-install-recommends install \
build-essential \
cmake \
curl \
ca-certificates \
extra-cmake-modules \
git \
libavcodec-dev \
libavdevice-dev \
libexif-dev \
libopenal-dev \
libopus-dev \
libqrencode-dev \
libqt5opengl5-dev \
libqt5svg5-dev \
libsodium-dev \
libsqlcipher-dev \
libtool \
libvpx-dev \
libkf5sonnet-dev \
pkg-config \
libqrencode-dev \
qt5-default \
qttools5-dev && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
COPY download/common.sh /build/download/common.sh
COPY download/download_snore.sh /build/download/download_snore.sh
COPY build_snore_linux.sh /build/build_snore_linux.sh
RUN mkdir -p /src/snore && \
cd /src/snore && \
/build/build_snore_linux.sh && \
rm -fr /src/snore
COPY download/download_toxcore.sh /build/download/download_toxcore.sh
COPY download/download_toxext.sh /build/download/download_toxext.sh
COPY download/download_toxext_messages.sh /build/download/download_toxext_messages.sh
COPY build_toxcore_linux.sh /build/build_toxcore_linux.sh
RUN mkdir -p /src/tox && \
cd /src/tox && \
/build/build_toxcore_linux.sh && \
rm -fr /src/tox
WORKDIR /qtox

View File

@ -0,0 +1,66 @@
# Copyright © 2021 by The qTox Project Contributors
#
# This program is libre 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/>.
FROM fedora:latest
RUN dnf --nodocs -y install dnf-plugins-core && \
dnf --nodocs -y install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm && \
dnf --nodocs -y install \
cmake \
make \
gcc \
gcc-c++ \
git \
libvpx-devel \
qt5-qtbase-devel \
qt5-linguist \
qt5-qtsvg-devel \
extra-cmake-modules \
opus-devel \
libsodium-devel \
libasan \
ffmpeg-devel \
libexif-devel \
qrencode-devel \
openal-soft-devel \
kf5-sonnet-devel \
libXScrnSaver-devel \
sqlite-devel \
sqlcipher-devel && \
dnf clean all
ENV PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig
COPY download/common.sh /build/download/common.sh
COPY download/download_snore.sh /build/download/download_snore.sh
COPY build_snore_linux.sh /build/build_snore_linux.sh
RUN mkdir -p /src/snore && \
cd /src/snore && \
/build/build_snore_linux.sh && \
rm -fr /src/snore
COPY download/download_toxcore.sh /build/download/download_toxcore.sh
COPY download/download_toxext.sh /build/download/download_toxext.sh
COPY download/download_toxext_messages.sh /build/download/download_toxext_messages.sh
COPY build_toxcore_linux.sh /build/build_toxcore_linux.sh
RUN mkdir -p /src/tox && \
cd /src/tox && \
/build/build_toxcore_linux.sh && \
rm -fr /src/tox
RUN echo '/usr/local/lib64/' >> /etc/ld.so.conf.d/locallib.conf && \
ldconfig
WORKDIR /qtox

View File

@ -0,0 +1,62 @@
# Copyright © 2021 by The qTox Project Contributors
#
# This program is libre 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/>.
FROM debian:buster
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get -y --force-yes --no-install-recommends install \
curl \
ca-certificates \
elfutils \
# flatpak-validate-icon uses gdk-pixbuf which needs an svg loader
librsvg2-common \
flatpak \
flatpak-builder && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Pre-download kde flatpak environment to speed up flatpak builds
RUN flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo && \
flatpak --system install flathub -y org.kde.Sdk/x86_64/5.15
COPY download/common.sh /build/download/common.sh
COPY download/download_sodium.sh /build/download/download_sodium.sh
RUN mkdir -p /src/libsodium && \
cd /src/libsodium && \
/build/download/download_sodium.sh
COPY download/download_sqlcipher.sh /build/download/download_sqlcipher.sh
RUN mkdir -p /src/sqlcipher && \
cd /src/sqlcipher && \
/build/download/download_sqlcipher.sh
COPY download/download_toxcore.sh /build/download/download_toxcore.sh
RUN mkdir -p /src/toxcore && \
cd /src/toxcore && \
/build/download/download_toxcore.sh
COPY download/download_toxext.sh /build/download/download_toxext.sh
RUN mkdir -p /src/toxext && \
cd /src/toxext && \
/build/download/download_toxext.sh
COPY download/download_toxext_messages.sh /build/download/download_toxext_messages.sh
RUN mkdir -p /src/toxext_messages && \
cd /src/toxext_messages && \
/build/download/download_toxext_messages.sh
WORKDIR /qtox

View File

@ -0,0 +1,55 @@
# Copyright © 2021 by The qTox Project Contributors
#
# This program is libre 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/>.
FROM opensuse/leap:latest
RUN zypper install --no-recommends -y \
git \
libexif-devel \
libopus-devel \
libQt5Concurrent-devel \
libqt5-linguist-devel \
libqt5-qtbase-common-devel \
libqt5-qtsvg-devel \
libsodium-devel \
libvpx-devel \
openal-soft-devel \
qrencode-devel \
sqlcipher-devel \
sonnet-devel \
libQt5Test-devel \
libQt5Network-devel \
libQt5OpenGL-devel \
libQt5Xml-devel \
curl \
tar \
gzip \
libavcodec-devel \
libavdevice-devel \
libXss-devel \
snorenotify-qt5-devel && \
zypper clean
COPY download/common.sh /build/download/common.sh
COPY download/download_toxcore.sh /build/download/download_toxcore.sh
COPY download/download_toxext.sh /build/download/download_toxext.sh
COPY download/download_toxext_messages.sh /build/download/download_toxext_messages.sh
COPY build_toxcore_linux.sh /build/build_toxcore_linux.sh
RUN mkdir -p /src/tox && \
cd /src/tox && \
/build/build_toxcore_linux.sh && \
rm -fr /src/tox
WORKDIR /qtox

View File

@ -0,0 +1,106 @@
# Copyright © 2019-2021 by The qTox Project Contributors
#
# This file is part of qTox, a Qt-based graphical interface for Tox.
# qTox is libre 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.
#
# qTox 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 qTox. If not, see <http://www.gnu.org/licenses/>
FROM ubuntu:18.04
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get -y --force-yes --no-install-recommends install \
build-essential \
autoconf \
automake \
libtool \
cmake \
extra-cmake-modules \
git \
libavcodec-dev \
libavdevice-dev \
libavfilter-dev \
libavutil-dev \
libexif-dev \
libgdk-pixbuf2.0-dev \
libglib2.0-dev \
libgtk2.0-dev \
libopenal-dev \
libopus-dev \
libqrencode-dev \
libqt5opengl5-dev \
libqt5svg5-dev \
libsodium-dev \
libsqlcipher-dev \
libswresample-dev \
libswscale-dev \
libvpx-dev \
libkf5sonnet-dev \
libxss-dev \
qt5-default \
qttools5-dev \
zsync \
libarchive-dev \
libfuse-dev \
liblzma-dev \
libglib2.0-dev \
libssl-dev \
libinotifytools0-dev \
liblz4-dev \
libcairo-dev \
desktop-file-utils \
wget \
xxd \
ca-certificates \
curl \
patchelf \
lcov && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
COPY download/common.sh /build/download/common.sh
COPY download/download_snore.sh /build/download/download_snore.sh
COPY build_snore_linux.sh /build/build_snore_linux.sh
RUN mkdir -p /src/snore && \
cd /src/snore && \
/build/build_snore_linux.sh --system-install && \
rm -fr /src/snore
COPY download/download_ldqt.sh /build/download/download_ldqt.sh
COPY build_ldqt_linux.sh /build/build_ldqt_linux.sh
RUN mkdir -p /src/ldqt && \
cd /src/ldqt && \
/build/build_ldqt_linux.sh && \
rm -fr /src/ldqt
COPY download/download_aitool.sh /build/download/download_aitool.sh
COPY build_aitool_linux.sh /build/build_aitool_linux.sh
RUN mkdir -p /src/aitool && \
cd /src/aitool && \
/build/build_aitool_linux.sh && \
rm -fr /src/aitool
COPY download/download_toxcore.sh /build/download/download_toxcore.sh
COPY download/download_toxext.sh /build/download/download_toxext.sh
COPY download/download_toxext_messages.sh /build/download/download_toxext_messages.sh
COPY build_toxcore_linux.sh /build/build_toxcore_linux.sh
RUN mkdir -p /src/tox && \
cd /src/tox && \
/build/build_toxcore_linux.sh && \
rm -fr /src/tox
RUN echo '/usr/local/lib/' >> /etc/ld.so.conf.d/locallib.conf && \
ldconfig
WORKDIR /qtox

View File

@ -0,0 +1,236 @@
# Copyright © 2021 by The qTox Project Contributors
#
# This program is libre 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/>.
FROM debian:bullseye-slim
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
ENV DEBIAN_FRONTEND=noninteractive
ARG ARCH
ARG WINEARCH
ENV WINEARCH=${WINEARCH}
RUN dpkg --add-architecture i386 && \
apt-get update && apt-get install -y --no-install-recommends \
autoconf \
automake \
build-essential \
ca-certificates \
cmake \
extra-cmake-modules \
git \
libarchive-tools \
libtool \
nsis \
pkg-config \
python3-pefile \
tclsh \
texinfo \
unzip \
curl \
yasm \
zip \
g++-mingw-w64-${ARCH//_/-} \
gcc-mingw-w64-${ARCH//_/-} \
gdb-mingw-w64 \
wine \
wine32 \
wine64 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN update-alternatives --set ${ARCH}-w64-mingw32-gcc /usr/bin/${ARCH}-w64-mingw32-gcc-posix && \
update-alternatives --set ${ARCH}-w64-mingw32-g++ /usr/bin/${ARCH}-w64-mingw32-g++-posix
COPY download/common.sh /build/download/common.sh
COPY download/download_openssl.sh /build/download/download_openssl.sh
COPY build_openssl_windows.sh /build/build_openssl_windows.sh
RUN mkdir -p /src/openssl && \
cd /src/openssl && \
/build/build_openssl_windows.sh --arch ${ARCH} && \
rm -fr /src/openssl
env PKG_CONFIG_PATH=/windows/lib/pkgconfig
COPY download/download_qt.sh /build/download/download_qt.sh
COPY build_qt_windows.sh /build/build_qt_windows.sh
RUN mkdir -p /src/qt && \
cd /src/qt && \
/build/build_qt_windows.sh --arch ${ARCH} && \
rm -fr /src/qt
COPY download/download_sqlcipher.sh /build/download/download_sqlcipher.sh
COPY build_sqlcipher_windows.sh /build/build_sqlcipher_windows.sh
RUN mkdir -p /src/sqlcipher && \
cd /src/sqlcipher && \
/build/build_sqlcipher_windows.sh --arch ${ARCH} && \
rm -fr /src/sqlcipher
COPY download/download_ffmpeg.sh /build/download/download_ffmpeg.sh
COPY build_ffmpeg_windows.sh /build/build_ffmpeg_windows.sh
RUN mkdir -p /src/ffmpeg && \
cd /src/ffmpeg && \
/build/build_ffmpeg_windows.sh --arch ${ARCH} && \
rm -fr /src/ffmpeg
COPY toolchain/windows-${ARCH}-toolchain.cmake /build/windows-toolchain.cmake
COPY download/download_openal.sh /build/download/download_openal.sh
COPY build_openal_windows.sh /build/build_openal_windows.sh
COPY patches/openal-cmake-3-11.patch /build/patches/openal-cmake-3-11.patch
RUN mkdir -p /src/openal && \
cd /src/openal && \
/build/build_openal_windows.sh --arch ${ARCH} && \
rm -fr /src/openal
COPY download/download_qrencode.sh /build/download/download_qrencode.sh
COPY build_qrencode_windows.sh /build/build_qrencode_windows.sh
RUN mkdir -p /src/qrencode && \
cd /src/qrencode && \
/build/build_qrencode_windows.sh --arch ${ARCH} && \
rm -fr /src/qrencode
COPY download/download_libexif.sh /build/download/download_libexif.sh
COPY build_libexif_windows.sh /build/build_libexif_windows.sh
RUN mkdir -p /src/exif && \
cd /src/exif && \
/build/build_libexif_windows.sh --arch ${ARCH} && \
rm -fr /src/exif
COPY download/download_snore.sh /build/download/download_snore.sh
COPY build_snore_windows.sh /build/build_snore_windows.sh
RUN mkdir -p /src/snore && \
cd /src/snore && \
/build/build_snore_windows.sh && \
rm -fr /src/snore
COPY download/download_opus.sh /build/download/download_opus.sh
COPY build_opus_windows.sh /build/build_opus_windows.sh
RUN mkdir -p /src/opus && \
cd /src/opus && \
/build/build_opus_windows.sh --arch ${ARCH} && \
rm -fr /src/opus
COPY download/download_sodium.sh /build/download/download_sodium.sh
COPY build_sodium_windows.sh /build/build_sodium_windows.sh
RUN mkdir -p /src/sodium && \
cd /src/sodium && \
/build/build_sodium_windows.sh --arch ${ARCH} && \
rm -fr /src/sodium
COPY download/download_vpx.sh /build/download/download_vpx.sh
COPY build_vpx_windows.sh /build/build_vpx_windows.sh
COPY patches/vpx.patch /build/patches/vpx.patch
RUN mkdir -p /src/vpx && \
cd /src/vpx && \
/build/build_vpx_windows.sh --arch ${ARCH} && \
rm -fr /src/vpx
COPY download/download_mingw_ldd.sh /build/download/download_mingw_ldd.sh
COPY build_mingw_ldd_windows.sh /build/build_mingw_ldd_windows.sh
RUN mkdir -p /src/mingw_ldd && \
cd /src/mingw_ldd && \
/build/build_mingw_ldd_windows.sh && \
rm -fr /src/mingw_ldd
COPY download/download_nsisshellexecasuser.sh /build/download/download_nsisshellexecasuser.sh
COPY build_nsisshellexecasuser_windows.sh /build/build_nsisshellexecasuser_windows.sh
RUN mkdir -p /src/nsisshellexecasuser && \
cd /src/nsisshellexecasuser && \
/build/build_nsisshellexecasuser_windows.sh && \
rm -fr /src/nsisshellexecasuser
COPY download/download_toxcore.sh /build/download/download_toxcore.sh
COPY download/download_toxext.sh /build/download/download_toxext.sh
COPY download/download_toxext_messages.sh /build/download/download_toxext_messages.sh
COPY build_toxcore_windows.sh /build/build_toxcore_windows.sh
RUN mkdir -p /src/tox && \
cd /src/tox && \
/build/build_toxcore_windows.sh && \
rm -fr /src/tox
RUN mkdir /export && \
cp /usr/${ARCH}-w64-mingw32/lib/libwinpthread-1.dll /export/ && \
cp /usr/lib/gcc/${ARCH}-w64-mingw32/10-posix/libgcc_s_*-1.dll /export && \
cp /usr/lib/gcc/${ARCH}-w64-mingw32/10-posix/libstdc++-6.dll /export && \
cp /usr/lib/gcc/${ARCH}-w64-mingw32/10-posix/libssp-0.dll /export && \
cp /windows/bin/Qt5Core.dll /export && \
cp /windows/bin/Qt5Gui.dll /export && \
cp /windows/bin/Qt5Network.dll /export && \
cp /windows/bin/Qt5Svg.dll /export && \
cp /windows/bin/Qt5Xml.dll /export && \
cp /windows/bin/Qt5Widgets.dll /export && \
cp /windows/bin/avcodec-*.dll /export && \
cp /windows/bin/avdevice-*.dll /export && \
cp /windows/bin/avformat-*.dll /export && \
cp /windows/bin/avutil-*.dll /export && \
cp /windows/bin/libexif-*.dll /export && \
cp /windows/bin/libqrencode.dll /export && \
cp /windows/bin/libsodium-*.dll /export && \
cp /windows/bin/libsqlcipher-*.dll /export && \
cp /windows/bin/swscale-*.dll /export && \
cp /windows/bin/libcrypto-*.dll /export && \
cp /windows/bin/libtoxcore.dll /export && \
cp /windows/bin/libopus-*.dll /export && \
cp /windows/lib/libvpx.dll /export && \
cp /windows/bin/libssl-*.dll /export && \
cp /windows/bin/libsnore-qt5.dll /export && \
mkdir -p /export/libsnore-qt5/ && \
cp /windows/plugins/libsnore-qt5/libsnore_backend_windowstoast.dll /export/libsnore-qt5/ && \
cp /windows/bin/SnoreToast.exe /export && \
cp -r /windows/plugins/iconengines /export && \
cp -r /windows/plugins/imageformats /export && \
cp -r /windows/plugins/platforms /export
RUN mkdir -p /debug_export
COPY download/download_mingw_debug_scripts.sh /build/download/download_mingw_debug_scripts.sh
RUN mkdir -p /src/mingw-debug-scripts && \
cd /src/mingw-debug-scripts && \
/build/download/download_mingw_debug_scripts.sh && \
sed -i "s|your-app-name.exe|qtox.exe|g" debug-*.bat && \
cp -a debug-*.bat /debug_export && \
rm -fr /src/mingw-debug-scripts
COPY download/download_gmp.sh /build/download/download_gmp.sh
COPY build_gmp_windows.sh /build/build_gmp_windows.sh
RUN mkdir -p /src/gmp && \
cd /src/gmp && \
/build/build_gmp_windows.sh && \
rm -fr /src/gmp
COPY download/download_libexpat.sh /build/download/download_libexpat.sh
COPY build_libexpat_windows.sh /build/build_libexpat_windows.sh
RUN mkdir -p /src/libexpat && \
cd /src/libexpat && \
/build/build_libexpat_windows.sh && \
rm -fr /src/libexpat
COPY download/download_gdb.sh /build/download/download_gdb.sh
COPY build_gdb_windows.sh /build/build_gdb_windows.sh
RUN mkdir -p /src/gdb && \
cd /src/gdb && \
/build/build_gdb_windows.sh && \
rm -fr /src/gdb && \
cp /windows/bin/gdb.exe /debug_export/gdb.exe
RUN mkdir -p /qtox
WORKDIR /qtox

76
buildscripts/download/common.sh Executable file
View File

@ -0,0 +1,76 @@
#!/bin/bash
# Copyright © 2021 by The qTox Project Contributors
#
# This program is libre 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/>.
check_sha256()
{
if uname | grep -q Darwin; then
HASH_BIN="gsha256sum"
else
HASH_BIN="sha256sum"
fi
if ! ( echo "$1 $2" | $HASH_BIN -c --quiet --status - )
then
echo "Error: sha256 of $2 doesn't match the known one."
echo "Expected: $1 $2"
echo -n "Got: "
sha256sum "$2"
exit 1
else
echo "sha256 matches the expected one: $1"
fi
}
download_file()
{
# Curl command wrapper to download a file to the CWD
local URL="$1"
curl -L --connect-timeout 10 -O "$URL"
}
download_verify_extract_tarball()
{
# Downlaoads the tarball at URL, ensures it has an sha256sum of HASH and
# extracts it to the CWD
local URL="$1"
local HASH="$2"
# Try linux style mktemp and fallback on osx style
TEMPDIR=$(mktemp -d -p . 2>/dev/null || mktemp -d -t qtox_download)
if [ $? -ne 0 ]; then
return 1
fi
TEMPDIR=$(cd "$TEMPDIR"; pwd -P)
pushd "$TEMPDIR" >/dev/null || exit 1
download_file "$URL"
if ! check_sha256 "$HASH" *; then
rm -fr "$TEMPDIR"
return 1
fi
popd >/dev/null || exit 1
tar -xf "$TEMPDIR"/* --strip-components=1
rm -fr "$TEMPDIR"
}

View File

@ -0,0 +1,26 @@
#!/bin/bash
# Copyright © 2021 by The qTox Project Contributors
#
# This program is libre 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 -euo pipefail
AITOOL_HASH=effcebc1d81c5e174a48b870cb420f490fb5fb4d
git clone -b master --single-branch --recursive \
https://github.com/AppImage/AppImageKit .
git checkout "$AITOOL_HASH"
git submodule update --init --recursive

View File

@ -0,0 +1,27 @@
#!/bin/bash
# Copyright © 2021 by The qTox Project Contributors
#
# This program is libre 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 -euo pipefail
FFMPEG_VERSION=4.4.1
FFMPEG_HASH=eadbad9e9ab30b25f5520fbfde99fae4a92a1ae3c0257a8d68569a4651e30e02
source "$(dirname $0)"/common.sh
download_verify_extract_tarball \
"https://www.ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.xz" \
"${FFMPEG_HASH}"

View File

@ -0,0 +1,28 @@
#!/bin/bash
# Copyright © 2021 by The qTox Project Contributors
#
# This program is libre 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 -euo pipefail
GDB_VERSION="11.1"
GDB_HASH="cccfcc407b20d343fb320d4a9a2110776dd3165118ffd41f4b1b162340333f94"
source "$(dirname $0)"/common.sh
download_verify_extract_tarball \
"http://ftp.gnu.org/gnu/gdb/gdb-${GDB_VERSION}.tar.xz" \
${GDB_HASH}

View File

@ -0,0 +1,28 @@
#!/bin/bash
# Copyright © 2021 by The qTox Project Contributors
#
# This program is libre 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 -euo pipefail
GMP_VERSION=6.2.1
GMP_HASH=fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
source "$(dirname $0)"/common.sh
download_verify_extract_tarball \
"http://ftp.gnu.org/gnu/gmp/gmp-${GMP_VERSION}.tar.xz" \
"${GMP_HASH}"

View File

@ -0,0 +1,27 @@
#!/bin/bash
# Copyright © 2021 by The qTox Project Contributors
#
# This program is libre 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 -euo pipefail
LINUXDEPLOYQT_VERSION=570ca2dcb16f59ce0a2721f780093db8037cc9e0
LINUXDEPLOYQT_HASH=d53496c349f540ce17ea42c508d85802db1c7c3571e1bf962ec4e95482ea938e
source "$(dirname $0)"/common.sh
download_verify_extract_tarball \
"https://github.com/probonopd/linuxdeployqt/archive/${LINUXDEPLOYQT_VERSION}.tar.gz" \
"${LINUXDEPLOYQT_HASH}"

View File

@ -0,0 +1,27 @@
#!/bin/bash
# Copyright © 2021 by The qTox Project Contributors
#
# This program is libre 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 -euo pipefail
LIBEXIF_VERSION=0.6.24
LIBEXIF_HASH=d47564c433b733d83b6704c70477e0a4067811d184ec565258ac563d8223f6ae
source "$(dirname $0)"/common.sh
download_verify_extract_tarball \
"https://github.com/libexif/libexif/releases/download/v${LIBEXIF_VERSION}/libexif-${LIBEXIF_VERSION}.tar.bz2" \
"${LIBEXIF_HASH}"

View File

@ -0,0 +1,27 @@
#!/bin/bash
# Copyright © 2021 by The qTox Project Contributors
#
# This program is libre 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 -euo pipefail
EXPAT_VERSION="2.4.1"
EXPAT_HASH="cf032d0dba9b928636548e32b327a2d66b1aab63c4f4a13dd132c2d1d2f2fb6a"
source "$(dirname $0)"/common.sh
download_verify_extract_tarball \
"https://github.com/libexpat/libexpat/releases/download/R_${EXPAT_VERSION//./_}/expat-${EXPAT_VERSION}.tar.xz" \
${EXPAT_HASH}

View File

@ -0,0 +1,27 @@
#!/bin/bash
# Copyright © 2021 by The qTox Project Contributors
#
# This program is libre 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 -euo pipefail
MINGW_W64_DEBUG_SCRIPTS_VERSION="c6ae689137844d1a6fd9c1b9a071d3f82a44c593"
MINGW_W64_DEBUG_SCRIPTS_HASH="5916bf9e6691d4f7f1c233c8c3a2b9f3b1d1ad0f58ab951381da5ec856f5d021"
source "$(dirname $0)"/common.sh
download_verify_extract_tarball \
"https://github.com/nurupo/mingw-w64-debug-scripts/archive/${MINGW_W64_DEBUG_SCRIPTS_VERSION}.tar.gz" \
${MINGW_W64_DEBUG_SCRIPTS_HASH}

View File

@ -0,0 +1,27 @@
#!/bin/bash
# Copyright © 2021 by The qTox Project Contributors
#
# This program is libre 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 -euo pipefail
MINGW_LDD_VERSION=0.2.1
MINGW_LDD_HASH=60d34506d2f345e011b88de172ef312f37ca3ba87f3764f511061b69878ab204
source "$(dirname $0)"/common.sh
download_verify_extract_tarball \
"https://github.com/nurupo/mingw-ldd/archive/v${MINGW_LDD_VERSION}.tar.gz" \
"${MINGW_LDD_HASH}"

View File

@ -0,0 +1,31 @@
#!/bin/bash
# Copyright © 2021 by The qTox Project Contributors
#
# This program is libre 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 -euo pipefail
NSISSHELLEXECASUSER_HASH=8fc19829e144716a422b15a85e718e1816fe561de379b2b5ae87ef9017490799
source "$(dirname "$0")/common.sh"
download_file http://nsis.sourceforge.net/mediawiki/images/c/c7/ShellExecAsUser.zip
if ! check_sha256 "$NSISSHELLEXECASUSER_HASH" ShellExecAsUser.zip; then
exit 1
fi
unzip ShellExecAsUser.zip
rm ShellExecAsUser.zip

View File

@ -0,0 +1,29 @@
#!/bin/bash
# Copyright © 2021 by The qTox Project Contributors
#
# This program is libre 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 -euo pipefail
OPENAL_VERSION=b80570bed017de60b67c6452264c634085c3b148
OPENAL_HASH=e9f6d37672e085d440ef8baeebb7d62fec1d152094c162e5edb33b191462bd78
source "$(dirname "$0")"/common.sh
## We can stop using the fork once OpenAL-Soft gets loopback capture implemented:
## https://github.com/kcat/openal-soft/pull/421
download_verify_extract_tarball \
"https://github.com/irungentoo/openal-soft-tox/archive/${OPENAL_VERSION}.tar.gz" \
"${OPENAL_HASH}"

View File

@ -0,0 +1,27 @@
#!/bin/bash
# Copyright © 2021 by The qTox Project Contributors
#
# This program is libre 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 -euo pipefail
OPENSSL_VERSION=1.1.1l
OPENSSL_HASH=0b7a3e5e59c34827fe0c3a74b7ec8baef302b98fa80088d7f9153aa16fa76bd1
source "$(dirname "$0")"/common.sh
download_verify_extract_tarball \
"https://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz" \
"$OPENSSL_HASH"

View File

@ -0,0 +1,27 @@
#!/bin/bash
# Copyright © 2021 by The qTox Project Contributors
#
# This program is libre 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 -euo pipefail
OPUS_VERSION=1.3.1
OPUS_HASH=65b58e1e25b2a114157014736a3d9dfeaad8d41be1c8179866f144a2fb44ff9d
source "$(dirname "$0")"/common.sh
download_verify_extract_tarball \
"https://archive.mozilla.org/pub/opus/opus-${OPUS_VERSION}.tar.gz" \
"${OPUS_HASH}"

View File

@ -0,0 +1,27 @@
#!/bin/bash
# Copyright © 2021 by The qTox Project Contributors
#
# This program is libre 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 -euo pipefail
QRENCODE_VERSION=4.1.1
QRENCODE_HASH=e455d9732f8041cf5b9c388e345a641fd15707860f928e94507b1961256a6923
source "$(dirname "$0")"/common.sh
download_verify_extract_tarball \
"https://fukuchi.org/works/qrencode/qrencode-${QRENCODE_VERSION}.tar.bz2" \
"${QRENCODE_HASH}"

View File

@ -0,0 +1,29 @@
#!/bin/bash
# Copyright © 2021 by The qTox Project Contributors
#
# This program is libre 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 -euo pipefail
QT_MAJOR=5
QT_MINOR=12
QT_PATCH=12
QT_HASH=1979a3233f689cb8b3e2783917f8f98f6a2e1821a70815fb737f020cd4b6ab06
source "$(dirname "$0")"/common.sh
download_verify_extract_tarball \
https://download.qt.io/official_releases/qt/${QT_MAJOR}.${QT_MINOR}/${QT_MAJOR}.${QT_MINOR}.${QT_PATCH}/single/qt-everywhere-src-${QT_MAJOR}.${QT_MINOR}.${QT_PATCH}.tar.xz \
"${QT_HASH}"

View File

@ -0,0 +1,27 @@
#!/bin/bash
# Copyright © 2021 by The qTox Project Contributors
#
# This program is libre 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 -euo pipefail
SNORE_VERSION=0.7.0
SNORE_HASH=2e3f5fbb80ab993f6149136cd9a14c2de66f48cabce550dead167a9448f5bed9
source "$(dirname "$0")"/common.sh
download_verify_extract_tarball \
"https://github.com/KDE/snorenotify/archive/v${SNORE_VERSION}.tar.gz" \
"${SNORE_HASH}"

View File

@ -0,0 +1,27 @@
#!/bin/bash
# Copyright © 2021 by The qTox Project Contributors
#
# This program is libre 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 -euo pipefail
SODIUM_VERSION=1.0.18
SODIUM_HASH=6f504490b342a4f8a4c4a02fc9b866cbef8622d5df4e5452b46be121e46636c1
source "$(dirname "$0")"/common.sh
download_verify_extract_tarball \
"https://download.libsodium.org/libsodium/releases/libsodium-${SODIUM_VERSION}.tar.gz" \
"${SODIUM_HASH}"

View File

@ -0,0 +1,27 @@
#!/bin/bash
# Copyright © 2021 by The qTox Project Contributors
#
# This program is libre 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 -euo pipefail
SQLCIPHER_VERSION=4.5.0
SQLCIPHER_HASH=20c46a855c47d5a0a159fdcaa8491ec7bdbaa706a734ee52bc76188b929afb14
source "$(dirname "$0")"/common.sh
download_verify_extract_tarball \
"https://github.com/sqlcipher/sqlcipher/archive/v${SQLCIPHER_VERSION}.tar.gz" \
"${SQLCIPHER_HASH}"

View File

@ -0,0 +1,27 @@
#!/bin/bash
# Copyright © 2021 by The qTox Project Contributors
#
# This program is libre 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 -euo pipefail
TOXCORE_VERSION=0.2.13
TOXCORE_HASH=67114fa57504c58b695f5dce8ef85124d555f2c3c353d0d2615e6d4845114ab8
source "$(dirname "$0")"/common.sh
download_verify_extract_tarball \
https://github.com/TokTok/c-toxcore/archive/v$TOXCORE_VERSION.tar.gz \
"$TOXCORE_HASH"

View File

@ -0,0 +1,28 @@
#!/bin/bash
# Copyright © 2021 by The qTox Project Contributors
#
# This program is libre 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 -euo pipefail
TOXEXT_VERSION=0.0.3
TOXEXT_HASH=99cf215d261a07bd83eafd1c69dcf78018db605898350b6137f1fd8e7c54734a
source "$(dirname "$0")"/common.sh
download_verify_extract_tarball \
https://github.com/toxext/toxext/archive/v$TOXEXT_VERSION.tar.gz \
"$TOXEXT_HASH"

View File

@ -0,0 +1,28 @@
#!/bin/bash
# Copyright © 2021 by The qTox Project Contributors
#
# This program is libre 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 -euo pipefail
TOXEXT_MESSAGES_VERSION=0.0.3
TOXEXT_MESSAGES_HASH=e7a9a199a3257382a85a8e555b6c8c540b652a11ca9a471b9da2a25a660dfdc3
source "$(dirname "$0")"/common.sh
download_verify_extract_tarball \
https://github.com/toxext/tox_extension_messages/archive/v$TOXEXT_MESSAGES_VERSION.tar.gz \
"$TOXEXT_MESSAGES_HASH"

View File

@ -0,0 +1,27 @@
#!/bin/bash
# Copyright © 2021 by The qTox Project Contributors
#
# This program is libre 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 -euo pipefail
VPX_VERSION=1.11.0
VPX_HASH=965e51c91ad9851e2337aebcc0f517440c637c506f3a03948062e3d5ea129a83
source "$(dirname "$0")"/common.sh
download_verify_extract_tarball \
"https://github.com/webmproject/libvpx/archive/v$VPX_VERSION.tar.gz" \
"${VPX_HASH}"

View File

@ -0,0 +1,16 @@
https://github.com/microsoft/vcpkg/blob/3baf583934f3077070e9ed4e7684f743ecced577/ports/openal-soft/cmake-3-11.patch
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a871f4c..f9f6b34 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -965,7 +965,8 @@ OPTION(ALSOFT_REQUIRE_DSOUND "Require DirectSound backend" OFF)
OPTION(ALSOFT_REQUIRE_MMDEVAPI "Require MMDevApi backend" OFF)
IF(HAVE_WINDOWS_H)
# Check MMSystem backend
- CHECK_INCLUDE_FILES("windows.h;mmsystem.h" HAVE_MMSYSTEM_H -D_WIN32_WINNT=0x0502)
+ set(CMAKE_REQUIRED_DEFINITIONS -D_WIN32_WINNT=0x0502)
+ CHECK_INCLUDE_FILES("windows.h;mmsystem.h" HAVE_MMSYSTEM_H)
IF(HAVE_MMSYSTEM_H)
CHECK_SHARED_FUNCTION_EXISTS(waveOutOpen "windows.h;mmsystem.h" winmm "" HAVE_LIBWINMM)
IF(HAVE_LIBWINMM)

View File

@ -0,0 +1,119 @@
diff -ruN libvpx/build/make/configure.sh patched/build/make/configure.sh
--- libvpx/build/make/configure.sh 2019-02-13 16:56:48.972857636 +0100
+++ patched/build/make/configure.sh 2019-02-13 16:50:37.995967583 +0100
@@ -1426,11 +1426,13 @@
win32)
add_asflags -f win32
enabled debug && add_asflags -g cv8
+ add_ldflags "-Wl,-no-undefined"
EXE_SFX=.exe
;;
win64)
add_asflags -f win64
enabled debug && add_asflags -g cv8
+ add_ldflags "-Wl,-no-undefined"
EXE_SFX=.exe
;;
linux*|solaris*|android*)
diff -ruN libvpx/build/make/Makefile patched/build/make/Makefile
--- libvpx/build/make/Makefile 2019-02-13 16:56:48.972857636 +0100
+++ patched/build/make/Makefile 2019-02-13 16:50:37.995967583 +0100
@@ -304,6 +304,7 @@
$(if $(quiet),@echo " [LD] $$@")
$(qexec)$$(LD) -shared $$(LDFLAGS) \
-Wl,--no-undefined -Wl,-soname,$$(SONAME) \
+ -Wl,-out-implib,libvpx.dll.a \
-Wl,--version-script,$$(EXPORTS_FILE) -o $$@ \
$$(filter %.o,$$^) $$(extralibs)
endef
@@ -388,7 +389,7 @@
.libs: $(LIBS)
@touch $@
$(foreach lib,$(filter %_g.a,$(LIBS)),$(eval $(call archive_template,$(lib))))
-$(foreach lib,$(filter %so.$(SO_VERSION_MAJOR).$(SO_VERSION_MINOR).$(SO_VERSION_PATCH),$(LIBS)),$(eval $(call so_template,$(lib))))
+$(foreach lib,$(filter %dll,$(LIBS)),$(eval $(call so_template,$(lib))))
$(foreach lib,$(filter %$(SO_VERSION_MAJOR).dylib,$(LIBS)),$(eval $(call dl_template,$(lib))))
$(foreach lib,$(filter %$(SO_VERSION_MAJOR).dll,$(LIBS)),$(eval $(call dll_template,$(lib))))
diff -ruN libvpx/configure patched/configure
--- libvpx/configure 2019-02-13 16:56:49.162860897 +0100
+++ patched/configure 2019-02-13 16:53:03.328719607 +0100
@@ -513,23 +513,23 @@
}
process_detect() {
- if enabled shared; then
+ #if enabled shared; then
# Can only build shared libs on a subset of platforms. Doing this check
# here rather than at option parse time because the target auto-detect
# magic happens after the command line has been parsed.
- case "${tgt_os}" in
- linux|os2|solaris|darwin*|iphonesimulator*)
+ # case "${tgt_os}" in
+ # linux|os2|solaris|darwin*|iphonesimulator*)
# Supported platforms
- ;;
- *)
- if enabled gnu; then
- echo "--enable-shared is only supported on ELF; assuming this is OK"
- else
- die "--enable-shared only supported on ELF, OS/2, and Darwin for now"
- fi
- ;;
- esac
- fi
+ # ;;
+ # *)
+ # if enabled gnu; then
+ # echo "--enable-shared is only supported on ELF; assuming this is OK"
+ # else
+ # die "--enable-shared only supported on ELF, OS/2, and Darwin for now"
+ # fi
+ # ;;
+ # esac
+ #fi
if [ -z "$CC" ] || enabled external_build; then
echo "Bypassing toolchain for environment detection."
enable_feature external_build
diff -ruN libvpx/examples.mk patched/examples.mk
--- libvpx/examples.mk 2019-02-13 16:56:49.162860897 +0100
+++ patched/examples.mk 2019-02-13 16:50:37.995967583 +0100
@@ -315,7 +315,7 @@
ifneq ($(filter os2%,$(TGT_OS)),)
SHARED_LIB_SUF=_dll.a
else
-SHARED_LIB_SUF=.so
+SHARED_LIB_SUF=.dll.a
endif
endif
CODEC_LIB_SUF=$(if $(CONFIG_SHARED),$(SHARED_LIB_SUF),.a)
diff -ruN libvpx/libs.mk patched/libs.mk
--- libvpx/libs.mk 2019-02-13 16:56:48.972857636 +0100
+++ patched/libs.mk 2019-02-13 16:50:37.995967583 +0100
@@ -256,12 +256,12 @@
LIBVPX_SO_SYMLINKS :=
LIBVPX_SO_IMPLIB := libvpx_dll.a
else
-LIBVPX_SO := libvpx.so.$(SO_VERSION_MAJOR).$(SO_VERSION_MINOR).$(SO_VERSION_PATCH)
-SHARED_LIB_SUF := .so
+LIBVPX_SO := libvpx.dll
+SHARED_LIB_SUF := .dll
EXPORT_FILE := libvpx.ver
-LIBVPX_SO_SYMLINKS := $(addprefix $(LIBSUBDIR)/, \
- libvpx.so libvpx.so.$(SO_VERSION_MAJOR) \
- libvpx.so.$(SO_VERSION_MAJOR).$(SO_VERSION_MINOR))
+LIBVPX_SO_SYMLINKS :=
+
+
endif
endif
endif
@@ -271,7 +271,7 @@
$(if $(LIBVPX_SO_IMPLIB), $(BUILD_PFX)$(LIBVPX_SO_IMPLIB))
$(BUILD_PFX)$(LIBVPX_SO): $(LIBVPX_OBJS) $(EXPORT_FILE)
$(BUILD_PFX)$(LIBVPX_SO): extralibs += -lm
-$(BUILD_PFX)$(LIBVPX_SO): SONAME = libvpx.so.$(SO_VERSION_MAJOR)
+$(BUILD_PFX)$(LIBVPX_SO): SONAME = libvpx.dll
$(BUILD_PFX)$(LIBVPX_SO): EXPORTS_FILE = $(EXPORT_FILE)
libvpx.def: $(call enabled,CODEC_EXPORTS)

View File

@ -0,0 +1,13 @@
SET(CMAKE_SYSTEM_NAME Windows)
SET(CMAKE_C_COMPILER i686-w64-mingw32-gcc)
SET(CMAKE_CXX_COMPILER i686-w64-mingw32-g++)
SET(CMAKE_RC_COMPILER i686-w64-mingw32-windres)
SET(CMAKE_FIND_ROOT_PATH /usr/i686-w64-mingw32)
# search for programs in the build host directories
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

View File

@ -0,0 +1,13 @@
SET(CMAKE_SYSTEM_NAME Windows)
SET(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc)
SET(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++)
SET(CMAKE_RC_COMPILER x86_64-w64-mingw32-windres)
SET(CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32)
# search for programs in the build host directories
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

View File

@ -49,7 +49,9 @@ auto_test(chatlog chatlinestorage "")
auto_test(persistence paths "")
auto_test(persistence dbschema "")
auto_test(persistence offlinemsgengine "")
auto_test(persistence smileypack "${${PROJECT_NAME}_RESOURCES}") # needs emojione
if(NOT "${SMILEYS}" STREQUAL "DISABLED")
auto_test(persistence smileypack "${${PROJECT_NAME}_RESOURCES}") # needs emojione
endif()
auto_test(model friendmessagedispatcher "")
auto_test(model groupmessagedispatcher "${MOCK_SOURCES}")
auto_test(model messageprocessor "")

93
docker-compose.yml Normal file
View File

@ -0,0 +1,93 @@
x-shared-params: &shared_params
# Fixes various issues when building/running in the docker containers
# Known fixes:
# * Appimage mounting
# * Attaching to processes in GDB
# * Fix tcl build due to pivot_root
cap_add:
- ALL
# Allows us to run app images from within the context of a docker image
devices:
- /dev/fuse:/dev/fuse
# X11 stuff
environment:
DISPLAY: $DISPLAY
XAUTHORITY: $XAUTHORITY
volumes:
- .:/qtox
- /tmp/.X11-unix:/tmp/.X11-unix
- ~/.Xauthority:/root/.Xauthority
user: ${USER_ID:-0}:${GROUP_ID:-0}
network_mode: host
services:
archlinux:
image: qtox_archlinux:latest
build:
context: ./buildscripts
dockerfile: docker/Dockerfile.archlinux
<<: *shared_params
debian_old:
image: qtox_debian_old:latest
build:
context: ./buildscripts
dockerfile: docker/Dockerfile.debian_old
<<: *shared_params
debian:
image: qtox_debian:latest
build:
context: ./buildscripts
dockerfile: docker/Dockerfile.debian
args:
DEBIAN_VERSION: stable
<<: *shared_params
ubuntu_lts:
image: qtox_ubuntu:latest
build:
context: ./buildscripts
dockerfile: docker/Dockerfile.ubuntu_lts
<<: *shared_params
flatpak:
image: qtox_flatpak:latest
# Flatpak build uses pivot_root() in tcl build
privileged: true
build:
context: ./buildscripts
dockerfile: docker/Dockerfile.flatpak_builder
<<: *shared_params
centos:
image: qtox_centos:latest
build:
context: ./buildscripts
dockerfile: docker/Dockerfile.centos
<<: *shared_params
fedora:
image: qtox_fedora:latest
build:
context: ./buildscripts
dockerfile: docker/Dockerfile.fedora
<<: *shared_params
opensuse:
image: qtox_opensuse:latest
build:
context: ./buildscripts
dockerfile: docker/Dockerfile.opensuse
<<: *shared_params
windows_builder:
image: qtox_windows_builder:latest
build:
context: ./buildscripts
dockerfile: docker/Dockerfile.windows_builder
args:
ARCH: x86_64
WINEARCH: win64
<<: *shared_params
windows_builder.i686:
image: qtox_windows_builder.i686:latest
build:
context: ./buildscripts
dockerfile: docker/Dockerfile.windows_builder
args:
ARCH: i686
WINEARCH: win32
<<: *shared_params

View File

@ -1,78 +0,0 @@
# Copyright © 2019 by The qTox Project Contributors
#
# This file is part of qTox, a Qt-based graphical interface for Tox.
# qTox is libre 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.
#
# qTox 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 qTox. If not, see <http://www.gnu.org/licenses/>
FROM debian:stretch
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get -y --force-yes install \
automake \
autotools-dev \
build-essential \
check \
checkinstall \
cmake \
ffmpeg \
git \
libavcodec-dev \
libavdevice-dev \
libexif-dev \
libgdk-pixbuf2.0-dev \
libgtk2.0-dev \
libopenal-dev \
libopus-dev \
libqrencode-dev \
libqt5opengl5-dev \
libqt5svg5-dev \
libsodium-dev \
libsqlcipher-dev \
libtool \
libvpx-dev \
libxss-dev \
pkg-config \
qrencode \
qt5-default \
qttools5-dev \
qttools5-dev-tools \
yasm
RUN git clone https://github.com/toktok/c-toxcore.git /toxcore
WORKDIR /toxcore
RUN git checkout v0.2.13 && \
cmake . -DBOOTSTRAP_DAEMON=OFF && \
cmake --build . && \
make install && \
echo '/usr/local/lib/' >> /etc/ld.so.conf.d/locallib.conf && \
ldconfig
RUN git clone https://github.com/toxext/toxext.git /toxext
WORKDIR /toxext
RUN git checkout v0.0.3 && \
cmake . && \
cmake --build . -- -j $(nproc) && \
cmake --build . --target install
RUN git clone https://github.com/toxext/tox_extension_messages.git /tox_extension_messages
WORKDIR /tox_extension_messages
RUN git checkout v0.0.3 && \
cmake . && \
cmake --build . -- -j $(nproc) && \
cmake --build . --target install
COPY . /qtox
WORKDIR /qtox
RUN cmake . && cmake --build .

View File

@ -1,75 +0,0 @@
# Copyright © 2019 by The qTox Project Contributors
#
# This file is part of qTox, a Qt-based graphical interface for Tox.
# qTox is libre 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.
#
# qTox 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 qTox. If not, see <http://www.gnu.org/licenses/>
FROM ubuntu:18.04
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get -y --force-yes install \
build-essential \
cmake \
git \
libavcodec-dev \
libavdevice-dev \
libavfilter-dev \
libavutil-dev \
libexif-dev \
libgdk-pixbuf2.0-dev \
libglib2.0-dev \
libgtk2.0-dev \
libopenal-dev \
libopus-dev \
libqrencode-dev \
libqt5opengl5-dev \
libqt5svg5-dev \
libsodium-dev \
libsqlcipher-dev \
libswresample-dev \
libswscale-dev \
libvpx-dev \
libxss-dev \
qrencode \
qt5-default \
qttools5-dev-tools \
qttools5-dev
RUN git clone https://github.com/toktok/c-toxcore.git /toxcore
WORKDIR /toxcore
RUN git checkout v0.2.13 && \
cmake . -DBOOTSTRAP_DAEMON=OFF && \
cmake --build . && \
make install && \
echo '/usr/local/lib/' >> /etc/ld.so.conf.d/locallib.conf && \
ldconfig
RUN git clone https://github.com/toxext/toxext.git /toxext
WORKDIR /toxext
RUN git checkout v0.0.3 && \
cmake . && \
cmake --build . -- -j $(nproc) && \
cmake --build . --target install
RUN git clone https://github.com/toxext/tox_extension_messages.git /tox_extension_messages
WORKDIR /tox_extension_messages
RUN git checkout v0.0.3 && \
cmake . && \
cmake --build . -- -j $(nproc) && \
cmake --build . --target install
COPY . /qtox
WORKDIR /qtox
RUN cmake . && cmake --build .

View File

@ -1,22 +0,0 @@
#!/bin/bash
# Copyright © 2019 by The qTox Project Contributors
#
# This file is part of qTox, a Qt-based graphical interface for Tox.
# qTox is libre 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.
#
# qTox 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 qTox. If not, see <http://www.gnu.org/licenses/>
cd "$(dirname "$0")/.."
docker build . -f docker/Dockerfile.debian -t qtox
cd -

View File

@ -1,22 +0,0 @@
#!/bin/bash
# Copyright © 2019 by The qTox Project Contributors
#
# This file is part of qTox, a Qt-based graphical interface for Tox.
# qTox is libre 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.
#
# qTox 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 qTox. If not, see <http://www.gnu.org/licenses/>
cd "$(dirname "$0")/.."
docker build . -f docker/Dockerfile.ubuntu -t qtox
cd -

View File

@ -1,24 +0,0 @@
#!/bin/sh
# Copyright © 2019 by The qTox Project Contributors
#
# This file is part of qTox, a Qt-based graphical interface for Tox.
# qTox is libre 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.
#
# qTox 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 qTox. If not, see <http://www.gnu.org/licenses/>
XSOCK=/tmp/.X11-unix
XAUTH=/tmp/.docker.xauth
touch $XAUTH
xauth nlist $DISPLAY | sed -e 's/^..../ffff/' | xauth -f $XAUTH nmerge -
docker run -ti --rm -v $XSOCK:$XSOCK -v $XAUTH:$XAUTH -e DISPLAY=$DISPLAY -e XAUTHORITY=$XAUTH qtox ./qtox

View File

@ -1,54 +0,0 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: GPL-3.0+
#
# Copyright © 2018-2019 by The qTox Project Contributors
#
# This script should be run from the root of the repository
# usage: ./flatpak/build-flatpak.sh [Debug]
#
# If [Debug] is set to "Debug" the container will run in interactive mode and
# stay open to poke around in the filesystem.
readonly DEBUG="$1"
# Fail out on error
set -exo pipefail
if [ ! -f ./flatpak/build-flatpak.sh ]; then
echo ""
echo "You are attempting to run the build-flatpak.sh from a wrong directory."
echo "If you wish to run this script, you'll have to have"
echo "the repository root directory as the working directory."
echo ""
exit 1
fi
mkdir -p ./output
if [ "$DEBUG" == "Debug" ]
then
echo "Execute: /qtox/appimage/build.sh to start the build script"
echo "Execute: exit to leave the container"
docker run --rm --privileged -it \
-v $PWD:/qtox \
-v $PWD/output:/output \
debian:buster-slim \
/bin/bash
else
docker run --rm --privileged \
-v $PWD:/qtox \
-v $PWD/output:/output \
debian:buster-slim \
/bin/bash -c "/qtox/flatpak/build.sh"
fi
# use the version number in the name when building a tag on Travis CI
if [ -n "$TRAVIS_TAG" ]
then
readonly OUTFILE=./output/qTox-"$TRAVIS_TAG".x86_64.flatpak
mv ./output/*.flatpak "$OUTFILE"
sha256sum "$OUTFILE" > "$OUTFILE".sha256
fi

View File

@ -2,58 +2,23 @@
# SPDX-License-Identifier: GPL-3.0+
#
# Copyright © 2018-2019 by The qTox Project Contributors
# Copyright © 2018-2021 by The qTox Project Contributors
# Fail out on error
set -exuo pipefail
# directory paths
readonly QTOX_SRC_DIR="/qtox"
readonly OUTPUT_DIR="/output"
readonly BUILD_DIR="/build"
readonly QTOX_BUILD_DIR="$BUILD_DIR"/qtox
readonly FP_BUILD_DIR="$BUILD_DIR"/flatpak
readonly APT_FLAGS="-y --no-install-recommends"
# flatpak manifest download location
readonly MANIFEST_FILE="flatpak/io.github.qtox.qTox.json"
# directory containing necessary patches
readonly PATCH_DIR="flatpak/patches"
# use multiple cores when building
export MAKEFLAGS="-j$(nproc)"
FLATPAK_DESCRIPTOR=$(dirname $(realpath $0))/io.github.qtox.qTox.json
# Get packages
apt-get update
apt-get install $APT_FLAGS ca-certificates git elfutils wget xz-utils patch bzip2 librsvg2-2 librsvg2-common flatpak flatpak-builder
# create build directory
mkdir -p "$BUILD_DIR"
cd "$BUILD_DIR"
# copy qtox source
cp -r "$QTOX_SRC_DIR" "$QTOX_BUILD_DIR"
cd "$QTOX_BUILD_DIR"
# create flatpak build directory
mkdir -p "$FP_BUILD_DIR"
cd "$FP_BUILD_DIR"
# Add 'https://flathub.org' remote:
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
## Workaround for Flathub download issues: https://github.com/flathub/flathub/issues/845
# Pre download org.kde.Sdk because it fails often
for i in {1..5}
do
echo "Download try $i"
flatpak --system install flathub -y org.kde.Sdk/x86_64/5.15 || true
done
## Workaround end
mkdir -p /flatpak-build
cd /flatpak-build
# Build the qTox flatpak
flatpak-builder --disable-rofiles-fuse --install-deps-from=flathub --force-clean --repo=tox-repo qTox-flatpak "$QTOX_BUILD_DIR"/flatpak/io.github.qtox.qTox.json
flatpak-builder --disable-rofiles-fuse --install-deps-from=flathub --force-clean --repo=qtox-repo build "$FLATPAK_DESCRIPTOR"
# Create a bundle for distribution
flatpak build-bundle tox-repo "$OUTPUT_DIR"/qtox.flatpak io.github.qtox.qTox
flatpak build-bundle qtox-repo qtox.flatpak io.github.qtox.qTox
cp qtox.flatpak /qtox
# Chmod since everything is root:root
chmod 755 -R "$OUTPUT_DIR"

View File

@ -69,23 +69,8 @@
},
"sources": [
{
"type": "git",
"url": "https://github.com/sqlcipher/sqlcipher",
"tag": "v4.4.0",
"commit": "4a81bea61e1da6fec222d713852830f1fd01aed2",
"disable-fsckobjects" : true
}
]
},
{
"name": "snorenotify",
"buildsystem": "cmake-ninja",
"sources": [
{
"type": "git",
"url": "https://github.com/KDE/snorenotify",
"tag": "v0.7.0",
"commit": "9124e016f4f7615af5e8fca962994f7ed85de3cc"
"type": "dir",
"path": "/src/sqlcipher"
}
]
},
@ -93,10 +78,8 @@
"name": "libsodium",
"sources": [
{
"type": "git",
"url": "https://github.com/jedisct1/libsodium",
"tag": "1.0.18",
"commit": "4f5e89fa84ce1d178a6765b8b46f2b6f91216677"
"type": "dir",
"path": "/src/libsodium"
}
]
},
@ -110,10 +93,8 @@
],
"sources": [
{
"type": "git",
"url": "https://github.com/toktok/c-toxcore",
"tag": "v0.2.13",
"commit": "4348b96a5b482134a9cd55cb0ef9616798b4eb3c"
"type": "dir",
"path": "/src/toxcore"
}
]
},
@ -122,10 +103,8 @@
"buildsystem": "cmake-ninja",
"sources": [
{
"type": "git",
"url": "https://github.com/toxext/toxext",
"tag": "v0.0.3",
"commit": "e34f91bc92bc1799c133bd1602ef5748a4eb4459"
"type": "dir",
"path": "/src/toxext"
}
]
},
@ -134,10 +113,8 @@
"buildsystem": "cmake-ninja",
"sources": [
{
"type": "git",
"url": "https://github.com/toxext/tox_extension_messages",
"tag": "v0.0.3",
"commit": "3def0e36f63a3537b8fda87e12f870665d90dfcc"
"type": "dir",
"path": "/src/toxext_messages"
}
]
},
@ -151,7 +128,7 @@
"sources": [
{
"type": "dir",
"path": "/build/qtox/"
"path": "/qtox/"
}
]
}

View File

@ -0,0 +1,131 @@
#!/usr/bin/env python3
# Copyright © 2021 by The qTox Project Contributors
#
# This program is libre 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/>.
from argparse import ArgumentParser
from pathlib import Path
import re
import tempfile
import json
import unittest
import subprocess
QTOX_ROOT = Path(__file__).parent.parent
DOWNLOAD_FILE_PATHS = QTOX_ROOT / 'buildscripts' / 'download'
def parse_args():
parser = ArgumentParser(description="""
Update dependencies of a flathub manifest to match the versions used by
qtox. This script will iterate over all known dependencies in the manifest
and replace their tags with the ones specified by our download_xxx.sh
scripts. The commit hash for the tag will be replaced with whatever is
currently in the git remote
""")
parser.add_argument(
"--flathub-manifest",
help="Path to flathub manifest",
required=True,
dest="flathub_manifest_path")
parser.add_argument(
"--output",
help="Output manifest path",
required=True,
dest="output_manifest_path")
return parser.parse_args()
VERSION_EXTRACT_REGEX=re.compile(".*_VERSION=(.*)")
def find_version(download_script_path):
"""
Find the version specified for a given dependency by parsing its download script
"""
# Unintelligent regex parsing, but it will have to do.
# Hope there is no shell expansion in our version info, otherwise we'll have
# to do something a little more intelligent
with open(download_script_path) as f:
script_content = f.read()
matches = VERSION_EXTRACT_REGEX.search(script_content, re.MULTILINE)
return matches.group(1)
class FindVersionTest(unittest.TestCase):
def test_version_parsing(self):
# Create a dummy download script and check that we can extract the version from it
with tempfile.TemporaryDirectory() as d:
sample_download_script = """
#!/bin/bash
source "$(dirname "$0")"/common.sh
TEST_VERSION=1.2.3
TEST_HASH=:)
download_verify_extrat_tarball \
https://test_site.com/${TEST_VERSION} \
${TEST_HASH}
"""
sample_download_script_path = d + '/test_script.sh'
with open(sample_download_script_path, 'w') as f:
f.write(sample_download_script)
self.assertEqual(find_version(sample_download_script_path), "1.2.3")
def load_flathub_manifest(flathub_manifest_path):
with open(flathub_manifest_path) as f:
return json.load(f)
def commit_from_tag(url, tag):
git_output = subprocess.run(
['git', 'ls-remote', url, f"{tag}^{{}}"], check=True, stdout=subprocess.PIPE)
commit = git_output.stdout.split(b'\t')[0]
return commit.decode()
class CommitFromTagTest(unittest.TestCase):
def test_commit_from_tag(self):
self.assertEqual(commit_from_tag(str(QTOX_ROOT), "v1.17.3"), "c0e9a3b79609681e5b9f6bbf8f9a36cb1993dc5f")
def update_source(module, tag):
module_source = module["sources"][0]
module_source["tag"]= tag
module_source["commit"] = commit_from_tag(module_source["url"], module_source["tag"])
def main(flathub_manifest_path, output_manifest_path):
flathub_manifest = load_flathub_manifest(flathub_manifest_path)
sqlcipher_version = find_version(DOWNLOAD_FILE_PATHS / 'download_sqlcipher.sh')
sodium_version = find_version(DOWNLOAD_FILE_PATHS / 'download_sodium.sh')
toxcore_version = find_version(DOWNLOAD_FILE_PATHS / 'download_toxcore.sh')
toxext_version = find_version(DOWNLOAD_FILE_PATHS / 'download_toxext.sh')
toxext_messages_version = find_version(DOWNLOAD_FILE_PATHS / 'download_toxext_messages.sh')
for module in flathub_manifest["modules"]:
if module["name"] == "sqlcipher":
update_source(module, f"v{sqlcipher_version}")
elif module["name"] == "libsodium":
update_source(module, sodium_version)
elif module["name"] == "c-toxcore":
update_source(module, f"v{toxcore_version}")
elif module["name"] == "toxext":
update_source(module, f"v{toxext_version}")
elif module["name"] == "tox_extension_messages":
update_source(module, f"v{toxext_messages_version}")
with open(output_manifest_path, 'w') as f:
json.dump(flathub_manifest, f, indent=4)
if __name__ == '__main__':
main(**vars(parse_args()))

View File

@ -1,3 +1,4 @@
brew "coreutils"
brew "git"
brew "wget"
brew "libtool"

View File

@ -40,6 +40,8 @@ QT_DIR="/usr/local/Cellar/qt5" # Folder name of QT install
QT_VER=($(ls ${QT_DIR} | sed -n -e 's/^\([0-9]*\.([0-9]*\.([0-9]*\).*/\1/' -e '1p;$p'))
QT_DIR_VER="${QT_DIR}/${QT_VER[1]}"
SCRIPT_DIR=$( cd $(dirname $0); pwd -P)
TOXCORE_DIR="${MAIN_DIR}/toxcore" # Change to Git location
TOX_EXT_DIR="${MAIN_DIR}/toxext"
TOX_EXT_MESSAGES_DIR="${MAIN_DIR}/tox_extension_messages"
@ -175,35 +177,21 @@ install() {
#cd $MAIN_DIR # just in case
# Toxcore
if [[ -e $TOXCORE_DIR/.git/index ]]
then
fcho "Toxcore git repo already in place !"
cd $TOXCORE_DIR
git pull
else
fcho "Cloning Toxcore git ... "
git clone --branch v0.2.13 --depth=1 https://github.com/toktok/c-toxcore "$TOXCORE_DIR"
fi
# toxext
if [[ -e $TOX_EXT_DIR/.git/index ]]
then
fcho "ToxExt git repo already in place !"
cd $TOX_EXT_DIR
git pull
else
fcho "Cloning ToxExt git ... "
git clone --branch v0.0.3 --depth=1 https://github.com/toxext/toxext "$TOX_EXT_DIR"
fi
# tox_extension_messages
if [[ -e $TOX_EXT_MESSAGES_DIR/.git/index ]]
then
fcho "ToxExt git repo already in place !"
cd $TOX_EXT_MESSAGES_DIR
git pul
else
fcho "Cloning tox_extension_messages git ... "
git clone --branch v0.0.3 --depth=1 https://github.com/toxext/tox_extension_messages "$TOX_EXT_MESSAGES_DIR"
fi
rm -fr "${TOXCORE_DIR}"
mkdir -p "${TOXCORE_DIR}"
cd "${TOXCORE_DIR}"
"${SCRIPT_DIR}"/../buildscripts/download/download_toxcore.sh
rm -fr "${TOX_EXT_DIR}"
mkdir -p "${TOX_EXT_DIR}"
cd "${TOX_EXT_DIR}"
"${SCRIPT_DIR}"/../buildscripts/download/download_toxext.sh
rm -fr "${TOX_EXT_MESSAGES_DIR}"
mkdir -p "${TOX_EXT_MESSAGES_DIR}"
cd "${TOX_EXT_MESSAGES_DIR}"
"${SCRIPT_DIR}"/../buildscripts/download/download_toxext_messages.sh
# qTox
if [[ $TRAVIS = true ]]
then

View File

@ -1,130 +1,14 @@
# Cross-compile from Linux to Windows
## Intro
Following these instructions you will be able to cross-compile qTox for
Windows.
This script can be used by qTox users and devs to compile qTox for Windows
themselves.
Please note that the compilation script doesn't build the updater.
## Usage
[Install Docker](https://docs.docker.com/install).
Create 2 directories:
* `workspace` -- a directory that will contain a cache of qTox dependencies
and the final qTox cross-compilation build. You should create this directory.
* `qtox` -- the root directory of a qTox repository. This directory must
contain the qTox source code that will be cross-compiled.
These directories will be mounted inside a Docker container at `/workspace` and
`/qtox`.
> Note:
> The contents of `qtox` directory are not modified during compilation. The
> `build.sh` script makes a temporary copy of the `qtox` directory for the
> compilation.
Once you sort out the directories, you are ready to run the `build.sh` script
in a Docker container.
> Note:
> The`build.sh` script takes 2 arguments: architecture and build type.
> Valid values for the architecture are `i686` for 32-bit and `x86_64` for
> 64-bit. Valid values for the build type are `release` and `debug`. All
> case sensitive.
To start cross-compiling for 32-bit release version of qTox run:
```sh
sudo docker run --rm \
-v /absolute/path/to/your/workspace:/workspace \
-v /absolute/path/to/your/qtox:/qtox \
debian:bullseye-slim \
/bin/bash /qtox/windows/cross-compile/build.sh i686 release
```
If you want to debug some compilation issue, you might want to instead run:
```sh
# Get shell inside Debian Bullseye container so that you can poke around if needed
sudo docker run -it \
--rm \
-v /absolute/path/to/your/workspace:/workspace \
-v /absolute/path/to/your/qtox:/qtox \
debian:bullseye-slim \
/bin/bash
# Run the script
bash /qtox/windows/cross-compile/build.sh i686 release
```
These will cross-compile all of the qTox dependencies and qTox itself, storing
them in the `workspace` directory. The first time you run it for each
architecture, it will take a long time for the cross-compilation to finish, as
qTox has a lot of dependencies that need to be cross-compiled. But once you do
it once for each architecture, the dependencies will get cached inside the
`workspace` directory, and the next time you build qTox, the `build.sh` script
will skip recompiling them, going straight to compiling qTox, which is a lot
faster.
> Note:
> On a certain Intel Core i7 processor, a fresh build takes about 125
> minutes on a single core, and about 30 minutes using all 8 hyperthreads.
> Once built, however, it takes about 8 minutes on a single core and 2
> minutes using 8 hyperthreads to rebuild using the cached dependencies.
After cross-compiling has finished, you should find the comiled qTox in a
`workspace/i686/qtox` or `workspace/x86_64/qtox` directory, depending on the
architecture.
You will also find `workspace/dep-cache` directory, where all the
cross-compiled qTox dependencies will be cached for the future builds. You can
remove any directory inside the `dep-cache`, which will result in the
`build.sh` re-compiling the removed dependency only.
The `workspace` direcory structure for reference:
From the windows_builder/windows_builder.i686 docker image, run build.sh. NOTE:
The arch argument must match the builder image
```
workspace
├── i686
│   ├── dep-cache
│   │   ├── libexif
│   │   ├── libffmpeg
│   │   ├── libopenal
│   │   ├── libopenssl
│   │   ├── libopus
│   │   ├── libqrencode
│   │   ├── libqt5
│   │   ├── libsodium
│   │   ├── libsqlcipher
│   │   ├── libtoxcore
│   │   ├── libvpx
│   │   ├── mingw-w64-debug-scripts
│   │   └── nsis_shellexecuteasuser
│   └── qtox
│   ├── debug
│   └── release
└── x86_64
├── dep-cache
│   ├── libexif
│   ├── libffmpeg
│   ├── libopenal
│   ├── libopenssl
│   ├── libopus
│   ├── libqrencode
│   ├── libqt5
│   ├── libsodium
│   ├── libsqlcipher
│   ├── libtoxcore
│   ├── libvpx
│   ├── mingw-w64-debug-scripts
│   └── nsis_shellexecuteasuser
└── qtox
├── debug
└── release
$ docker compose run windows_builder
# mkdir build-windows
# cd build-windows
# # Example is using --arch x86_64, --arch i686 should be used if you are in the i686 docker image
# /qtox/windows/cross-compile/build.sh --src-dir /qtox --arch x86_64 --build-type Release
```

1454
windows/cross-compile/build.sh Normal file → Executable file

File diff suppressed because it is too large Load Diff

View File

@ -1,14 +0,0 @@
# the name of the target operating system
SET(CMAKE_SYSTEM_NAME Windows)
# which compilers to use for C and C++
SET(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc)
SET(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++)
SET(CMAKE_RC_COMPILER x86_64-w64-mingw32-windres)
# adjust the default behaviour of the FIND_XXX() commands:
# search headers and libraries in the target environment, search
# programs in the host environment
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)