Merge updates from master

This commit is contained in:
Repository mirror & CI
2021-02-15 07:22:36 +00:00
12 changed files with 261 additions and 4 deletions

View File

@@ -35,6 +35,8 @@ RDEPEND="
media-video/ffmpeg
media-video/mpv
net-misc/curl
>=dev-qt/qtquickcontrols-5.12:5
>=dev-qt/qtquickcontrols2-5.12:5
"
DEPEND="
${COMMON_DEPEND}

View File

@@ -35,6 +35,8 @@ RDEPEND="
media-video/ffmpeg
media-video/mpv
net-misc/curl
>=dev-qt/qtquickcontrols-5.15:5
>=dev-qt/qtquickcontrols2-5.15:5
"
DEPEND="
${COMMON_DEPEND}

View File

@@ -1 +1,2 @@
DIST usockets-0.6.0_p20210126.tar.gz 57764 BLAKE2B 3ddcfaa684dec96a80f81424512bbd7a2fd8dd0724a0c20628aa76b5bb3e5b2177402b33feb8d046f3fa813288d3d3a5b8b18d7df8bd6a28b029162cdbe3b9ab SHA512 047b95a125b0a79ee4b301bb0c718aded6d6dbcafef64965ad6bcf14428b6569e67c2a9eb3d6d4bf3a2f4e2e46e978555507dec9047e6497823a880ae7deed03
DIST usockets-0.7.1.tar.gz 62337 BLAKE2B 84f4274e560fae5bd12d22c87d0c44234421939ec978218b094848506448b622d32648d6f5163e95abf956f18bd6e26ffc58e27403572e49295572fd0f8eed32 SHA512 06e5ae094fd07b623d65dfcb3168cf6dcd115fc41c8af1858527be6bef08cbfa432a87021c32e7b3c87d56662a32a971b08b3b2934e91b822cf68407951015ed

View File

@@ -0,0 +1,124 @@
diff --git a/Makefile b/Makefile
index 9b54cac..c31e575 100644
--- a/Makefile
+++ b/Makefile
@@ -1,60 +1,59 @@
+DESTDIR ?=
+
+prefix ?= /usr
+exec_prefix ?= $(prefix)
+LIB ?= lib
+libdir ?= $(exec_prefix)/$(LIB)
+includedir ?= $(exec_prefix)/include
+
+PKG_CONFIG ?= pkg-config
+
+VERSION ?= 0.0
+LIBTARGET = libusockets.so.$(VERSION)
+
+REQUIRES =
+COMMON_FLAGS = -Isrc
+
# WITH_OPENSSL=1 enables OpenSSL 1.1+ support or BoringSSL
# For now we need to link with C++ for OpenSSL support, but should be removed with time
ifeq ($(WITH_OPENSSL),1)
- override CFLAGS += -DLIBUS_USE_OPENSSL
- # With problems on macOS, make sure to pass needed LDFLAGS required to find these
- override LDFLAGS += -lssl -lcrypto -lstdc++
-else
- # WITH_WOLFSSL=1 enables WolfSSL 4.2.0 support (mutually exclusive with OpenSSL)
- ifeq ($(WITH_WOLFSSL),1)
- # todo: change these
- override CFLAGS += -DLIBUS_USE_WOLFSSL -I/usr/local/include
- override LDFLAGS += -L/usr/local/lib -lwolfssl
- else
- override CFLAGS += -DLIBUS_NO_SSL
- endif
+COMMON_FLAGS += -DLIBUS_USE_OPENSSL
+LDFLAGS += -lssl -lcrypto -lstdc++
+REQUIRES += libssl libcrypto
endif
# WITH_LIBUV=1 builds with libuv as event-loop
ifeq ($(WITH_LIBUV),1)
- override CFLAGS += -DLIBUS_USE_LIBUV
- override LDFLAGS += -luv
+COMMON_FLAGS += -DLIBUS_USE_LIBUV
+REQUIRES += libuv
endif
-# WITH_GCD=1 builds with libdispatch as event-loop
-ifeq ($(WITH_GCD),1)
- override CFLAGS += -DLIBUS_USE_GCD
- override LDFLAGS += -framework CoreFoundation
-endif
+CFLAGS += -std=c11 $(COMMON_FLAGS)
+CXXFLAGS += -std=c++17 $(COMMON_FLAGS)
-# WITH_ASAN builds with sanitizers
-ifeq ($(WITH_ASAN),1)
- override CFLAGS += -fsanitize=address -g
- override LDFLAGS += -fsanitize=address
-endif
-
-override CFLAGS += -std=c11 -Isrc
-override LDFLAGS += uSockets.a
-
-# By default we build the uSockets.a static library
default:
- rm -f *.o
- $(CC) $(CFLAGS) -flto -O3 -c src/*.c src/eventing/*.c src/crypto/*.c
-# For now we do rely on C++17 for OpenSSL support but we will be porting this work to C11
+ $(CC) $(CFLAGS) -fPIC -c src/*.c src/eventing/*.c src/crypto/*.c
ifeq ($(WITH_OPENSSL),1)
- $(CXX) $(CXXFLAGS) -std=c++17 -flto -O3 -c src/crypto/*.cpp
+ $(CXX) $(CXXFLAGS) -fPIC -c src/crypto/*.cpp
endif
- $(AR) rvs uSockets.a *.o
-
-# Builds all examples
-.PHONY: examples
-examples: default
- for f in examples/*.c; do $(CC) -flto -O3 $(CFLAGS) -o $$(basename "$$f" ".c") "$$f" $(LDFLAGS); done
-
-swift_examples:
- swiftc -O -I . examples/swift_http_server/main.swift uSockets.a -o swift_http_server
+ $(AR) rvs libusockets.a *.o
+ $(CC) -shared -o $(LIBTARGET) *.o -Wl,-soname,$(LIBTARGET) `$(PKG_CONFIG) --libs $(REQUIRES)` $(LDFLAGS)
+ sed -e "s:@PREFIX@:$(prefix):" -e "s:@REQUIRES@:$(REQUIRES):" \
+ -e "s:@LIB@:$(LIB):" -e "s:@VERSION@:$(VERSION):" libusockets.pc.in > libusockets.pc
+
+install:
+ install -d "$(DESTDIR)$(libdir)/pkgconfig" "$(DESTDIR)$(includedir)"
+ install -m 644 src/libusockets.h "$(DESTDIR)$(includedir)/"
+ install -m 755 $(LIBTARGET) "$(DESTDIR)$(libdir)"
+ ln -sf $(LIBTARGET) "$(DESTDIR)$(libdir)/libusockets.so"
+ install -m 755 libusockets.a "$(DESTDIR)$(libdir)/"
+ install -m 644 libusockets.pc "$(DESTDIR)$(libdir)/pkgconfig/"
clean:
rm -f *.o
rm -f *.a
+ rm -f *.so
rm -rf .certs
+ rm -f libusockets.pc
+
+.PHONY: default install clean
diff --git a/libusockets.pc.in b/libusockets.pc.in
new file mode 100644
index 0000000..b818020
--- /dev/null
+++ b/libusockets.pc.in
@@ -0,0 +1,12 @@
+prefix=@PREFIX@
+libdir=${prefix}/@LIB@
+includedir=${prefix}/include
+
+Name: uSockets
+Version: @VERSION@
+Description: eventing, networking and crypto for async applications.
+URL: https://github.com/uNetworking/uSockets
+
+Cflags: -I${includedir}
+Libs: -L${libdir} -lusockets
+Requires.private: @REQUIRES@

View File

@@ -0,0 +1,49 @@
# Copyright 2019-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit toolchain-funcs
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 static-libs"
DEPEND="
libuv? ( dev-libs/libuv[static-libs?] )
ssl? ( >=dev-libs/openssl-1.1.0[static-libs?] )
"
RDEPEND="${DEPEND}"
PATCHES=(
"${FILESDIR}/${PN}-0.7.1-Makefile.patch"
)
src_configure() {
tc-export CC CXX
export VERSION="${PV%_*}" \
LIB="$(get_libdir)" \
WITH_OPENSSL="$(usex ssl 1 0)"
WITH_LIBUV="$(usex libuv 1 0)"
default
}
src_install() {
default
einstalldocs
if ! use static-libs; then
rm -f "${ED}/usr/$(get_libdir)/libusockets.a" || die
fi
}

View File

@@ -12,10 +12,9 @@ if [[ ${PV} == 9999 ]]; then
inherit git-r3
EGIT_REPO_URI="https://github.com/uNetworking/uSockets.git"
else
COMMIT=45a70140b191e74c66301e5fefdacbd298b8c518
SRC_URI="https://github.com/uNetworking/uSockets/archive/${COMMIT}.tar.gz -> ${P}.tar.gz"
SRC_URI="https://github.com/uNetworking/uSockets/archive/v${PV}.tar.gz -> ${P}.tar.gz"
KEYWORDS="~amd64 ~arm64 ~x86"
S="${WORKDIR}/uSockets-${COMMIT}"
S="${WORKDIR}/uSockets-${PV}"
fi
LICENSE="Apache-2.0"
@@ -29,7 +28,7 @@ DEPEND="
RDEPEND="${DEPEND}"
PATCHES=(
"${FILESDIR}/${PN}-0.6.0-Makefile.patch"
"${FILESDIR}/${PN}-0.7.1-Makefile.patch"
)
src_configure() {

View File

@@ -0,0 +1 @@
DIST btrfs-heatmap-9.tar.gz 661880 BLAKE2B e714dc3d54c099d74aa811a36b25097b32a11de20a92a92e1e9380ad3019cb9d260a1061aee222e800fd0a0718d80810810674d67cd202a7ac3a3abc4b181658 SHA512 0eeeed72ee26d469577c7c8671c2bf93d258537aa606d7d92e866982136b0ebc151419fbd59bc062062f9537651b4a93afc06d1c804a611a89253fc592f3c996

View File

@@ -0,0 +1,32 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
PYTHON_COMPAT=( python3_{6,7,8,9} )
inherit python-single-r1
DESCRIPTION="Python 3 script to draw a heatmap of a btrfs filesystem"
HOMEPAGE="https://github.com/knorrie/btrfs-heatmap"
SRC_URI="https://github.com/knorrie/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64"
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
RDEPEND="
${PYTHON_DEPS}
$(python_gen_cond_dep '
>=sys-fs/python-btrfs-12[${PYTHON_MULTI_USEDEP}]
')"
DEPEND="${RDEPEND}"
src_install()
{
dobin btrfs-heatmap
python_fix_shebang "${ED}"/usr/bin/btrfs-heatmap
default
}

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM 'http://www.gentoo.org/dtd/metadata.dtd'>
<pkgmetadata>
<maintainer type="person">
<email>gentoo-guru@steev.me.uk</email>
<name>Steven Davies</name>
</maintainer>
<longdescription>The btrfs heatmap script creates a visualization of how a btrfs filesystem is using the underlying disk space of the block devices that are added to it.</longdescription>
</pkgmetadata>

View File

@@ -0,0 +1 @@
DIST python-btrfs-12.tar.gz 92369 BLAKE2B bc899900c4d436ca4ad940247ac6edc9022f09f604c4c9b78288065e8950a9ba86147d1d9992e2410edb9907a2e7748467b1ae92d33b21c6e7ab9149c84431e3 SHA512 93d7ac4b0c8cc62e5a89b0ffd269695c2c52a4111385ec00d2cb467b6d1c35e59a450c128ca4ddedf91955f51962092ec2e2431ce3d9243d25beeaa2d2ec38ac

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM 'http://www.gentoo.org/dtd/metadata.dtd'>
<pkgmetadata>
<maintainer type="person">
<email>gentoo-guru@steev.me.uk</email>
<name>Steven Davies</name>
</maintainer>
<longdescription>A Python 3 library that provides ways to interact programmatically with an online btrfs file system. It provides a pure python shadow implementation of data structures used in btrfs together with convenient wrappers around the collection of kernel functions that are available in the btrfs kernel API. Using them, we can examine the secret inner world of a btrfs file system for educational purposes.</longdescription>
</pkgmetadata>

View File

@@ -0,0 +1,28 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
PYTHON_COMPAT=( python3_{6,7,8,9} )
DISTUTILS_USE_SETUPTOOLS="no"
inherit distutils-r1
DESCRIPTION="Python 3 module to inspect btrfs filesystems"
HOMEPAGE="https://github.com/knorrie/python-btrfs"
SRC_URI="https://github.com/knorrie/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64"
IUSE="examples"
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
RDEPEND="${PYTHON_DEPS}"
DEPEND="${RDEPEND}"
python_install_all() {
use examples && local DOCS=( README.md CHANGES examples )
distutils-r1_python_install_all
}