diff options
author | nox <nox@FreeBSD.org> | 2015-01-31 01:47:01 +0800 |
---|---|---|
committer | nox <nox@FreeBSD.org> | 2015-01-31 01:47:01 +0800 |
commit | e88409664f7e7c0d34455dd6a185f3340ff76f53 (patch) | |
tree | eba56ed28ad3c88ff9936d398a35888c97a41522 /graphics/libbpg | |
parent | 457fe8660734bb7a44c2297224ddfbb05bba1f88 (diff) | |
download | freebsd-ports-gnome-e88409664f7e7c0d34455dd6a185f3340ff76f53.tar.gz freebsd-ports-gnome-e88409664f7e7c0d34455dd6a185f3340ff76f53.tar.zst freebsd-ports-gnome-e88409664f7e7c0d34455dd6a185f3340ff76f53.zip |
Add new port graphics/libbpg:
BPG (Better Portable Graphics) is a new image format. Its purpose is to
replace the JPEG image format when quality or file size is an issue. Its
main advantages are:
- High compression ratio. Files are much smaller than JPEG for similar
quality.
- Supported by most Web browsers with a small Javascript decoder (gzipped
size: 56 KB).
- Based on a subset of the HEVC open video compression standard.
- Supports the same chroma formats as JPEG (grayscale, YCbCr 4:2:0, 4:2:2,
4:4:4) to reduce the losses during the conversion. An alpha channel is
supported. The RGB, YCgCo and CMYK color spaces are also supported.
- Native support of 8 to 14 bits per channel for a higher dynamic range.
- Lossless compression is supported.
- Various metadata (such as EXIF, ICC profile, XMP) can be included.
- Animation support.
WWW: http://bellard.org/bpg/
PR: 196837
Submitted by: Matthieu Volat <mazhe@alkumuna.eu>
Diffstat (limited to 'graphics/libbpg')
-rw-r--r-- | graphics/libbpg/Makefile | 56 | ||||
-rw-r--r-- | graphics/libbpg/distinfo | 2 | ||||
-rw-r--r-- | graphics/libbpg/files/patch-Makefile | 82 | ||||
-rw-r--r-- | graphics/libbpg/files/patch-jctvc_TLibCommon_TComPicYuv.cpp | 11 | ||||
-rw-r--r-- | graphics/libbpg/pkg-descr | 17 | ||||
-rw-r--r-- | graphics/libbpg/pkg-plist | 6 |
6 files changed, 174 insertions, 0 deletions
diff --git a/graphics/libbpg/Makefile b/graphics/libbpg/Makefile new file mode 100644 index 000000000000..61dc815693fd --- /dev/null +++ b/graphics/libbpg/Makefile @@ -0,0 +1,56 @@ +# Created by: Matthieu Volat <mazhe@alkumuna.eu> +# $FreeBSD$ + +PORTNAME= libbpg +PORTVERSION= 0.9.5 +CATEGORIES= graphics +MASTER_SITES= http://bellard.org/bpg/ + +MAINTAINER= mazhe@alkumuna.eu +COMMENT= BPG (Better Portable Graphics) is a new image format + +LICENSE= BSD2CLAUSE LGPL21 +LICENSE_COMB= multi + +LIB_DEPENDS= libjpeg.so:${PORTSDIR}/graphics/jpeg \ + libpng.so:${PORTSDIR}/graphics/png + +OPTIONS_DEFINE= SDL JCTVC X265 +OPTIONS_DEFAULT=SDL JCTVC +OPTIONS_SUB= yes + +USE_LDCONFIG= yes +SDL_USE= SDL=image +X265_LIB_DEPENDS= libx265.so:${PORTSDIR}/multimedia/x265 + +.include <bsd.port.options.mk> + +JCTVC_DESC= Enable JCTVC (best quality but slow) for the encoder +JCTVCHI_DESC= Use bit depths > 12 with JCTVC (experimental) +USES= gmake compiler:c++11-lib +CFLAGS+= -fPIC -I${LOCALBASE}/include +LDFLAGS+= -L${LOCALBASE}/lib + +do-configure: +.if ! ${PORT_OPTIONS:MSDL} + ${REINPLACE_CMD} -e 's/^USE_BPGVIEW=y$$/#USE_BPGVIEW=/' ${WRKSRC}/Makefile +.endif +.if ! ${PORT_OPTIONS:MJCTVC} + ${REINPLACE_CMD} -e 's/^USE_JCTVC=y$$/#USE_JCTVC=/' ${WRKSRC}/Makefile +.endif +.if ${PORT_OPTIONS:MX265} + ${REINPLACE_CMD} -e 's/^#USE_JCTVC_HIGH_BIT_DEPTH=y$$/USE_JCTVC_HIGH_BIT_DEPTH=y/' ${WRKSRC}/Makefile +.endif +.if ${PORT_OPTIONS:MX265} + ${REINPLACE_CMD} -e 's/^#USE_X265=y$$/USE_X265=y/' ${WRKSRC}/Makefile +.endif + +post-install: +.if ${PORT_OPTIONS:MSDL} + ${INSTALL_PROGRAM} ${WRKSRC}/bpgview ${STAGEDIR}${PREFIX}/bin +.endif + ${INSTALL_DATA} ${WRKSRC}/libbpg.h ${STAGEDIR}${PREFIX}/include + ${INSTALL_LIB} ${WRKSRC}/libbpg.a ${STAGEDIR}${PREFIX}/lib + ${INSTALL_LIB} ${WRKSRC}/libbpg.so ${STAGEDIR}${PREFIX}/lib + +.include <bsd.port.mk> diff --git a/graphics/libbpg/distinfo b/graphics/libbpg/distinfo new file mode 100644 index 000000000000..a4e8266b5530 --- /dev/null +++ b/graphics/libbpg/distinfo @@ -0,0 +1,2 @@ +SHA256 (libbpg-0.9.5.tar.gz) = 30de1d0099920e24b7c9aae4d4e6b62f446823f0a1d52eb195dfc25c662ee203 +SIZE (libbpg-0.9.5.tar.gz) = 1039871 diff --git a/graphics/libbpg/files/patch-Makefile b/graphics/libbpg/files/patch-Makefile new file mode 100644 index 000000000000..092a50a163dd --- /dev/null +++ b/graphics/libbpg/files/patch-Makefile @@ -0,0 +1,82 @@ +--- Makefile.orig 2015-01-11 16:17:07 UTC ++++ Makefile +@@ -17,7 +17,7 @@ USE_BPGVIEW=y + # Enable for compilation on MacOS X + #CONFIG_APPLE=y + # Installation prefix +-prefix=/usr/local ++prefix=${DESTDIR}${PREFIX} + + + ################################# +@@ -31,19 +31,20 @@ CROSS_PREFIX:= + EXE:= + endif + +-CC=$(CROSS_PREFIX)gcc +-CXX=$(CROSS_PREFIX)g++ +-AR=$(CROSS_PREFIX)ar ++CC?=$(CROSS_PREFIX)gcc ++CXX?=$(CROSS_PREFIX)g++ ++AR?=$(CROSS_PREFIX)ar ++LD?=$(CROSS_PREFIX)ld + EMCC=emcc + + PWD:=$(shell pwd) + +-CFLAGS:=-Os -Wall -MMD -fno-asynchronous-unwind-tables -fdata-sections -ffunction-sections -fno-math-errno -fno-signed-zeros -fno-tree-vectorize -fomit-frame-pointer +-CFLAGS+=-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_REENTRANT +-CFLAGS+=-I. +-CFLAGS+=-DCONFIG_BPG_VERSION=\"$(shell cat VERSION)\" ++CFLAGS_DIST:=-Os -Wall -MMD -fno-asynchronous-unwind-tables -fdata-sections -ffunction-sections -fno-math-errno -fno-signed-zeros -fno-tree-vectorize -fomit-frame-pointer ++CFLAGS_DIST+=-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_REENTRANT ++CFLAGS_DIST+=-I. ++CFLAGS_DIST+=-DCONFIG_BPG_VERSION=\"$(shell cat VERSION)\" + ifdef USE_JCTVC_HIGH_BIT_DEPTH +-CFLAGS+=-DRExt__HIGH_BIT_DEPTH_SUPPORT ++CFLAGS_DIST+=-DRExt__HIGH_BIT_DEPTH_SUPPORT + endif + + # Emscriptem config +@@ -53,14 +54,17 @@ EMLDFLAGS+=-s NO_FILESYSTEM=1 -s NO_BROW + EMLDFLAGS+=-O3 --memory-init-file 0 --closure 1 --post-js post.js + EMCFLAGS:=$(CFLAGS) + +-LDFLAGS=-g ++LDFLAGS_DIST=-g + ifdef CONFIG_APPLE +-LDFLAGS+=-Wl,-dead_strip ++LDFLAGS_DIST+=-Wl,-dead_strip + else +-LDFLAGS+=-Wl,--gc-sections ++LDFLAGS_DIST+=-Wl,--gc-sections + endif +-CFLAGS+=-g +-CXXFLAGS=$(CFLAGS) ++CFLAGS_DIST+=-g ++ ++CFLAGS:=${CFLAGS_DIST} ${CFLAGS} ++LDFLAGS:=${LDFLAGS_DIST} ${LDFLAGS} ++CXXFLAGS=${CFLAGS} + + PROGS=bpgdec$(EXE) bpgenc$(EXE) + ifdef USE_BPGVIEW +@@ -70,7 +74,7 @@ ifdef USE_EMCC + PROGS+=bpgdec.js bpgdec8.js bpgdec8a.js + endif + +-all: $(PROGS) ++all: libbpg.a libbpg.so $(PROGS) + + LIBBPG_OBJS:=$(addprefix libavcodec/, \ + hevc_cabac.o hevc_filter.o hevc.o hevcpred.o hevc_refs.o\ +@@ -158,6 +162,9 @@ bpgenc.o: CFLAGS+=-Wno-unused-but-set-va + libbpg.a: $(LIBBPG_OBJS) + $(AR) rcs $@ $^ + ++libbpg.so: $(LIBBPG_OBJS) ++ $(CC) $(LDFLAGS) -shared -o $@ $^ ++ + bpgdec$(EXE): bpgdec.o libbpg.a + $(CC) $(LDFLAGS) -o $@ $^ $(BPGDEC_LIBS) + diff --git a/graphics/libbpg/files/patch-jctvc_TLibCommon_TComPicYuv.cpp b/graphics/libbpg/files/patch-jctvc_TLibCommon_TComPicYuv.cpp new file mode 100644 index 000000000000..35441b27ec8f --- /dev/null +++ b/graphics/libbpg/files/patch-jctvc_TLibCommon_TComPicYuv.cpp @@ -0,0 +1,11 @@ +--- jctvc/TLibCommon/TComPicYuv.cpp.orig 2015-01-11 16:17:07 UTC ++++ jctvc/TLibCommon/TComPicYuv.cpp +@@ -41,7 +41,7 @@ + + #ifdef __APPLE__ + #include <malloc/malloc.h> +-#else ++#elif __Linux__ + #include <malloc.h> + #endif + diff --git a/graphics/libbpg/pkg-descr b/graphics/libbpg/pkg-descr new file mode 100644 index 000000000000..b01043c95930 --- /dev/null +++ b/graphics/libbpg/pkg-descr @@ -0,0 +1,17 @@ +BPG (Better Portable Graphics) is a new image format. Its purpose is to +replace the JPEG image format when quality or file size is an issue. Its +main advantages are: + - High compression ratio. Files are much smaller than JPEG for similar + quality. + - Supported by most Web browsers with a small Javascript decoder (gzipped + size: 56 KB). + - Based on a subset of the HEVC open video compression standard. + - Supports the same chroma formats as JPEG (grayscale, YCbCr 4:2:0, 4:2:2, + 4:4:4) to reduce the losses during the conversion. An alpha channel is + supported. The RGB, YCgCo and CMYK color spaces are also supported. + - Native support of 8 to 14 bits per channel for a higher dynamic range. + - Lossless compression is supported. + - Various metadata (such as EXIF, ICC profile, XMP) can be included. + - Animation support. + +WWW: http://bellard.org/bpg/ diff --git a/graphics/libbpg/pkg-plist b/graphics/libbpg/pkg-plist new file mode 100644 index 000000000000..9877f9ccdb9a --- /dev/null +++ b/graphics/libbpg/pkg-plist @@ -0,0 +1,6 @@ +bin/bpgdec +bin/bpgenc +%%SDL%%bin/bpgview +include/libbpg.h +lib/libbpg.a +lib/libbpg.so |