View | Details | Raw Unified | Return to bug 196837 | Differences between
and this patch

Collapse All | Expand All

(-)graphics/libbpg/Makefile (+55 lines)
Line 0 Link Here
1
# Created by: Matthieu Volat <mazhe@alkumuna.eu>
2
# $FreeBSD$
3
4
PORTNAME=	libbpg
5
PORTVERSION=	0.9.5
6
CATEGORIES=	graphics
7
MASTER_SITES=	http://bellard.org/bpg/
8
9
MAINTAINER=	mazhe@alkumuna.eu
10
COMMENT=	BPG (Better Portable Graphics) is a new image format
11
12
LICENSE=	BSD LGPL21
13
LICENSE_COMB=   multi
14
15
LIB_DEPENDS=	libjpeg.so:${PORTSDIR}/graphics/jpeg \
16
		libpng.so:${PORTSDIR}/graphics/png
17
18
OPTIONS_DEFINE=	SDL JCTVC JCTVCHI X265
19
OPTIONS_DEFAULT=SDL JCTVC
20
OPTIONS_SUB=	yes
21
22
.include <bsd.port.options.mk>
23
24
SDL_USE=	SDL=image
25
JCTVC_DESC=	Enable JCTVC (best quality but slow) for the encoder
26
JCTVCHI_DESC=	Use bit depths > 12 with JCTVC (experimental)
27
X265_DEPENDS=	libx265.so:${PORTSDIR}/multimedia/x265
28
USES=		gmake
29
CFLAGS+=	-fPIC -I${LOCALBASE}/include
30
LDFLAGS+=	-L${LOCALBASE}/lib
31
32
33
do-configure:
34
.if ! ${PORT_OPTIONS:MSDL}
35
	${REINPLACE_CMD} -e 's/^USE_BPGVIEW=y$$/#USE_BPGVIEW=/' ${WRKSRC}/Makefile
36
.endif
37
.if ! ${PORT_OPTIONS:MJCTVC}
38
	${REINPLACE_CMD} -e 's/^USE_JCTVC=y$$/#USE_JCTVC=/' ${WRKSRC}/Makefile
39
.endif
40
.if ${PORT_OPTIONS:MX265}
41
	${REINPLACE_CMD} -e 's/^#USE_JCTVC_HIGH_BIT_DEPTH=y$$/USE_JCTVC_HIGH_BIT_DEPTH=y/' ${WRKSRC}/Makefile
42
.endif
43
.if ${PORT_OPTIONS:MX265}
44
	${REINPLACE_CMD} -e 's/^#USE_X265=y$$/USE_X265=y/' ${WRKSRC}/Makefile
45
.endif
46
47
post-install:
48
.if ${PORT_OPTIONS:MSDL}
49
	${INSTALL_PROGRAM} ${WRKSRC}/bpgview ${STAGEDIR}${PREFIX}/bin
50
.endif
51
	${INSTALL_DATA} ${WRKSRC}/libbpg.h ${STAGEDIR}${PREFIX}/include
52
	${INSTALL_LIB} ${WRKSRC}/libbpg.a ${STAGEDIR}${PREFIX}/lib
53
	${INSTALL_LIB} ${WRKSRC}/libbpg.so ${STAGEDIR}${PREFIX}/lib
54
55
.include <bsd.port.mk>
(-)graphics/libbpg/distinfo (+2 lines)
Line 0 Link Here
1
SHA256 (libbpg-0.9.5.tar.gz) = 30de1d0099920e24b7c9aae4d4e6b62f446823f0a1d52eb195dfc25c662ee203
2
SIZE (libbpg-0.9.5.tar.gz) = 1039871
(-)graphics/libbpg/files/patch-Makefile (+82 lines)
Line 0 Link Here
1
--- Makefile.orig	2015-01-11 16:17:07 UTC
2
+++ Makefile
3
@@ -17,7 +17,7 @@ USE_BPGVIEW=y
4
 # Enable for compilation on MacOS X
5
 #CONFIG_APPLE=y
6
 # Installation prefix
7
-prefix=/usr/local
8
+prefix=${DESTDIR}${PREFIX}
9
 
10
 
11
 #################################
12
@@ -31,19 +31,20 @@ CROSS_PREFIX:=
13
 EXE:=
14
 endif
15
 
16
-CC=$(CROSS_PREFIX)gcc
17
-CXX=$(CROSS_PREFIX)g++
18
-AR=$(CROSS_PREFIX)ar
19
+CC?=$(CROSS_PREFIX)gcc
20
+CXX?=$(CROSS_PREFIX)g++
21
+AR?=$(CROSS_PREFIX)ar
22
+LD?=$(CROSS_PREFIX)ld
23
 EMCC=emcc
24
 
25
 PWD:=$(shell pwd)
26
 
27
-CFLAGS:=-Os -Wall -MMD -fno-asynchronous-unwind-tables -fdata-sections -ffunction-sections -fno-math-errno -fno-signed-zeros -fno-tree-vectorize -fomit-frame-pointer
28
-CFLAGS+=-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_REENTRANT
29
-CFLAGS+=-I.
30
-CFLAGS+=-DCONFIG_BPG_VERSION=\"$(shell cat VERSION)\"
31
+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 
32
+CFLAGS_DIST+=-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_REENTRANT
33
+CFLAGS_DIST+=-I.
34
+CFLAGS_DIST+=-DCONFIG_BPG_VERSION=\"$(shell cat VERSION)\"
35
 ifdef USE_JCTVC_HIGH_BIT_DEPTH
36
-CFLAGS+=-DRExt__HIGH_BIT_DEPTH_SUPPORT
37
+CFLAGS_DIST+=-DRExt__HIGH_BIT_DEPTH_SUPPORT
38
 endif
39
 
40
 # Emscriptem config
41
@@ -53,14 +54,17 @@ EMLDFLAGS+=-s NO_FILESYSTEM=1 -s NO_BROW
42
 EMLDFLAGS+=-O3 --memory-init-file 0 --closure 1 --post-js post.js
43
 EMCFLAGS:=$(CFLAGS)
44
 
45
-LDFLAGS=-g
46
+LDFLAGS_DIST=-g
47
 ifdef CONFIG_APPLE
48
-LDFLAGS+=-Wl,-dead_strip
49
+LDFLAGS_DIST+=-Wl,-dead_strip
50
 else
51
-LDFLAGS+=-Wl,--gc-sections
52
+LDFLAGS_DIST+=-Wl,--gc-sections
53
 endif
54
-CFLAGS+=-g
55
-CXXFLAGS=$(CFLAGS)
56
+CFLAGS_DIST+=-g
57
+
58
+CFLAGS:=${CFLAGS_DIST} ${CFLAGS}
59
+LDFLAGS:=${LDFLAGS_DIST} ${LDFLAGS}
60
+CXXFLAGS=${CFLAGS}
61
 
62
 PROGS=bpgdec$(EXE) bpgenc$(EXE)
63
 ifdef USE_BPGVIEW
64
@@ -70,7 +74,7 @@ ifdef USE_EMCC
65
 PROGS+=bpgdec.js bpgdec8.js bpgdec8a.js
66
 endif
67
 
68
-all: $(PROGS)
69
+all: libbpg.a libbpg.so $(PROGS)
70
 
71
 LIBBPG_OBJS:=$(addprefix libavcodec/, \
72
 hevc_cabac.o  hevc_filter.o  hevc.o         hevcpred.o  hevc_refs.o\
73
@@ -158,6 +162,9 @@ bpgenc.o: CFLAGS+=-Wno-unused-but-set-va
74
 libbpg.a: $(LIBBPG_OBJS) 
75
 	$(AR) rcs $@ $^
76
 
77
+libbpg.so: $(LIBBPG_OBJS) 
78
+	$(CC) $(LDFLAGS) -shared -o $@ $^
79
+
80
 bpgdec$(EXE): bpgdec.o libbpg.a
81
 	$(CC) $(LDFLAGS) -o $@ $^ $(BPGDEC_LIBS)
82
 
(-)graphics/libbpg/files/patch-jctvc_TLibCommon_TComPicYuv.cpp (+11 lines)
Line 0 Link Here
1
--- jctvc/TLibCommon/TComPicYuv.cpp.orig	2015-01-11 16:17:07 UTC
2
+++ jctvc/TLibCommon/TComPicYuv.cpp
3
@@ -41,7 +41,7 @@
4
 
5
 #ifdef __APPLE__
6
 #include <malloc/malloc.h>
7
-#else
8
+#elif __Linux__
9
 #include <malloc.h>
10
 #endif
11
 
(-)graphics/libbpg/pkg-descr (+17 lines)
Line 0 Link Here
1
BPG (Better Portable Graphics) is a new image format. Its purpose is to 
2
replace the JPEG image format when quality or file size is an issue. Its
3
main advantages are:
4
 - High compression ratio. Files are much smaller than JPEG for similar 
5
   quality.
6
 - Supported by most Web browsers with a small Javascript decoder (gzipped
7
   size: 56 KB).
8
 - Based on a subset of the HEVC open video compression standard.
9
 - Supports the same chroma formats as JPEG (grayscale, YCbCr 4:2:0, 4:2:2, 
10
   4:4:4) to reduce the losses during the conversion. An alpha channel is 
11
   supported. The RGB, YCgCo and CMYK color spaces are also supported.
12
 - Native support of 8 to 14 bits per channel for a higher dynamic range.
13
 - Lossless compression is supported.
14
 - Various metadata (such as EXIF, ICC profile, XMP) can be included.
15
 - Animation support. 
16
17
WWW: http://bellard.org/bpg/
(-)graphics/libbpg/pkg-plist (+6 lines)
Line 0 Link Here
1
bin/bpgdec
2
bin/bpgenc
3
%%SDL%%bin/bpgview
4
include/libbpg.h
5
lib/libbpg.a
6
lib/libbpg.so

Return to bug 196837