aboutsummaryrefslogtreecommitdiff
path: root/x11/cde-devel/Makefile
blob: f140314d334f24b604bab3eccbf70996ed1179d3 (plain) (blame)
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
PORTNAME=	cde
PORTVERSION=	${COMMIT_DATE}
CATEGORIES=	x11
.if !defined(MASTERDIR)
PKGNAMESUFFIX=	-devel
.endif

MAINTAINER=	cy@FreeBSD.org
COMMENT=	Common Desktop Environment

USE_GITHUB=	yes
GH_ACCOUNT=	cschuber
GH_PROJECT=	cdesktopenv-code
GH_TAGNAME=	3300d665a
COMMIT_DATE=	2022.08.26

LICENSE=	LGPL21

BROKEN_mips64=		fails to build: ./config/imake/imake: No such file or directory
BROKEN_powerpc64=	fails to build: ./config/imake/imake: No such file or directory
BROKEN_i386=		cannot bind to a temporary of type va_list

WRKSRC_SUBDIR=	${PORTNAME}

# For concurrent testing purposes only. Define DT_ID in make.conf to build
# a cde-25 pkg which will coexist with cde-24.
.if defined(CDE_CONCURRENT) && !defined(MASTERDIR)
DT_ID=	${PKGNAMESUFFIX}
.else
DT_ID=
.endif
PLIST_SUB=	DT_ID=${DT_ID}

BUILD_DEPENDS=	ksh93:shells/ksh93			\
		bdftopcf:x11-fonts/bdftopcf		\
		mkfontscale>=0:x11-fonts/mkfontscale	\
		biconv:converters/iconv			\
		${LOCALBASE}/libdata/pkgconfig/fontconfig.pc:x11-fonts/fontconfig \
		${LOCALBASE}/libdata/pkgconfig/freetype2.pc:print/freetype2 \
		onsgmls:textproc/opensp \
		xrdb:x11/xrdb
RUN_DEPENDS=	ksh93:shells/ksh93			\
		${LOCALBASE}/bin/fc-cache:x11-fonts/fontconfig \
		${LOCALBASE}/libdata/pkgconfig/freetype2.pc:print/freetype2 \
		xrdb:x11/xrdb \
		xset:x11/xset

USES=		autoreconf:build iconv:wchar_t gmake jpeg libtool motif perl5 \
		shebangfix tcl:86 xorg
SHEBANG_LANG=	pl
SHEBANG_FILES=	programs/dtinfo/tools/bin/ccdate
DT_PREFIX=	${PREFIX}/dt${DT_ID}
USE_LDCONFIG=	${DT_PREFIX}/lib
USE_RC_SUBR=	dtcms${DT_ID} dtlogin${DT_ID}
USE_XORG=	ice sm x11 xau xdmcp xext xinerama xmu xscrnsaver xt

GNU_CONFIGURE=	yes
GNU_CONFIGURE_PREFIX=	${DT_PREFIX}
MANPREFIX=	${DT_PREFIX}/share
INFODIR=	${DT_PREFIX}/share/info
CONFIGURE_ARGS=	--with-tcl=${LOCALBASE}/lib/tcl8.6 MAKE="gmake"
MAKE_ARGS+=	PERL=${PERL} "LOCAL_LDFLAGS=${LDFLAGS}"
MAKE_JOBS_UNSAFE=yes
MAKE_ENV=	MALLOC_CONF=junk:false
SUB_FILES=	pkg-message
LDFLAGS+=	-z muldefs #--allow-multiple-definition

pre-configure:
	@cd ${WRKSRC} && ./autogen.sh

post-patch:
	@if [ -f /usr/include/iconv.h ]; then \
	    ${REINPLACE_CMD} -e 's!^[[:space:]]*const char .ip = (const char .) .bp!char *ip = *bp!' \
	    ${WRKSRC}/programs/dtmail/libDtMail/Common/Session.C \
	    ${WRKSRC}/programs/dtmail/libDtMail/RFC/RFCBodyPart.C; \
	fi

# From shells/ksh93
	@${REINPLACE_CMD} -e 's|SF_FLAGS|SFIO_FLAGS|g' \
		${WRKSRC}/programs/dtksh/ksh93/src/lib/libast/include/sfio*.h  \
		${WRKSRC}/programs/dtksh/ksh93/src/lib/libast/sfio/*.c \
		${WRKSRC}/programs/dtksh/ksh93/src/lib/libast/sfio/*.h

# Needed for armv6
	@${REINPLACE_CMD} -e 's|__va_copy|va_copy|g' \
		${WRKSRC}/programs/dtksh/ksh93/src/lib/libast/hash/*.c \
		${WRKSRC}/programs/dtksh/ksh93/src/lib/libast/sfio/*.c \
		${WRKSRC}/programs/dtksh/ksh93/src/lib/libast/string/*.c

# Fix all hardcoded path
	@${REINPLACE_CMD} -e 's|/usr/bin/perl|${LOCALBASE}/bin/perl|g' \
		${WRKSRC}/programs/dtinfo/tools/bin/ccdate
	@${FIND} ${WRKSRC} -type f ! -path doc/common | \
		${XARGS} ${REINPLACE_CMD} -e \
		's|/usr/dt|${DT_PREFIX}|g ; \
		s|/etc/dt|${DT_PREFIX}/etc|g'

# we need to remove a few LOCALBASE
	@${REINPLACE_CMD} -e 's|${LOCALBASE}/etc/dtsr|/etc/dtsr|g' -e \
		's|${LOCALBASE}/etc/dtinfo_start|/etc/dtinfo_start|g' \
		${WRKSRC}/programs/tttypes/dtinfo_start.ptype \
		${WRKSRC}/programs/tttypes/dtinfo.ptype

# why redefine exit??
	@${REINPLACE_CMD} -e '/void exit/d' \
		${WRKSRC}/lib/tt/bin/tt_type_comp/frozen.mp_types_lex.C
# (time_t*) NULL is apparently too C-ish
	@${REINPLACE_CMD} -e 's,(time_t) *NULL,nullptr,' \
		${WRKSRC}/programs/dtmail/libDtMail/Common/FileShare.C \
		${WRKSRC}/programs/dtmail/libDtMail/RFC/RFCMailBox.C

# chown is not supported as install as user
	@${FIND} ${WRKSRC} -type f -name Makefile.am | ${XARGS} \
	${REINPLACE_CMD} -e '/chown /d; /chgrp /d;'

post-install:
	@${INSTALL_DATA} ${WRKSRC}/lib/pam/libpam/pam.conf \
		${STAGEDIR}${PREFIX}/etc/pam.d/cde${DT_ID}.conf
	@${ECHO_CMD} MANPATH /usr/local/dt/share/man >  ${STAGEDIR}/${PREFIX}/etc/man.d/cde${DT_ID}.conf
	@${FIND} ${STAGEDIR}/${DT_PREFIX} -type f -exec ${SH} -c '${STRIP_CMD} {} > /dev/null 2>&1' \;
	@cd ${WRKSRC}/examples && @${FIND} . | ${CPIO} -pd ${STAGEDIR}/${DT_PREFIX}/share
	@cd ${STAGEDIR}/${DT_PREFIX}; ${LN} -sf share/examples
	# Only a problem on armv7 so far
	${FIND} ${STAGEDIR}/${DT_PREFIX} -type f -name 'ecp.*' -delete


.include <bsd.port.mk>