aboutsummaryrefslogtreecommitdiffstats
path: root/graphics/gimp-gmic-plugin/Makefile
blob: 77f4da52446a364ef6a4f43b64ce4daf17122ce1 (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
# $FreeBSD$

PORTNAME=   gmic
PORTVERSION=    1.5.8.3
CATEGORIES= graphics
MASTER_SITES=   SF/${PORTNAME} \
        SF/${PORTNAME}/old
PKGNAMEPREFIX=  gimp-
PKGNAMESUFFIX=  -plugin
DISTNAME=   ${PORTNAME}_${PORTVERSION}

MAINTAINER= rm@FreeBSD.org
COMMENT=    GREYC's Magic Image Converter

LIB_DEPENDS=    libGraphicsMagick++.so:${PORTSDIR}/graphics/GraphicsMagick13 \
        libIlmImf.so:${PORTSDIR}/graphics/OpenEXR \
        libMagick++.so:${PORTSDIR}/graphics/ImageMagick \
        libavcodec.so:${PORTSDIR}/multimedia/ffmpeg \
        libfftw3.so:${PORTSDIR}/math/fftw3 \
        libgimp-2.0.so:${PORTSDIR}/graphics/gimp-app

OPTIONS_DEFINE= BASH
OPTIONS_SUB=    yes
BASH_RUN_DEPENDS=   ${LOCALBASE}/bin/bash:${PORTSDIR}/shells/bash

WRKSRC=     ${WRKDIR}/${PORTNAME}-${PORTVERSION}/src

USES=       gmake
USE_GCC=    yes
USE_GNOME=  gtk20
USE_XORG=   x11 xext xrandr

PLUGIN_DIR?=    libexec/gimp/2.2/plug-ins
PLIST_SUB+= PLUGIN_DIR=${PLUGIN_DIR}

CPPFLAGS+=  -I${LOCALBASE}/include
LDFLAGS+=   -L${LOCALBASE}/lib
CFLAGS:=    ${CFLAGS:N-O*:N-pipe}
CXXFLAGS:=  ${CXXFLAGS:N-O*:N-pipe}

PLIST_FILES=    bin/gmic \
        man/man1/gmic.1.gz \
        %%BASH%%etc/bash_completion.d/gmic_bashcompletion.sh \
        %%PLUGIN_DIR%%/gmic_gimp
PLIST_DIRSTRY=  %%PLUGIN_DIR%%

EXAMPLESDIR=    ${PREFIX}/share/examples/${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX}
PORTEXAMPLES=   gmic_in_script.scm gmic_use_lib.cpp

.include <bsd.port.options.mk>

post-patch:
    @${REINPLACE_CMD} -e 's#/usr/X11R6#${PREFIX}#g' \
        ${WRKSRC}/Makefile

do-install:
    @${MKDIR} ${STAGEDIR}${PREFIX}/${PLUGIN_DIR}
    ${INSTALL_PROGRAM} ${WRKSRC}/gmic_gimp ${STAGEDIR}${PREFIX}/${PLUGIN_DIR}
    ${INSTALL_PROGRAM} ${WRKSRC}/gmic ${STAGEDIR}${PREFIX}/bin
    ${INSTALL_MAN} ${WRKSRC}/../man/gmic.1.gz ${STAGEDIR}${MAN1PREFIX}/man/man1
    @${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
    ${INSTALL_DATA} ${PORTEXAMPLES:S|^|${WRKSRC}/|} ${STAGEDIR}${EXAMPLESDIR}
.if ${PORT_OPTIONS:MBASH}
    @${MKDIR} ${STAGEDIR}${PREFIX}/etc/bash_completion.d
    ${INSTALL_SCRIPT} ${WRKSRC}/gmic_bashcompletion.sh \
        ${STAGEDIR}${PREFIX}/etc/bash_completion.d
.endif

.include <bsd.port.mk>