summaryrefslogtreecommitdiffstats
path: root/freebsd/trinity.port.mk
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2015-07-02 17:25:15 +0200
committerSlávek Banko <slavek.banko@axis.cz>2015-07-02 17:25:15 +0200
commit595d2593963dfc33e52fb3bf82fc2595dc2c0e37 (patch)
treea284a943099fabc9782c2959c6da43e2b09078ae /freebsd/trinity.port.mk
parentbb6e8f18c1d80974cd4f7a810267bd9753121f45 (diff)
downloadtde-packaging-595d2593963dfc33e52fb3bf82fc2595dc2c0e37.tar.gz
tde-packaging-595d2593963dfc33e52fb3bf82fc2595dc2c0e37.zip
FreeBSD: Initial import
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
Diffstat (limited to 'freebsd/trinity.port.mk')
-rw-r--r--freebsd/trinity.port.mk160
1 files changed, 160 insertions, 0 deletions
diff --git a/freebsd/trinity.port.mk b/freebsd/trinity.port.mk
new file mode 100644
index 000000000..f88171f38
--- /dev/null
+++ b/freebsd/trinity.port.mk
@@ -0,0 +1,160 @@
+### General information
+
+TDE_VERSION?= 14.0.1
+TDE_PREFIX= /opt/trinity
+PREFIX= ${TDE_PREFIX}
+
+HOMEPAGE= http://www.trinitydesktop.org/
+MAINTAINER?= slavek.banko@axis.cz
+MASTER_SITE_TDE?= http://mirror.xcer.cz/trinity-sb/pool/main-r14/%SUBDIR%/ \
+ http://ppa.quickbuild.pearsoncomputing.net/slavek-banko/main-r14/ubuntu/pool/main/%SUBDIR%/
+MASTER_SITE_TDE_DEPS?= http://mirror.xcer.cz/trinity-sb/pool/deps-r14/%SUBDIR%/ \
+ http://ppa.quickbuild.pearsoncomputing.net/slavek-banko/deps-r14/ubuntu/pool/main/%SUBDIR%/
+MASTER_SITES= ${MASTER_SITE_TDE}
+
+PORTVERSION= ${TDE_VERSION}${TDE_PREVERSION:C/~(pre|r|s)([0-9]*).*/.p\2/1}
+DISTNAME= ${PORTNAME}_${TDE_VERSION}${TDE_PREVERSION:C/(~(pre|r|s)[0-9]*).*/\1/1}
+DISTSRC= ${PORTNAME}-${TDE_VERSION}${TDE_PREVERSION}
+EXTRACT_CMD= gtar
+EXTRACT_SUFX= .orig.tar.xz
+.if ${MASTER_SITES:M*nightly-builds*}
+EXTRACT_BASE= # tarballs from nightly-builds not contains directory by name of package
+.else
+EXTRACT_BASE= ${DISTSRC}/
+.endif
+EXTRACT_AFTER_ARGS+=--transform "s|^\(${DISTSRC}\)\?|${DISTNAME}/|S" --wildcards
+
+
+### General build options
+
+TDE_DEBUG?= 0
+
+.MAKEFLAGS= # Reset makeflags to avoid -B supplied from bsd.port.subdir.mk
+
+PKG_CONFIG_PATH=/opt/trinity/lib/pkgconfig:/usr/local/libdata/pkgconfig:/usr/libdata/pkgconfig
+
+EXTRACT_DEPENDS=\
+ gtar:${PORTSDIR}/archivers/gtar \
+
+BUILD_DEPENDS=\
+ automake:${PORTSDIR}/devel/automake \
+ libtool:${PORTSDIR}/devel/libtool \
+ cmake:${PORTSDIR}/devel/cmake \
+ gfind:${PORTSDIR}/misc/findutils \
+ gsed:${PORTSDIR}/textproc/gsed \
+ bash:${PORTSDIR}/shells/bash \
+
+USES+= gmake
+
+PATCH_STRIP= -p1
+
+
+# Build Flags
+TDE_FLAGS=-I${LOCALBASE}/include
+TDE_LDFLAGS=-L${LOCALBASE}/lib
+
+.if ${TDE_DEBUG}
+TDE_FLAGS+= -g
+CMAKE_BUILD_TYPE=Debug
+.else
+TDE_FLAGS+= -DNDEBUG
+CMAKE_BUILD_TYPE=RelWithDebInfo
+.endif
+CMAKE_BUILD_TYPE_U=`echo ${CMAKE_BUILD_TYPE} | tr [:lower:] [:upper:]`
+
+# Custom configure commands
+TDE_BUILD_ENV=\
+ TDEDIR="${TDE_PREFIX}" \
+ PATH="${TDE_PREFIX}/bin:${PATH}" \
+ PKG_CONFIG_PATH="${PKG_CONFIG_PATH}" \
+ CFLAGS="${CFLAGS} ${TDE_FLAGS}" \
+ CXXFLAGS="${CXXFLAGS} ${TDE_FLAGS}" \
+ LDFLAGS="${LDFLAGS} ${TDE_LDFLAGS}"
+
+TDE_CMAKE_CONFIGURE=\
+ export ${TDE_BUILD_ENV}; \
+ export CMAKE_PREFIX_PATH="${LOCALBASE}"; \
+ cd ${WRKSRC} && mkdir .build && cd .build && \
+ cmake .. \
+ -DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}" \
+ -DCMAKE_C_FLAGS="${TDE_FLAGS}" \
+ -DCMAKE_CXX_FLAGS="${TDE_FLAGS}" \
+ -DCMAKE_EXE_LINKER_FLAGS_${CMAKE_BUILD_TYPE_U}="${TDE_LDFLAGS}" \
+ -DCMAKE_MODULE_LINKER_FLAGS_${CMAKE_BUILD_TYPE_U}="${TDE_LDFLAGS}" \
+ -DCMAKE_SHARED_LINKER_FLAGS_${CMAKE_BUILD_TYPE_U}="${TDE_LDFLAGS}" \
+ \
+ -DCMAKE_INSTALL_PREFIX="${TDE_PREFIX}" \
+ -DCMAKE_INSTALL_RPATH="${TDE_PREFIX}/lib" \
+ -DCMAKE_SKIP_RPATH=OFF \
+ -DCMAKE_VERBOSE_MAKEFILE=ON \
+
+
+TDE_AUTOTOOLS_CONFIGURE=\
+ export ${TDE_BUILD_ENV}; \
+ cd ${WRKSRC} && mkdir .build && cd .build && \
+ ${WRKSRC}/configure \
+ --prefix=${TDE_PREFIX} \
+ --exec-prefix=${TDE_PREFIX} \
+ --bindir=${TDE_PREFIX}/bin \
+ --libdir=${TDE_PREFIX}/lib \
+ --includedir=${TDE_PREFIX}/include \
+ --datadir=${TDE_PREFIX}/share \
+ \
+ --enable-shared \
+ --disable-static \
+ --disable-dependency-tracking \
+ --enable-final \
+ --enable-new-ldflags \
+ --enable-closure \
+ --enable-rpath \
+
+.if ${TDE_DEBUG}
+TDE_AUTOTOOLS_CONFIGURE+=--enable-debug
+.else
+TDE_AUTOTOOLS_CONFIGURE+=--disable-debug
+.endif
+
+### Custom build targets
+tde-pathfix:
+ cd ${WRKSRC}; \
+ [ -d admin ] && \
+ gsed -i admin/am_edit \
+ admin/debianrules \
+ admin/nmcheck \
+ -e "s|/usr/bin/perl|${LOCALBASE}/bin/perl|"; \
+ [ -d cmake ] && \
+ gsed -i cmake/install_apidox \
+ cmake/generate_apidox \
+ -e "s|/bin/bash|${LOCALBASE}/bin/bash|g"; \
+ gfind -name "*.pl" | xargs -r \
+ gsed -i -e "s|/usr/bin/perl|${LOCALBASE}/bin/perl|"
+
+### Custom build targets for CMAKE
+tde-cmake-prepare:
+ rm -rf "${WRKSRC}/.build"
+
+tde-cmake-build:
+ ${TDE_BUILD_ENV} \
+ ${MAKE_CMD} -C "${WRKSRC}/.build"
+
+tde-cmake-install:
+ ${TDE_BUILD_ENV} \
+ DESTDIR=${STAGEDIR} \
+ ${MAKE_CMD} -C "${WRKSRC}/.build" install
+
+### Custom build targets for AUTOTOOLS
+tde-autotools-prepare:
+ rm -rf "${WRKSRC}/.build"
+ 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"
+ ${MAKE_CMD} -C "${WRKSRC}" -f "admin/Makefile.common"
+
+tde-autotools-build:
+ ${TDE_BUILD_ENV} \
+ ${MAKE_CMD} -C "${WRKSRC}/.build"
+
+tde-autotools-install:
+ ${TDE_BUILD_ENV} \
+ DESTDIR=${STAGEDIR} \
+ ${MAKE_CMD} -C "${WRKSRC}/.build" install