qttools: read test from current directory and freeze example 5.7 plugin

see: https://github.com/mxe/mxe/issues/1901#issuecomment-333551106
This commit is contained in:
Tony Theodore 2017-10-10 23:15:06 +11:00
parent f118332737
commit ab5d9a7185
5 changed files with 49 additions and 4 deletions

View File

@ -29,6 +29,9 @@ export QT5_PKGS=${QT5_PKGS}qtbase
cp `eval echo src/{$QT5_PKGS}.mk` $PLUGIN_DIR
cp `eval echo src/{$QT5_PKGS}-*.patch` $PLUGIN_DIR
# copy other relevant sources
cp -R src/qttools-test $PLUGIN_DIR
# set $(PKG)_PATCHES to only look for patches in the current directory
# on macos, use `gsed` instead of `sed`
find $PLUGIN_DIR -name "qt[^5]*.mk" -exec sed -i '9i$(PKG)_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/$(PKG)-[0-9]*.patch)))' {} \;

View File

@ -0,0 +1,30 @@
# This file is part of MXE. See LICENSE.md for licensing information.
# Source: https://github.com/mxe/mxe/issues/1185
cmake_minimum_required(VERSION 3.0)
find_package(Qt5 REQUIRED COMPONENTS Core Widgets Gui UiTools)
include_directories(${Qt5UiTools_INCLUDE_DIRS})
add_executable(mxe-cmake-qtuitools mxe-cmake-qtuitools.cpp)
# NB: Qt5Widgets, Qt5Gui, Qt5Core must be given separately; otherwise they are
# appended automatically at the end, making it impossible to satisfy all the
# other implicit dependencies (opengl, harfbuzz, etc.)
target_link_libraries(
mxe-cmake-qtuitools
${Qt5UiTools_LIBRARIES}
${Qt5Widgets_LIBRARIES}
${Qt5Gui_LIBRARIES}
${Qt5Core_LIBRARIES}
opengl32
harfbuzz
jpeg
png
glib-2.0
winmm
ws2_32
intl
iconv
pcre16
z
)

View File

@ -0,0 +1,10 @@
// This file is part of MXE. See LICENSE.md for licensing information.
// Source: https://github.com/mxe/mxe/issues/1185
#include <QUiLoader>
int main() {
QUiLoader l;
return 0;
}

View File

@ -12,6 +12,8 @@ $(PKG)_FILE = $(subst qtbase,qttools,$(qtbase_FILE))
$(PKG)_URL = $(subst qtbase,qttools,$(qtbase_URL))
$(PKG)_DEPS := gcc qtactiveqt qtbase qtdeclarative
$(PKG)_TEST_DIR := $(dir $(lastword $(MAKEFILE_LIST)))/qttools-test
define $(PKG)_UPDATE
echo $(qtbase_VERSION)
endef
@ -23,9 +25,8 @@ define $(PKG)_BUILD
# test QUiLoader
mkdir '$(1)'.test
cd '$(1)'.test && '$(TARGET)-cmake' '$(PWD)/src/qttools-test'
cd '$(1)'.test && '$(TARGET)-cmake' '$($(PKG)_TEST_DIR)'
$(MAKE) -C '$(1)'.test
cp '$(1)'.test/mxe-cmake-qtuitools.exe \
'$(PREFIX)/$(TARGET)/bin/test-qttools.exe'
endef

View File

@ -11,6 +11,8 @@ $(PKG)_FILE = $(subst qtbase,qttools,$(qtbase_FILE))
$(PKG)_URL = $(subst qtbase,qttools,$(qtbase_URL))
$(PKG)_DEPS := gcc qtactiveqt qtbase qtdeclarative
$(PKG)_TEST_DIR := $(dir $(lastword $(MAKEFILE_LIST)))/qttools-test
define $(PKG)_UPDATE
echo $(qtbase_VERSION)
endef
@ -22,9 +24,8 @@ define $(PKG)_BUILD
# test QUiLoader
mkdir '$(1)'.test
cd '$(1)'.test && '$(TARGET)-cmake' '$(PWD)/src/qttools-test'
cd '$(1)'.test && '$(TARGET)-cmake' '$($(PKG)_TEST_DIR)'
$(MAKE) -C '$(1)'.test
cp '$(1)'.test/mxe-cmake-qtuitools.exe \
'$(PREFIX)/$(TARGET)/bin/test-qttools.exe'
endef