diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/libomemo-test.c | 38 | ||||
-rw-r--r-- | src/libomemo-test.cmake | 22 | ||||
-rw-r--r-- | src/libomemo.mk | 32 | ||||
-rw-r--r-- | src/mxml.mk | 13 | ||||
-rw-r--r-- | src/sqlite.mk | 4 | ||||
-rw-r--r-- | src/tidy-html5-test.c | 49 | ||||
-rw-r--r-- | src/tidy-html5.mk | 30 | ||||
-rw-r--r-- | src/vmime.mk | 4 | ||||
-rw-r--r-- | src/wt-1-fixes.patch | 31 | ||||
-rw-r--r-- | src/wt.mk | 4 |
10 files changed, 197 insertions, 30 deletions
diff --git a/src/libomemo-test.c b/src/libomemo-test.c new file mode 100644 index 0000000..ef1cbc7 --- /dev/null +++ b/src/libomemo-test.c @@ -0,0 +1,38 @@ +// This file is part of MXE. See LICENSE.md for licensing information. + +#include <libomemo.h> +#include <libomemo_crypto.h> +#include <stdio.h> + +int main(int argc, char *argv[]) +{ + char * msg_p = "<message xmlns='jabber:client' type='chat' to='alice@example.com'>" + "<body>hello</body>" + "</message>"; + + printf("Original message:\n%s\n\n", msg_p); + fflush(stdout); + + omemo_crypto_provider crypto = { + .random_bytes_func = omemo_default_crypto_random_bytes, + .aes_gcm_encrypt_func = omemo_default_crypto_aes_gcm_encrypt, + .aes_gcm_decrypt_func = omemo_default_crypto_aes_gcm_decrypt, + (void *) 0 + }; + + uint32_t sid = 9178; + + omemo_message * msg_out_p; + if (omemo_message_prepare_encryption(msg_p, sid, &crypto, &msg_out_p) != 0) + return 1; + + char * xml_out_p; + if (omemo_message_export_encrypted(msg_out_p, &xml_out_p) != 0) + return 1; + + printf("Encrypted message:\n%s\n\n", xml_out_p); + fflush(stdout); + + return 0; +} + diff --git a/src/libomemo-test.cmake b/src/libomemo-test.cmake new file mode 100644 index 0000000..44e7fc5 --- /dev/null +++ b/src/libomemo-test.cmake @@ -0,0 +1,22 @@ +# This file is part of MXE. See LICENSE.md for licensing information. + +# partial module - included by src/cmake/CMakeLists.txt + +set(TGT test-${PKG}-cmake) + +enable_language(C) +add_executable(${TGT} ${CMAKE_CURRENT_LIST_DIR}/${PKG}-test.c) + +find_package(PkgConfig REQUIRED) +pkg_check_modules(GLIB2 glib-2.0) + +include_directories(${GLIB2_INCLUDE_DIRS}) +target_link_libraries(${TGT} omemo-conversations + mxml + gcrypt + gpg-error + pthread + ${GLIB2_LIBRARIES}) + +install(TARGETS ${TGT} DESTINATION bin) + diff --git a/src/libomemo.mk b/src/libomemo.mk new file mode 100644 index 0000000..e5b6705 --- /dev/null +++ b/src/libomemo.mk @@ -0,0 +1,32 @@ +# This file is part of MXE. See LICENSE.md for licensing information. + +PKG := libomemo +$(PKG)_WEBSITE := https://github.com/gkdr/libomemo +$(PKG)_DESCR := Implementation of OMEMO in C +$(PKG)_IGNORE := +$(PKG)_VERSION := 0.4.1 +$(PKG)_CHECKSUM := af66fd2958dc5d6b23bc488b69e9f431bfb308d79bdd1b1c31de4575862c5142 +$(PKG)_GH_CONF := gkdr/libomemo, v +$(PKG)_DEPS := gcc glib libgcrypt mxml sqlite + +define $(PKG)_BUILD + $(MAKE) -C '$(SOURCE_DIR)' -j '$(JOBS)' all \ + CC='$(TARGET)-gcc' \ + LD='$(TARGET)-ld' \ + AR='$(TARGET)-ar' \ + PKG_CONFIG='$(TARGET)-pkg-config' \ + LIBGCRYPT_CONFIG='$(PREFIX)/$(TARGET)/bin/libgcrypt-config' + $(INSTALL) -d '$(PREFIX)/$(TARGET)/lib' + $(INSTALL) -d '$(PREFIX)/$(TARGET)/include' + $(INSTALL) -m644 '$(SOURCE_DIR)/build'/libomemo*.a '$(PREFIX)/$(TARGET)/lib/' + $(INSTALL) -m644 '$(SOURCE_DIR)/src'/libomemo*.h '$(PREFIX)/$(TARGET)/include/' + + # test cmake + mkdir '$(SOURCE_DIR).test-cmake' + cd '$(SOURCE_DIR).test-cmake' && '$(TARGET)-cmake' \ + -DPKG=$(PKG) \ + '$(PWD)/src/cmake/test' + $(MAKE) -C '$(SOURCE_DIR).test-cmake' -j 1 install +endef + +$(PKG)_BUILD_SHARED = diff --git a/src/mxml.mk b/src/mxml.mk index 60c11de..651f2a1 100644 --- a/src/mxml.mk +++ b/src/mxml.mk @@ -1,22 +1,17 @@ # This file is part of MXE. See LICENSE.md for licensing information. PKG := mxml -$(PKG)_WEBSITE := https://michaelrsweet.github.io/ +$(PKG)_WEBSITE := https://michaelrsweet.github.io/mxml/ $(PKG)_DESCR := Mini-XML $(PKG)_IGNORE := -$(PKG)_VERSION := 2.9 -$(PKG)_CHECKSUM := cded54653c584b24c4a78a7fa1b3b4377d49ac4f451ddf170ebbc8161d85ff92 +$(PKG)_VERSION := 2.10 +$(PKG)_CHECKSUM := 267ff58b64ddc767170d71dab0c729c06f45e1df9a9b6f75180b564f09767891 +$(PKG)_GH_CONF := michaelrsweet/mxml, release- $(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION) $(PKG)_FILE := $(PKG)-$($(PKG)_VERSION).tar.gz $(PKG)_URL := https://github.com/michaelrsweet/mxml/releases/download/release-$($(PKG)_VERSION)/$($(PKG)_FILE) $(PKG)_DEPS := gcc pthreads -define $(PKG)_UPDATE - $(WGET) -q -O- 'https://www.msweet.org/downloads.php?L+Z3' | \ - $(SED) -n 's,.*<a href="files.*mxml-\([0-9\.]*\)\.tar.*,\1,p' | \ - head -1 -endef - define $(PKG)_BUILD cd '$(1)' && ./configure \ --host='$(TARGET)' \ diff --git a/src/sqlite.mk b/src/sqlite.mk index c7dcf07..98e72d9 100644 --- a/src/sqlite.mk +++ b/src/sqlite.mk @@ -4,8 +4,8 @@ PKG := sqlite $(PKG)_WEBSITE := https://www.sqlite.org/ $(PKG)_DESCR := SQLite $(PKG)_IGNORE := -$(PKG)_VERSION := 3170000 -$(PKG)_CHECKSUM := a4e485ad3a16e054765baf6371826b5000beed07e626510896069c0bf013874c +$(PKG)_VERSION := 3180000 +$(PKG)_CHECKSUM := 3757612463976e7d08c5e9f0af3021613fc24bbcfe1c51197d6776b9ece9ac5c $(PKG)_SUBDIR := $(PKG)-autoconf-$($(PKG)_VERSION) $(PKG)_FILE := $(PKG)-autoconf-$($(PKG)_VERSION).tar.gz $(PKG)_URL := https://www.sqlite.org/2017/$($(PKG)_FILE) diff --git a/src/tidy-html5-test.c b/src/tidy-html5-test.c new file mode 100644 index 0000000..8f3df77 --- /dev/null +++ b/src/tidy-html5-test.c @@ -0,0 +1,49 @@ +// This file is part of MXE. See LICENSE.md for licensing information. + +#include <tidy.h> +#include <tidybuffio.h> + +#include <stdbool.h> +#include <stdio.h> + + +int main() +{ + const char *input = "<h1>Blah</h1><p><b>Blah-blah-blah!</b>"; + printf("Input (HTML fragment):\n%s\n\n", input); + fflush(stdout); + + TidyDoc tDoc = tidyCreate(); + TidyBuffer output = {0}; + TidyBuffer errBuf = {0}; + int rc = -1; + + const bool ok = tidyOptSetBool(tDoc, TidyXhtmlOut, yes); + + if (ok) + rc = tidySetErrorBuffer(tDoc, &errBuf); + if (rc >= 0) + rc = tidyParseString(tDoc, input); + if (rc >= 0) + rc = tidyCleanAndRepair(tDoc); + if (rc >= 0) + rc = tidyRunDiagnostics(tDoc); + if (rc > 1) + rc = (tidyOptSetBool(tDoc, TidyForceOutput, yes) ? rc : -1); + if (rc >= 0) + rc = tidySaveBuffer(tDoc, &output); + + if (rc > 0) + printf("Diagnostics:\n%s\n\n", errBuf.bp); + if (rc >= 0) + printf("Output (valid HTML document):\n%s\n\n", output.bp); + else + printf("Unknown error: %d.\n\n", rc); + fflush(stdout); + + tidyBufFree(&errBuf); + tidyBufFree(&output); + tidyRelease(tDoc); + + return rc; +} diff --git a/src/tidy-html5.mk b/src/tidy-html5.mk new file mode 100644 index 0000000..33af291 --- /dev/null +++ b/src/tidy-html5.mk @@ -0,0 +1,30 @@ +# This file is part of MXE. See LICENSE.md for licensing information. + +PKG := tidy-html5 +$(PKG)_WEBSITE := http://www.html-tidy.org/ +$(PKG)_DESCR := HTML/XML syntax checker and reformatter +$(PKG)_IGNORE := +$(PKG)_VERSION := 5.4.0 +$(PKG)_CHECKSUM := a2d754b7349982e33f12d798780316c047a3b264240dc6bbd4641542e57a0b7a +$(PKG)_GH_CONF := htacg/tidy-html5 +$(PKG)_DEPS := gcc + +define $(PKG)_BUILD + cd '$(BUILD_DIR)' && $(TARGET)-cmake '$(SOURCE_DIR)' \ + -DTIDY_COMPAT_HEADERS:BOOL=YES \ + -DBUILD_SHARED_LIB=$(CMAKE_SHARED_BOOL) + $(MAKE) -C '$(BUILD_DIR)' -j $(JOBS) + $(MAKE) -C '$(BUILD_DIR)' -j 1 install + + $(if $(BUILD_STATIC), + cd '$(PREFIX)/$(TARGET)/lib' && mv libtidys.a libtidy.a, + rm -f '$(PREFIX)/$(TARGET)/lib/libtidys.a') + rm -f '$(PREFIX)/$(TARGET)/bin/tidy.exe' + + # build test manually + '$(TARGET)-gcc' \ + -W -Wall -Werror \ + '$(PWD)/src/$(PKG)-test.c' \ + -o '$(PREFIX)/$(TARGET)/bin/test-$(PKG).exe' \ + -ltidy +endef diff --git a/src/vmime.mk b/src/vmime.mk index f7b36a1..be53acf 100644 --- a/src/vmime.mk +++ b/src/vmime.mk @@ -4,8 +4,8 @@ PKG := vmime $(PKG)_WEBSITE := https://www.vmime.org/ $(PKG)_DESCR := VMime $(PKG)_IGNORE := -$(PKG)_VERSION := 1bc9f45 -$(PKG)_CHECKSUM := 367c1f607427347ed789179c85711a822679e77a3bc20ccefa1a2ed4b372dba3 +$(PKG)_VERSION := 8e6db1c +$(PKG)_CHECKSUM := 63c90e7cb58ac4135f7caefe0a738089862137c167f79749a0ff8427af7c972f $(PKG)_GH_CONF := kisli/vmime/master $(PKG)_DEPS := gcc gnutls libgsasl libiconv pthreads zlib diff --git a/src/wt-1-fixes.patch b/src/wt-1-fixes.patch index 11b129c..e619196 100644 --- a/src/wt-1-fixes.patch +++ b/src/wt-1-fixes.patch @@ -2,14 +2,14 @@ This file is part of MXE. See LICENSE.md for licensing information. Contains ad hoc patches for cross building. -From 91ffd2fb6f9c5ed3017af5363b3f14313a45ea9c Mon Sep 17 00:00:00 2001 -From: MXE -Date: Mon, 18 Jun 2012 13:23:21 +0200 -Subject: [PATCH 1/2] fixes for mxe +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Boris Nagaev <bnagaev@gmail.com> +Date: Sat, 1 Apr 2017 15:17:43 +0200 +Subject: [PATCH] Wt fixes diff --git a/cmake/WtFindBoost-vintage.txt b/cmake/WtFindBoost-vintage.txt -index e48b21e..1198139 100644 +index 1111111..2222222 100644 --- a/cmake/WtFindBoost-vintage.txt +++ b/cmake/WtFindBoost-vintage.txt @@ -70,6 +70,7 @@ ELSE(MSVC) @@ -21,7 +21,7 @@ index e48b21e..1198139 100644 boost_thread-mt boost_thread-${BOOST_COMPILER}-${BOOST_VERSION} diff --git a/cmake/WtFindGm.txt b/cmake/WtFindGm.txt -index 76697fc..9bc0fa1 100644 +index 1111111..2222222 100644 --- a/cmake/WtFindGm.txt +++ b/cmake/WtFindGm.txt @@ -59,6 +59,12 @@ IF(WIN32) @@ -38,10 +38,10 @@ index 76697fc..9bc0fa1 100644 FIND_LIBRARY(GM_LIB NAMES diff --git a/cmake/WtFindPangoFt2.txt b/cmake/WtFindPangoFt2.txt -index cd1e640..b1bbe3d 100644 +index 1111111..2222222 100644 --- a/cmake/WtFindPangoFt2.txt +++ b/cmake/WtFindPangoFt2.txt -@@ -36,11 +36,15 @@ SET(PANGO_FT2_INCLUDE_DIRS +@@ -43,13 +43,17 @@ SET(PANGO_FT2_INCLUDE_DIRS ${GLIB2_INCLUDE_DIR} ${GLIB2_CONFIG_INCLUDE_DIR}) @@ -49,7 +49,9 @@ index cd1e640..b1bbe3d 100644 - ${PANGO_FT2_LIBRARY} - ${PANGO_LIBRARY} - ${GOBJECT2_LIBRARY} -- ${GLIB2_LIBRARY}) +- ${GLIB2_LIBRARY} +- ${FONTCONFIG_LIBRARY} +- ) +IF(PANGO_FT2_LIBS) + SET(PANGO_FT2_LIBRARIES optimized ${PANGO_FT2_LIBS}) +ELSE(PANGO_FT2_LIBS) @@ -57,16 +59,18 @@ index cd1e640..b1bbe3d 100644 + ${PANGO_FT2_LIBRARY} + ${PANGO_LIBRARY} + ${GOBJECT2_LIBRARY} -+ ${GLIB2_LIBRARY}) ++ ${GLIB2_LIBRARY} ++ ${FONTCONFIG_LIBRARY} ++ ) +ENDIF(PANGO_FT2_LIBS) IF (PANGO_INCLUDE_DIR AND FT2_INCLUDE_DIR diff --git a/cmake/WtFindSsl.txt b/cmake/WtFindSsl.txt -index d99f1df..7c1f70b 100644 +index 1111111..2222222 100644 --- a/cmake/WtFindSsl.txt +++ b/cmake/WtFindSsl.txt -@@ -109,6 +109,11 @@ IF(WIN32) +@@ -110,6 +110,11 @@ IF(WIN32) AND SSL_LIB_DEBUG AND SSL_TOO_LIB_RELEASE AND SSL_TOO_LIB_DEBUG) @@ -78,6 +82,3 @@ index d99f1df..7c1f70b 100644 ELSEIF(APPLE) FIND_LIBRARY(SSL_LIB NAMES --- -1.9.3 (Apple Git-50) - @@ -4,8 +4,8 @@ PKG := wt $(PKG)_WEBSITE := https://www.webtoolkit.eu/ $(PKG)_DESCR := Wt $(PKG)_IGNORE := -$(PKG)_VERSION := 3.3.6 -$(PKG)_CHECKSUM := 8f82576076deb1d72cfb8ff42cf7ffb3553a45da32123b2a3cf36e66040678ab +$(PKG)_VERSION := 3.3.7 +$(PKG)_CHECKSUM := 054af8d62a7c158df62adc174a6a57610868470a07e7192ee7ce60a18552851d $(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION) $(PKG)_FILE := $(PKG)-$($(PKG)_VERSION).tar.gz $(PKG)_URL := https://github.com/emweb/wt/archive/$($(PKG)_VERSION).tar.gz |