aboutsummaryrefslogtreecommitdiffstats
path: root/editors/qemacs/Makefile
blob: ce1687541f0f9c5c39b763d297320c0bd4a37ae0 (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
# New ports collection makefile for:    qemacs
# Date created:             27 January 2003
# Whom:         Brad Davis <so14k@so14k.com> et al
#
# $FreeBSD$
#

PORTNAME=   qemacs
PORTVERSION=    0.3.1
PORTREVISION=   1
CATEGORIES= editors
MASTER_SITES=   http://fabrice.bellard.free.fr/qemacs/

MAINTAINER= ports@FreeBSD.org
COMMENT=    Quick Emacs - a very small but powerful UNIX editor

USE_GMAKE=  yes
HAS_CONFIGURE=  yes
CONFIGURE_ARGS= --prefix="${PREFIX}" --make="${GMAKE}" --cc="${CC}" \
        --extra-cflags="${CFLAGS}" --extra-ldflags="${LDFLAGS}"

DATADIR=    ${PREFIX}/share/qe

MAN1=       qe.1
MLINKS=     qe.1 qemacs.1
PORTDOCS=   qe-doc.html
PLIST_FILES=    bin/html2png bin/qe bin/qemacs \
        %%DATADIR%%/kmaps %%DATADIR%%/ligatures
PLIST_DIRS= %%DATADIR%%

.include <bsd.port.pre.mk>

.if ${ARCH} == "amd64"
IGNORE=     crashes on startup
.endif

.if defined(WITHOUT_PNG)
CONFIGURE_ARGS+=    --disable-png
.else
LIB_DEPENDS+=   png.5:${PORTSDIR}/graphics/png
CFLAGS+=    `libpng-config --I_opts`
LDFLAGS=    `libpng-config --L_opts`
.endif

.if defined(WITHOUT_X11)
PKGNAMESUFFIX=  -nox11
CONFIGURE_ARGS+=    --disable-x11
.else
USE_XLIB=   yes
CFLAGS+=    -I${X11BASE}/include
LDFLAGS+=   -L${X11BASE}/lib
.endif

post-patch:
    @${FIND} ${WRKSRC} -name "Makefile" | ${XARGS} ${REINPLACE_CMD} -e \
        's|-Wall -g|-Wall|g ; \
         s|-m.*386||g ; \
         s|-ldl||g ; \
         s|-L/usr/X11R6/lib||g ; \
         s|make -C|$$(MAKE) -C|g ; \
         s|HOST_CC|CC|g'
    @${REINPLACE_CMD} -e 's|/usr/share/doc/qemacs/|${DOCSDIR}/|g ; \
         s|README.gz|qe-doc.html|g' ${WRKSRC}/qe.1

do-install:
    ${INSTALL_PROGRAM} ${WRKSRC}/html2png ${PREFIX}/bin
    ${INSTALL_PROGRAM} ${WRKSRC}/qe ${PREFIX}/bin
    ${LN} -sf qe ${PREFIX}/bin/qemacs
    ${INSTALL_MAN} ${WRKSRC}/qe.1 ${MANPREFIX}/man/man1
    @${MKDIR} ${DATADIR}
    ${INSTALL_DATA} ${WRKSRC}/kmaps ${DATADIR}
    ${INSTALL_DATA} ${WRKSRC}/ligatures ${DATADIR}
.if !defined(NOPORTDOCS)
    @${MKDIR} ${DOCSDIR}
    ${INSTALL_DATA} ${WRKSRC}/qe-doc.html ${DOCSDIR}
.endif

.include <bsd.port.post.mk>