Skip to content

Commit

Permalink
Migrate to qt5 and drop qt4 support (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
at-wat authored May 2, 2019
1 parent 6800160 commit 5a9cfdc
Show file tree
Hide file tree
Showing 9 changed files with 65 additions and 45 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.git
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
build
install-win32
packages
23 changes: 8 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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

26 changes: 26 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand Down
5 changes: 5 additions & 0 deletions main.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#include "ypspur_gui.h"
#include <QApplication>

#ifdef _WIN32
#include <QtCore/QtPlugin>
Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)
#endif // _WIN32

int main(int argc, char* argv[])
{
QApplication app(argc, argv);
Expand Down
4 changes: 0 additions & 4 deletions ypspur_gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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())
{
Expand Down
4 changes: 0 additions & 4 deletions ypspur_gui.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
43 changes: 22 additions & 21 deletions ypspur_gui.pro
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 5a9cfdc

Please sign in to comment.