aboutsummaryrefslogtreecommitdiffstats
path: root/graphics/lcms/Makefile
blob: e177e208769acb4165efee60464a26ba91efa97a (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
# New ports collection makefile for:    lcms
# Date created:     October 30, 2000
# Whom:         Mikhail Teterin <mi@aldan.algebra.com>
#
# $FreeBSD$
#

PORTNAME=   lcms
PORTVERSION=    1.18
PORTREVISION=   0
PORTEPOCH=  1
CATEGORIES= graphics
MASTER_SITES=   ${MASTER_SITE_SOURCEFORGE} \
        http://www.littlecms.com/
MASTER_SITE_SUBDIR= ${PORTNAME}

MAINTAINER= stas@FreeBSD.org
COMMENT=    Light Color Management System -- a color management library

USE_GNOME=  gnomehack gnometarget lthack
GNU_CONFIGURE=  yes
CONFIGURE_ENV=  CFLAGS="${CFLAGS} -I${LOCALBASE}/include" \
        CPPFLAGS="${CPPFLAGS} -I${LOCALBASE}/include" \
        LDFLAGS="${LDFLAGS} -L${LOCALBASE}/lib"
USE_LDCONFIG=   yes

OPTIONS=    TIFFICC "Build color profile applier for tiff" off \
        JPEGICC "Build color profile applier for JPEG" off

.include <bsd.port.pre.mk>

.if defined(WITH_TIFFICC)
LIB_DEPENDS+=   tiff.4:${PORTSDIR}/graphics/tiff
PLIST_SUB+= TIFFICC=""
MAN1+=      tifficc.1
.else
CONFIGURE_ARGS= --without-tiff
PLIST_SUB+= TIFFICC="@comment "
.endif

.if defined(WITH_JPEGICC)
LIB_DEPENDS+=   jpeg.9:${PORTSDIR}/graphics/jpeg
PLIST_SUB+= JPEGICC=""
MAN1+=      jpegicc.1
.else
CONFIGURE_ARGS= --without-jpeg
PLIST_SUB+= JPEGICC="@comment "
.endif

post-patch:
    @${REINPLACE_CMD} -e \
        's|^SUBDIRS =.*$$|SUBDIRS = src include|g' ${WRKSRC}/Makefile.in
    @${REINPLACE_CMD} -e \
        's|-O3||g' ${WRKSRC}/src/Makefile.in

#
# Get rid of .la and static library files
#
post-configure:
    @${REINPLACE_CMD} -E -e \
        '/Install the pseudo-library/,/staticlibs=/s,^,#,' ${WRKSRC}/libtool

post-install:
.if !defined(NOPORTDOCS)
    @${MKDIR} ${DOCSDIR}
.for file in doc/LCMSAPI.TXT doc/TUTORIAL.TXT tifficc/tifficc.c \
    jpegicc/jpegicc.c jpegicc/iccjpeg.c samples/wtpt.c samples/icctrans.c
    ${INSTALL_DATA} ${WRKSRC}/${file} ${DOCSDIR}
.endfor
.endif

.if defined(WITH_TIFFICC)
    @(cd ${WRKSRC}/tifficc && ${SETENV} ${MAKE_ENV} ${MAKE} \
        ${MAKE_FLAGS} Makefile all install)
.endif

.if defined(WITH_JPEGICC)
    @(cd ${WRKSRC}/jpegicc && ${SETENV} ${MAKE_ENV} ${MAKE} \
        ${MAKE_FLAGS} Makefile all install)
.endif

post-build test:
    cd ${WRKSRC}/testbed && ${SETENV} ${MAKE_ENV} ${MAKE} check

.include <bsd.port.post.mk>