summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/qhttpengine-1-fixes.patch59
-rw-r--r--src/qhttpengine.mk19
2 files changed, 70 insertions, 8 deletions
diff --git a/src/qhttpengine-1-fixes.patch b/src/qhttpengine-1-fixes.patch
new file mode 100644
index 0000000..72b1185
--- /dev/null
+++ b/src/qhttpengine-1-fixes.patch
@@ -0,0 +1,59 @@
+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: Tony Theodore <tonyt@logyst.com>
+Date: Thu, 15 Mar 2018 18:47:38 +1100
+Subject: [PATCH 1/1] Enable static builds
+
+see: https://github.com/nitroshare/qhttpengine/pull/25
+
+If unspecified, `add_library` uses the value from cmake's builtin `BUILD_SHARED_LIBS` (default true).
+
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index 1111111..2222222 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -39,7 +39,7 @@ if(WIN32)
+ set(SRC ${SRC} "${CMAKE_CURRENT_BINARY_DIR}/resource.rc")
+ endif()
+
+-add_library(qhttpengine SHARED ${HEADERS} ${SRC})
++add_library(qhttpengine ${HEADERS} ${SRC})
+
+ set_target_properties(qhttpengine PROPERTIES
+ CXX_STANDARD 11
+diff --git a/src/qhttpengine.pc.in b/src/qhttpengine.pc.in
+index 1111111..2222222 100644
+--- a/src/qhttpengine.pc.in
++++ b/src/qhttpengine.pc.in
+@@ -6,5 +6,6 @@ Name: @PROJECT_NAME@
+ Description: @PROJECT_DESCRIPTION@
+ URL: @PROJECT_URL@
+ Version: @PROJECT_VERSION@
++Requires: Qt5Network
+ Cflags: -I${includedir}
+ Libs: -L${libdir} -lqhttpengine
+diff --git a/src/qhttpengine_export.h.in b/src/qhttpengine_export.h.in
+index 1111111..2222222 100644
+--- a/src/qhttpengine_export.h.in
++++ b/src/qhttpengine_export.h.in
+@@ -30,10 +30,14 @@
+ #define QHTTPENGINE_VERSION_PATCH @PROJECT_VERSION_PATCH@
+ #define QHTTPENGINE_VERSION "@PROJECT_VERSION@"
+
+-#if defined(QHTTPENGINE_LIBRARY)
+-# define QHTTPENGINE_EXPORT Q_DECL_EXPORT
++#if defined(QT_STATIC)
++# define QHTTPENGINE_EXPORT
+ #else
+-# define QHTTPENGINE_EXPORT Q_DECL_IMPORT
++# if defined(QHTTPENGINE_LIBRARY)
++# define QHTTPENGINE_EXPORT Q_DECL_EXPORT
++# else
++# define QHTTPENGINE_EXPORT Q_DECL_IMPORT
++# endif
+ #endif
+
+ #endif // QHTTPENGINE_QHTTPENGINE_H
diff --git a/src/qhttpengine.mk b/src/qhttpengine.mk
index 3ad829d..726e28b 100644
--- a/src/qhttpengine.mk
+++ b/src/qhttpengine.mk
@@ -3,16 +3,19 @@
PKG := qhttpengine
$(PKG)_WEBSITE := https://github.com/nitroshare/qhttpengine
$(PKG)_IGNORE :=
-$(PKG)_VERSION := 0.1.0
-$(PKG)_CHECKSUM := 6df0e2f303eb5fb80995e0322903c2991b398a0b89fb483dae7c24bdefa1eaf1
-$(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION)
-$(PKG)_FILE := $(PKG)-$($(PKG)_VERSION).tar.gz
-$(PKG)_URL := https://github.com/nitroshare/qhttpengine/archive/$($(PKG)_VERSION).tar.gz
+$(PKG)_VERSION := 1.0.1
+$(PKG)_CHECKSUM := 6505cf889909dc29bab4069116656e7ca5a9e879f04935139439c5691a76c55e
+$(PKG)_GH_CONF := nitroshare/qhttpengine/tags
$(PKG)_DEPS := cc qtbase
define $(PKG)_BUILD
- mkdir '$(1)/build'
- cd '$(1)/build' && '$(TARGET)-cmake' ..
+ cd '$(BUILD_DIR)' && $(TARGET)-cmake '$(SOURCE_DIR)'
+ $(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)'
+ $(MAKE) -C '$(BUILD_DIR)' -j 1 install
- $(MAKE) -C '$(1)/build' -j '$(JOBS)' install
+ # compile test
+ '$(TARGET)-g++' \
+ -W -Wall -Werror -std=c++11 \
+ '$(SOURCE_DIR)/examples/auth/server.cpp' -o '$(PREFIX)/$(TARGET)/bin/test-$(PKG).exe' \
+ `'$(TARGET)-pkg-config' $(PKG) --cflags --libs`
endef