summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2015-07-09 19:19:01 +0200
committerSlávek Banko <slavek.banko@axis.cz>2015-07-09 19:19:01 +0200
commite190d6805f1437cb7be40764378690f340ced136 (patch)
treef2cd1fe9598be06bf37c192f55013493a41587d4
parent590fc6f46b2f0155ba07b55880fe8321b1439140 (diff)
downloadtde-packaging-e190d6805f1437cb7be40764378690f340ced136.tar.gz
tde-packaging-e190d6805f1437cb7be40764378690f340ced136.zip
FreeBSD: Add option for build in source
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
-rw-r--r--freebsd/trinity.port.mk21
1 files changed, 12 insertions, 9 deletions
diff --git a/freebsd/trinity.port.mk b/freebsd/trinity.port.mk
index f88171f38..5893857d9 100644
--- a/freebsd/trinity.port.mk
+++ b/freebsd/trinity.port.mk
@@ -48,6 +48,7 @@ USES+= gmake
PATCH_STRIP= -p1
+TDE_BUILD_SUBDIR=.build # Set to empty for build-in-source
# Build Flags
TDE_FLAGS=-I${LOCALBASE}/include
@@ -74,8 +75,9 @@ TDE_BUILD_ENV=\
TDE_CMAKE_CONFIGURE=\
export ${TDE_BUILD_ENV}; \
export CMAKE_PREFIX_PATH="${LOCALBASE}"; \
- cd ${WRKSRC} && mkdir .build && cd .build && \
- cmake .. \
+ [ -z "${TDE_BUILD_SUBDIR}" ] || mkdir ${WRKSRC}/${TDE_BUILD_SUBDIR} && \
+ cd ${WRKSRC}/${TDE_BUILD_SUBDIR} && \
+ cmake ${WRKSRC} \
-DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}" \
-DCMAKE_C_FLAGS="${TDE_FLAGS}" \
-DCMAKE_CXX_FLAGS="${TDE_FLAGS}" \
@@ -91,7 +93,8 @@ TDE_CMAKE_CONFIGURE=\
TDE_AUTOTOOLS_CONFIGURE=\
export ${TDE_BUILD_ENV}; \
- cd ${WRKSRC} && mkdir .build && cd .build && \
+ [ -z "${TDE_BUILD_SUBDIR}" ] || mkdir ${WRKSRC}/${TDE_BUILD_SUBDIR} && \
+ cd ${WRKSRC}/${TDE_BUILD_SUBDIR} && \
${WRKSRC}/configure \
--prefix=${TDE_PREFIX} \
--exec-prefix=${TDE_PREFIX} \
@@ -131,20 +134,20 @@ tde-pathfix:
### Custom build targets for CMAKE
tde-cmake-prepare:
- rm -rf "${WRKSRC}/.build"
+ [ -z "${TDE_BUILD_SUBDIR}" ] || rm -rf "${WRKSRC}/${TDE_BUILD_SUBDIR}"
tde-cmake-build:
${TDE_BUILD_ENV} \
- ${MAKE_CMD} -C "${WRKSRC}/.build"
+ ${MAKE_CMD} -C "${WRKSRC}/${TDE_BUILD_SUBDIR}"
tde-cmake-install:
${TDE_BUILD_ENV} \
DESTDIR=${STAGEDIR} \
- ${MAKE_CMD} -C "${WRKSRC}/.build" install
+ ${MAKE_CMD} -C "${WRKSRC}/${TDE_BUILD_SUBDIR}" install
### Custom build targets for AUTOTOOLS
tde-autotools-prepare:
- rm -rf "${WRKSRC}/.build"
+ [ -z "${TDE_BUILD_SUBDIR}" ] || rm -rf "${WRKSRC}/${TDE_BUILD_SUBDIR}"
cp -f "/usr/local/share/aclocal/libtool.m4" "${WRKSRC}/admin/libtool.m4.in"
cp -f "/usr/local/share/libtool/build-aux/ltmain.sh" "${WRKSRC}/admin/ltmain.sh"
gsed -i "${WRKSRC}/admin/acinclude.m4.in" -e "s|/usr/include/tqt|${LOCALBASE}/include/tqt|g"
@@ -152,9 +155,9 @@ tde-autotools-prepare:
tde-autotools-build:
${TDE_BUILD_ENV} \
- ${MAKE_CMD} -C "${WRKSRC}/.build"
+ ${MAKE_CMD} -C "${WRKSRC}/${TDE_BUILD_SUBDIR}"
tde-autotools-install:
${TDE_BUILD_ENV} \
DESTDIR=${STAGEDIR} \
- ${MAKE_CMD} -C "${WRKSRC}/.build" install
+ ${MAKE_CMD} -C "${WRKSRC}/${TDE_BUILD_SUBDIR}" install