PORTNAME=	firefox
PORTVERSION=	${VER}
PORTREVISION=	3
CATEGORIES=	www
MASTER_SITES=	https://www.midnightbsd.org/ftp/MidnightBSD/distfiles/

MAINTAINER=	ports@MidnightBSD.org
COMMENT=	Mozilla Firefox for FreeBSD

LICENSE=	mpl gpl2
LICENSE_COMB=	dual

LIB_DEPENDS+=	libicui18n.so:devel/icu \
		libvpx.so:multimedia/libvpx \
		libevent.so:devel/libevent \
		libstartup-notification-1.so:x11/startup-notification \
		nspr>=4.25:devel/nspr \
                nss>=3.51.1:security/nss \
                icu>=61.1,1:devel/icu \
                harfbuzz>=2.6.4:print/harfbuzz \
                graphite2>=1.3.14:graphics/graphite2 \
                png>=1.6.35:graphics/png \
		ffmpeg:multimedia/ffmpeg \
		libffi.so:devel/libffi \
		libpixman-1.so:x11/pixman \
		libwebp.so:graphics/webp \
		libfontconfig.so:x11-fonts/fontconfig \
                libfreetype.so:print/freetype2


USES=		compiler:c++17-lang cpe gl gmake gnome iconv jpeg localbase perl5 pkgconfig \
		desktop-file-utils tar:xz
CPE_VENDOR=	mozilla
USE_GL=         gl
USE_GNOME=      cairo gdkpixbuf2 gtk20 gtk30
USE_XORG=       x11 xcb xcomposite xdamage xext xfixes xrender xt

ONLY_FOR_ARCHS=	amd64
PLIST=          ${PKGDIR}/pkg-plist${COMPONENT}

NO_BUILD=	yes

.include <bsd.port.pre.mk>

.if ${ARCH} == "amd64"
.if ${OSVERSION} >= 200000
VER=    80
DISTFILES=      firefox-80.0.1,2.txz
COMPONENT=.11
LIB_DEPENDS+=	libaom.so:multimedia/aom \
		libdav1d.so:multimedia/dav1d
.else
VER=    63
DISTFILES=      firefox-63.0_3,1.txz
COMPONENT=.10
MASTER_SITES+=	https://pkg.freebsd.org/FreeBSD:10:amd64/latest/All/
.endif
.endif


do-extract:
	${MKDIR} ${FAKE_DESTDIR}/usr/local
	cd ${FAKE_DESTDIR} && tar -xzf ${DISTDIR}/${DISTFILES}

do-install:
	${NOOP}

.include <bsd.port.post.mk>
