summaryrefslogtreecommitdiffstats
path: root/freebsd/trinity.port.mk
blob: 0de956dfc40e3df342e06168f74167bca951081b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
### General information

TDE_VERSION?=	14.0.8
TDE_PREFIX=	/opt/trinity
PREFIX=		${TDE_PREFIX}

HOMEPAGE=		http://www.trinitydesktop.org/
MAINTAINER?=		slavek.banko@axis.cz
MASTER_SITE_TDE?=	http://mirror.ppa.trinitydesktop.org/trinity/deb/trinity-r14.0.x/pool/main/%SUBDIR%/ \
			http://mirror.ppa.trinitydesktop.org/trinity/deb/trinity-sb/pool/main-r14/%SUBDIR%/
MASTER_SITE_TDE_DEPS?=	http://mirror.ppa.trinitydesktop.org/trinity/deb/trinity-builddeps-r14.0.x/pool/main/%SUBDIR%/ \
			http://mirror.ppa.trinitydesktop.org/trinity/deb/trinity-sb/pool/deps-r14/%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/libdata/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 \
		ninja:${PORTSDIR}/devel/ninja \
		gettext:${PORTSDIR}/devel/gettext \
		gfind:${PORTSDIR}/misc/findutils \
		gsed:${PORTSDIR}/textproc/gsed \
		bash:${PORTSDIR}/shells/bash \

USES+=	ninja

PATCH_STRIP=	-p1

TDE_BUILD_SUBDIR=.build	# Set to empty for build-in-source

# 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}"; \
	[ -z "${TDE_BUILD_SUBDIR}" ] || mkdir ${WRKSRC}/${TDE_BUILD_SUBDIR} && \
	cd ${WRKSRC}/${TDE_BUILD_SUBDIR} && \
	cmake ${WRKSRC} \
		-GNinja \
		-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}; \
	[ -z "${TDE_BUILD_SUBDIR}" ] || mkdir ${WRKSRC}/${TDE_BUILD_SUBDIR} && \
	cd ${WRKSRC}/${TDE_BUILD_SUBDIR} && \
	${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 ] && [ -e admin/am_edit ] && \
	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|"

tde-build:
	${TDE_BUILD_ENV} \
	${MAKE_CMD} -C "${WRKSRC}/${TDE_BUILD_SUBDIR}"

tde-check:
	${TDE_BUILD_ENV} \
	${MAKE_CMD} -C "${WRKSRC}/${TDE_BUILD_SUBDIR}" check

tde-install:
	${TDE_BUILD_ENV} \
	DESTDIR=${STAGEDIR} \
	${MAKE_CMD} -C "${WRKSRC}/${TDE_BUILD_SUBDIR}" install

### Custom build targets for CMAKE
tde-cmake-prepare:
	[ -z "${TDE_BUILD_SUBDIR}" ] || rm -rf "${WRKSRC}/${TDE_BUILD_SUBDIR}"

tde-cmake-build: tde-build

tde-cmake-check: tde-check

tde-cmake-install: tde-install

### Custom build targets for AUTOTOOLS
tde-autotools-prepare:
	[ -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"
	${MAKE_CMD} -C "${WRKSRC}" -f "admin/Makefile.common"

tde-autotools-build: tde-build

tde-autotools-check: tde-check

tde-autotools-install: tde-install