mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
chore(build): correct switch to cmake
This commit is contained in:
parent
5694f97d58
commit
657d1a84d1
|
@ -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
|
||||
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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 \
|
||||
|
@ -120,7 +116,7 @@ cd ffmpeg*
|
|||
--enable-decoder=h264 \
|
||||
--enable-decoder=mjpeg
|
||||
|
||||
make -j$(nproc)
|
||||
CC="ccache $CC" CXX="ccache $CXX" make -j$(nproc)
|
||||
make install
|
||||
cd ../../
|
||||
# libsodium
|
||||
|
@ -128,7 +124,8 @@ 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 ..
|
||||
|
@ -136,8 +133,8 @@ cd ..
|
|||
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
|
||||
|
@ -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
INSTALL.md
108
INSTALL.md
|
@ -34,6 +34,7 @@
|
|||
- [Compile qTox](#compile-qtox)
|
||||
- [OS X](#osx)
|
||||
- [Windows](#windows)
|
||||
- [Compile-time switches](#compile-time-switches)
|
||||
|
||||
<a name="dependencies" />
|
||||
## Dependencies
|
||||
|
@ -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.
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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" />
|
||||
|
@ -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.**
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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() {
|
||||
|
|
|
@ -8,6 +8,7 @@ apt_install() {
|
|||
autotools-dev
|
||||
check
|
||||
checkinstall
|
||||
cmake
|
||||
git build-essential
|
||||
libavdevice-dev
|
||||
libgdk-pixbuf2.0-dev
|
||||
|
@ -27,7 +28,6 @@ apt_install() {
|
|||
qt5-default
|
||||
qt5-qmake
|
||||
qttools5-dev-tools
|
||||
cmake
|
||||
)
|
||||
|
||||
local codename=$(lsb_release -c -s)
|
||||
|
@ -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
|
||||
libQt5Sql-devel
|
||||
libQt5Sql5-sqlite
|
||||
libQt5Xml-devel
|
||||
libXScrnSaver-devel
|
||||
libffmpeg-devel
|
||||
libopus-devel
|
||||
libqt5-linguist
|
||||
libqt5-qtbase-common-devel
|
||||
libqt5-qtsvg-devel
|
||||
libQt5Sql5-sqlite
|
||||
libQt5Sql-devel
|
||||
libQt5Xml-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[@]}"
|
||||
}
|
||||
|
@ -159,7 +159,7 @@ main() {
|
|||
fi
|
||||
|
||||
./bootstrap.sh
|
||||
cmake .
|
||||
cmake -H. -B_build
|
||||
make -j$(nproc)
|
||||
}
|
||||
main
|
||||
|
|
Loading…
Reference in New Issue
Block a user