aboutsummaryrefslogtreecommitdiffstats
path: root/multimedia/openh264/Makefile
blob: b6c731b101499ab91b75ab4de6204248a0c538df (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
# $FreeBSD$

PORTNAME=   openh264
PORTVERSION=    1.5.0
DISTVERSIONPREFIX=v
PORTEPOCH=  2
CATEGORIES= multimedia

MAINTAINER= gecko@FreeBSD.org
COMMENT=    Cisco implementation of H.264 codec

LICENSE=    BSD2CLAUSE
LICENSE_FILE=   ${WRKSRC}/LICENSE

USE_GITHUB= yes
GH_ACCOUNT= cisco

USES=       compiler cpe gmake
CPE_VENDOR= cisco
USE_LDCONFIG=   yes
ASFLAGS+=   ${ASFLAGS_${MACHINE}_${CHOSEN_COMPILER_TYPE}}
ASFLAGS_arm_clang=  -no-integrated-as
ASFLAGS_arm64_clang=    -no-integrated-as
MAKE_ARGS=  PREFIX="${PREFIX}" \
        OS=bsd ARCH="${ARCH:S/amd64/x86_64/}" \
        CCASFLAGS='$$(CFLAGS) ${ASFLAGS}' \
        CFLAGS_OPT="" CFLAGS_DEBUG=""
ALL_TARGET= all

OPTIONS_DEFINE= DEBUG PLUGINS TEST
OPTIONS_DEFAULT=PLUGINS
OPTIONS_SUB=    yes

DEBUG_BUILD_DEPENDS_OFF=    ${DEBUG_BUILD_DEPENDS_OFF_${ARCH}}
DEBUG_BUILD_DEPENDS_OFF_aarch64=as:devel/binutils
DEBUG_BUILD_DEPENDS_OFF_amd64=  nasm:devel/nasm
DEBUG_BUILD_DEPENDS_OFF_i386=   nasm:devel/nasm
DEBUG_MAKE_ARGS=BUILDTYPE=Debug
PLUGINS_BUILD_DEPENDS=gmp-api>=34.0:multimedia/gmp-api
#           gmp-api<36.0:multimedia/gmp-api
PLUGINS_CFLAGS= -I${LOCALBASE}/include/gmp-api
PLUGINS_MAKE_ARGS=HAVE_GMP_API=Yes
PLUGINS_ALL_TARGET=plugin
PLUGINS_USES=   webplugin:gecko
WEBPLUGIN_NAME= gmp-gmp${PORTNAME}
WEBPLUGIN_FILES=gmp${PORTNAME}.info libgmp${PORTNAME}.so
SUB_FILES+= gmp${PORTNAME}.js
SUB_LIST+=  PORTVERSION=${PORTVERSION} TIMESTAMP="`date +%s`"

TEST_BUILD_DEPENDS=googletest>=1.6.0:devel/googletest
TEST_CFLAGS=    -I${LOCALBASE}/include
TEST_MAKE_ARGS= HAVE_GTEST=Yes
TEST_ALL_TARGET=test

post-patch:
    ${REINPLACE_CMD} -e '/gtest-targets\.mk/d' \
        -e '/pkgconfig/s/$$(LIBDIR_NAME)/libdata/' \
        ${WRKSRC}/Makefile

pre-build:
    ${LN} -sf ${LOCALBASE}/lib/libgtest.so ${WRKSRC}/libgtest.a

post-install:
    ${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/lib${PORTNAME}.so.*

post-install-PLUGINS-on:
    ${MKDIR} ${STAGEDIR}${WEBPLUGIN_DIR}
    ${INSTALL_DATA} ${WRKSRC}/gmp${PORTNAME}.info ${STAGEDIR}${WEBPLUGIN_DIR}
    ${INSTALL_LIB} ${WRKSRC}/libgmp${PORTNAME}.so ${STAGEDIR}${WEBPLUGIN_DIR}
    ${INSTALL_DATA} ${WRKDIR}/gmp${PORTNAME}.js ${STAGEDIR}${WEBPLUGIN_DIR}

.include <bsd.port.mk>