summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Pipping <sping@gentoo.org>2020-12-05 15:48:39 +0100
committerSebastian Pipping <sping@gentoo.org>2020-12-05 16:01:18 +0100
commit73f5dc714de94558c1714e42f6e6233d64e92071 (patch)
tree4dbdbbb7ad9ae907daa7ed91dc8c6bfbe961feb6 /x11-plugins
parentnet-misc/frr: correct dependencies (diff)
downloadgentoo-73f5dc714de94558c1714e42f6e6233d64e92071.tar.gz
gentoo-73f5dc714de94558c1714e42f6e6233d64e92071.tar.bz2
gentoo-73f5dc714de94558c1714e42f6e6233d64e92071.zip
x11-plugins/lurch: Unbundle net-libs/libsignal-protocol-c
Signed-off-by: Sebastian Pipping <sping@gentoo.org> Package-Manager: Portage-3.0.0, Repoman-2.3.23
Diffstat (limited to 'x11-plugins')
-rw-r--r--x11-plugins/lurch/Manifest1
-rw-r--r--x11-plugins/lurch/files/lurch-0.6.8-axc-0.3.3-libsignal-protocol-c.patch91
-rw-r--r--x11-plugins/lurch/files/lurch-0.6.8-libsignal-protocol-c.patch92
-rw-r--r--x11-plugins/lurch/lurch-0.6.8-r2.ebuild76
4 files changed, 260 insertions, 0 deletions
diff --git a/x11-plugins/lurch/Manifest b/x11-plugins/lurch/Manifest
index 7bfc6cb7dff5..04316110470c 100644
--- a/x11-plugins/lurch/Manifest
+++ b/x11-plugins/lurch/Manifest
@@ -1,2 +1,3 @@
+DIST axc-0.3.3.tar.gz 39497 BLAKE2B 7f13f2ee6bb98fecc3ff5ddb726e19d412d588613be50e6666e8bfdcf248e842b97c00cccbc19fef55c0df50053e0b80539f0573dfa7a54a8c88725735382bc6 SHA512 9fe494eb4a264a31c137a4f21e4a53358d55f6f6b3bd2fab0fbe43c0e85f2372127a2a85d00d2e308f3785b30cf8161de3f696aaf71c232f594ef3c54b8f6771
DIST libomemo-0.7.0.tar.gz 23678 BLAKE2B 91b57f6c93d5f777996687ea0648d996950bc893314e4e3ee02973c70165a9e533ab6980a420bd270d7a4acaa45da7cf83b401b69e2b305b017a3fbb42d5b4d2 SHA512 f9843a35958e4a7930ed9e9f4bef1e765bd51721d6e79d2c092bad86d26f092d22d1cdd4df1c4017b9434bb84c33e226985136d35dfcbcf9b915eb3cae862fa5
DIST lurch-0.6.8.tar.gz 398267 BLAKE2B 23211e82b80e26105f0d62510dc321abdd818eae21dd9f3e24f6ab01458748df64283acb99371a8ece34248f06e9e04edd35da30c771f45779474b3b43c3a53d SHA512 8b93523049d05a00f1d7286ec9d0d8d03c7ae46793ac72ea08c0d12cb5193324be4805fb6278d6c0f906d9c63db9d7ce6ca2a21442236df51e0ee0b48de6ef1d
diff --git a/x11-plugins/lurch/files/lurch-0.6.8-axc-0.3.3-libsignal-protocol-c.patch b/x11-plugins/lurch/files/lurch-0.6.8-axc-0.3.3-libsignal-protocol-c.patch
new file mode 100644
index 000000000000..261c3ac57c5b
--- /dev/null
+++ b/x11-plugins/lurch/files/lurch-0.6.8-axc-0.3.3-libsignal-protocol-c.patch
@@ -0,0 +1,91 @@
+From d5c2d8902ec268a1e6f8a9f5bd6fabde1e8ddf6a Mon Sep 17 00:00:00 2001
+From: Sebastian Pipping <sebastian@pipping.org>
+Date: Thu, 3 Dec 2020 23:59:00 +0100
+Subject: [PATCH] axc: Use system's libsignal-protocol-c shared library
+
+---
+ Makefile | 26 ++++++++++----------------
+ 1 file changed, 10 insertions(+), 16 deletions(-)
+
+diff --git a/lib/axc/Makefile b/lib/axc/Makefile
+index 601e4fb..d08dd85 100644
+--- a/lib/axc/Makefile
++++ b/lib/axc/Makefile
+@@ -14,6 +14,9 @@ GLIB_LDFLAGS ?= $(shell $(PKG_CONFIG) --libs glib-2.0)
+ SQLITE3_CFLAGS ?= $(shell $(PKG_CONFIG) --cflags sqlite3)
+ SQLITE3_LDFLAGS ?= $(shell $(PKG_CONFIG) --libs sqlite3)
+
++LIBSIGNAL_PROTOCOL_C_CFLAGS ?= $(shell $(PKG_CONFIG) --cflags libsignal-protocol-c)
++LIBSIGNAL_PROTOCOL_C_LDFLAGS ?= $(shell $(PKG_CONFIG) --libs libsignal-protocol-c)
++
+ LIBGCRYPT_CONFIG ?= libgcrypt-config
+ LIBGCRYPT_LDFLAGS ?= $(shell $(LIBGCRYPT_CONFIG) --libs)
+
+@@ -24,26 +27,24 @@ TDIR = test
+ TFN = test_all
+ CDIR = coverage
+
+-AX_DIR=./lib/libsignal-protocol-c
+-AX_BDIR=$(AX_DIR)/build/src
+-AX_PATH=$(AX_BDIR)/libsignal-protocol-c.a
+-
+ PKGCFG_C=$(GLIB_CFLAGS) \
+ $(SQLITE3_CFLAGS) \
++ $(LIBSIGNAL_PROTOCOL_C_CFLAGS) \
+ $(LIBGCRYPT_CFLAGS)
+
+ PKGCFG_L=$(GLIB_LDFLAGS) \
+ $(SQLITE3_LDFLAGS) \
++ $(LIBSIGNAL_PROTOCOL_C_LDFLAGS) \
+ $(LIBGCRYPT_LDFLAGS)
+
+-HEADERS=-I$(AX_DIR)/src
++HEADERS=
+ CFLAGS += $(HEADERS) $(PKGCFG_C) -std=c11 -g -Wall -Wextra -Wpedantic \
+ -Wstrict-overflow -fno-strict-aliasing -funsigned-char \
+ -fno-builtin-memset
+ CPPFLAGS += -D_XOPEN_SOURCE=700 -D_BSD_SOURCE -D_POSIX_SOURCE -D_GNU_SOURCE -D_DEFAULT_SOURCE
+ TESTFLAGS=$(HEADERS) $(PKGCFG_C) -g -O0 --coverage
+ PICFLAGS=-fPIC $(CFLAGS)
+-LDFLAGS += -pthread -ldl $(PKGCFG_L) $(AX_PATH) -lm
++LDFLAGS += -pthread -ldl $(PKGCFG_L) -lm
+ LDFLAGS_T= -lcmocka $(LDFLAGS)
+
+ all: $(BDIR)/libaxc.a
+@@ -51,7 +52,7 @@ all: $(BDIR)/libaxc.a
+ $(BDIR):
+ $(MKDIR_P) $@
+
+-client: $(SDIR)/message_client.c $(BDIR)/axc_store.o $(BDIR)/axc_crypto.o $(BDIR)/axc.o $(AX_PATH)
++client: $(SDIR)/message_client.c $(BDIR)/axc_store.o $(BDIR)/axc_crypto.o $(BDIR)/axc.o
+ $(MKDIR_P) $@
+ $(CC) $(CPPFLAGS) $(CFLAGS) $^ -o $@/$@.o $(LDFLAGS)
+
+@@ -73,15 +74,8 @@ $(BDIR)/libaxc.a: $(BDIR)/axc.o $(BDIR)/axc_crypto.o $(BDIR)/axc_store.o
+ $(BDIR)/libaxc-nt.a: $(BDIR)/axc-nt.o $(BDIR)/axc_crypto.o $(BDIR)/axc_store.o
+ $(AR) rcs $@ $^
+
+-$(AX_PATH):
+- cd $(AX_DIR) && \
+- $(MKDIR_P) build && \
+- cd build && \
+- $(CMAKE) $(CMAKE_FLAGS) .. && \
+- $(MAKE)
+-
+ .PHONY: test
+-test: $(AX_PATH) test_store test_client
++test: test_store test_client
+
+ .PHONY: test_store
+ test_store: $(SDIR)/axc_store.c $(SDIR)/axc_crypto.c $(TDIR)/test_store.c
+@@ -109,6 +103,6 @@ clean:
+
+ .PHONY: clean-all
+ clean-all: clean
+- rm -rf client $(BDIR) $(CDIR) $(AX_DIR)/build
++ rm -rf client $(BDIR) $(CDIR)
+
+
+--
+2.27.0
+
diff --git a/x11-plugins/lurch/files/lurch-0.6.8-libsignal-protocol-c.patch b/x11-plugins/lurch/files/lurch-0.6.8-libsignal-protocol-c.patch
new file mode 100644
index 000000000000..4b3de986154d
--- /dev/null
+++ b/x11-plugins/lurch/files/lurch-0.6.8-libsignal-protocol-c.patch
@@ -0,0 +1,92 @@
+From 72f286f389236fe99cb10fdeda3ee9b474de645d Mon Sep 17 00:00:00 2001
+From: Sebastian Pipping <sebastian@pipping.org>
+Date: Fri, 4 Dec 2020 00:10:17 +0100
+Subject: [PATCH] lurch: Use system's libsignal-protocol-c shared library
+
+---
+ Makefile | 37 ++++++++++++++++++++++++-------------
+ 1 file changed, 24 insertions(+), 13 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 32bc9c9..937401d 100644
+--- a/Makefile
++++ b/Makefile
+@@ -28,16 +28,21 @@ LIBPURPLE_LDFLAGS=$(shell $(PKG_CONFIG) --cflags purple) \
+ XML2_CFLAGS ?= $(shell $(XML2_CONFIG) --cflags)
+ XML2_LDFLAGS ?= $(shell $(XML2_CONFIG) --libs)
+
++LIBSIGNAL_PROTOCOL_C_CFLAGS ?= $(shell $(PKG_CONFIG) --cflags libsignal-protocol-c)
++LIBSIGNAL_PROTOCOL_C_LDFLAGS ?= $(shell $(PKG_CONFIG) --libs libsignal-protocol-c)
++
+ LIBGCRYPT_LDFLAGS ?= $(shell $(LIBGCRYPT_CONFIG) --libs)
+
+ PKGCFG_C=$(GLIB_CFLAGS) \
+ $(LIBPURPLE_CFLAGS) \
++ $(LIBSIGNAL_PROTOCOL_C_CFLAGS) \
+ $(XML2_CFLAGS)
+
+
+ PKGCFG_L=$(shell $(PKG_CONFIG) --libs sqlite3 mxml) \
+ $(GLIB_LDFLAGS) \
+ $(LIBPURPLE_LDFLAGS) \
++ $(LIBSIGNAL_PROTOCOL_C_LDFLAGS) \
+ $(XML2_LDFLAGS) \
+ $(LIBGCRYPT_LDFLAGS)
+
+@@ -51,7 +56,7 @@ else
+ endif
+ endif
+
+-HEADERS=-I$(HDIR)/jabber -I$(LOMEMO_SRC) -I$(AXC_SRC) -I$(AX_DIR)/src
++HEADERS=-I$(HDIR)/jabber -I$(LOMEMO_SRC) -I$(AXC_SRC)
+ CFLAGS += -std=c11 -Wall -g -Wstrict-overflow $(PKGCFG_C) $(HEADERS)
+ PLUGIN_CPPFLAGS=-DPURPLE_PLUGINS
+ # -D_BSD_SOURCE can be removed once nobody uses glibc <= 2.18 any more
+@@ -79,26 +84,32 @@ AXC_SRC=$(AXC_DIR)/src
+ AXC_BUILD=$(AXC_DIR)/build
+ AXC_PATH=$(AXC_BUILD)/libaxc-nt.a
+
+-AX_DIR=$(AXC_DIR)/lib/libsignal-protocol-c
+-AX_PATH=$(AX_DIR)/build/src/libsignal-protocol-c.a
+-
+-VENDOR_LIBS=$(LOMEMO_PATH) $(AXC_PATH) $(AX_PATH)
++VENDOR_LIBS=$(LOMEMO_PATH) $(AXC_PATH)
+
+
+ ### make rules
+ #
+-all: $(BDIR)/lurch.so
++all: $(BDIR)/lurch.so $(BDIR)/linkdummy
++
++
++$(BDIR)/linkdummy.c:
++ echo 'int main() { return 0; }' > $@
++
++$(BDIR)/liblinklurch.so: $(BDIR)/lurch.so | $(BDIR)
++ ln -f $^ $@
++
++$(BDIR)/linkdummy: $(BDIR)/linkdummy.o $(BDIR)/liblinklurch.so
++ $(CC) \
++ $(shell $(PKG_CONFIG) --libs purple) \
++ -L$(BDIR) -llinklurch \
++ $^ \
++ -o $@ \
++ $(LDFLAGS)
++
+
+ $(BDIR):
+ $(MKDIR_P) build
+
+-$(AX_PATH):
+- cd $(AX_DIR)/ && \
+- $(MKDIR_P) build && \
+- cd build && \
+- $(CMAKE) $(CMAKE_FLAGS) .. \
+- && $(MAKE)
+-
+ $(AXC_PATH):
+ $(MAKE) -C "$(AXC_DIR)" build/libaxc-nt.a
+
+--
+2.27.0
+
diff --git a/x11-plugins/lurch/lurch-0.6.8-r2.ebuild b/x11-plugins/lurch/lurch-0.6.8-r2.ebuild
new file mode 100644
index 000000000000..d0d3d5c728b1
--- /dev/null
+++ b/x11-plugins/lurch/lurch-0.6.8-r2.ebuild
@@ -0,0 +1,76 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit toolchain-funcs
+
+AXC_PV=0.3.3
+LIBOMEMO_PV=0.7.0
+
+DESCRIPTION="OMEMO encryption for libpurple (XEP-0384)"
+HOMEPAGE="https://github.com/gkdr/lurch"
+SRC_URI="https://github.com/gkdr/lurch/releases/download/v${PV}/lurch-${PV}-src.tar.gz -> ${P}.tar.gz
+ https://github.com/gkdr/axc/archive/v${AXC_PV}.tar.gz -> axc-${AXC_PV}.tar.gz
+ https://github.com/gkdr/libomemo/archive/v${LIBOMEMO_PV}.tar.gz -> libomemo-${LIBOMEMO_PV}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE=""
+
+# NOTE
+# The build systems of axc (ex-libaxolotl)
+# at https://github.com/gkdr/axc and of libomemo
+# at https://github.com/gkdr/libomemo build static
+# libraries (*.a files) only, so it is not clear when or
+# how to best unbundle them into standalone packages.
+# Related yet-to-be-merged pull requests to build shared libraries
+# exist upstream:
+# - https://github.com/gkdr/axc/pull/17
+# - https://github.com/gkdr/lurch/pull/151
+# - https://github.com/gkdr/libomemo/pull/30
+RDEPEND="
+ dev-db/sqlite
+ dev-libs/glib
+ dev-libs/libgcrypt:=
+ dev-libs/libxml2
+ dev-libs/mxml
+ net-im/pidgin:=
+ >=net-libs/libsignal-protocol-c-2.3.2
+ "
+DEPEND="
+ ${RDEPEND}
+ virtual/pkgconfig
+ "
+
+PATCHES=(
+ # Unbundle net-libs/libsignal-protocol-c
+ "${FILESDIR}"/${P}-libsignal-protocol-c.patch
+ "${FILESDIR}"/${P}-axc-${AXC_PV}-libsignal-protocol-c.patch
+)
+
+src_prepare() {
+ # Upgrade outdated bundle of axc
+ rm -R lib/axc || die
+ mv "${WORKDIR}"/axc-${AXC_PV} lib/axc || die
+
+ # Upgrade outdated bundle of libomemo
+ rm -R lib/libomemo || die
+ mv "${WORKDIR}"/libomemo-${LIBOMEMO_PV} lib/libomemo || die
+
+ # Unbundle axc's bundled net-libs/libsignal-protocol-c
+ rm -R lib/axc/lib/libsignal-protocol-c || die
+
+ default
+}
+
+src_compile() {
+ local makeargs=(
+ CC="$(tc-getCC)"
+ LIBGCRYPT_CONFIG="$(tc-getPROG LIBGCRYPT_CONFIG libgcrypt-config)"
+ PKG_CONFIG="$(tc-getPKG_CONFIG)"
+ XML2_CONFIG="$(tc-getPROG XML2_CONFIG xml2-config)"
+ )
+ emake "${makeargs[@]}"
+}