Skip to content
This repository has been archived by the owner on Feb 12, 2023. It is now read-only.

Commit

Permalink
chore(build): correct switch to cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
zetok committed Jan 28, 2017
1 parent 5694f97 commit 657d1a8
Show file tree
Hide file tree
Showing 5 changed files with 141 additions and 59 deletions.
5 changes: 1 addition & 4 deletions .travis/build-osx.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
#
# Copyright © 2016 by The qTox Project Contributors
# Copyright © 2016-2017 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
Expand All @@ -23,9 +23,6 @@ set -e -o pipefail
install_ccache() {
echo "Installing ccache ..."
brew install ccache
# make sure to use ccache for all the compiling
export CC="ccache $CC"
export CXX="ccache $CXX"
}

# Build OSX
Expand Down
58 changes: 37 additions & 21 deletions .travis/build-ubuntu-14-04.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
#
# Copyright © 2015-2016 by The qTox Project Contributors
# Copyright © 2015-2017 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
Expand Down Expand Up @@ -48,10 +48,6 @@ sudo apt-get install -y --force-yes \
qt53xmlpatterns \
pkg-config || yes

# make sure to use ccache for all the compiling
export CC="ccache $CC"
export CXX="ccache $CXX"

# Qt
source /opt/qt53/bin/qt53-env.sh || yes

Expand All @@ -72,7 +68,7 @@ cd ffmpeg*
# demuxers, decoders and parsers needed for webcams:
# mjpeg, h264

./configure --prefix="$PREFIX_DIR" \
CC="ccache $CC" CXX="ccache $CXX" ./configure --prefix="$PREFIX_DIR" \
--disable-avfilter \
--disable-avresample \
--disable-bzlib \
Expand Down Expand Up @@ -120,24 +116,25 @@ cd ffmpeg*
--enable-decoder=h264 \
--enable-decoder=mjpeg

make -j$(nproc)
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.8
./autogen.sh
./configure && make -j$(nproc)
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.1.0 --depth=1 https://github.com/toktok/c-toxcore.git toxcore
cd toxcore
autoreconf -if
./configure
make -j$(nproc) > /dev/null
CC="ccache $CC" CXX="ccache $CXX" ./configure
CC="ccache $CC" CXX="ccache $CXX" make -j$(nproc) > /dev/null
sudo make install
echo '/usr/local/lib/' | sudo tee -a /etc/ld.so.conf.d/locallib.conf
sudo ldconfig
Expand All @@ -149,14 +146,33 @@ $CXX --version
# needed, otherwise ffmpeg doesn't get detected
export PKG_CONFIG_PATH="$PWD/libs/lib/pkgconfig"

# first build qTox without support for optional dependencies
echo '*** BUILDING "MINIMAL" VERSION ***'
cmake . -DCMAKE_C_COMPILER="$CC" -DCMAKE_CXX_COMPILER="$CXX" -DENABLE_SYSTRAY_STATUSNOTIFIER_BACKEND=NO -DENABLE_SYSTRAY_GTK_BACKEND=NO -DDISABLE_PLATFORM_EXT=YES -DSMILEYS=DISABLED
# ↓ reduce if build fails with OOM
make -j$(nproc)
# clean it up, and build normal version
make clean
echo '*** BUILDING "FULL" VERSION ***'
cmake . -DCMAKE_C_COMPILER="$CC" -DCMAKE_CXX_COMPILER="$CXX"
# ↓ reduce if build fails with OOM
make -j$(nproc)

build_qtox() {
bdir() {
pushd .
cd $BUILDDIR
make -j$(nproc)
# check if `qtox` file has been made, is non-empty and is an executable
[[ -s qtox ]] && [[ -x qtox ]]
popd
}

local BUILDDIR=_build

# first build qTox without support for optional dependencies
echo '*** BUILDING "MINIMAL" VERSION ***'
cmake -H. -B"$BUILDDIR" \
-DSMILEYS=DISABLED \
-DENABLE_STATUSNOTIFIER=False \
-DENABLE_GTK_SYSTRAY=False

bdir

# clean it up, and build normal version
rm -rf "$BUILDDIR"

echo '*** BUILDING "FULL" VERSION ***'
cmake -H. -B"$BUILDDIR"
bdir
}
build_qtox
108 changes: 87 additions & 21 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
- [Compile qTox](#compile-qtox)
- [OS X](#osx)
- [Windows](#windows)
- [Compile-time switches](#compile-time-switches)

<a name="dependencies" />
## Dependencies
Expand All @@ -52,8 +53,8 @@

## Optional dependencies

They can be disabled/enabled by passing arguments to `cmake` as
`-D{name}={value}` command when building qTox.
They can be disabled/enabled by passing arguments to `cmake` command when
building qTox.

If they are missing, qTox is built without support for the functionality.

Expand All @@ -66,7 +67,7 @@ If they are missing, qTox is built without support for the functionality.
| [libXScrnSaver] | >= 1.2 |
| [libX11] | >= 1.6.0 |

To disable: `DISABLE_PLATFORM_EXT=YES`
Disabled if dependencies are missing during compilation.

#### KDE Status Notifier / GTK tray backend

Expand All @@ -79,8 +80,7 @@ To disable: `DISABLE_PLATFORM_EXT=YES`
| [GTK+] | >= 2.0 |
| [Pango] | >= 1.18 |

To disable: `ENABLE_SYSTRAY_STATUSNOTIFIER_BACKEND=NO
ENABLE_SYSTRAY_GTK_BACKEND=NO`
To disable: `-DENABLE_STATUSNOTIFIER=False -DENABLE_GTK_SYSTRAY=False`

#### Unity tray backend

Expand All @@ -97,7 +97,7 @@ Disabled by default.
| [libappindicator] | >= 0.4.92 |
| [Pango] | >= 1.18 |

To enable: `ENABLE_SYSTRAY_UNITY_BACKEND=YES`
To enable: `-DENABLE_APPINDICATOR=True`


<a name="linux" />
Expand Down Expand Up @@ -238,10 +238,25 @@ your `sources.list`. Adding backports:
http://backports.debian.org/Instructions/

```bash
sudo apt-get install build-essential cmake qt5-qmake qt5-default qttools5-dev-tools \
libqt5opengl5-dev libqt5svg5-dev libopenal-dev libxss-dev qrencode \
libqrencode-dev libglib2.0-dev libgdk-pixbuf2.0-dev libgtk2.0-dev ffmpeg \
libsqlcipher-dev pkg-config yasm
sudo apt-get install \
build-essential \
cmake \
ffmpeg \
libgdk-pixbuf2.0-dev \
libglib2.0-dev \
libgtk2.0-dev \
libopenal-dev \
libqrencode-dev \
libqt5opengl5-dev \
libqt5svg5-dev \
libsqlcipher-dev \
libxss-dev \
pkg-config \
qrencode \
qt5-default \
qt5-qmake \
qttools5-dev-tools \
yasm
```

**Go to [FFmpeg](#ffmpeg) section to compile it.**
Expand Down Expand Up @@ -288,22 +303,54 @@ http://slackbuilds.org/repository/14.1/network/qTox/
<a name="ubuntu-other-deps" />
#### Ubuntu >=15.04
```bash
sudo apt-get install build-essential cmake qt5-qmake qt5-default qttools5-dev-tools \
libqt5opengl5-dev libqt5svg5-dev libopenal-dev libxss-dev qrencode \
libqrencode-dev libavutil-ffmpeg-dev libswresample-ffmpeg-dev \
libavcodec-ffmpeg-dev libswscale-ffmpeg-dev libavfilter-ffmpeg-dev \
libavdevice-ffmpeg-dev libglib2.0-dev libgdk-pixbuf2.0-dev libgtk2.0-dev \
libsqlcipher-dev
sudo apt-get install \
build-essential cmake \
libavcodec-ffmpeg-dev \
libavdevice-ffmpeg-dev \
libavfilter-ffmpeg-dev \
libavutil-ffmpeg-dev \
libgdk-pixbuf2.0-dev \
libglib2.0-dev \
libgtk2.0-dev \
libopenal-dev \
libqrencode-dev \
libqt5opengl5-dev \
libqt5svg5-dev \
libsqlcipher-dev \
libswresample-ffmpeg-dev \
libswscale-ffmpeg-dev \
libxss-dev \
qrencode \
qt5-default \
qt5-qmake \
qttools5-dev-tools
```

<a name="ubuntu-other-1604-deps" />
#### Ubuntu >=16.04:
```bash
sudo apt-get install build-essential cmake qt5-qmake qt5-default \
qttools5-dev-tools libqt5opengl5-dev libqt5svg5-dev libopenal-dev \
libxss-dev qrencode libqrencode-dev libavutil-dev libswresample-dev \
libavcodec-dev libswscale-dev libavfilter-dev libavdevice-dev \
libglib2.0-dev libgdk-pixbuf2.0-dev libgtk2.0-dev libsqlcipher-dev
sudo apt-get install \
build-essential \
cmake \
libavcodec-dev \
libavdevice-dev \
libavfilter-dev \
libavutil-dev \
libgdk-pixbuf2.0-dev \
libglib2.0-dev \
libgtk2.0-dev \
libopenal-dev \
libqrencode-dev \
libqt5opengl5-dev \
libqt5svg5-dev \
libsqlcipher-dev \
libswresample-dev \
libswscale-dev \
libxss-dev \
qrencode \
qt5-default \
qt5-qmake \
qttools5-dev-tools
```

### FFmpeg
Expand Down Expand Up @@ -680,6 +727,25 @@ Run `bootstrap.bat` in cloned `C:\qTox` directory. Script will download rest of
dependencies compile them and put to appropriate directories.


## Compile-time switches

They are passed as an argument to `cmake` command. E.g. with a switch `SWITCH`
that has value `YES` it would be passed to `cmake` in a following manner:

```bash
cmake -DSWITCH=yes
```

Switches:

- `SMILEYS`, values:
- if not defined or an unsupported value is passed, all emoticon packs are
included
- `DISABLED` – don't include any emoticon packs, custom ones are still loaded
- `MIN` – minimal support for emoticons, only a single emoticon pack is
included


[Atk]: https://wiki.gnome.org/Accessibility
[Cairo]: https://www.cairographics.org/
[DBus Menu]: https://launchpad.net/libdbusmenu
Expand Down
9 changes: 6 additions & 3 deletions osx/qTox-Mac-Deployer-ULTIMATE.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#
# Copyright © 2015 by RowenStipe
# Copyright © 2016 by The qTox Project Contributors
# Copyright © 2016-2017 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
Expand Down Expand Up @@ -166,6 +166,8 @@ install() {
then
fcho "Updating brew formulas ..."
brew update > /dev/null
else
brew install cmake
fi
brew install ffmpeg qrencode qt5 sqlcipher

Expand Down Expand Up @@ -226,8 +228,9 @@ build() {
cd $BUILD_DIR
fcho "Now working in ${PWD}"
fcho "Starting cmake ... "
cmake $QTOX_DIR
make
export CMAKE_PREFIX_PATH=$(brew --prefix qt5)
cmake -H$QTOX_DIR -B.
make -j$(sysctl -n hw.ncpu)
}

deploy() {
Expand Down
20 changes: 10 additions & 10 deletions simple_make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ apt_install() {
autotools-dev
check
checkinstall
cmake
git build-essential
libavdevice-dev
libgdk-pixbuf2.0-dev
Expand All @@ -27,7 +28,6 @@ apt_install() {
qt5-default
qt5-qmake
qttools5-dev-tools
cmake
)

local codename=$(lsb_release -c -s)
Expand Down Expand Up @@ -115,27 +115,27 @@ fedora_locallib() {

zypper_install() {
local zypper_packages=(
cmake
git
libffmpeg-devel
libopus-devel
libQt5Concurrent-devel
libqt5-linguist
libQt5Network-devel
libQt5OpenGL-devel
libqt5-qtbase-common-devel
libqt5-qtsvg-devel
libQt5Sql5-sqlite
libQt5Sql-devel
libQt5Sql5-sqlite
libQt5Xml-devel
libXScrnSaver-devel
libffmpeg-devel
libopus-devel
libqt5-linguist
libqt5-qtbase-common-devel
libqt5-qtsvg-devel
libsodium-devel
libvpx-devel
libXScrnSaver-devel
openal-soft-devel
patterns-openSUSE-devel_basis
patterns-openSUSE-devel_basis
qrencode-devel
sqlcipher-devel
cmake
)
sudo zypper in "${zypper_packages[@]}"
}
Expand All @@ -159,7 +159,7 @@ main() {
fi

./bootstrap.sh
cmake .
cmake -H. -B_build
make -j$(nproc)
}
main

0 comments on commit 657d1a8

Please sign in to comment.