view qt/qtbase/qtbase.sh @ 1157:598566babc0c

audio/alsa-tools: initial import, closes #1202
author David Demelier <markand@malikania.fr>
date Tue, 01 Oct 2019 20:11:00 +0200
parents 297b5eef115e
children 6710613b88b9
line wrap: on
line source

#!/bin/sh
#
# Copyright (c) 2019 David Demelier <markand@malikania.fr>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#

# TODO: add option for PostgreSQL and mariadb.
# TODO: add optional dependencies for Qt modules (e.g. qtwayland)

PKGNAME=qtbase
PKGVERSION=5.13.0
PKGREVISION=1
PKGLICENSE="GPLv30 LGPLv21"
PKGSUMMARY="cross platform SDK for developing applications"
PKGDOWNLOAD="http://download.qt-project.org/official_releases/qt/${PKGVERSION%.*}/$PKGVERSION/submodules/$PKGNAME-everywhere-src-$PKGVERSION.tar.xz"
PKGDEPENDS="pcre2"
PKGOPTIONS="CUPS
            DATABASES
            DBUS
            EVDEV
            FONTCONFIG
            GLIB
            GTK
            GUI
            HARFBUZZ
            ICU
            JPEG
            KMS
            LIBINPUT
            MTDEV
            OPENGL
            PNG
            SSL
            SYSLOG
            TTF
            UDEV
            X
            ZLIB"

: ${CC:=clang}
: ${CXX:=clang++}
: ${CUPS:=yes}
: ${DATABASES:=sqlite}  # (list) none, sqlite
: ${DBUS:=yes}
: ${EVDEV:=yes}
: ${FONTCONFIG:=yes}
: ${GLIB:=yes}
: ${GTK:=yes}
: ${GUI:=yes}           # requires TTF
: ${HARFBUZZ:=yes}
: ${ICU:=yes}
: ${JPEG:=yes}
: ${KMS:=yes}
: ${LIBINPUT:=yes}
: ${MTDEV:=yes}
: ${OPENGL:=yes}
: ${PNG:=yes}
: ${SSL:=yes}
: ${SYSLOG:=no}
: ${TTF:=yes}
: ${UDEV:=yes}
: ${X:=yes}
: ${ZLIB:=yes}

if [ "$CXX" = "clang++" ]; then
	platform="linux-clang"
else
	platform="linux-g++"
fi

if [ "$CUPS" = "yes" ]; then
	PKGDEPENDS="cups $PKGDEPENDS"
	with_cups="-cups"
else
	with_cups="-no-cups"
fi

#
# It looks like there is no option to disable all SQL drivers to create a
# "white" list of desired drivers so disable all by default unless it is listed
# in DATABASES option.
#
# First, create a list with unsupported databases in vanilla.
#
with_databases="-no-sql-db2
                -no-sql-ibase
                -no-sql-oci
                -no-sql-odbc
                -no-sql-sqlite2
                -no-sql-tds"

if echo $DATABASES | grep -q "sqlite"; then
	PKGDEPENDS="sqlite $PKGDEPENDS"
	with_databases="-sql-sqlite -system-sqlite $with_databases"
else
	with_databases="-no-sql-sqlite $with_databases"
fi

if [ "$DBUS" = "yes" ]; then
	PKGDEPENDS="dbus $PKGDEPENDS"
	with_dbus="-dbus-linked"
else
	with_dbus="-no-dbus"
fi

if [ "$EVDEV" = "yes" ]; then
	with_evdev="-evdev"
else
	with_evdev="-no-evdev"
fi

if [ "$FONTCONFIG" = "yes" ]; then
	PKGDEPENDS="fontconfig $PKGDEPENDS"
	with_fontconfig="-fontconfig"
else
	with_fontconfig="-no-fontconfig"
fi

if [ "$TTF" = "yes" ]; then
	PKGDEPENDS="freetype $PKGDEPENDS"
	with_ttf="-system-freetype"
else
	with_ttf="-no-freetype"
fi

if [ "$GLIB" = "yes" ]; then
	PKGDEPENDS="glib $PKGDEPENDS"
	with_glib="-glib"
else
	with_glib="-no-glib"
fi

if [ "$GTK" = "yes" ]; then
	PKGDEPENDS="gtk $PKGDEPENDS"
	with_gtk="-gtk"
else
	with_gtk="-no-gtk"
fi

if [ "$GUI" = "yes" ]; then
	if [ "$TTF" != "yes" ]; then
		echo "warning: GUI requires TTF" 1>&2
	fi

	with_gui="-gui"
else
	with_gui="-no-gui"
fi

if [ "$HARFBUZZ" = "yes" ]; then
	PKGDEPENDS="harfbuzz $PKGDEPENDS"
	with_harfbuzz="-system-harfbuzz"
else
	with_harfbuzz="-no-harfbuzz"
fi

if [ "$ICU" = "yes" ]; then
	PKGDEPENDS="icu $PKGDEPENDS"
	with_icu="-icu"
else
	with_icu="-no-icu"
fi

if [ "$KMS" = "yes" ]; then
	PKGDEPENDS="libdrm $PKGDEPENDS"
	with_kms="-kms"
else
	with_kms="-no-kms"
fi

if [ "$LIBINPUT" = "yes" ]; then
	PKGDEPENDS="libinput $PKGDEPENDS"
	with_libinput="-libinput"
else
	with_libinput="-no-libinput"
fi

if [ "$MTDEV" = "yes" ]; then
	PKGDEPENDS="mtdev $PKGDEPENDS"
	with_mtdev="-mtdev"
else
	with_mtdev="-no-mtdev"
fi

if [ "$JPEG" = "yes" ]; then
	PKGDEPENDS="libjpeg-turbo $PKGDEPENDS"
	with_jpeg="-system-libjpeg"
else
	with_jpeb="-no-libjpeg"
fi

if [ "$OPENGL" = "yes" ]; then
	with_opengl="-opengl"
else
	with_opengl="-no-opengl"
fi

if [ "$PNG" = "yes" ]; then
	PKGDEPENDS="libpng $PKGDEPENDS"
	with_png="-system-libpng"
else
	with_png="-no-libpng"
fi

if [ "$SSL" = "yes" ]; then
	PKGDEPENDS="libressl $PKGDEPENDS"
	with_ssl="-ssl -openssl-linked"
else
	with_ssl="-no-openssl"
fi

if [ "$SYSLOG" = "yes" ]; then
	with_syslog="-syslog"
else
	with_syslog="-no-syslog"
fi

if [ "$UDEV" = "yes" ]; then
	PKGDEPENDS="eudev $PKGDEPENDS"
	with_udev="-libudev"
else
	with_udev="-no-libudev"
fi

if [ "$X" = "yes" ]; then
	with_x="-xcb -xcb-xlib -xcb-xinput"
else
	with_x="-no-xcb -no-xcb-xlib -no-xcb-xinput"
fi

if [ "$ZLIB" = "yes" ]; then
	PKGDEPENDS="zlib $PKGDEPENDS"
	with_zlib="-system-zlib"
else
	with_zlib="-no-zlib"
fi

build()
{
	rm -rf $PKGNAME-everywhere-src-$PKGVERSION
	tar xvf $PKGNAME-everywhere-src-$PKGVERSION.tar.xz
	cd $PKGNAME-everywhere-src-$PKGVERSION

	# https://github.com/void-linux/void-packages/tree/master/srcpkgs/qt5/patches
	patch -p0 < ../patch-libressl.patch
	patch -p0 < ../patch-musl.patch
	patch -p0 < ../patch-fhs.patch
	PKG_CONFIG_PATH=/lib/pkgconfig \
	./configure \
		-opensource \
		-prefix / \
		-archdatadir /lib/qt \
		-datadir /share/qt \
		-docdir /share/doc/qt \
		-libexecdir /libexec \
		-confirm-license \
		-release \
		-platform $platform \
		-nomake examples \
		-nomake tests \
		-system-pcre \
		$with_cups \
		$with_databases \
		$with_dbus \
		$with_evdev \
		$with_fontconfig \
		$with_glib \
		$with_gtk \
		$with_gui \
		$with_harfbuzz \
		$with_icu \
		$with_kms \
		$with_libinput \
		$with_opengl \
		$with_png \
		$with_ssl \
		$with_syslog \
		$with_ttf \
		$with_udev \
		$with_x \
		$with_zlib
	make
	make install INSTALL_ROOT=$DESTDIR
	find $DESTDIR -type f -name "*.la" -delete

	cd ..
	rm -rf $PKGNAME-everywhere-src-$PKGVERSION
}