From da92c0e1ca2be53df4a7889090656b428869d140 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Thu, 15 Apr 2021 15:46:40 +0200 Subject: [PATCH] Ports: Build shared libraries for a few more ports This manually builds shared libraries for a bunch of ports. Using libtool would be preferable but that's currently broken so I'm linking the shared libraries manually. --- Ports/SDL2_gfx/package.sh | 5 +++++ Ports/SDL2_image/package.sh | 2 ++ Ports/SDL2_mixer/package.sh | 2 ++ Ports/SDL2_ttf/package.sh | 5 +++++ Ports/libiconv/package.sh | 1 - Ports/libjpeg/package.sh | 6 ++++++ Ports/libogg/package.sh | 6 ++++++ Ports/libpng/package.sh | 7 +++++++ Ports/libvorbis/package.sh | 10 ++++++++++ Ports/zlib/package.sh | 8 +++++++- 10 files changed, 50 insertions(+), 2 deletions(-) diff --git a/Ports/SDL2_gfx/package.sh b/Ports/SDL2_gfx/package.sh index 5a4fa235d7..70883aea64 100755 --- a/Ports/SDL2_gfx/package.sh +++ b/Ports/SDL2_gfx/package.sh @@ -6,3 +6,8 @@ files="https://downloads.sourceforge.net/project/sdl2gfx/SDL2_gfx-${version}.tar depends="SDL2" useconfigure=true configopts="--with-sdl-prefix=${SERENITY_BUILD_DIR}/Root/usr/local" + +install() { + run make install DESTDIR=$DESTDIR $installopts + run ${CC} -shared -o $DESTDIR/usr/local/lib/libSDL2_gfx.so -Wl,--whole-archive $DESTDIR/usr/local/lib/libSDL2_gfx.a -Wl,--no-whole-archive +} diff --git a/Ports/SDL2_image/package.sh b/Ports/SDL2_image/package.sh index 4078ec4c2f..234fbba2da 100755 --- a/Ports/SDL2_image/package.sh +++ b/Ports/SDL2_image/package.sh @@ -19,4 +19,6 @@ build() { install() { run make -k DESTDIR="${SERENITY_BUILD_DIR}/Root" install + ${CC} -shared -o $DESTDIR/usr/local/lib/libSDL2_image.so -Wl,--whole-archive $DESTDIR/usr/local/lib/libSDL2_image.a -Wl,--no-whole-archive + rm -f $DESTDIR/usr/local/lib/libSDL2_image.la } diff --git a/Ports/SDL2_mixer/package.sh b/Ports/SDL2_mixer/package.sh index 7d53e83ced..80e2300306 100755 --- a/Ports/SDL2_mixer/package.sh +++ b/Ports/SDL2_mixer/package.sh @@ -20,4 +20,6 @@ build() { install() { run make -k DESTDIR="${SERENITY_BUILD_DIR}/Root" install + ${CC} -shared -o $DESTDIR/usr/local/lib/libSDL2_mixer.so -Wl,--whole-archive $DESTDIR/usr/local/lib/libSDL2_mixer.a -Wl,--no-whole-archive -Wl,--no-as-needed -lvorbis -lvorbisfile + rm -f $DESTDIR/usr/local/lib/libSDL2_mixer.la } diff --git a/Ports/SDL2_ttf/package.sh b/Ports/SDL2_ttf/package.sh index 08a3bdcd3c..61f35dd8eb 100755 --- a/Ports/SDL2_ttf/package.sh +++ b/Ports/SDL2_ttf/package.sh @@ -13,3 +13,8 @@ configure() { FT2_CFLAGS="-I${SERENITY_BUILD_DIR}/Root/usr/local/include/freetype2" \ LIBS="-lgui -lgfx -lipc -lcore -lcompress" } + +install() { + run make install DESTDIR=$DESTDIR $installopts + run ${CC} -shared -o $DESTDIR/usr/local/lib/libSDL2_ttf.so -Wl,--whole-archive $DESTDIR/usr/local/lib/libSDL2_ttf.a -Wl,--no-whole-archive +} diff --git a/Ports/libiconv/package.sh b/Ports/libiconv/package.sh index 9354854dd5..b9fb916453 100755 --- a/Ports/libiconv/package.sh +++ b/Ports/libiconv/package.sh @@ -13,5 +13,4 @@ auth_opts="--keyring ./gnu-keyring.gpg libiconv-${version}.tar.gz.sig" install() { run make DESTDIR=$DESTDIR $installopts install run ${SERENITY_ARCH}-pc-serenity-gcc -shared -o $DESTDIR/usr/local/lib/libiconv.so -Wl,--whole-archive $DESTDIR/usr/local/lib/libiconv.a -Wl,--no-whole-archive - run ln -sf ../local/lib/libiconv.so $DESTDIR/usr/lib/libiconv.so } diff --git a/Ports/libjpeg/package.sh b/Ports/libjpeg/package.sh index 3928c395e0..898549fe6c 100755 --- a/Ports/libjpeg/package.sh +++ b/Ports/libjpeg/package.sh @@ -5,3 +5,9 @@ useconfigure=true files="https://ijg.org/files/jpegsrc.v${version}.tar.gz jpeg-${version}.tar.gz ad7e40dedc268f97c44e7ee3cd54548a" auth_type="md5" workdir="jpeg-$version" + +install() { + run make DESTDIR=$DESTDIR $installopts install + ${CC} -shared -o $DESTDIR/usr/local/lib/libjpeg.so -Wl,--whole-archive $DESTDIR/usr/local/lib/libjpeg.a -Wl,--no-whole-archive + rm -f $DESTDIR/usr/local/lib/libjpeg.la +} diff --git a/Ports/libogg/package.sh b/Ports/libogg/package.sh index 97fcbd22c4..ec203ce436 100755 --- a/Ports/libogg/package.sh +++ b/Ports/libogg/package.sh @@ -3,3 +3,9 @@ port=libogg version=1.3.4 useconfigure=true files="https://github.com/xiph/ogg/releases/download/v${version}/libogg-${version}.tar.gz libogg-${version}.tar.gz" + +install() { + run make DESTDIR=$DESTDIR $installopts install + ${CC} -shared -o $DESTDIR/usr/local/lib/libogg.so -Wl,--whole-archive $DESTDIR/usr/local/lib/libogg.a -Wl,--no-whole-archive + rm -f $DESTDIR/usr/local/lib/libogg.la +} diff --git a/Ports/libpng/package.sh b/Ports/libpng/package.sh index c8c5902d44..1bad108b31 100755 --- a/Ports/libpng/package.sh +++ b/Ports/libpng/package.sh @@ -4,3 +4,10 @@ version=1.6.37 useconfigure=true files="https://download.sourceforge.net/libpng/libpng-${version}.tar.gz libpng-${version}.tar.gz" depends="zlib" + +install() { + run make DESTDIR=$DESTDIR $installopts install + ${CC} -shared -o $DESTDIR/usr/local/lib/libpng16.so -Wl,--whole-archive $DESTDIR/usr/local/lib/libpng16.a -Wl,--no-whole-archive -lz + ln -sf libpng16.so $DESTDIR/usr/local/lib/libpng.so + rm -f $DESTDIR/usr/local/lib/libpng16.la $DESTDIR/usr/local/lib/libpng.la +} diff --git a/Ports/libvorbis/package.sh b/Ports/libvorbis/package.sh index 84dfa1d2ee..80fd293b41 100755 --- a/Ports/libvorbis/package.sh +++ b/Ports/libvorbis/package.sh @@ -4,3 +4,13 @@ version=1.3.7 useconfigure=true files="https://github.com/xiph/vorbis/releases/download/v${version}/libvorbis-${version}.tar.gz libvorbis-${version}.tar.gz" depends=libogg + +install() { + run make DESTDIR=$DESTDIR $installopts install + ${CC} -shared -o $DESTDIR/usr/local/lib/libvorbis.so -Wl,--whole-archive $DESTDIR/usr/local/lib/libvorbis.a -Wl,--no-whole-archive -logg + rm -f $DESTDIR/usr/local/lib/libvorbis.la + ${CC} -shared -o $DESTDIR/usr/local/lib/libvorbisenc.so -Wl,--whole-archive $DESTDIR/usr/local/lib/libvorbisenc.a -Wl,--no-whole-archive -lvorbis + rm -f $DESTDIR/usr/local/lib/libvorbisenc.la + ${CC} -shared -o $DESTDIR/usr/local/lib/libvorbisfile.so -Wl,--whole-archive $DESTDIR/usr/local/lib/libvorbisfile.a -Wl,--no-whole-archive -lvorbis + rm -f $DESTDIR/usr/local/lib/libvorbisfile.la +} diff --git a/Ports/zlib/package.sh b/Ports/zlib/package.sh index d1fa5292f1..d174531bdb 100755 --- a/Ports/zlib/package.sh +++ b/Ports/zlib/package.sh @@ -10,5 +10,11 @@ auth_import_key="783FCD8E58BCAFBA" auth_opts="zlib-${version}.tar.gz.asc" configure() { - run ./configure --static + run ./configure +} + +install() { + run make DESTDIR=$DESTDIR $installopts install + ${CC} -shared -o $DESTDIR/usr/local/lib/libz.so -Wl,--whole-archive $DESTDIR/usr/local/lib/libz.a -Wl,--no-whole-archive + rm -f $DESTDIR/usr/local/lib/libz.la }