From 1fdd815143ec3647ec10dae9d9041ea33a75f3e6 Mon Sep 17 00:00:00 2001 From: jbu Date: Thu, 20 Aug 2015 21:29:37 +0200 Subject: [PATCH] xbps-src: New build-style qmake --- Manual.md | 6 ++++++ common/build-style/qmake.sh | 28 ++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 common/build-style/qmake.sh diff --git a/Manual.md b/Manual.md index 66ac89a4042..14951f38837 100644 --- a/Manual.md +++ b/Manual.md @@ -596,6 +596,12 @@ be defined to set the allowed python versions to be built, i.e: - `slashpackage` For packages that use the /package hierarchy and package/compile to build, such as `daemontools` or any `djb` software. +- `qmake` For packages that use Qt4/Qt5 qmake profiles (`*.pro`), qmake arguments +for the configure phase can be passed in via `configure_args`, make build arguments can +be passed in via `make_build_args` and install arguments via `make_install_args`. The build +target can be overridden via `make_build_target` and the install target +via `make_install_target`. + > If `build_style` is not set, the template must (at least) define a `do_install()` function and optionally more phases via `do_xxx()` functions. diff --git a/common/build-style/qmake.sh b/common/build-style/qmake.sh new file mode 100644 index 00000000000..230a328653b --- /dev/null +++ b/common/build-style/qmake.sh @@ -0,0 +1,28 @@ +# +# This helper is for templates using Qt4/Qt5 qmake. +# +do_configure() { + : ${configure_script:=qmake} + + if [ -n "$build_pie" ]; then + ${configure_script} ${configure_args} \ + QMAKE_LFLAGS_SHLIB+=" -Wl,-z,now" \ + QMAKE_LFLAGS_PLUGIN+=" -Wl,-z,now" + else + ${configure_script} ${configure_args} + fi +} + +do_build() { + : ${make_cmd:=make} + + ${make_cmd} ${makejobs} ${make_build_args} ${make_build_target} +} + +do_install() { + : ${make_cmd:=make} + : ${make_install_target:=install} + + ${make_cmd} STRIP=true PREFIX=/usr DESTDIR=${DESTDIR} \ + INSTALL_ROOT=${DESTDIR}/usr ${make_install_args} ${make_install_target} +}