media-libs/urt: Install a shared library.

Package-Manager: Portage-2.3.46, Repoman-2.3.10
This commit is contained in:
Jeroen Roovers
2018-08-15 08:54:52 +02:00
parent fdb09eba47
commit 5a34e5ca05
3 changed files with 295 additions and 0 deletions
@@ -0,0 +1,60 @@
--- a/lib/makefile.src
+++ b/lib/makefile.src
@@ -5,10 +5,6 @@
DEST =
#endif
-#ifndef NO_RANLIB
-RANLIB = ranlib
-#endif
-
# If nothing else is specified, default is to build the library.
default: buildlib
@@ -40,8 +36,8 @@
echo cp $(LIBNAME) $(DEST)/$(LIBNAME) ; \
cp $(LIBNAME) $(DEST)/$(LIBNAME) ; \
if test x$(RANLIB) != x ; then \
- echo ranlib $(DEST)/$(LIBNAME) ; \
- ranlib $(DEST)/$(LIBNAME) ; \
+ echo $(RANLIB) $(DEST)/$(LIBNAME) ; \
+ $(RANLIB) $(DEST)/$(LIBNAME) ; \
else \
true ; \
fi ; \
@@ -49,11 +45,11 @@
echo cp $(LIBNAME) $(DEST)/debug/$(LIBNAME) ; \
if test x$(RANLIB) != x ; then \
cp $(LIBNAME) $(DEST)/debug/$(LIBNAME) ; \
- echo ranlib $(DEST)/debug/$(LIBNAME) ; \
+ echo $(RANLIB) $(DEST)/debug/$(LIBNAME) ; \
else \
true ; \
fi ; \
- ranlib $(DEST)/debug/$(LIBNAME) ; \
+ $(RANLIB) $(DEST)/debug/$(LIBNAME) ; \
else \
true ; \
fi ; \
@@ -65,13 +61,18 @@
# Rebuild the library from all the .o files.
buildlib: $(OBJS)
-rm -f $(LIBNAME)
- ar rc $(LIBNAME)
- ar q $(LIBNAME) $(OBJS)
+ $(AR) rc $(LIBNAME) $(OBJS)
#ifndef NO_RANLIB
- ranlib $(LIBNAME)
+ $(RANLIB) $(LIBNAME)
#endif
touch buildlib
+# Gentoo wants dynamic linking
+buildlibso: $(OBJS)
+ -rm -f $(LIBNAME).so
+ $(CC) $(CFLAGS) $(LDFLAGS) -shared -Wl,-soname=librle-0.0.0.so $(OBJS) -lm -o librle.so
+ touch buildlibso
+
# Clean up installed stuff and binaries
pristine: clean
-@if test $(DEST)X != X ; then \
@@ -0,0 +1,139 @@
some hosts are more anal about ar usage than others
http://bugs.gentoo.org/107428
respect user LDFLAGS
http://bugs.gentoo.org/126872
--- a/tools/clock/makefile.src
+++ b/tools/clock/makefile.src
@@ -6,7 +6,7 @@ install: rleClock
mv rleClock ../rleClock.out
rleClock:rleClock.o font.o
- ${CC} ${CFLAGS} rleClock.o font.o -lm ${LIBS} -o rleClock
+ ${CC} ${CFLAGS} ${LDFLAGS} rleClock.o font.o ${LIBS} -o rleClock -lm
font.c:font.src makeFont
chmod +x makeFont
--- a/tools/makefile.src
+++ b/tools/makefile.src
@@ -62,21 +62,21 @@ applymap.out rlebg.out: $(RI)/rle_raw.h
pyrlib.o: pyrlib.c $(RI)/pyramid.h $(RI)/rle.h $(RI)/rle_config.h
$(CC) $(CFLAGS) pyrlib.c -c
pyrmask.out: pyrlib.o pyrmask.c $(RI)/pyramid.h
- $(CC) $(CFLAGS) -I$(RI) pyrmask.c pyrlib.o $(LIBS) -lm -o pyrmask.new
+ $(CC) $(LDFLAGS) $(CFLAGS) -I$(RI) pyrmask.c pyrlib.o $(LIBS) -lm -o pyrmask.new
mv pyrmask.new pyrmask.out
fant.out: fant.o mallocNd.o
- $(CC) $(CFLAGS) -I$(RI) fant.o mallocNd.o $(LIBS) -lm -o fant.new
+ $(CC) $(LDFLAGS) $(CFLAGS) -I$(RI) fant.o mallocNd.o $(LIBS) -lm -o fant.new
mv fant.new fant.out
# rlebox and crop use some common code.
rle_box.o: $(RI)/rle.h $(RI)/rle_config.h $(RI)/rle_raw.h
crop.out: crop.c rle_box.o
- ${CC} ${CFLAGS} crop.c rle_box.o ${LIBS} -o crop.new
+ ${CC} ${LDFLAGS} ${CFLAGS} crop.c rle_box.o ${LIBS} -o crop.new
mv crop.new crop.out
rlebox.out: rlebox.c rle_box.o
- ${CC} ${CFLAGS} rlebox.c rle_box.o ${LIBS} -o rlebox.new
+ ${CC} ${LDFLAGS} ${CFLAGS} rlebox.c rle_box.o ${LIBS} -o rlebox.new
mv rlebox.new rlebox.out
# rleClock has it's own directory, must be built special
@@ -100,7 +100,7 @@ clean: clean-pgm
.SUFFIXES:
.SUFFIXES: .out .c .o
.c.out:
- $(CC) $(CFLAGS) $< $(LIBS) -lm -o $*.new
+ $(CC) $(LDFLAGS) $(CFLAGS) $< $(LIBS) -lm -o $*.new
mv $*.new $@
.c.o:
--- a/cnv/makefile.src
+++ b/cnv/makefile.src
@@ -76,13 +76,13 @@ PBMDIR =
# ppmtorle - ppm format to RLE
# rletoppm - RLE to ppm format
pgmtorle.out: pgmtorle.c
- $(CC) $(CFLAGS) $(INCPBMPLUS) $*.c $(LIBS) $(LIBPBMPLUS) -o $*.new
+ $(CC) $(CFLAGS) $(LDFLAGS) $(INCPBMPLUS) $*.c $(LIBS) $(LIBPBMPLUS) -o $*.new
mv $*.new $@
ppmtorle.out: ppmtorle.c
- $(CC) $(CFLAGS) $(INCPBMPLUS) $*.c $(LIBS) $(LIBPBMPLUS) -o $*.new
+ $(CC) $(CFLAGS) $(LDFLAGS) $(INCPBMPLUS) $*.c $(LIBS) $(LIBPBMPLUS) -o $*.new
mv $*.new $@
rletoppm.out: rletoppm.c
- $(CC) $(CFLAGS) $(INCPBMPLUS) $*.c $(LIBS) $(LIBPBMPLUS) -o $*.new
+ $(CC) $(CFLAGS) $(LDFLAGS) $(INCPBMPLUS) $*.c $(LIBS) $(LIBPBMPLUS) -o $*.new
mv $*.new $@
#endif
@@ -95,10 +95,10 @@ rletoppm.out: rletoppm.c
# iristorle/rletoiris - Convert between RLE and SGI image format.
#
iristorle.out: iristorle.c
- $(CC) $(CFLAGS) -I/usr/include/gl $*.c $(LIBS) -limage -o $*.new
+ $(CC) $(CFLAGS) $(LDFLAGS) -I/usr/include/gl $*.c $(LIBS) -limage -o $*.new
mv $*.new $@
rletoiris.out: rletoiris.c
- $(CC) $(CFLAGS) -I/usr/include/gl $*.c $(LIBS) -limage -o $*.new
+ $(CC) $(CFLAGS) $(LDFLAGS) -I/usr/include/gl $*.c $(LIBS) -limage -o $*.new
mv $*.new $@
#endif
@@ -108,10 +108,10 @@ TIFFDIR =
# tifftorle - Convert TIFF images to RLE
# rletotiff - Convert RLE images to TIFF
rletotiff.out: rletotiff.c
- $(CC) $(CFLAGS) $(INCTIFF) $*.c $(LIBS) $(LIBTIFF) -lm -o $*.new
+ $(CC) $(CFLAGS) $(LDFLAGS) $(INCTIFF) $*.c $(LIBS) $(LIBTIFF) -lm -o $*.new
mv $*.new $@
tifftorle.out: tifftorle.c
- $(CC) $(CFLAGS) $(INCTIFF) $*.c $(LIBS) $(LIBTIFF) -lm -o $*.new
+ $(CC) $(CFLAGS) $(LDFLAGS) $(INCTIFF) $*.c $(LIBS) $(LIBTIFF) -lm -o $*.new
mv $*.new $@
#endif
@@ -125,7 +125,7 @@ tifftorle.out: tifftorle.c
# Will build with the default rule.
# rletorla - RLE to Wavefront RLA
rletorla.out: rletorla.c
- $(CC) $(CFLAGS) $*.c $(LIBS) $(LIBWAVEFRONT) -lm -o $*.new
+ $(CC) $(CFLAGS) $(LDFLAGS) $*.c $(LIBS) $(LIBWAVEFRONT) -lm -o $*.new
mv $*.new $@
#endif WAVEFRONT
@@ -144,7 +144,7 @@ pristine: pristine-pgm
.SUFFIXES:
.SUFFIXES: .out .c
.c.out:
- $(CC) $(CFLAGS) $*.c $(LIBS) -lm -o $*.new
+ $(CC) $(CFLAGS) $(LDFLAGS) $*.c $(LIBS) -lm -o $*.new
mv $*.new $@
# Dependency lines. Make sure to #ifdef them.
--- a/cnv/rletoabA62/makefile.src
+++ b/cnv/rletoabA62/makefile.src
@@ -15,7 +15,7 @@ all : $(PGMS)
# Executables. The .out will be stripped off in the install action.
rletoabA62.out : rletoabA62.o rle.o
- $(CC) $(CFLAGS) -o rletoabA62.new \
+ $(CC) $(CFLAGS) $(LDFLAGS) -o rletoabA62.new \
rletoabA62.o rle.o $(LIBS)
mv rletoabA62.new rletoabA62.out
--- a/cnv/rletogif/makefile.src
+++ b/cnv/rletogif/makefile.src
@@ -15,7 +15,7 @@ all: $(PGMS)
# The executable. The ".out" will be stripped off in the install action.
rletogif.out: ${OBJ}
- ${CC} ${CFLAGS} ${OBJ} ${LIBS} -o rletogif.new
+ ${CC} ${CFLAGS} ${LDFLAGS} ${OBJ} ${LIBS} -o rletogif.new
mv rletogif.new rletogif.out
# Incremental install, copies executable to DEST dir.
+96
View File
@@ -0,0 +1,96 @@
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=6
inherit eutils flag-o-matic multilib toolchain-funcs
DESCRIPTION="the Utah Raster Toolkit is a library for dealing with raster images"
HOMEPAGE="http://www.cs.utah.edu/gdc/projects/urt/"
SRC_URI="ftp://ftp.iastate.edu/pub/utah-raster/${P}.tar.Z"
LICENSE="URT gif? ( free-noncomm )"
SLOT="0/${PVR}"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~x64-solaris ~x86-solaris"
IUSE="gif postscript static-libs tiff X"
RDEPEND="
X? ( x11-libs/libXext )
gif? ( media-libs/giflib )
postscript? ( app-text/ghostscript-gpl )
tiff? ( media-libs/tiff:= )
"
DEPEND="
${RDEPEND}
X? ( x11-base/xorg-proto )
"
S=${WORKDIR}
urt_config() {
use $1 && echo "#define $2" || echo "##define $2"
}
PATCHES=(
"${FILESDIR}"/${P}-rle-fixes.patch
"${FILESDIR}"/${P}-compile-updates.patch
"${FILESDIR}"/${P}-tempfile.patch
"${FILESDIR}"/${P}-r2-build-fixes.patch
"${FILESDIR}"/${P}-make.patch
"${FILESDIR}"/${P}-solaris.patch
"${FILESDIR}"/${P}-librle-toolchain.patch
)
src_prepare() {
rm -f bin/README
default
# punt bogus manpage #109511
rm -f man/man1/template.1
# stupid OS X declares a stack_t type already #107428
sed -i -e 's:stack_t:_urt_stack:g' tools/clock/rleClock.c || die
}
src_configure() {
append-cflags -fPIC
sed -i -e '/^CFLAGS/s: -O : :' makefile.hdr
cp "${FILESDIR}"/gentoo-config config/gentoo
cat >> config/gentoo <<-EOF
$(urt_config X X11)
$(urt_config postscript POSTSCRIPT)
$(urt_config tiff TIFF)
ExtraCFLAGS = ${CFLAGS}
MFLAGS = ${MAKEOPTS}
# prevent circular depend #111455
$(has_version media-libs/giflib && urt_config gif GIF)
EOF
./Configure config/gentoo || die "config"
}
src_compile() {
tc-export AR RANLIB
emake CC=$(tc-getCC) -C lib buildlibso
emake CC=$(tc-getCC)
}
src_install() {
mkdir -p man-dest/man{1,3,5}
# this just installs it into some local dirs
make install || die
dobin bin/*
use static-libs && dolib.a lib/librle.a
dolib.so lib/librle.so
dosym librle.so /usr/$(get_libdir)/librle-0.0.0.so
insinto /usr/include
doins include/rle*.h
doman man-dest/man?/*.[135]
dodoc *-changes CHANGES* README blurb
}