aboutsummaryrefslogtreecommitdiffstats
path: root/multimedia/libmtp/Makefile
blob: e51d41566b633ddde08eaee0d6786c39fbc73dd8 (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
# Created by: Petar Zhivkov Petrov <pesho.petrov@gmail.com>
# $FreeBSD$

PORTNAME=   libmtp
PORTVERSION=    1.1.8
PORTREVISION=   1
CATEGORIES= multimedia audio
MASTER_SITES=   SF

MAINTAINER= ports@FreeBSD.org
COMMENT=    Media Transfer Protocol (MTP) library

LICENSE=    LGPL21 # or any later version

OPTIONS_DEFINE= MTPZ
OPTIONS_DEFAULT=    MTPZ
MTPZ_DESC=  Enable functionality to connect to MTPZ devices

GNU_CONFIGURE=  yes
CONFIGURE_ARGS= --disable-doxygen
INSTALL_TARGET= install-strip
USES=       iconv libtool pathfix pkgconfig
USE_LDCONFIG=   yes

CPPFLAGS+=  -I${LOCALBASE}/include
LIBS+=      -L${LOCALBASE}/lib

.if !exists(/usr/libdata/pkgconfig/libusb-1.0.pc)
CONFIGURE_ENV+= LIBUSB_CFLAGS=" " LIBUSB_LIBS="-lusb"
.endif

MTPZ_CONFIGURE_ENABLE=  mtpz
MTPZ_LIB_DEPENDS=   libgcrypt.so:${PORTSDIR}/security/libgcrypt

post-patch:
.if !exists(/usr/libdata/pkgconfig/libusb-1.0.pc)
    @${REINPLACE_CMD} -e \
        '/LIBUSB_REQUIRES/s|libusb-1.0||' ${WRKSRC}/configure
    @${REINPLACE_CMD} -e \
        '/Libs.private/s|:|& @LIBUSB_LIBS@|' ${WRKSRC}/libmtp.pc.in
.endif
    @${REINPLACE_CMD} -e \
        '/if test/s|==|=| ; \
         /endian.h/s|machine|sys|' ${WRKSRC}/configure
    @${REINPLACE_CMD} -e \
        's|Requires|&.private|' ${WRKSRC}/libmtp.pc.in
    @${REINPLACE_CMD} -e \
        's|__builtin_bswap|bswap|g' ${WRKSRC}/src/mtpz.c

.include <bsd.port.mk>