aboutsummaryrefslogtreecommitdiffstats
path: root/multimedia/moonlight/Makefile
blob: 969c1c6196652d3b946cccfeb0d84c07eb2372ab (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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# New ports collection makefile for:    moonlight
# Date created:             Feb 13 2009
# Whom:                 Florent Thoumie <flz@FreeBSD.org>
#
# $FreeBSD$
#

PORTNAME=   moonlight
PORTVERSION=    1.0
PORTREVISION=   1
CATEGORIES= multimedia www
MASTER_SITES=   http://ftp.novell.com/pub/mono/sources/moon/
DISTNAME=   moon-${PORTVERSION}

MAINTAINER= mono@FreeBSD.org
COMMENT=    OpenSource Implementation of Silverlight

LIB_DEPENDS=    avcodec.1:${PORTSDIR}/multimedia/ffmpeg \
        execinfo.1:${PORTSDIR}/devel/libexecinfo

OPTIONS=    FF2 "Install Firefox 2.x support" on
#       FF3 "Install Firefox 3.x support" on

USE_BZIP2=  yes
GNU_CONFIGURE=  yes
CONFIGURE_ENV=  CPPFLAGS="-I${LOCALBASE}/include" \
        LDFLAGS="-L${LOCALBASE}/lib"
CONFIGURE_ARGS= --with-cairo=system \
        --with-debug=yes

BROKEN=     bad plist

WEBPLUGINS_DIR=     ${PREFIX}/lib/moon/plugin
WEBPLUGINS_FILES=   libmoonloader.so \
            libmoonplugin.so

.include <bsd.port.pre.mk>
.include "${PORTSDIR}/www/firefox/Makefile.webplugins"

.if !defined(WITHOUT_FF2) || exists(${LOCALBASE}/bin/firefox)
BUILD_DEPENDS+=     ${LOCALBASE}/bin/firefox:${PORTSDIR}/www/firefox
RUN_DEPENDS+=       ${LOCALBASE}/bin/firefox:${PORTSDIR}/www/firefox

USE_WEBPLUGINS+=    gecko18
WEBPLUGINS_FILES+=  libmoonplugin-ff2bridge.so

PLIST_SUB+=     FF2=""
CONFIGURE_ARGS+=    --with-ff2=yes
.else
PLIST_SUB+=     FF2="@comment "
CONFIGURE_ARGS+=    --with-ff2=no
.endif

#.if !defined(WITHOUT_FF3) || exists(${LOCALBASE}/bin/firefox3)
#BUILD_DEPENDS+=        ${LOCALBASE}/bin/firefox3:${PORTSDIR}/www/firefox3
#RUN_DEPENDS+=      ${LOCALBASE}/bin/firefox3:${PORTSDIR}/www/firefox3
#
#USE_WEBPLUGINS+=       gecko19
#WEBPLUGINS_FILES+= libmoonplugin-ff3bridge.so
#
#PLIST_SUB+=        FF3=""
#CONFIGURE_ARGS+=   --with-ff3=yes
#CONFIGURE_ENV+=        FF3_CFLAGS="-I${LOCALBASE}/include/firefox3/unstable -I${LOCALBASE}/include/nspr" \
#           FF3_LIBS="-pthread -L${LOCALBASE}/lib/firefox3"
#.else
PLIST_SUB+=     FF3="@comment "
CONFIGURE_ARGS+=    --with-ff3=no
#.endif

# Building the .xpi doesn't actually require embedded cairo, but it's a safer option
# as there's no way for firefox to detect if cairo is already installed apparently.
.if defined(WITH_XPI_PLUGIN)
CONFIGURE_ARGS+=--enable-user-plugin --with-cairo=embedded
PLIST=      ${NONEXISTENT}
PLIST_FILES=    ${WEBPLUGINS_DIR}/${PKGNAME}-freebsd-${OSREL}.xpi
.endif

post-patch:
    @${REINPLACE_CMD} -e '/<malloc.h>/d' \
            ${WRKSRC}/src/animation.cpp \
            ${WRKSRC}/src/runtime.cpp \
            ${WRKSRC}/src/xaml.cpp \
            ${WRKSRC}/src/xap.cpp \
            ${WRKSRC}/src/value.cpp
    @${REINPLACE_CMD} -e 's|CODEC_URL|""|' \
            ${WRKSRC}/src/pipeline-ui.cpp
    @${REINPLACE_CMD} -e 's|\(^LIBS\) =|\1 = -lexecinfo|' \
        -e 's|/proc/|/compat/linux/proc/| ' \
            ${WRKSRC}/src/Makefile.in
    @${REINPLACE_CMD} -e 's|-ldl||' \
            ${WRKSRC}/plugin/Makefile.in
#   @${REINPLACE_CMD} -e 's|\(FF3_MODULES\)=.*|\1="libavutil"|1' \
#           ${WRKSRC}/configure
#   @${REINPLACE_CMD} -e 's|\(FF3_MODULES\)=.*|\1="firefox-js firefox-plugin"|1' \
#           ${WRKSRC}/configure

.if defined(WITH_XPI_PLUGIN)
do-install:
    ${INSTALL_DATA} ${WRKSRC}/plugin/install/novell-moonlight.xpi \
        ${WEBPLUGINS_DIR}/${PKGNAME}-freebsd-${OSREL}.xpi
.endif

.include <bsd.port.post.mk>