public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/proj/guru:master commit in: dev-cpp/usockets/, dev-cpp/usockets/files/
@ 2020-06-14 10:39 Andrew Ammerlaan
  0 siblings, 0 replies; only message in thread
From: Andrew Ammerlaan @ 2020-06-14 10:39 UTC (permalink / raw
  To: gentoo-commits

commit:     7b7e834b9f32518331782ed112b2ce21233e29a0
Author:     Aisha Tammy <gentoo <AT> aisha <DOT> cc>
AuthorDate: Sat Jun 13 14:20:04 2020 +0000
Commit:     Andrew Ammerlaan <andrewammerlaan <AT> riseup <DOT> net>
CommitDate: Sat Jun 13 14:20:04 2020 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=7b7e834b

dev-cpp/usockets: update to latest + live

Package-Manager: Portage-2.3.99, Repoman-2.3.22
Signed-off-by: Aisha Tammy <gentoo <AT> aisha.cc>

 dev-cpp/usockets/Manifest                      |  1 +
 dev-cpp/usockets/files/usockets-Makefile.patch | 54 +++++++++++++++----------
 dev-cpp/usockets/usockets-0.4.0.ebuild         | 56 ++++++++++++++++++++++++++
 dev-cpp/usockets/usockets-9999.ebuild          | 56 ++++++++++++++++++++++++++
 4 files changed, 145 insertions(+), 22 deletions(-)

diff --git a/dev-cpp/usockets/Manifest b/dev-cpp/usockets/Manifest
index ddf126a..7b538ac 100644
--- a/dev-cpp/usockets/Manifest
+++ b/dev-cpp/usockets/Manifest
@@ -1 +1,2 @@
 DIST usockets-0.3.5.tar.gz 47939 BLAKE2B fc73f44adc19bd31b78832084a64f2ba3e7b463232056bf67370cf116bf43a0e63734a26fcc833b3d5f917c671cc6fb1983d52c4c92e2f7aae81500df5c5d12d SHA512 a76a469d10e10592b651aa6ccc5d25dfa89015d6b74c8d2268df8eee4206d9194de82ac79079f06f5277803ecfa13cf4bd9ff29bf0ccc98b6ee64798aada796e
+DIST usockets-0.4.0.tar.gz 48367 BLAKE2B 025b83bd1f9778c469ad29bde0f8cab7fbc5f9b86e5cd97261b9aee77c2d26a67d22a185a17011e9c067acb23e0341c4112a00dbf270510013e1e863b5678ff1 SHA512 c480c6fd4a87ebe7d9db1928185075d52da63482f4ecc37f684fe10654e92de540badf47d2ab8e6021266a87308496189b39e95830d11924da0023a222decf2d

diff --git a/dev-cpp/usockets/files/usockets-Makefile.patch b/dev-cpp/usockets/files/usockets-Makefile.patch
index 8d10a20..a51f8b1 100644
--- a/dev-cpp/usockets/files/usockets-Makefile.patch
+++ b/dev-cpp/usockets/files/usockets-Makefile.patch
@@ -1,52 +1,62 @@
 diff --git a/Makefile b/Makefile
-index fa6e2ff..9fdcf47 100644
+index fa6e2ff..529ed74 100644
 --- a/Makefile
 +++ b/Makefile
 @@ -1,3 +1,14 @@
 +DESTDIR ?=
 +
-+prefix ?= "/usr/local"
-+exec_prefix	?=	"$(prefix)"
++prefix ?=	"/usr/local"
++exec_prefix ?=	"$(prefix)"
 +libdir ?=	"$(exec_prefix)/lib"
 +includedir?=	"$(exec_prefix)/include/uSockets"
 +
-+VERSION = 0.3.5
-+LIBTARGET = libusockets.so
++# OpenBSD specific library version
++LIBTARGET =	libusockets.so.$(LIBusockets_VERSION)
 +
 +
  # WITH_OPENSSL=1 enables OpenSSL 1.1+ support
  ifeq ($(WITH_OPENSSL),1)
  	override CFLAGS += -DLIBUS_USE_OPENSSL
-@@ -35,8 +46,27 @@ endif
+@@ -33,13 +44,33 @@ ifeq ($(WITH_ASAN),1)
+ endif
+ 
  override CFLAGS += -std=c11 -Isrc
- override LDFLAGS += uSockets.a
+-override LDFLAGS += uSockets.a
  
 -# By default we build the uSockets.a static library
-+# By default we build the libusockets.so shared library
- default:
+-default:
++static:
+ 	rm -f *.o
+-	$(CC) $(CFLAGS) -flto -O3 -c src/*.c src/eventing/*.c src/crypto/*.c
+-	$(AR) rvs uSockets.a *.o
++	$(CC) $(CFLAGS) -c src/*.c src/eventing/*.c src/crypto/*.c
++	$(AR) rvs libusockets.a *.o
++
++dynamic:
 +	rm -f *.o
-+	$(CC) $(CFLAGS) $(CPPFLAGS) -fpic -c src/*.c src/eventing/*.c src/crypto/*.c
-+	$(CC) -shared -Wl,-soname,libusockets.so -o $(LIBTARGET) *.o
++	$(CC) -fPIC -c src/*.c src/eventing/*.c src/crypto/*.c $(CFLAGS)
++	$(CC) -shared -fPIC -Wl,-soname,$(LIBTARGET) $(CFLAGS) -o $(LIBTARGET) *.o $(LDFLAGS)
++
++default: static dynamic
 +
-+install: default
++install:
 +	# install the folders needed  (making sure that the exist)
 +	install -d "$(DESTDIR)$(libdir)" \
 +	"$(DESTDIR)$(includedir)/internal/eventing" \
 +	"$(DESTDIR)$(includedir)/internal/networking"
-+	# install the library first, while making sure that the symlink is updated
-+	install -m 755 $(LIBTARGET) "$(DESTDIR)$(libdir)/$(LIBTARGET).$(VERSION)"
-+	@ cd "$(DESTDIR)$(libdir)" && ln -snf "$(LIBTARGET).$(VERSION)" "$(LIBTARGET)"
++	# OpenBSD specific library version
++	install -m 755 $(LIBTARGET) "$(DESTDIR)$(libdir)/"
++	# install static library
++	install -m 755 libusockets.a "$(DESTDIR)$(libdir)/"
 +	# we also install all the header files
-+	install -m 644 src/*.h "$(DESTDIR)$(includedir)/"
++	install  src/*.h "$(DESTDIR)$(includedir)/"
 +	install -m 644 src/internal/*.h "$(DESTDIR)$(includedir)/internal/"
 +	install -m 644 src/internal/eventing/*.h "$(DESTDIR)$(includedir)/internal/eventing/"
 +	install -m 644 src/internal/networking/*.h "$(DESTDIR)$(includedir)/internal/networking/"
-+
-+static:
- 	rm -f *.o
- 	$(CC) $(CFLAGS) -flto -O3 -c src/*.c src/eventing/*.c src/crypto/*.c
- 	$(AR) rvs uSockets.a *.o
-@@ -52,4 +82,5 @@ swift_examples:
+ 
+ # Builds all examples
+ .PHONY: examples
+@@ -52,4 +83,5 @@ swift_examples:
  clean:
  	rm -f *.o
  	rm -f *.a

diff --git a/dev-cpp/usockets/usockets-0.4.0.ebuild b/dev-cpp/usockets/usockets-0.4.0.ebuild
new file mode 100644
index 0000000..0b4a1f0
--- /dev/null
+++ b/dev-cpp/usockets/usockets-0.4.0.ebuild
@@ -0,0 +1,56 @@
+# Copyright 2019-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit multilib
+
+DESCRIPTION="tiny eventing, networking & crypto for async applications"
+HOMEPAGE="https://github.com/uNetworking/uSockets"
+
+if [[ ${PV} == 9999 ]]; then
+	inherit git-r3
+	EGIT_REPO_URI="https://github.com/uNetworking/uSockets.git"
+else
+	SRC_URI="https://github.com/uNetworking/uSockets/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+	KEYWORDS="~amd64 ~arm64 ~x86"
+	S="${WORKDIR}/uSockets-${PV}"
+fi
+
+LICENSE="Apache-2.0"
+SLOT="0"
+IUSE="libuv +ssl libressl static-libs"
+
+DEPEND="ssl? (
+		libressl? ( >=dev-libs/libressl-3.0.0:=[static-libs?] )
+		!libressl? ( >=dev-libs/openssl-1.1.0:=[static-libs?] )
+	)
+	libuv? ( dev-libs/libuv[static-libs?] )
+"
+BDEPEND="${DEPEND}"
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+	"${FILESDIR}/usockets-Makefile.patch"
+)
+
+src_compile() {
+	# the Makefile uses environment variables
+	emake -j1 \
+		  LIBusockets_VERSION=${PV} \
+		  WITH_OPENSSL=$(usex ssl 1 0) \
+		  WITH_LIBUV=$(usex libuv 1 0) \
+		  default
+}
+
+src_install() {
+	emake -j1 \
+		  libdir="/usr/$(get_libdir)" \
+		  prefix="/usr" DESTDIR="${D}" \
+		  LIBusockets_VERSION=${PV} \
+		  install
+	einstalldocs
+	if ! use static-libs; then
+		rm "${D}/usr/$(get_libdir)/libusockets.a" || die
+	fi
+}

diff --git a/dev-cpp/usockets/usockets-9999.ebuild b/dev-cpp/usockets/usockets-9999.ebuild
new file mode 100644
index 0000000..0b4a1f0
--- /dev/null
+++ b/dev-cpp/usockets/usockets-9999.ebuild
@@ -0,0 +1,56 @@
+# Copyright 2019-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit multilib
+
+DESCRIPTION="tiny eventing, networking & crypto for async applications"
+HOMEPAGE="https://github.com/uNetworking/uSockets"
+
+if [[ ${PV} == 9999 ]]; then
+	inherit git-r3
+	EGIT_REPO_URI="https://github.com/uNetworking/uSockets.git"
+else
+	SRC_URI="https://github.com/uNetworking/uSockets/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+	KEYWORDS="~amd64 ~arm64 ~x86"
+	S="${WORKDIR}/uSockets-${PV}"
+fi
+
+LICENSE="Apache-2.0"
+SLOT="0"
+IUSE="libuv +ssl libressl static-libs"
+
+DEPEND="ssl? (
+		libressl? ( >=dev-libs/libressl-3.0.0:=[static-libs?] )
+		!libressl? ( >=dev-libs/openssl-1.1.0:=[static-libs?] )
+	)
+	libuv? ( dev-libs/libuv[static-libs?] )
+"
+BDEPEND="${DEPEND}"
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+	"${FILESDIR}/usockets-Makefile.patch"
+)
+
+src_compile() {
+	# the Makefile uses environment variables
+	emake -j1 \
+		  LIBusockets_VERSION=${PV} \
+		  WITH_OPENSSL=$(usex ssl 1 0) \
+		  WITH_LIBUV=$(usex libuv 1 0) \
+		  default
+}
+
+src_install() {
+	emake -j1 \
+		  libdir="/usr/$(get_libdir)" \
+		  prefix="/usr" DESTDIR="${D}" \
+		  LIBusockets_VERSION=${PV} \
+		  install
+	einstalldocs
+	if ! use static-libs; then
+		rm "${D}/usr/$(get_libdir)/libusockets.a" || die
+	fi
+}


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-06-14 10:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-06-14 10:39 [gentoo-commits] repo/proj/guru:master commit in: dev-cpp/usockets/, dev-cpp/usockets/files/ Andrew Ammerlaan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox