aboutsummaryrefslogtreecommitdiff
path: root/graphics/libgphoto2/Makefile
blob: 7f0848ce82262b55e8e676239305f1235710681d (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
# Created by: Anders Nordby <anders@fix.no>
# $FreeBSD$

PORTNAME=	libgphoto2
PORTVERSION=	2.4.14
PORTREVISION=	3
CATEGORIES=	graphics
MASTER_SITES=	SF/gphoto/libgphoto/${PORTVERSION}

MAINTAINER=	ports@FreeBSD.org
COMMENT=	Universal digital camera control library

LIB_DEPENDS=	exif:${PORTSDIR}/graphics/libexif \
		jpeg:${PORTSDIR}/graphics/jpeg

USES=		gmake pkgconfig
USE_BZIP2=	yes
USE_GNOME=	ltverhack
USE_AUTOTOOLS=	libtool libltdl
LIBTOOLFILES=	configure libgphoto2_port/configure
USE_LDCONFIG=	yes
CONFIGURE_ENV=	LTDLINCL="-I${LOCALBASE}/include" \
		LIBLTDL="-L${LOCALBASE}/lib -lltdl" \
		LIBUSB_CFLAGS="-I/usr/include" \
		LIBUSB_LIBS="-lusb"

PLIST_SUB=	VERSION="${PORTVERSION}" VERSION_PORT=0.8.0

MAN3=		libgphoto2.3 libgphoto2_port.3

.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MNLS}
USES+=		gettext
PLIST_SUB+=	NLS=""
.else
USES+=		iconv
CONFIGURE_ARGS+=	--disable-nls
PLIST_SUB+=	NLS="@comment "
.endif

post-patch:
.for file in configure libgphoto2_port/configure
	@${REINPLACE_CMD} -e \
		's|{libdir}/pkgconfig|{prefix}/libdata/pkgconfig|g ; \
		 s|-g -O2||g ; \
		 /grep -i linux/s|; fi ; then|; else false; fi ; then|' \
			${WRKSRC}/${file}
.endfor
.if ${PORT_OPTIONS:MNLS}
	@${REINPLACE_CMD} -e 's|(LDFLAGS) -o|(LDFLAGS) -lintl -o|' \
		${WRKSRC}/libgphoto2_port/libgphoto2_port/Makefile.in
.endif
	@${REINPLACE_CMD} -e '/test.*udevscriptdir/d ; \
		s| "$$(DESTDIR)$$(udevscriptdir)"||' \
			${WRKSRC}/libgphoto2_port/usb/Makefile.in \
			${WRKSRC}/packaging/generic/Makefile.in
	@${REINPLACE_CMD} -e 's|linux-hotplug ||' \
		${WRKSRC}/packaging/Makefile.in
	@${REINPLACE_CMD} -e \
		's|@HAVE_DOXYGEN_TRUE@|#| ; s|@HAVE_DOXYGEN_FALSE@||' \
			${WRKSRC}/doc/Makefile.in
	@${REINPLACE_CMD} -e '/Requires/d' \
		${WRKSRC}/libgphoto2_port/libgphoto2_port.pc.in
	@${REINPLACE_CMD} 's|with_hal=yes|with_hal=no|' \
		${WRKSRC}/libgphoto2_port/configure

.include <bsd.port.mk>