Skip to content

Commit

Permalink
build-style: introduce sip-build
Browse files Browse the repository at this point in the history
  • Loading branch information
sgn committed May 24, 2021
1 parent 0ea55e4 commit 614ffee
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 0 deletions.
65 changes: 65 additions & 0 deletions common/build-style/sip-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#
# This helper is for templates using sip-build.
#

do_configure() {
local _build_help=
local _qmake=
local _confirm_license=
local _apidir=
local _dbusdir=
: "${sip_builddir:=build}"
mkdir -p "${sip_builddir}"

_build_help="$(sip-build --help)"
case "$_build_help" in
*--confirm-license*) _confirm_license=yes ;;
esac
case "$_build_help" in
*--qmake*)
if [ "$QMAKE" ]; then
_qmake="$QMAKE"
elif [ -x /usr/lib/qt6/bin/qmake ]; then
_qmake=/usr/lib/qt6/bin/qmake
elif [ -x /usr/lib/qt5/bin/qmake ]; then
_qmake=/usr/lib/qt5/bin/qmake
else
msg_error 'qmake not found\n'
fi
;;
esac
case "$_build_help" in
*--dbus*)
for _dbusdir in "$XBPS_CROSS_BASE/usr/include/dbus"*; do
if [ -f "$_dbusdir/dbus/dbus-python.h" ]; then
break
fi
done
;;
esac

sip-build --no-make \
${_confirm_license:+--confirm-license} \
${_apidir:+--api-dir "$_apidir"} \
${_qmake:+--qmake "$_qmake"} \
${_dbusdir:+--dbus "$_dbusdir"} \
--build-dir "${sip_builddir}"

if [ "$CROSS_BUILD" ]; then
# -I/usr/include/python$py3_ver is set by sip-build :(
find "${sip_builddir}" -name Makefile |
xargs sed -i "s,-I\\(/usr/include\\),-I$XBPS_CROSS_BASE\\1,g"
fi
}

do_build() {
: "${sip_builddir:=build}"
make -C "${sip_builddir}" ${makejobs}
}

do_install() {
: "${sip_builddir:=build}"
make -C "${sip_builddir}" \
DESTDIR=${DESTDIR} INSTALL_ROOT=${DESTDIR} \
install
}
6 changes: 6 additions & 0 deletions common/environment/build-style/sip-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
hostmakedepends+=" python3-PyQt-builder pkg-config"
makedepends+=" python3-devel"
lib32disabled=yes

CFLAGS+=" -I$XBPS_CROSS_BASE/usr/include/python$py3_ver"
CXXFLAGS+=" -I$XBPS_CROSS_BASE/usr/include/python$py3_ver"

0 comments on commit 614ffee

Please sign in to comment.