diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..6b8710a --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +.git diff --git a/.gitignore b/.gitignore index 378eac2..5576fa6 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ build +install-win32 +packages diff --git a/.travis.yml b/.travis.yml index debe3ba..35d2c62 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,21 +1,14 @@ -dist: trusty -sudo: required +dist: xenial +services: docker +language: bash -language: c -compiler: gcc - -before_install: - - sudo apt-get update -y - - sudo apt-get install -y gcc-mingw-w64-i686 g++-mingw-w64-i686 - - sudo bash -c "cd /tmp && wget https://github.com/at-wat/qt/releases/download/v4.8-win32static/qt4.ubuntu-trusty.mingw32.tar.gz && cd / && tar xzf /tmp/qt4.ubuntu-trusty.mingw32.tar.gz" script: - - mkdir build-win32 && cd build-win32 && /usr/local/mingw32/bin/qmake ../ypspur_gui.pro && make release LFLAGS="-static -mwindows" - - cd ../ - - mkdir install-win32 && mkdir install-win32/bin && cp ./build-win32/release/ypspur-gui.exe ./install-win32/bin/ + - docker build -t builder . + - docker run --rm -v $(pwd)/install-win32:/install-win32 builder cp -r /work/install-win32/bin /install-win32/ before_deploy: - - export GIT_TAG=`git describe --abbrev=0 --tags` + - export GIT_TAG=$(git describe --abbrev=0 --tags) - mkdir packages - - cd install-win32/ && zip -q ../packages/ypspur-gui.win32.$GIT_TAG.zip -r $(ls) + - cd install-win32/ && zip -q ../packages/ypspur-gui.win32.${GIT_TAG}.zip -r $(ls) - cd ../ deploy: @@ -24,7 +17,7 @@ deploy: api_key: secure: "V7W5bnWUlZN7hznTQryYsqYQ3IezppMdJI6R37aNOAVVr6Z8qpF6wMILFPmATLvwxSxD8tVfp3kO5+zKjJ5PayFXkRszGfep7e/AhA+lGdpWPwNKNCuQ0xI8vCn6r++PvmlTYwqkYuSq2PHKpeO7L/TuuyyknFZSEdy3bfnvbXYGDN28TTF1gCH7HguiSi3NzR9XY+ssZozF5wC1PyyNIwOqBN2y8lLBbQAGuaw40JF95iC8V7LjX5N5u90xKdxwdCW0FM3rpbwbVkk9JQzlMYGCH8A/dffZlPrxroTmSZfSNNsiOgNRmCedzSvDoC25bD9zRHXJqWx8CPjLDdYcUdXwraQyJs6o8OqkGypanB5Xk/LWz/Y2k3Qa3F3odUHrEtNMxo7oMFd2WhGwCXj4nf6aa8bTB1dPMCIYsx52oPDGJMS2PseS9sbWU0YE+Dtj9tYsqZSufG4Tp2j/RO7hIMooDoR77XENOuIw/OzVcjQ/LCgE0rOGS2UQLa88x2Q1ezg7aaeusaMdx4Cnoe86LjoppLWIlq6xhChS+cH+ues96R6FJ8nialCJe94i4pAfaRcxes7t3oM1TZVA61V6RNIlylxROJO0euaI4Xx/OH8f0mDHl0YrGT1NmDPdF3N+mUxutL0ld1GsewbRdy/yZa/N6YvY4BZ/zrNTXKaqxIc=" file: - - packages/ypspur-gui.win32.$GIT_TAG.zip + - packages/ypspur-gui.win32.${GIT_TAG}.zip on: tags: true diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..5576f8f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,26 @@ +FROM fedora:latest + +RUN dnf install -y \ + make \ + mingw64-bzip2-static \ + mingw64-freetype-static \ + mingw64-gcc-c++ \ + mingw64-pcre2-static \ + mingw64-qt5-qmake \ + mingw64-qt5-qtbase-devel \ + mingw64-qt5-qtbase-static \ + mingw64-qt5-qtbase-static \ + mingw64-win-iconv-static \ + && dnf clean all + +COPY . /work +WORKDIR /work +RUN mkdir -p build-win32 \ + && mkdir -p install-win32/bin +RUN cd build-win32 \ + && mingw64-qmake-qt5 ../ypspur_gui.pro \ + && make release LFLAGS="-static -mwindows" \ + && cp ./release/ypspur-gui.exe ../install-win32/bin/ \ + && make clean + +RUN mingw-objdump -p install-win32/bin/ypspur-gui.exe | grep dll diff --git a/README.md b/README.md index 8c958ca..34cc60f 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ $ git clone https://github.com/at-wat/ypspur-gui.git $ cd ypspur-gui $ mkdir build $ cd build -$ qmake-qt4 ../ypspur-gui.pro +$ qmake ../ypspur-gui.pro $ make # make install ``` diff --git a/main.cpp b/main.cpp index 5a905a0..0def49c 100644 --- a/main.cpp +++ b/main.cpp @@ -1,6 +1,11 @@ #include "ypspur_gui.h" #include +#ifdef _WIN32 +#include +Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin) +#endif // _WIN32 + int main(int argc, char* argv[]) { QApplication app(argc, argv); diff --git a/ypspur_gui.cpp b/ypspur_gui.cpp index 2ba3131..a9d674e 100644 --- a/ypspur_gui.cpp +++ b/ypspur_gui.cpp @@ -219,11 +219,7 @@ void YPSpurGUI::setParamFile(QString fileName) settings_.setValue("coordinator/param", param_file_); } -#if QT_VERSION >= 0x050000 void YPSpurGUI::on_portList_currentTextChanged(const QString& arg1) -#else -void YPSpurGUI::on_portList_textChanged(const QString& arg1) -#endif { if (!arg1.isNull()) { diff --git a/ypspur_gui.h b/ypspur_gui.h index 581c8a1..5e053d4 100644 --- a/ypspur_gui.h +++ b/ypspur_gui.h @@ -39,11 +39,7 @@ private slots: void coordinatorQuit(int exitCode); void on_parameterBrowse_clicked(); -#if QT_VERSION >= 0x050000 void on_portList_currentTextChanged(const QString& arg1); -#else - void on_portList_textChanged(const QString& arg1); -#endif void on_interpreterCommand_returnPressed(); void on_coordinatorDefaultParam_clicked(); void on_coordinatorPath_textChanged(const QString& arg1); diff --git a/ypspur_gui.pro b/ypspur_gui.pro index 9bc4b84..acfa4b7 100644 --- a/ypspur_gui.pro +++ b/ypspur_gui.pro @@ -4,36 +4,37 @@ # #------------------------------------------------- -QT += core gui +lessThan(QT_MAJOR_VERSION, 5) { + error("ypspur-gui requires QT>=5") +} -greaterThan(QT_MAJOR_VERSION, 4): QT += widgets +QT += core gui widgets TARGET = ypspur-gui TEMPLATE = app - -SOURCES += main.cpp \ - ypspur_gui.cpp - +SOURCES += \ + main.cpp \ + ypspur_gui.cpp HEADERS += \ - ypspur_gui.h - -win32:LIBS += -lsetupapi -win32:INCLUDEPATH += /mingw/include/ddk - -win32:QMAKE_CXXFLAGS_RELEASE -= -O -win32:QMAKE_CXXFLAGS_RELEASE -= -O1 -win32:QMAKE_CXXFLAGS_RELEASE -= -O2 - -win32:QMAKE_CXXFLAGS_RELEASE *= -Os - - + ypspur_gui.h FORMS += \ - ypspur_gui.ui + ypspur_gui.ui + +win32:QTPLUGIN.platforms = qwindows +win32:LIBS += \ + -lsetupapi \ + -lqwindows \ + -ldwmapi \ + -lQt5EventDispatcherSupport \ + -lQt5FontDatabaseSupport \ + -lQt5ThemeSupport \ + -lQt5VulkanSupport \ + -lQt5WindowsUIAutomationSupport -CONFIG += static +win32:QMAKE_CXXFLAGS_RELEASE *= -Os +win32:CONFIG += static INSTALLS += target target.path = /usr/local/bin -