aboutsummaryrefslogtreecommitdiff
path: root/net-p2p/xmule/Makefile
blob: 5b0df9f3e67acfe3509672ff09696c2be5d4dad6 (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
128
# New ports collection makefile for:	xmule
# Date created:		Tue Mar 11 05:06:20 UTC 2003
# Whom:			Mario Sergio Fujikawa Ferreira <lioux@FreeBSD.org>
#
# $FreeBSD$
#

PORTNAME=	xmule
PORTVERSION=	1.12.2
PORTREVISION=	4
CATEGORIES=	net-p2p
MASTER_SITES=		${MASTER_SITE_SOURCEFORGE}
#MASTER_SITES=	http://download.berlios.de/%SUBDIR%/
MASTER_SITE_SUBDIR=	xmule

MAINTAINER=	lioux@FreeBSD.org
COMMENT=	Port of eMule eDonkey P2P client using wxWindows class library

BUILD_DEPENDS=	${LOCALBASE}/lib/libcryptopp.a:${PORTSDIR}/security/cryptopp
LIB_DEPENDS=	expat.6:${PORTSDIR}/textproc/expat2
RUN_DEPENDS=	wget:${PORTSDIR}/ftp/wget

USE_GETTEXT=	yes
USE_XLIB=	yes
USE_BZIP2=	yes
USE_GNOME=	gnomehier \
		gnomehack \
		gnomeprefix
USE_GMAKE=	yes
USE_WX=		2.6
WX_CONF_ARGS=	absolute
GNU_CONFIGURE=	yes
CONFIGURE_ARGS=	--without-included-gettext \
		--with-cryptopp-prefix=${LOCALBASE} \
		--with-gtk-prefix=${LOCALBASE} \
		--with-libiconv-prefix=${LOCALBASE} \
		--with-libintl-prefix=${LOCALBASE} \
		--enable-debug
CONFIGURE_ENV=	CPPFLAGS="${CPPFLAGS} ${PTHREAD_CFLAGS} -I${LOCALBASE}/include" \
		LDFLAGS="${LDFLAGS} ${PTHREAD_LIBS} -L${LOCALBASE}/lib"
MAKE_ARGS=	-e
MAKE_ENV=	CC="${CC}" CXX="${CXX}"

# for debugging purposes
STRIP=

FILES_ATOLL_PATCH=	src/Preferences.cpp \
			src/otherfunctions.cpp
FILES_STDINT_PATCH=	\
			intl/loadmsgcat.c \
			src/ClientList.h \
			src/sockets.h

.include <bsd.port.pre.mk>

.if ${OSVERSION} < 500000
BROKEN=		"Does not compile on FreeBSD 4.x"
.endif

.if ${ARCH} == "sparc64"
BROKEN=		"Does not compile on sparc64"
.endif

post-patch:
# it works for FreeBSD as well
	@${REINPLACE_CMD} -E \
		-e 's|(Linux)|FreeBSD/\1|' \
		${WRKSRC}/src/*.cpp
# update documentation with correct prefix
	@${REINPLACE_CMD} -E \
		-e 's|/usr/X11R6/(bin/${PORTNAME}-ed2k-handler)|${PREFIX}/\1|' \
		${WRKSRC}/docs/ED2K-Links.HOWTO
# use BSD_INSTALL_* macros
	@${REINPLACE_CMD} -E \
		-e 's|cp -f|${INSTALL_DATA}|' \
		${WRKSRC}/Makefile.in
	@${REINPLACE_CMD} -E \
		-e 's|cp -p|${INSTALL_DATA}|' \
		${WRKSRC}/po/Makefile.in.in
# fix mkinstalldirs location
# uphold CXX{,FLAGS}
	${FIND} ${WRKSRC} -name "Makefile*" -type f -print0 | \
		${XARGS} -0 \
		${REINPLACE_CMD} -E \
		-e 's,^(MKINSTALLDIRS|mkinstalldirs).*$$,\1=${INSTALL_WRKSRC}/mkinstalldirs,' \
		-e 's|g\+\+|${CXX}|' \
		-e 's|-O3|${CXXFLAGS}|'
# use correct FreeBSD atoll() prototype
.for file in ${FILES_ATOLL_PATCH}
	@${REINPLACE_CMD} -E \
		-e 's|atoll[[:space:]]*\([[:space:]]*char|atoll(const char|' \
		${WRKSRC}/${file}
.endfor
# stdint.h -> inttypes.h
.for file in ${FILES_STDINT_PATCH}
	@${REINPLACE_CMD} -E \
		-e 's|<stdint.h>|<inttypes.h>|' \
		${WRKSRC}/${file}
.endfor
# wx-config -> ${WX_CONFIG}
	@${REINPLACE_CMD} -E \
		-e 's|wx-config|${WX_CONFIG}|' \
		${WRKSRC}/src/xmule.make.in

pre-configure:
	@${FIND} ${WRKSRC} -type f -name "Makefile.in" | \
		${XARGS} -x -n 10 \
		${REINPLACE_CMD} -E \
		-e 's!^(AUTOCONF|AUTOHEADER|AUTOMAKE|ACLOCAL).*$$!\1=${TRUE}!'
	@${REINPLACE_CMD} -E \
		-e 's|^(CXXFLAGS.*)$$|\1 -I${LOCALBASE}/include|' \
		${WRKSRC}/xLibs/xrc/xrc.make.in

pre-install:
	@${CHMOD} a=rx ${WRKSRC}/mkinstalldirs

post-install:
# install xmule binary
	@${INSTALL_PROGRAM} \
		${WRKSRC}/${PORTNAME} \
		${PREFIX}/bin
# do not install a generic named ed2k binary
# install it under a more specific name
	@${INSTALL_PROGRAM} \
		${WRKSRC}/ed2k.xmule-2.0 \
		${PREFIX}/bin/${PORTNAME}-ed2k-handler

.include <bsd.port.post.mk>