Merge pull request #1714 from sibuserv/add-libotr

Add libotr
pull/1267/merge
Boris Nagaev 7 years ago committed by GitHub
commit aa2099d3b6

@ -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= \

@ -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}

@ -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;
}

@ -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
Loading…
Cancel
Save