freebsd-ports/multimedia/mplayer/Makefile.common
2020-12-26 17:18:04 +00:00

79 lines
2.4 KiB
Makefile

# Contains the build infrastructural definitions for both
# mplayer and mencoder....the variables that we need to set
# before we include bsd.port.pre.mk
#
# $FreeBSD$
MPLAYER_PORT_VERSION= 1.4.0
MPLAYER_SNAPSHOT_DATE= 2020-12-25
MASTER_SITES= LOCAL/riggs/mplayer
DISTNAME= mplayer-${MPLAYER_PORT_VERSION}.${MPLAYER_SNAPSHOT_DATE:S/-//g}
WRKSRC= ${WRKDIR}/mplayer-export-${MPLAYER_SNAPSHOT_DATE}
LICENSE= GPLv2
LICENSE_FILE= ${WRKSRC}/LICENSE
LIB_DEPENDS= libpng.so:graphics/png \
libavcodec.so:multimedia/ffmpeg \
libfreetype.so:print/freetype2
BUILD_DEPENDS= ${BUILD_DEPENDS_${ARCH}}
BUILD_DEPENDS_i386= as:devel/binutils
USES= compiler:c11 gmake iconv ncurses tar:xz
NOPRECIOUSMAKEVARS= yes # ARCH
HAS_CONFIGURE= yes
CONFIGURE_ENV= TMPDIR="${WRKSRC}"
CONFIGURE_ARGS= --cc="${CC}" \
--host-cc="${CC}" \
--as="${AS}" \
--mandir="${PREFIX}/man" \
--extra-cflags="-I${PREFIX}/include -I${LOCALBASE}/include" \
--extra-libs="-L${PREFIX}/lib" \
--disable-alsa \
--disable-ass-internal \
--disable-bitmap-font \
--disable-crystalhd \
--disable-esd \
--disable-faad \
--disable-ffmpeg_a \
--disable-ggi \
--disable-ggiwmh \
--disable-liba52 \
--disable-libbs2b \
--disable-libilbc \
--disable-libnut \
--disable-libvorbis \
--disable-live \
--disable-joystick \
--disable-mad \
--disable-libmpeg2 \
--disable-nemesi \
--disable-real \
--yasm=''
common-post-patch:
@${REINPLACE_CMD} \
-e 's|/dev/dvd|${DEFAULT_DVD_DEVICE}|; \
s|/dev/cdrom|${DEFAULT_CDROM_DEVICE}|' \
-e 's|/usr/local|${LOCALBASE}|' \
-e 's|%%LOCALBASE%%|${LOCALBASE}|' \
-e 's|-lbz2|/usr/lib/libbz2.so|' \
-e 's|-lncurses|/usr/lib/libncurses.so|' \
-e 's|-liconv|${ICONV_LIB}|' \
${CONFIGURE_WRKSRC}/${CONFIGURE_SCRIPT}
@${FIND} -E ${WRKSRC} -type f \
-iregex ".*(configure|.sh|Makefile)" -print0 | \
${XARGS} -x -0 -n 10 \
${REINPLACE_CMD} -E \
-e 's|[[:space:]]gcc[-[:digit:]\.]+| ${CC}|' \
-e 's|[[:space:]]gcc| ${CC}|' \
-e 's|\$$\(CC\)|${CC}|' \
-e 's|/usr/X11R6|${LOCALBASE}|' \
-e 's|%%LOCALBASE%%|${LOCALBASE}|'
@${FIND} ${WRKSRC}/DOCS/man -name "mplayer.1" | ${XARGS} ${REINPLACE_CMD} -E -e \
's|/usr/\\:local/\\:etc/\\:mplayer|${DATADIR:S/\//\/\\\:/g}|g ; \
s|/dev/\\:(dvd[[:alnum:]]*[[:>:]])|${DEFAULT_DVD_DEVICE:S/dev\//dev\/\\\:/}|g ; \
s|/dev/\\:(cdrom[[:alnum:]]*[[:>:]])|${DEFAULT_CDROM_DEVICE:S/dev\//dev\/\\\:/}|g'
@${RM} ${WRKSRC}/binary.ver