mirror of https://git.wownero.com/dsc/mxe.git
Merge pull request #1952 from tonytheodore/mxml-new
mxml and libomemo: enable shared
This commit is contained in:
commit
be17659b0a
|
@ -28,10 +28,19 @@ define $(PKG)_MAKE
|
|||
$(MAKE) -C '$(1)' -j '$(JOBS)' install bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS=
|
||||
ln -sf '$(PREFIX)/$(TARGET)/bin/libgcrypt-config' '$(PREFIX)/bin/$(TARGET)-libgcrypt-config'
|
||||
|
||||
# create pkg-config file
|
||||
$(INSTALL) -d '$(PREFIX)/$(TARGET)/lib/pkgconfig'
|
||||
(echo 'Name: $(PKG)'; \
|
||||
echo 'Version: $($(PKG)_VERSION)'; \
|
||||
echo 'Description: $(PKG)'; \
|
||||
echo 'Libs: ' "`$(TARGET)-libgcrypt-config --libs`"; \
|
||||
echo 'Cflags: ' "`$(TARGET)-libgcrypt-config --cflags`";) \
|
||||
> '$(PREFIX)/$(TARGET)/lib/pkgconfig/$(PKG).pc'
|
||||
|
||||
'$(TARGET)-gcc' \
|
||||
-W -Wall -Werror -ansi -pedantic \
|
||||
'$(TEST_FILE)' -o '$(PREFIX)/$(TARGET)/bin/test-libgcrypt.exe' \
|
||||
`$(TARGET)-libgcrypt-config --cflags --libs`
|
||||
`$(TARGET)-pkg-config libgcrypt --cflags --libs`
|
||||
endef
|
||||
|
||||
define $(PKG)_BUILD
|
||||
|
|
|
@ -23,11 +23,11 @@ int main(int argc, char *argv[])
|
|||
uint32_t sid = 9178;
|
||||
|
||||
omemo_message * msg_out_p;
|
||||
if (omemo_message_prepare_encryption(msg_p, sid, &crypto, &msg_out_p) != 0)
|
||||
if (omemo_message_prepare_encryption(msg_p, sid, &crypto, OMEMO_STRIP_NONE, &msg_out_p) != 0)
|
||||
return 1;
|
||||
|
||||
char * xml_out_p;
|
||||
if (omemo_message_export_encrypted(msg_out_p, &xml_out_p) != 0)
|
||||
if (omemo_message_export_encrypted(msg_out_p, OMEMO_ADD_MSG_NONE, &xml_out_p) != 0)
|
||||
return 1;
|
||||
|
||||
printf("Encrypted message:\n%s\n\n", xml_out_p);
|
||||
|
|
|
@ -8,15 +8,9 @@ enable_language(C)
|
|||
add_executable(${TGT} ${CMAKE_CURRENT_LIST_DIR}/${PKG}-test.c)
|
||||
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(GLIB2 glib-2.0)
|
||||
pkg_check_modules(LIBOMEMO libomemo)
|
||||
|
||||
include_directories(${GLIB2_INCLUDE_DIRS})
|
||||
target_link_libraries(${TGT} omemo-conversations
|
||||
mxml
|
||||
gcrypt
|
||||
gpg-error
|
||||
pthread
|
||||
${GLIB2_LIBRARIES})
|
||||
include_directories(${LIBOMEMO_INCLUDE_DIRS})
|
||||
target_link_libraries(${TGT} ${LIBOMEMO_LIBRARIES})
|
||||
|
||||
install(TARGETS ${TGT} DESTINATION bin)
|
||||
|
||||
|
|
|
@ -4,8 +4,8 @@ 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)_VERSION := 0.6.1
|
||||
$(PKG)_CHECKSUM := 26e2ef3df93d9461ed6d62bbb495b8ac6de385ec7a5aa28ff28dd869ba908170
|
||||
$(PKG)_GH_CONF := gkdr/libomemo, v
|
||||
$(PKG)_DEPS := gcc glib libgcrypt mxml sqlite
|
||||
|
||||
|
@ -18,8 +18,21 @@ define $(PKG)_BUILD
|
|||
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/'
|
||||
$(if $(BUILD_STATIC),\
|
||||
$(INSTALL) -m644 '$(SOURCE_DIR)/build'/libomemo*.a '$(PREFIX)/$(TARGET)/lib/' \
|
||||
$(else), \
|
||||
$(MAKE_SHARED_FROM_STATIC) '$(SOURCE_DIR)/build/libomemo-conversations.a' \
|
||||
`$(TARGET)-pkg-config --libs-only-l glib-2.0 sqlite3 mxml libgcrypt`)
|
||||
|
||||
# create pkg-config file
|
||||
$(INSTALL) -d '$(PREFIX)/$(TARGET)/lib/pkgconfig'
|
||||
(echo 'Name: $(PKG)'; \
|
||||
echo 'Version: $($(PKG)_VERSION)'; \
|
||||
echo 'Description: $($(PKG)_DESCR)'; \
|
||||
echo 'Requires: glib-2.0 sqlite3 mxml libgcrypt'; \
|
||||
echo 'Libs: -lomemo-conversations';) \
|
||||
> '$(PREFIX)/$(TARGET)/lib/pkgconfig/$(PKG).pc'
|
||||
|
||||
# test cmake
|
||||
mkdir '$(SOURCE_DIR).test-cmake'
|
||||
|
@ -28,5 +41,3 @@ define $(PKG)_BUILD
|
|||
'$(PWD)/src/cmake/test'
|
||||
$(MAKE) -C '$(SOURCE_DIR).test-cmake' -j 1 install
|
||||
endef
|
||||
|
||||
$(PKG)_BUILD_SHARED =
|
||||
|
|
31
src/mxml.mk
31
src/mxml.mk
|
@ -4,31 +4,36 @@ PKG := mxml
|
|||
$(PKG)_WEBSITE := https://michaelrsweet.github.io/mxml/
|
||||
$(PKG)_DESCR := Mini-XML
|
||||
$(PKG)_IGNORE :=
|
||||
$(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)_VERSION := 2.11
|
||||
$(PKG)_CHECKSUM := 7d3dfe661e50908fe41aef9b97ba6f7f158cab5208515c6be9f5bc9daf032329
|
||||
$(PKG)_GH_CONF := michaelrsweet/mxml, v
|
||||
$(PKG)_DEPS := gcc pthreads
|
||||
|
||||
define $(PKG)_BUILD
|
||||
cd '$(1)' && ./configure \
|
||||
--host='$(TARGET)' \
|
||||
# doesn't support out-of-source builds
|
||||
# https://github.com/michaelrsweet/mxml/issues/135
|
||||
cd '$(SOURCE_DIR)' && $(SOURCE_DIR)/configure \
|
||||
$(MXE_CONFIGURE_OPTS) \
|
||||
--disable-shared \
|
||||
--prefix='$(PREFIX)/$(TARGET)' \
|
||||
--enable-static \
|
||||
--enable-threads
|
||||
$(MAKE) -C '$(1)' -j '$(JOBS)' libmxml.a
|
||||
$(MAKE) -C '$(1)' -j 1 install-libmxml.a
|
||||
$(MAKE) -C '$(SOURCE_DIR)' -j '$(JOBS)' libmxml.a
|
||||
$(INSTALL) -d '$(PREFIX)/$(TARGET)/include'
|
||||
$(INSTALL) -m644 '$(1)/mxml.h' '$(PREFIX)/$(TARGET)/include/'
|
||||
$(INSTALL) -d '$(PREFIX)/$(TARGET)/lib/pkgconfig'
|
||||
$(INSTALL) -m644 '$(1)/mxml.pc' '$(PREFIX)/$(TARGET)/lib/pkgconfig/'
|
||||
|
||||
# shared libs are easier to do ourselves in the case where all
|
||||
# functions are exported.
|
||||
# https://github.com/michaelrsweet/mxml/issues/188
|
||||
# https://github.com/michaelrsweet/mxml/issues/192
|
||||
$(if $(BUILD_STATIC),\
|
||||
$(MAKE) -C '$(SOURCE_DIR)' -j 1 install-libmxml.a \
|
||||
$(else), \
|
||||
$(MAKE_SHARED_FROM_STATIC) '$(SOURCE_DIR)/libmxml.a' -lpthread)
|
||||
|
||||
'$(TARGET)-gcc' \
|
||||
-W -Wall -Werror -ansi -pedantic \
|
||||
'$(TEST_FILE)' -o '$(PREFIX)/$(TARGET)/bin/test-mxml.exe' \
|
||||
`'$(TARGET)-pkg-config' mxml --cflags --libs`
|
||||
endef
|
||||
|
||||
$(PKG)_BUILD_SHARED =
|
||||
|
|
Loading…
Reference in New Issue