aboutsummaryrefslogtreecommitdiffstats
path: root/graphics/xaralx/Makefile
blob: b910d832d12c3d456afa2fadb7ed6d081233b463 (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
# New ports collection makefile for:    XaraLX
# Date created:             22 Mar 2006
# Whom:                 Vasil Dimov <vd@FreeBSD.org>
#
# $FreeBSD$
#

PORTNAME=   XaraLX
PORTVERSION?=   0.7r1692
PORTREVISION?=  0
CATEGORIES= graphics
MASTER_SITES=   http://downloads.xara.com/opensource/ \
        ${MASTER_SITE_LOCAL}
MASTER_SITE_SUBDIR= vd/${PORTNAME:L}${PKGNAMESUFFIX}
DISTFILES?= ${PORTNAME}Src-${PORTVERSION}.tar.bz2

MAINTAINER= vd@FreeBSD.org
COMMENT?=   Top-tier vector/general purpose graphics program (recommended version)

USE_BZIP2=  yes
USE_X_PREFIX=   yes

#WXDEP= ${X11BASE}/libwx_baseu-2.6.so.0.3.1
WXDEP=  wxgtk2-unicode>=2.6.3
BUILD_DEPENDS+= pkg-config:${PORTSDIR}/devel/pkg-config \
        ${WXDEP}:${PORTSDIR}/x11-toolkits/wxgtk26-unicode \
        xml2-config:${PORTSDIR}/textproc/libxml2 \
        zip:${PORTSDIR}/archivers/zip
RUN_DEPENDS+=   ${WXDEP}:${PORTSDIR}/x11-toolkits/wxgtk26-unicode \
        convert:${PORTSDIR}/graphics/ImageMagick
LIB_DEPENDS+=   dlmalloc.2:${PORTSDIR}/devel/libdlmalloc \
        xml2.5:${PORTSDIR}/textproc/libxml2

USE_AUTOTOOLS=  autoconf:259:env aclocal:19:env automake:19:env libtool:15:env
GNU_CONFIGURE=  yes
CONFIGURE_TARGET=   --build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
CONFIGURE_ARGS+=    --with-wx-config=wxgtk2u-2.6-config \
        --program-suffix=${PKGNAMESUFFIX}
# we're using dlmalloc because the stock libc does not have malloc_usable_size()
CONFIGURE_ENV+= LIBS="-L${LOCALBASE}/lib -ldlmalloc"

USE_GMAKE=  yes
MAKE_ENV?=  INCLUDES="-I${LOCALBASE}/include/dlmalloc" LANG=C

USE_GCC=    3.4+

MAN1=   xaralx${PKGNAMESUFFIX}.1
MANFILE=    xaralx.1

.if !defined(NOPORTDOCS)
DOCS=   AUTHORS GPL LICENSE README doc/gifutil.txt doc/mtrand.txt \
    doc/en/LICENSE
.endif

# make non-conflicting with the slave port
DOCSDIR?=   ${PREFIX}/share/doc/${PORTNAME}${PKGNAMESUFFIX}
EXAMPLESDIR?=   ${PREFIX}/share/examples/${PORTNAME}${PKGNAMESUFFIX}

PIXMAPSDIR= ${PREFIX}/share/pixmaps

# directories with .xar files
XARDIRS=    Designs Templates

PLIST_SUB+= PKGNAMESUFFIX=${PKGNAMESUFFIX} \
        DESKTOPDIR=${DESKTOPDIR:S|^${PREFIX}/||} \
        PIXMAPSDIR=${PIXMAPSDIR:S|^${PREFIX}/||}

.include <bsd.port.pre.mk>

.if ${ARCH} != "i386" && ${ARCH} != "amd64" && ${ARCH} != "powerpc"
BROKEN= does not configure due to the lack of CDraw libraries for ${ARCH}
.endif

post-patch:
    ${REINPLACE_CMD} -E \
        -e 's/^Name=Xara Xtreme$$/Name=Xara Xtreme ${PORTVERSION}/' \
        -e 's/^Icon=xaralx.png$$/Icon=xaralx${PKGNAMESUFFIX}.png/' \
        -e 's/^FilePattern=xaralx;$$/FilePattern=xaralx${PKGNAMESUFFIX}/' \
        -e 's/^Exec=xaralx %F$$/Exec=xaralx${PKGNAMESUFFIX} %F/' \
        -e 's/^TryExec=xaralx$$/TryExec=xaralx${PKGNAMESUFFIX}/' \
        ${WRKSRC}/xaralx.desktop

pre-configure:
    cd ${WRKSRC} && \
    ${SETENV} ${AUTOTOOLS_ENV} \
    ACLOCAL="${ACLOCAL} -I ${LOCALBASE}/share/aclocal" \
    ${AUTORECONF} -f -i -s

.if !target(do-install)
do-install:
    ${MKDIR} ${DESKTOPDIR}
    ${MKDIR} ${EXAMPLESDIR}
    ${INSTALL_PROGRAM} ${WRKSRC}/XaraLX \
        ${PREFIX}/bin/xaralx${PKGNAMESUFFIX}
    ${INSTALL_DATA} ${WRKSRC}/xaralx.desktop \
        ${DESKTOPDIR}/xaralx${PKGNAMESUFFIX}.desktop
    ${INSTALL_DATA} ${WRKSRC}/xaralx.png \
        ${PIXMAPSDIR}/xaralx${PKGNAMESUFFIX}.png
.for xardir in ${XARDIRS}
    ${MKDIR} ${EXAMPLESDIR}/${xardir}
    ${INSTALL_DATA} ${WRKSRC}/${xardir}/*.xar ${EXAMPLESDIR}/${xardir}/
.endfor
    ${INSTALL_MAN} ${WRKSRC}/doc/${MANFILE} \
        ${MANPREFIX}/man/man1/xaralx${PKGNAMESUFFIX}.1
.if !defined(NOPORTDOCS)
    ${MKDIR} ${DOCSDIR}
    ${MKDIR} ${DOCSDIR}/en
.for d in ${DOCS}
    ${INSTALL_DATA} ${WRKSRC}/${d} ${DOCSDIR}/${d:S|^doc/||}
.endfor
    ${MKDIR} ${DOCSDIR}/en/xaralxHelp
    ${TAR} -C ${DOCSDIR}/en/xaralxHelp \
        -zxf ${WRKSRC}/doc/en/xaralxHelp.tar.gz
.endif
.endif

.include <bsd.port.post.mk>