summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Harder <radhermit@gentoo.org>2016-08-19 22:13:39 -0400
committerTim Harder <radhermit@gentoo.org>2016-08-19 22:27:58 -0400
commitcb21070a45e736d674aede6991df0b6da7cded63 (patch)
tree27c7b7892c11aeaeadc8af68dbaee8587a817539 /app-arch/zopfli
parentdev-util/rebar: stabilize 2.6.1 on amd64/x86, bug #587914 (diff)
downloadgentoo-cb21070a45e736d674aede6991df0b6da7cded63.tar.gz
gentoo-cb21070a45e736d674aede6991df0b6da7cded63.tar.bz2
gentoo-cb21070a45e736d674aede6991df0b6da7cded63.zip
app-arch/zopfli: link binaries against installed libraries
Also install headers so the installed libraries are actually useful to third party builds.
Diffstat (limited to 'app-arch/zopfli')
-rw-r--r--app-arch/zopfli/files/zopfli-1.0.1-makefile.patch33
-rw-r--r--app-arch/zopfli/zopfli-1.0.1-r2.ebuild42
2 files changed, 64 insertions, 11 deletions
diff --git a/app-arch/zopfli/files/zopfli-1.0.1-makefile.patch b/app-arch/zopfli/files/zopfli-1.0.1-makefile.patch
index 8a5e87f3e897..a4a7dc280912 100644
--- a/app-arch/zopfli/files/zopfli-1.0.1-makefile.patch
+++ b/app-arch/zopfli/files/zopfli-1.0.1-makefile.patch
@@ -10,35 +10,46 @@
-CXXFLAGS = -W -Wall -Wextra -ansi -pedantic -O2
+CFLAGS += -W -Wall -Wextra -ansi -pedantic
+CXXFLAGS += -W -Wall -Wextra -ansi -pedantic
++LDFLAGS += -L.
+LIBS = -lm
-+LDFLAGS += $(LIBS)
ZOPFLILIB_SRC = src/zopfli/blocksplitter.c src/zopfli/cache.c\
src/zopfli/deflate.c src/zopfli/gzip_container.c\
-@@ -20,22 +22,22 @@
+@@ -18,24 +20,28 @@
+ .PHONY: zopfli zopflipng
+
++all: zopfli zopflipng
++
# Zopfli binary
- zopfli:
+-zopfli:
- $(CC) $(ZOPFLILIB_SRC) $(ZOPFLIBIN_SRC) $(CFLAGS) -o zopfli
-+ $(CC) $(ZOPFLILIB_SRC) $(ZOPFLIBIN_SRC) $(CFLAGS) $(LDFLAGS) -o zopfli
++zopfli: libzopfli
++ $(CC) $(ZOPFLIBIN_SRC) $(CFLAGS) $(LDFLAGS) $(LIBS) -lzopfli -o zopfli
# Zopfli shared library
libzopfli:
$(CC) $(ZOPFLILIB_SRC) $(CFLAGS) -fPIC -c
- $(CC) $(ZOPFLILIB_OBJ) $(CFLAGS) -shared -Wl,-soname,libzopfli.so.1 -o libzopfli.so.1.0.1
-+ $(CC) $(ZOPFLILIB_OBJ) $(CFLAGS) $(LDFLAGS) -shared -Wl,-soname,libzopfli.so.1 -o libzopfli.so.1.0.1
++ $(CC) $(ZOPFLILIB_OBJ) $(CFLAGS) $(LDFLAGS) $(LIBS) -shared -Wl,-soname,libzopfli.so.1 -o libzopfli.so.1.0.1
++ @ln -s libzopfli.so.1.0.1 libzopfli.so.1
++ @ln -s libzopfli.so.1.0.1 libzopfli.so
# ZopfliPNG binary
- zopflipng:
- $(CC) $(ZOPFLILIB_SRC) $(CFLAGS) -c
+-zopflipng:
+- $(CC) $(ZOPFLILIB_SRC) $(CFLAGS) -c
- $(CXX) $(ZOPFLILIB_OBJ) $(LODEPNG_SRC) $(ZOPFLIPNGLIB_SRC) $(ZOPFLIPNGBIN_SRC) $(CFLAGS) -o zopflipng
-+ $(CXX) $(ZOPFLILIB_OBJ) $(LODEPNG_SRC) $(ZOPFLIPNGLIB_SRC) $(ZOPFLIPNGBIN_SRC) $(CFLAGS) $(LDFLAGS) -o zopflipng
++zopflipng: libzopflipng
++ $(CXX) $(ZOPFLILIB_OBJ) $(LODEPNG_SRC) $(ZOPFLIPNGBIN_SRC) $(CFLAGS) $(LDFLAGS) $(LIBS) -lzopflipng -o zopflipng
# ZopfliPNG shared library
- libzopflipng:
- $(CC) $(ZOPFLILIB_SRC) $(CFLAGS) -fPIC -c
+-libzopflipng:
+- $(CC) $(ZOPFLILIB_SRC) $(CFLAGS) -fPIC -c
- $(CXX) $(ZOPFLILIB_OBJ) $(LODEPNG_SRC) $(ZOPFLIPNGLIB_SRC) $(CFLAGS) -fPIC --shared -Wl,-soname,libzopflipng.so.1 -o libzopflipng.so.1.0.0
-+ $(CXX) $(ZOPFLILIB_OBJ) $(LODEPNG_SRC) $(ZOPFLIPNGLIB_SRC) $(CFLAGS) $(LDFLAGS) -fPIC --shared -Wl,-soname,libzopflipng.so.1 -o libzopflipng.so.1.0.0
++libzopflipng: libzopfli
++ $(CXX) $(ZOPFLILIB_OBJ) $(LODEPNG_SRC) $(ZOPFLIPNGLIB_SRC) $(CFLAGS) $(LDFLAGS) $(LIBS) -fPIC --shared -Wl,-soname,libzopflipng.so.1 -o libzopflipng.so.1.0.0
++ @ln -s libzopflipng.so.1.0.0 libzopflipng.so.1
++ @ln -s libzopflipng.so.1.0.0 libzopflipng.so
# Remove all libraries and binaries
clean:
diff --git a/app-arch/zopfli/zopfli-1.0.1-r2.ebuild b/app-arch/zopfli/zopfli-1.0.1-r2.ebuild
new file mode 100644
index 000000000000..3d155dcde2f4
--- /dev/null
+++ b/app-arch/zopfli/zopfli-1.0.1-r2.ebuild
@@ -0,0 +1,42 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+
+inherit toolchain-funcs
+
+DESCRIPTION="Very good, but slow, deflate or zlib compression"
+HOMEPAGE="https://github.com/google/zopfli/"
+SRC_URI="https://github.com/google/zopfli/archive/${P}.tar.gz"
+
+S="${WORKDIR}/${PN}-${P}"
+
+LICENSE="Apache-2.0"
+SLOT="0/1"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+
+DOCS=( CONTRIBUTORS README README.zopflipng )
+
+PATCHES=( "${FILESDIR}"/${P}-makefile.patch )
+
+# zopflipng statically links an exact version of LodePNG (https://github.com/lvandeve/lodepng)
+
+src_prepare() {
+ default
+ tc-export CC CXX
+}
+
+# The Makefile has no install phase
+src_install() {
+ dolib.so libzopfli.so*
+ doheader src/zopfli/zopfli.h
+
+ dobin ${PN}
+
+ # This version was erroneously not bumped to match ${PV}
+ dolib.so libzopflipng.so*
+ doheader src/zopflipng/zopflipng_lib.h
+
+ dobin zopflipng
+}