media-libs/libbpg: new package

Package-Manager: Portage-3.0.13, Repoman-3.0.2
RepoMan-Options: --force
Signed-off-by: Michele Santullo <m.santullo@posteo.net>
This commit is contained in:
Michele Santullo
2021-03-15 19:40:06 +01:00
parent 7f2e5212e1
commit 0b9dc090db
6 changed files with 144 additions and 0 deletions

View File

@@ -0,0 +1 @@
DIST libbpg-0.9.8.tar.gz 2029021 BLAKE2B 827d819d6e392a1a0186a58b16b9b69c41f4a0c94046ff2a1aab0e735e01aae8c10d06ad03c1bf9f0722a7620f50ae7da25bddda681e457ad4cdeec8cb922edc SHA512 2d5f7a035033d8b969c2765a4f1368e1a2c8c5ace12aec5d449ca5cc4ef5eb89431a75f2d6d03fd7117b548801b5554503411f499f497da69ff33ca6e714553d

View File

@@ -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

View File

@@ -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

View File

@@ -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
#################################

View File

@@ -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 <<EOF > ${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
}

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<longdescription lang="en">
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.
</longdescription>
<maintainer type="person">
<email>m.santullo@posteo.net</email>
<name>Michele Santullo</name>
</maintainer>
<upstream>
<maintainer>
<name>Fabrice Bellard</name>
<email>fabrice@bellard.org</email>
</maintainer>
</upstream>
</pkgmetadata>