[fix] Fixed Qv2ray AppImage build and added Crowdin Service

Former-commit-id: eed7826d33
This commit is contained in:
Leroy.H.Y 2019-09-16 12:47:01 +08:00
parent 62e2fd6a9f
commit 0c7c224b52
9 changed files with 73 additions and 62 deletions

View File

@ -1,11 +1,9 @@
install:
- set QTDIR=C:\Qt\5.10\mingw53_32
- choco install -y InnoSetup
- set PATH=%QTDIR%\bin;C:\Qt\Tools\mingw730_32\bin;%PATH%;"C:\Program Files (x86)\Inno Setup 5"
- set QTDIR=C:\Qt\5.13.0\mingw73_32
- set PATH=%QTDIR%\bin;C:\Qt\Tools\mingw730_32\bin;%PATH%
- git submodule update --init
build_script:
- lrelease.exe Qv2ray.pro
- mkdir build && cd build
- qmake ..\Qv2ray.pro "QV2RAY_LRELEASE=true"
- qmake ..\Qv2ray.pro
- mingw32-make

View File

@ -3,28 +3,28 @@ language: cpp
matrix:
include:
- os: linux
dist: xenial
dist: bionic
sudo: required
env: BADGE=linux
- os: osx
env: BADGE=osx
before_install:
- if [ "$BADGE" = "linux" ]; then sudo add-apt-repository -y ppa:beineri/opt-qt-5.11.1-xenial; fi
- if [ "$BADGE" = "linux" ]; then sudo apt-get update; fi
install:
- if [ "$BADGE" = "linux" ]; then sudo apt-get install qtchooser libgl-dev qt511-meta-minimal; fi
- if [ "$BADGE" = "linux" ]; then sudo apt-get install qtchooser libgl-dev qt5-default qttools5-dev-tools; fi
- if [ "$BADGE" = "osx" ]; then brew install cppcheck https://raw.githubusercontent.com/Homebrew/homebrew-core/master/Formula/qt.rb; fi
- if [ "$BADGE" = "osx" ]; then brew link --force qt; fi
before_script:
- if [ "$BADGE" = "osx" ]; then export PATH="/usr/local/opt/qt/bin:$PATH"; fi
- if [ "$BADGE" = "linux" ]; then sudo cp ./libs/lrelease.prf /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/; fi
script:
- git submodule update --init
- lrelease ./Qv2ray.pro
- mkdir build && cd ./build
- if [ "$BADGE" = "linux" ]; then /opt/qt511/bin/qmake ../ "QV2RAY_LRELEASE=true"; fi
- if [ "$BADGE" = "osx" ]; then qmake "QV2RAY_LRELEASE=true" ../; fi
- make
- mkdir build && cd ./build
- qmake ../
- if [ "$BADGE" = "linux" ]; then make compiler_lrelease_make_all; fi
- if [ "$BADGE" = "linux" ]; then ls -lah --color=always --recursive; fi
- make -j8

View File

@ -9,7 +9,7 @@ QT += core gui widgets network
TARGET = Qv2ray
TEMPLATE = app
DEFINES += QT_DEPRECATED_WARNINGS
CONFIG += c++11 openssl-linked lrelease embed_translations
CONFIG += c++11 openssl openssl-linked lrelease embed_translations
win32: QMAKE_TARGET_DESCRIPTION = "Qv2ray, a cross-platform v2ray GUI client."
win32: QMAKE_TARGET_PRODUCT = "Qv2ray"
@ -98,3 +98,11 @@ win32: QMAKE_CXXFLAGS += "-Wno-missing-field-initializers"
qnx: target.path = /tmp/$${TARGET}/bin
unix: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target
desktop.files += ./icons/Qv2ray.desktop
desktop.path = /opt/$${TARGET}/share/applications/
icon.files += ./icons/Qv2ray.png
icon.path = /opt/$${TARGET}/share/icons/hicolor/256x256/apps/
INSTALLS += desktop
INSTALLS += icon

View File

@ -1,3 +1,3 @@
files:
- source: /translations/source.ts
- source: /translations/en-US.ts
translation: /translations/%locale%.ts

View File

@ -1,26 +0,0 @@
#!/bin/bash
set -e
if [ ! -z "$DEBUG" ] ; then
env
set -x
fi
THIS="$0"
# http://stackoverflow.com/questions/3190818/
args=("$@")
NUMBER_OF_ARGS="$#"
if [ -z $APPDIR ] ; then
# Find the AppDir. It is the directory that contains AppRun.
# This assumes that this script resides inside the AppDir or a subdirectory.
# If this script is run inside an AppImage, then the AppImage runtime likely has already set $APPDIR
path="$(dirname "$(readlink -f "${THIS}")")"
while [[ "$path" != "" && ! -e "$path/$1" ]]; do
path=${path%/*}
done
APPDIR="$path"
fi
echo Application is located at: $APPDIR
exec $APPDIR/opt/Qv2ray/bin/Qv2ray

View File

@ -1,9 +0,0 @@
[Desktop Entry]
Encoding=UTF-8
Type=Application
Keywords=Internet;VPN;Proxy;v2ray;Qt
Categories=Network;Qt;
Icon=Qv2ray
Exec=AppRun
Name=Qv2ray
Comment=Cross-platform v2ray GUI Client in Qt.

View File

@ -1,9 +1,8 @@
[Desktop Entry]
Encoding=UTF-8
Type=Application
Keywords=Internet;VPN;Proxy;v2ray;Qt
Keywords=Internet;VPN;Proxy;v2ray;Qt;
Categories=Network;Qt;
Icon=Qv2ray
Exec=/opt/Qv2ray/Qv2ray
Exec=/opt/Qv2ray/bin/Qv2ray
Name=Qv2ray
Comment=Cross-platform v2ray GUI Client in Qt.

41
libs/lrelease.prf Normal file
View File

@ -0,0 +1,41 @@
# Automatically generate .qm files out of .ts files in TRANSLATIONS and
# EXTRA_TRANSLATIONS.
#
# If embed_translations is enabled, the generated .qm files are made available
# in the resource system under :/i18n/.
#
# Otherwise, the .qm files are available in the build directory in LRELEASE_DIR.
# They can also be automatically installed by setting QM_FILES_INSTALL_PATH.
qtPrepareTool(QMAKE_LRELEASE, lrelease)
isEmpty(LRELEASE_DIR): LRELEASE_DIR = .qm
isEmpty(QM_FILES_RESOURCE_PREFIX): QM_FILES_RESOURCE_PREFIX = i18n
lrelease.name = lrelease
lrelease.input = TRANSLATIONS EXTRA_TRANSLATIONS
lrelease.output = $$LRELEASE_DIR/${QMAKE_FILE_IN_BASE}.qm
lrelease.commands = $$QMAKE_LRELEASE ${QMAKE_FILE_IN} $$QMAKE_LRELEASE_FLAGS -qm ${QMAKE_FILE_OUT}
silent: lrelease.commands = @echo lrelease ${QMAKE_FILE_IN} && $$lrelease.commands
lrelease.CONFIG = no_link
QMAKE_EXTRA_COMPILERS += lrelease
all_translations = $$TRANSLATIONS $$EXTRA_TRANSLATIONS
for (translation, all_translations) {
# mirrors $$LRELEASE_DIR/${QMAKE_FILE_IN_BASE}.qm above
translation = $$basename(translation)
QM_FILES += $$OUT_PWD/$$LRELEASE_DIR/$$replace(translation, \\..*$, .qm)
}
embed_translations {
qmake_qm_files.files = $$QM_FILES
qmake_qm_files.base = $$OUT_PWD/$$LRELEASE_DIR
qmake_qm_files.prefix = $$QM_FILES_RESOURCE_PREFIX
RESOURCES += qmake_qm_files
} else {
!isEmpty(QM_FILES_INSTALL_PATH) {
qm_files.files = $$QM_FILES
qm_files.path = $$QM_FILES_INSTALL_PATH
INSTALLS += qm_files
}
lrelease.CONFIG += target_predeps no_clean
}

View File

@ -596,8 +596,8 @@
<name>PrefrencesWindow</name>
<message>
<location filename="../src/w_PrefrencesWindow.ui" line="20"/>
<location filename="../src/w_PrefrencesWindow.cpp" line="103"/>
<location filename="../src/w_PrefrencesWindow.cpp" line="175"/>
<location filename="../src/w_PrefrencesWindow.cpp" line="108"/>
<location filename="../src/w_PrefrencesWindow.cpp" line="180"/>
<source>Prefrences</source>
<translation type="unfinished"></translation>
</message>
@ -821,22 +821,22 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/w_PrefrencesWindow.cpp" line="103"/>
<location filename="../src/w_PrefrencesWindow.cpp" line="108"/>
<source>PortNumbersCannotBeSame</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/w_PrefrencesWindow.cpp" line="175"/>
<location filename="../src/w_PrefrencesWindow.cpp" line="180"/>
<source>RunAsRootNotOnWindows</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/w_PrefrencesWindow.cpp" line="295"/>
<location filename="../src/w_PrefrencesWindow.cpp" line="300"/>
<source>#OpenVCoreFile</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/w_PrefrencesWindow.cpp" line="306"/>
<location filename="../src/w_PrefrencesWindow.cpp" line="311"/>
<source>OpenVAssetsDir</source>
<translation type="unfinished"></translation>
</message>
@ -864,17 +864,17 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/main.cpp" line="155"/>
<location filename="../src/main.cpp" line="167"/>
<source>DependencyMissing</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/main.cpp" line="155"/>
<location filename="../src/main.cpp" line="167"/>
<source>osslDependMissing,PleaseReDownload</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/main.cpp" line="164"/>
<location filename="../src/main.cpp" line="176"/>
<source>#AnotherInstanceRunning</source>
<translation type="unfinished"></translation>
</message>