aboutsummaryrefslogtreecommitdiffstats
path: root/net/remmina-plugins/bsd.plugin.mk
blob: 0249f5fbec5468fffe018275100236b1470e42e8 (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
.if defined(PKGNAMESUFFIX)

PORTNAME=   remmina-plugin
PATCHDIR=   ${.CURDIR}/../remmina/files

LICENSE=    GPLv2

BUILD_DEPENDS+= remmina>=${PORTVERSION}:${PORTSDIR}/net/remmina
RUN_DEPENDS+=   remmina>=${PORTVERSION}:${PORTSDIR}/net/remmina

USES+=      cmake gmake pkgconfig desktop-file-utils
USE_GNOME=  atk gdkpixbuf2 glib20 gtk20 pango
INSTALLS_ICONS= yes
LDFLAGS+=   -lpthread -L${LOCALBASE}/lib
CPPFLAGS+=  -I${LOCALBASE}/include
CFLAGS+=    -I${WRKSRC}/remmina/include -I${LOCALBASE}/include -fPIC

# disable appindicator as it is new feature of gnome 3
CMAKE_ARGS+=    -DWITH_APPINDICATOR=OFF
# set build directory
CMAKE_ARGS+=    --build=build
# prefer gtk2 rather than gtk3
CMAKE_ARGS+=    -DGTK_VERSION=2

SSH_DESC=   Build with SSH tunneling support

.include <bsd.port.options.mk>

.include <bsd.port.pre.mk>

.if ${PKGNAMESUFFIX} == "-i18n" || ${PKGNAMESUFFIX} == "-gnome"
PLIST=      ${.CURDIR}/pkg-plist
.else
PLIST_SUB+= PLUGIN="${PKGNAMESUFFIX:S,-,,}"
PLIST=      ${PKGDIR}/pkg-plist.plugin
.endif

post-patch:
    @# do not build remmina core program
    ${REINPLACE_CMD} -e 's|add_subdirectory(remmina)||' ${WRKSRC}/CMakeLists.txt
    ${REINPLACE_CMD} -e 's|find_suggested_package(AVAHI)||' ${WRKSRC}/CMakeLists.txt
    @# which plugins to build
.if ${PKGNAMESUFFIX:S,-,,} != "nx"
    ${REINPLACE_CMD} -e 's|find_suggested_package(LIBSSH)||' ${WRKSRC}/remmina-plugins/CMakeLists.txt
    ${REINPLACE_CMD} -e 's|find_required_package(XKBFILE)||' ${WRKSRC}/remmina-plugins/CMakeLists.txt
    ${REINPLACE_CMD} -e 's|add_subdirectory(nx)||' ${WRKSRC}/remmina-plugins/CMakeLists.txt
.endif
.if ${PKGNAMESUFFIX:S,-,,} != "gnome"
    ${REINPLACE_CMD} -e 's|add_subdirectory(remmina-plugins-gnome)||' ${WRKSRC}/CMakeLists.txt
.endif
.if ${PKGNAMESUFFIX:S,-,,} != "vnc"
    ${REINPLACE_CMD} -e 's|find_suggested_package(GCRYPT)||' ${WRKSRC}/CMakeLists.txt
    ${REINPLACE_CMD} -e' s|find_required_package(LIBVNCSERVER)||' ${WRKSRC}/remmina-plugins/CMakeLists.txt
    ${REINPLACE_CMD} -e 's|add_subdirectory(vnc)||' ${WRKSRC}/remmina-plugins/CMakeLists.txt
.endif
.if ${PKGNAMESUFFIX:S,-,,} != "xdmcp"
    ${REINPLACE_CMD} -e 's|add_subdirectory(xdmcp)||' ${WRKSRC}/remmina-plugins/CMakeLists.txt
.endif
.if ${PKGNAMESUFFIX:S,-,,} != "telepathy"
    ${REINPLACE_CMD} -e 's|find_suggested_package(TELEPATHY)||' ${WRKSRC}/remmina-plugins/CMakeLists.txt
    ${REINPLACE_CMD} -e 's|add_subdirectory(telepathy)||' ${WRKSRC}/remmina-plugins/CMakeLists.txt
.endif
.if ${PKGNAMESUFFIX:S,-,,} != "i18n"
    ${REINPLACE_CMD} -e 's|add_subdirectory(po)||' ${WRKSRC}/remmina-plugins/CMakeLists.txt
.endif

.include <bsd.port.post.mk>
.endif