From 0b9dc090db00b9811b42bac865e7c8b30fd757cd Mon Sep 17 00:00:00 2001 From: Michele Santullo Date: Mon, 15 Mar 2021 19:40:06 +0100 Subject: [PATCH] media-libs/libbpg: new package Package-Manager: Portage-3.0.13, Repoman-3.0.2 RepoMan-Options: --force Signed-off-by: Michele Santullo --- media-libs/libbpg/Manifest | 1 + .../libbpg/files/libbpg-0.9.8-add-chost.patch | 13 ++++ .../files/libbpg-0.9.8-dont-strip-bins.patch | 13 ++++ .../libbpg-0.9.8-remove-forced-options.patch | 27 +++++++ media-libs/libbpg/libbpg-0.9.8.ebuild | 72 +++++++++++++++++++ media-libs/libbpg/metadata.xml | 18 +++++ 6 files changed, 144 insertions(+) create mode 100644 media-libs/libbpg/Manifest create mode 100644 media-libs/libbpg/files/libbpg-0.9.8-add-chost.patch create mode 100644 media-libs/libbpg/files/libbpg-0.9.8-dont-strip-bins.patch create mode 100644 media-libs/libbpg/files/libbpg-0.9.8-remove-forced-options.patch create mode 100644 media-libs/libbpg/libbpg-0.9.8.ebuild create mode 100644 media-libs/libbpg/metadata.xml diff --git a/media-libs/libbpg/Manifest b/media-libs/libbpg/Manifest new file mode 100644 index 0000000000..a8ff0b6ccd --- /dev/null +++ b/media-libs/libbpg/Manifest @@ -0,0 +1 @@ +DIST libbpg-0.9.8.tar.gz 2029021 BLAKE2B 827d819d6e392a1a0186a58b16b9b69c41f4a0c94046ff2a1aab0e735e01aae8c10d06ad03c1bf9f0722a7620f50ae7da25bddda681e457ad4cdeec8cb922edc SHA512 2d5f7a035033d8b969c2765a4f1368e1a2c8c5ace12aec5d449ca5cc4ef5eb89431a75f2d6d03fd7117b548801b5554503411f499f497da69ff33ca6e714553d diff --git a/media-libs/libbpg/files/libbpg-0.9.8-add-chost.patch b/media-libs/libbpg/files/libbpg-0.9.8-add-chost.patch new file mode 100644 index 0000000000..9b5054de1a --- /dev/null +++ b/media-libs/libbpg/files/libbpg-0.9.8-add-chost.patch @@ -0,0 +1,13 @@ +diff --git a/Makefile b/Makefile +index 8364e93..d3fc48f 100644 +--- a/Makefile ++++ b/Makefile +@@ -27,7 +27,7 @@ CROSS_PREFIX:=x86_64-w64-mingw32- + #CROSS_PREFIX=i686-w64-mingw32- + EXE:=.exe + else +-CROSS_PREFIX:= ++CROSS_PREFIX:=${CHOST}- + EXE:= + endif + diff --git a/media-libs/libbpg/files/libbpg-0.9.8-dont-strip-bins.patch b/media-libs/libbpg/files/libbpg-0.9.8-dont-strip-bins.patch new file mode 100644 index 0000000000..486086adad --- /dev/null +++ b/media-libs/libbpg/files/libbpg-0.9.8-dont-strip-bins.patch @@ -0,0 +1,13 @@ +diff --git a/Makefile b/Makefile +index a5ba63b..8364e93 100644 +--- a/Makefile ++++ b/Makefile +@@ -214,7 +214,7 @@ size: + gzip < bpgdec | wc + + install: bpgenc bpgdec +- install -s -m 755 $^ $(prefix)/bin ++ install -m 755 $^ $(prefix)/bin + + CLEAN_DIRS=doc html libavcodec libavutil \ + jctvc jctvc/TLibEncoder jctvc/TLibVideoIO jctvc/TLibCommon jctvc/libmd5 diff --git a/media-libs/libbpg/files/libbpg-0.9.8-remove-forced-options.patch b/media-libs/libbpg/files/libbpg-0.9.8-remove-forced-options.patch new file mode 100644 index 0000000000..1ebf05faed --- /dev/null +++ b/media-libs/libbpg/files/libbpg-0.9.8-remove-forced-options.patch @@ -0,0 +1,27 @@ +diff --git a/Makefile b/Makefile +index 3a8db4c..a5ba63b 100644 +--- a/Makefile ++++ b/Makefile +@@ -5,11 +5,11 @@ + # Enable compilation of Javascript decoder with Emscripten + #USE_EMCC=y + # Enable x265 for the encoder +-USE_X265=y ++#USE_X265=y + # Enable the JCTVC code (best quality but slow) for the encoder + #USE_JCTVC=y + # Compile bpgview (SDL and SDL_image libraries needed) +-USE_BPGVIEW=y ++#USE_BPGVIEW=y + # Enable it to use bit depths > 12 (need more tests to validate encoder) + #USE_JCTVC_HIGH_BIT_DEPTH=y + # Enable the cross compilation for Windows +@@ -17,7 +17,7 @@ USE_BPGVIEW=y + # Enable for compilation on MacOS X + #CONFIG_APPLE=y + # Installation prefix +-prefix=/usr/local ++#prefix=/usr/local + + + ################################# diff --git a/media-libs/libbpg/libbpg-0.9.8.ebuild b/media-libs/libbpg/libbpg-0.9.8.ebuild new file mode 100644 index 0000000000..e55afb24dd --- /dev/null +++ b/media-libs/libbpg/libbpg-0.9.8.ebuild @@ -0,0 +1,72 @@ +# Copyright 2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +DESCRIPTION="Better Portable Graphics reference implementation" +HOMEPAGE="https://bellard.org/bpg/" +SRC_URI="${HOMEPAGE}/${P}.tar.gz" + +LICENSE="LGPL-2.1" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="+x265 bpgview jctvc emcc static-libs" + +PATCHES=( + "${FILESDIR}"/${P}-remove-forced-options.patch + "${FILESDIR}"/${P}-dont-strip-bins.patch + "${FILESDIR}"/${P}-add-chost.patch +) + +DEPEND="" +RDEPEND="${DEPEND}" +BDEPEND=" + media-video/ffmpeg + media-libs/libpng + virtual/jpeg + bpgview? ( media-libs/sdl-image ) + bpgview? ( media-libs/libsdl ) +" + +src_prepare() { + default + + cat < ${PN}.pc +prefix="${EPREFIX}/usr" +libdir="\${prefix}/$(get_libdir)" +includedir="\${prefix}/include" + +Name: ${PN} +Description: ${DESCRIPTION} +URL: ${HOMEPAGE} +Version: ${PV} +Libs: "-L\${libdir}" -lbpg +Cflags: "-I\${includedir}" +EOF +} + +src_compile() { + emake \ + $(usex x265 USE_X265=y '') \ + $(usex bpgview USE_BPGVIEW=y '') \ + $(usex jctvc USE_JCTVC=y '') \ + $(usex emcc USE_EMCC=y '') +} + +src_install() { + mkdir -p "${D}"/usr/bin + emake prefix="${D}"/usr install + + if use bpgview; then + dobin bpgview + fi + + if use static-libs; then + dolib.a libbpg.a + doheader libbpg.h + doheader bpgenc.h + + insinto /usr/$(get_libdir)/pkgconfig + doins ${PN}.pc + fi +} diff --git a/media-libs/libbpg/metadata.xml b/media-libs/libbpg/metadata.xml new file mode 100644 index 0000000000..f0651d33ae --- /dev/null +++ b/media-libs/libbpg/metadata.xml @@ -0,0 +1,18 @@ + + + + + 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. + + + m.santullo@posteo.net + Michele Santullo + + + + Fabrice Bellard + fabrice@bellard.org + + +