summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBoris Nagaev <bnagaev@gmail.com>2017-03-21 00:36:35 (GMT)
committerGitHub <noreply@github.com>2017-03-21 00:36:35 (GMT)
commitaa2099d3b66790af5cd3a0516accd340ed73e5a0 (patch)
treebd7afa5808d49e0494ff0ec1977bb1bb96a77a5a
parent07028e3a6d9f52e8a03c06f11edb6704f22e8f23 (diff)
parentb57256b51ff29c2184a5b89ad1b9b209065c2f84 (diff)
downloadmxe-aa2099d3b66790af5cd3a0516accd340ed73e5a0.zip
mxe-aa2099d3b66790af5cd3a0516accd340ed73e5a0.tar.gz
mxe-aa2099d3b66790af5cd3a0516accd340ed73e5a0.tar.bz2
Merge pull request #1714 from sibuserv/add-libotr
Add libotr
-rw-r--r--Makefile1
-rw-r--r--src/libotr-1-fixes.patch43
-rw-r--r--src/libotr-test.c14
-rw-r--r--src/libotr.mk34
4 files changed, 92 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index c9e4440..53d312b 100644
--- a/Makefile
+++ b/Makefile
@@ -142,6 +142,7 @@ MXE_DISABLE_DOCS = \
dist_man8_MANS= \
dist_man9_MANS= \
notrans_dist_man_MANS= \
+ MANLINKS= \
info_TEXINFOS= \
doc_DATA= \
dist_doc_DATA= \
diff --git a/src/libotr-1-fixes.patch b/src/libotr-1-fixes.patch
new file mode 100644
index 0000000..77d4425
--- /dev/null
+++ b/src/libotr-1-fixes.patch
@@ -0,0 +1,43 @@
+This file is part of MXE. See LICENSE.md for licensing information.
+
+Contains ad hoc patches for cross building.
+
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Boris Nagaev <bnagaev@gmail.com>
+Date: Thu, 16 Mar 2017 04:09:42 +0100
+Subject: [PATCH] fix out-of-tree build
+
+Fix the error:
+libotr-4.1.1/toolkit/otr_parse.c:26:19: fatal error: proto.h:
+ No such file or directory
+
+diff --git a/toolkit/Makefile.am b/toolkit/Makefile.am
+index 1111111..2222222 100644
+--- a/toolkit/Makefile.am
++++ b/toolkit/Makefile.am
+@@ -1,4 +1,4 @@
+-AM_CPPFLAGS = -I$(includedir) -I../src @LIBGCRYPT_CFLAGS@
++AM_CPPFLAGS = -I$(includedir) -I$(top_srcdir)/src @LIBGCRYPT_CFLAGS@
+
+ noinst_HEADERS = aes.h ctrmode.h parse.h sesskeys.h readotr.h sha1hmac.h
+
+
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Boris Nagaev <bnagaev@gmail.com>
+Date: Thu, 16 Mar 2017 06:09:50 +0100
+Subject: [PATCH] .pc: add -fstack-protector-all and private libs
+
+The flags taken from the build log.
+
+diff --git a/libotr.pc.in b/libotr.pc.in
+index 1111111..2222222 100644
+--- a/libotr.pc.in
++++ b/libotr.pc.in
+@@ -7,5 +7,6 @@ Name: libotr
+ Description: Off-the-Record Messaging Library
+ Version: @VERSION@
+ URL: https://otr.cypherpunks.ca/
+-Libs: -L${libdir} -lotr
++Libs: -L${libdir} -lotr -fstack-protector-all
++Libs.private: -lgcrypt -lgpg-error -lintl -liconv
+ Cflags: -I${includedir}
diff --git a/src/libotr-test.c b/src/libotr-test.c
new file mode 100644
index 0000000..77a6b07
--- /dev/null
+++ b/src/libotr-test.c
@@ -0,0 +1,14 @@
+/*
+ * This file is part of MXE. See LICENSE.md for licensing information.
+ */
+
+#include <libotr/proto.h>
+#include <libotr/userstate.h>
+
+int main() {
+ OtrlUserState userstate;
+ OTRL_INIT;
+ userstate = otrl_userstate_create();
+ otrl_userstate_free(userstate);
+ return 0;
+}
diff --git a/src/libotr.mk b/src/libotr.mk
new file mode 100644
index 0000000..5b30e46
--- /dev/null
+++ b/src/libotr.mk
@@ -0,0 +1,34 @@
+# This file is part of MXE. See LICENSE.md for licensing information.
+
+PKG := libotr
+$(PKG)_WEBSITE := https://otr.cypherpunks.ca/
+$(PKG)_DESCR := Off-the-Record Messaging
+$(PKG)_IGNORE :=
+$(PKG)_VERSION := 4.1.1
+$(PKG)_CHECKSUM := 8b3b182424251067a952fb4e6c7b95a21e644fbb27fbd5f8af2b2ed87ca419f5
+$(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION)
+$(PKG)_FILE := $(PKG)-$($(PKG)_VERSION).tar.gz
+$(PKG)_URL := https://otr.cypherpunks.ca/$($(PKG)_FILE)
+$(PKG)_DEPS := gcc libgcrypt libgpg_error libiconv
+
+define $(PKG)_UPDATE
+ $(WGET) -q -O- 'https://otr.cypherpunks.ca/' | \
+ $(SED) -n 's,.*<a href="libotr-\([0-9][^>]*\)\.tar\.gz">.*,\1,p' | \
+ head -1
+endef
+
+define $(PKG)_BUILD
+ cd '$(SOURCE_DIR)' && ACLOCAL_PATH='$(PREFIX)/$(TARGET)/share/aclocal' autoreconf -fi
+ cd '$(BUILD_DIR)' && '$(SOURCE_DIR)/configure' \
+ $(MXE_CONFIGURE_OPTS) \
+ --with-libgcrypt-prefix='$(PREFIX)/$(TARGET)'
+
+ $(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)' \
+ $(if $(BUILD_SHARED), LDFLAGS=-no-undefined) $(MXE_DISABLE_CRUFT)
+ $(MAKE) -C '$(BUILD_DIR)' -j 1 install $(MXE_DISABLE_CRUFT)
+
+ '$(TARGET)-gcc' \
+ -W -Wall -Werror -ansi -pedantic \
+ '$(TEST_FILE)' -o '$(PREFIX)/$(TARGET)/bin/test-$(PKG).exe' \
+ `'$(TARGET)-pkg-config' $(PKG) --cflags --libs`
+endef