summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTony Theodore <tonyt@logyst.com>2017-08-13 05:03:20 (GMT)
committerGitHub <noreply@github.com>2017-08-13 05:03:20 (GMT)
commita008e046c6695b7185a3571293ce3dfe19f8f1de (patch)
treed01b2283ebf71e885aa562fd09c2a899ce47a431 /src
parenta31891146d1cdc612d51be4f863240a816245399 (diff)
parentb0fdbc9e8bd493f2fc7c240603568de8c3cb1af3 (diff)
downloadmxe-a008e046c6695b7185a3571293ce3dfe19f8f1de.zip
mxe-a008e046c6695b7185a3571293ce3dfe19f8f1de.tar.gz
mxe-a008e046c6695b7185a3571293ce3dfe19f8f1de.tar.bz2
Merge pull request #1878 from tonytheodore/libarchive-nettle
libarchive: use nettle instead of bcrypt for CNG(Crypto Next Generation)
Diffstat (limited to 'src')
-rw-r--r--src/libarchive-1-fixes.patch30
-rw-r--r--src/libarchive-test.c4
-rw-r--r--src/libarchive.mk16
3 files changed, 26 insertions, 24 deletions
diff --git a/src/libarchive-1-fixes.patch b/src/libarchive-1-fixes.patch
index 8d9423e..f4e3532 100644
--- a/src/libarchive-1-fixes.patch
+++ b/src/libarchive-1-fixes.patch
@@ -20,23 +20,21 @@ index 1111111..2222222 100644
+Libs.private: @LIBS@ -liconv
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Tim Kientzle <kientzle@acm.org>
-Date: Sun, 16 Jul 2017 16:10:08 -0700
-Subject: [PATCH] Issue #924: fix capitalization of bcrypt.h header
+From: Tony Theodore <tonyt@logyst.com>
+Date: Sun, 13 Aug 2017 14:38:47 +1000
+Subject: [PATCH] libarchive.pc.in: add Cflags.private for static linking
taken from:
-https://github.com/libarchive/libarchive/commit/06052e47e500ef4c8c937c4c8b987433a647cb4c
+https://github.com/libarchive/libarchive/pull/934
-diff --git a/libarchive/archive_cryptor_private.h b/libarchive/archive_cryptor_private.h
+diff --git a/build/pkgconfig/libarchive.pc.in b/build/pkgconfig/libarchive.pc.in
index 1111111..2222222 100644
---- a/libarchive/archive_cryptor_private.h
-+++ b/libarchive/archive_cryptor_private.h
-@@ -64,7 +64,7 @@ typedef struct {
- } archive_crypto_ctx;
-
- #elif defined(_WIN32) && !defined(__CYGWIN__) && defined(HAVE_BCRYPT_H)
--#include <Bcrypt.h>
-+#include <bcrypt.h>
-
- /* Common in other bcrypt implementations, but missing from VS2008. */
- #ifndef BCRYPT_SUCCESS
+--- a/build/pkgconfig/libarchive.pc.in
++++ b/build/pkgconfig/libarchive.pc.in
+@@ -7,5 +7,6 @@ Name: libarchive
+ Description: library that can create and read several streaming archive formats
+ Version: @VERSION@
+ Cflags: -I${includedir}
++Cflags.private: -DLIBARCHIVE_STATIC
+ Libs: -L${libdir} -larchive
+ Libs.private: @LIBS@ -liconv
diff --git a/src/libarchive-test.c b/src/libarchive-test.c
index 65f87b3..df42857 100644
--- a/src/libarchive-test.c
+++ b/src/libarchive-test.c
@@ -7,6 +7,7 @@
int main(int argc, char *argv[])
{
struct archive *tgz;
+ struct archive *zip;
(void)argc;
(void)argv;
@@ -16,5 +17,8 @@ int main(int argc, char *argv[])
archive_write_set_format_ustar(tgz);
archive_write_free(tgz);
+ zip = archive_read_new();
+ archive_read_support_format_zip(zip);
+
return 0;
}
diff --git a/src/libarchive.mk b/src/libarchive.mk
index 805a97e..16bc3bc 100644
--- a/src/libarchive.mk
+++ b/src/libarchive.mk
@@ -9,7 +9,7 @@ $(PKG)_CHECKSUM := ed2dbd6954792b2c054ccf8ec4b330a54b85904a80cef477a1c74643ddafa
$(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION)
$(PKG)_FILE := $(PKG)-$($(PKG)_VERSION).tar.gz
$(PKG)_URL := https://www.libarchive.org/downloads/$($(PKG)_FILE)
-$(PKG)_DEPS := gcc bzip2 libiconv libxml2 openssl xz zlib
+$(PKG)_DEPS := gcc bzip2 libiconv libxml2 nettle openssl xz zlib
define $(PKG)_UPDATE
$(WGET) -q -O- 'https://www.libarchive.org/downloads/' | \
@@ -19,20 +19,20 @@ define $(PKG)_UPDATE
endef
define $(PKG)_BUILD
- $(if $(BUILD_STATIC),\
- $(SED) -i '1i#ifndef LIBARCHIVE_STATIC\n#define LIBARCHIVE_STATIC\n#endif' -i '$(1)/libarchive/archive.h'
- $(SED) -i '1i#ifndef LIBARCHIVE_STATIC\n#define LIBARCHIVE_STATIC\n#endif' -i '$(1)/libarchive/archive_entry.h')
- cd '$(1)' && ./configure \
+ # use nettle instead of bcrypt for CNG(Crypto Next Generation)
+ cd '$(BUILD_DIR)' && '$(SOURCE_DIR)/configure' \
$(MXE_CONFIGURE_OPTS) \
--disable-bsdtar \
--disable-bsdcpio \
--disable-bsdcat \
+ --without-cng \
+ --with-nettle \
XML2_CONFIG='$(PREFIX)/$(TARGET)'/bin/xml2-config
- $(MAKE) -C '$(1)' -j '$(JOBS)' man_MANS=
- $(MAKE) -C '$(1)' -j 1 install man_MANS=
+ $(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)' man_MANS=
+ $(MAKE) -C '$(BUILD_DIR)' -j 1 install man_MANS=
'$(TARGET)-gcc' \
-W -Wall -Werror -ansi -pedantic \
'$(TEST_FILE)' -o '$(PREFIX)/$(TARGET)/bin/test-libarchive.exe' \
- `'$(TARGET)-pkg-config' --libs-only-l libarchive`
+ `'$(TARGET)-pkg-config' --libs-only-l --cflags libarchive`
endef