summaryrefslogtreecommitdiffstats
path: root/graphics/ufraw/Makefile
blob: dc0a3f6ae2c05cad6df45ba8af1d0de99ed1c0bd (plain)
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
# Created by: Mark Murray <markm@FreeBSD.org>
# $FreeBSD$

PORTNAME=	ufraw
PORTVERSION=	0.18
PORTREVISION=	4
CATEGORIES=	graphics
MASTER_SITES=	SF/${PORTNAME}/${PORTNAME}/${PORTNAME}-${PORTVERSION}

MAINTAINER=	rodrigo@bebik.net
COMMENT=	Read and manipulate raw images from various digital cameras

LICENSE=	GPLv2

LIB_DEPENDS=	jpeg:${PORTSDIR}/graphics/jpeg \
		tiff:${PORTSDIR}/graphics/tiff \
		png15:${PORTSDIR}/graphics/png \
		lcms:${PORTSDIR}/graphics/lcms

GNU_CONFIGURE=	yes
CONFIGURE_ARGS=	--disable-silent-rules --enable-extras
USES=		gettext
USE_GMAKE=	yes

CPPFLAGS+=	-I${LOCALBASE}/include
LDFLAGS+=	-L${LOCALBASE}/lib ${PTHREAD_LIBS}
PC_FALSE=	cinepaint

MAN1=		ufraw.1

OPTIONS_DEFINE=	CONTRAST DST EXIV2 LENSFUN FITS GIMP GTK2 GNOME
OPTIONS_DEFAULT=CONTRAST EXIV2 LENSFUN GTK2

CONTRAST_DESC=	Enable contrast setting option
DST_DESC=	Use local time for timestamps
FITS_DESC=	FITS output support
GIMP_DESC=	Install GIMP plugin

.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MCONTRAST}
CONFIGURE_ARGS+=	--enable-contrast
.endif

.if ${PORT_OPTIONS:MDST}
CONFIGURE_ARGS+=	--enable-dst-correction
.endif

.if ${PORT_OPTIONS:MEXIV2}
LIB_DEPENDS+=	exiv2:${PORTSDIR}/graphics/exiv2
.else
PC_FALSE+=	exiv2
.endif

.if ${PORT_OPTIONS:MLENSFUN}
LIB_DEPENDS+=	lensfun:${PORTSDIR}/graphics/lensfun
.else
PC_FALSE+=	lensfun
.endif

.if ${PORT_OPTIONS:MFITS}
LIB_DEPENDS+=	cfitsio:${PORTSDIR}/astro/cfitsio
.else
PC_FALSE+=	cfitsio
.endif

.if ${PORT_OPTIONS:MGIMP}
LIB_DEPENDS+=	gimp-2.0:${PORTSDIR}/graphics/gimp-app
PLIST_SUB+=	GIMP=""
.else
CONFIGURE_ARGS+=--without-gimp
PC_FALSE+=	gimp
PLIST_SUB+=	GIMP="@comment "
.endif

.if ${PORT_OPTIONS:MGTK2}
LIB_DEPENDS+=	gtkimageview:${PORTSDIR}/x11-toolkits/gtkimageview
PLIST_FILES+=	bin/ufraw
.else
CONFIGURE_ARGS+=--without-gtk
.endif

.if ${PORT_OPTIONS:MGNOME}
CATEGORIES+=	gnome
USE_GNOME=	desktopfileutils gconf2
CONFIGURE_ARGS+=	--enable-mime
GCONF_SCHEMAS=	${PORTNAME}.schemas
PLIST_SUB+=	GNOME=""
.else
PLIST_SUB+=	GNOME="@comment "
.endif

post-patch:
	@${REINPLACE_CMD} -e '18s|^$$|#include <sys/types.h>|' \
		${WRKSRC}/dcraw.h
# Fix GConf2 schemas installation path; unconditionalize installation of
# .desktop file; avoid conflict with `graphics/dcraw' (rename the binary)
	@${REINPLACE_CMD} -e '/@schemasdir/s|datadir|sysconfdir| ; \
		/@app/s|@INSTALL_MIME_TRUE@|| ; \
		s|dcraw\$$(EXEEXT)|${PORTNAME}-&|' ${WRKSRC}/Makefile.in
.for i in ${PC_FALSE}
	@${REINPLACE_CMD} -e '/PKG_CONFIG.*${i}/s|$$PKG_CONFIG|${FALSE}|' \
		${WRKSRC}/configure
.endfor

pre-build:
	@${INSTALL_SCRIPT} ${LOCALBASE}/share/glib-2.0/gettext/mkinstalldirs \
		${WRKSRC}

post-install:
.if ${PORT_OPTIONS:MGNOME}
	@${SETENV} GCONF_CONFIG_SOURCE=${GCONF_CONFIG_SOURCE} \
		gconftool-2 --makefile-install-rule \
		${PREFIX}/etc/gconf/schemas/${PORTNAME}.schemas
	@-update-desktop-database
.endif

.include <bsd.port.mk>
OpenPOWER on IntegriCloud