From d8e171b8c94c7e15964fa4de375b820a1bf1f4a1 Mon Sep 17 00:00:00 2001
From: maciozo <maciozo@maciozo.com>
Date: Sat, 4 May 2019 22:26:02 +0100
Subject: [PATCH] [WIP] New package: libircclient-1.10

---
 common/shlibs                                 | 18 +++++-
 srcpkgs/libircclient-devel                    |  1 +
 srcpkgs/libircclient/files/libircclient.pc    |  7 +++
 .../patches/build_shared_and_static.patch     | 11 ++++
 srcpkgs/libircclient/template                 | 62 +++++++++++++++++++
 5 files changed, 96 insertions(+), 3 deletions(-)
 create mode 120000 srcpkgs/libircclient-devel
 create mode 100644 srcpkgs/libircclient/files/libircclient.pc
 create mode 100644 srcpkgs/libircclient/patches/build_shared_and_static.patch
 create mode 100644 srcpkgs/libircclient/template

diff --git a/common/shlibs b/common/shlibs
index 5bdd8d9832a..083326a331b 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -72,7 +72,7 @@ libncurses.so.6 ncurses-libs-6.0_1 ignore
 libncurses.so.5 ncurses-libs-6.0_1 ignore
 libncursesw.so.6 ncurses-libs-5.8_1 ignore
 libncursesw.so.5 ncurses-libs-5.8_1 ignore
-libnetcdf.so.13 netcdf-4.6.0_2
+libnetcdf.so.15 netcdf-4.7.0_1
 libformw.so.5 ncurses-libs-5.9_13 ignore
 libformw.so.6 ncurses-libs-5.8_1 ignore
 libpanelw.so.5 ncurses-libs-5.9_13 ignore
@@ -401,7 +401,7 @@ libavutil.so.56 libavutil-4.0_1
 libavfilter.so.7 libavfilter-4.0_1
 libSDL-1.2.so.0 SDL-1.2.14_1
 libSDL_image-1.2.so.0 SDL_image-1.2.10_1
-libx264.so.152 x264-20180119.2245_1
+libx264.so.157 x264-20190507.2245_1
 libxvidcore.so.4 xvidcore-1.2.2_1
 libtag.so.1 taglib-1.6.1_1
 libtag-extras.so.1 taglib-extras-1.0.1_1
@@ -2841,7 +2841,7 @@ libyaz_icu.so.5 yaz-5.23.1_1
 libyaz.so.5 yaz-5.23.1_1
 libyaz_server.so.5 yaz-5.23.1_1
 libgcab-1.0.so.0 gcab-0.7_1
-libliveMedia.so.65 live555-2018.12.14_1
+libliveMedia.so.66 live555-2019.05.03_1
 libgroupsock.so.8 live555-2018.12.14_1
 libUsageEnvironment.so.3 live555-2018.12.14_1
 libBasicUsageEnvironment.so.1 live555-2018.12.14_1
@@ -3450,3 +3450,15 @@ liboblibs.so.0.0 oblibs-0.0.1.1_1
 libaal-1.0.so.7 libaal-1.0.7_1
 libaal-minimal.so.0 libaal-1.0.7_1
 libcli.so.1.9 libcli-1.9.8.4_1
+libaddress_sorting.so.7 grpc-1.19.1_1
+libgpr.so.7 grpc-1.19.1_1
+libgrpc++.so.1 grpc-1.19.1_1
+libgrpc++_cronet.so.1 grpc-1.19.1_1
+libgrpc++_error_details.so.1 grpc-1.19.1_1
+libgrpc++_reflection.so.1 grpc-1.19.1_1
+libgrpc++_unsecure.so.1 grpc-1.19.1_1
+libgrpc.so.7 grpc-1.19.1_1
+libgrpc_cronet.so.7 grpc-1.19.1_1
+libgrpc_unsecure.so.7 grpc-1.19.1_1
+libgrpcpp_channelz.so.1 grpc-1.19.1_1
+libircclient.so.1 libircclient-1.10_1
diff --git a/srcpkgs/libircclient-devel b/srcpkgs/libircclient-devel
new file mode 120000
index 00000000000..2dfa3a687e7
--- /dev/null
+++ b/srcpkgs/libircclient-devel
@@ -0,0 +1 @@
+libircclient
\ No newline at end of file
diff --git a/srcpkgs/libircclient/files/libircclient.pc b/srcpkgs/libircclient/files/libircclient.pc
new file mode 100644
index 00000000000..ca92609cb9c
--- /dev/null
+++ b/srcpkgs/libircclient/files/libircclient.pc
@@ -0,0 +1,7 @@
+prefix=/usr
+libdir=${prefix}/lib
+
+Name: libircclient
+Description: IRC client library
+Version: 1.10
+Libs: -L${libdir} -lircclient -lcrypto -lssl
diff --git a/srcpkgs/libircclient/patches/build_shared_and_static.patch b/srcpkgs/libircclient/patches/build_shared_and_static.patch
new file mode 100644
index 00000000000..b1bd31e87f1
--- /dev/null
+++ b/srcpkgs/libircclient/patches/build_shared_and_static.patch
@@ -0,0 +1,11 @@
+--- src/Makefile.in.old    2019-05-09 17:41:04.886554931 +0100
++++ src/Makefile.in        2019-05-09 17:40:36.072963121 +0100
+@@ -9,7 +9,7 @@
+
+ OBJS = libircclient.o
+
+-all:   @TARGET@
++all: libircclient.so libircclient.a
+
+ static:        libircclient.a
+ shared: libircclient.so
diff --git a/srcpkgs/libircclient/template b/srcpkgs/libircclient/template
new file mode 100644
index 00000000000..be5f6e6845a
--- /dev/null
+++ b/srcpkgs/libircclient/template
@@ -0,0 +1,62 @@
+# Template file for 'libircclient'
+pkgname=libircclient
+version=1.10
+revision=1
+build_style=gnu-configure
+configure_args="--enable-openssl --enable-ipv6 --enable-shared"
+makedepends="libressl-devel"
+short_desc="IRC client library"
+maintainer="maciozo@maciozo.com <maciozo@maciozo.com>"
+license="LGPL-3.0-or-later"
+homepage="https://www.ulduzsoft.com/linux/libircclient/"
+distfiles="https://netix.dl.sourceforge.net/project/libircclient/libircclient/${version}/libircclient-${version}.tar.gz"
+checksum=bbb26f3af348b252c5204917a7f91cfdf172f1b6afbf4df1e561b03e20503c2d
+
+case "$XBPS_TARGET_MACHINE" in
+	*-musl)	depends+=" musl-devel";;
+	*) depends+=" glibc-devel";;
+esac
+
+do_install() {
+	vmkdir usr/lib
+	vcopy src/*.so /usr/lib
+	vcopy src/*.a /usr/lib
+	
+	# Generate versioned shlib link (libircclient.so.x -> libircclient.so)
+	
+	for _sharedlib in ${PKGDESTDIR}/usr/lib/*.so; do
+		echo $(basename ${_sharedlib})
+		_soname=$(objdump -p ${_sharedlib} | awk '/SONAME/ {print $2}')
+		ln -s $(basename ${_sharedlib}) ${PKGDESTDIR}/usr/lib/${_soname}
+	done
+	
+	vmkdir usr/include
+	vcopy include/* /usr/include
+	
+	vmkdir usr/share/doc/${pkgname}
+	vcopy doc/*.rst /usr/share/doc/${pkgname}
+	
+	vmkdir usr/share/doc/${pkgname}/sources
+	vcopy doc/sources/*.rst /usr/share/doc/${pkgname}/sources
+}
+
+libircclient-devel_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+
+	pkg_install() {
+		vmkdir usr/share/doc/${pkgname}
+		vmove usr/share/doc/${sourcepkg}/*
+
+		vmkdir usr/lib/pkgconfig
+		vcopy ${FILESDIR}/libircclient.pc /usr/lib/pkgconfig/
+
+		vmkdir usr/include
+		vmove usr/include
+		
+		vmkdir usr/lib
+		vmove "usr/lib/*.a"
+		
+		vman man/libircclient.1
+	}
+}
