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

PORTNAME=   gmic
PORTVERSION=    1.6.9
PORTREVISION=   16
CATEGORIES= graphics
MASTER_SITES=   http://gmic.eu/files/source/
PKGNAMEPREFIX=  gimp-
PKGNAMESUFFIX=  -plugin
DISTNAME=   ${PORTNAME}_${PORTVERSION}

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

LIB_DEPENDS=    libGraphicsMagick++.so:graphics/GraphicsMagick \
        libIlmImf.so:graphics/openexr \
        libopencv_video.so:graphics/opencv \
        libMagick++-6.so:graphics/ImageMagick \
        libavcodec.so:multimedia/ffmpeg \
        libfftw3.so:math/fftw3 \
        libgimp-2.0.so:graphics/gimp-app \
        libcurl.so:ftp/curl

OPTIONS_DEFINE= BASH EXAMPLES
OPTIONS_SUB=    yes
BASH_RUN_DEPENDS=   bash:shells/bash

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

USES=       dos2unix gmake localbase pkgconfig
USE_GCC=    yes
USE_GNOME=  gtk20
USE_XORG=   x11 xext xrandr
DOS2UNIX_FILES= Makefile

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

CFLAGS:=    ${CFLAGS:N-O*:N-pipe}
CXXFLAGS:=  ${CXXFLAGS:N-O*:N-pipe}
DOTLESS_VER=    ${PORTVERSION:S/.//g}

PLIST_FILES=    bin/gmic \
        man/man1/gmic.1.gz \
        %%BASH%%etc/bash_completion.d/gmic \
        %%PLUGIN_DIR%%/gmic_gimp \
        %%PLUGIN_DIR%%/cli_update${DOTLESS_VER}.gmic \
        %%PLUGIN_DIR%%/gimp_update${DOTLESS_VER}.gmic

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

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

do-install:
    @${MKDIR} ${STAGEDIR}${PREFIX}/${PLUGIN_DIR}
    ${INSTALL_PROGRAM} ${WRKSRC}/gmic_gimp ${STAGEDIR}${PREFIX}/${PLUGIN_DIR}
    ${INSTALL_DATA} ${WRKSRC}/../resources/cli_update${DOTLESS_VER}.gmic \
        ${WRKSRC}/../resources/gimp_update${DOTLESS_VER}.gmic \
        ${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}
do-install-BASH-on:
    @${MKDIR} ${STAGEDIR}${PREFIX}/etc/bash_completion.d
    ${INSTALL_SCRIPT} ${WRKSRC}/../resources/gmic_bashcompletion.sh \
        ${STAGEDIR}${PREFIX}/etc/bash_completion.d/gmic

.include <bsd.port.mk>