Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
QQxiaoming committed Apr 8, 2020
2 parents 2e2c9d6 + 34d87a8 commit 6a952c5
Show file tree
Hide file tree
Showing 13 changed files with 181 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

# PyQt
# Python
/.idea
/__pycache__
/dist
Expand Down Expand Up @@ -49,4 +49,4 @@ Makefile*
CMakeLists.txt.user*

# vscode
/.vscode
/.vscode
3 changes: 3 additions & 0 deletions InnoSetup/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# InnoSetup
/build
YUVviewer_setup.exe
1 change: 1 addition & 0 deletions InnoSetup/Info.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
YUVviewer tools
64 changes: 64 additions & 0 deletions InnoSetup/build_setup.iss
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@

#define MyAppName "YUVviewer"
#define MyAppVersion "0.3.3"
#define MyAppPublisher "zhiliao007 <[email protected]> QQxiaoming <[email protected]>"
#define MyAppURL "https://github.com/zhiliao007/YUVviewer"
#define MyAppExeName "YUVviewer.exe"
#define MyAppOutputName "YUVviewer_setup"

[Setup]
; 注: AppId的值为单独标识该应用程序。
; 不要为其他安装程序使用相同的AppId值。
; (生成新的GUID,点击 工具|在IDE中生成GUID。)
AppId={{4368AAE0-A354-4127-94A9-0C38727B1DCC}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={autopf}\{#MyAppName}
DefaultGroupName={#MyAppName}
OutputBaseFilename={#MyAppOutputName}
Compression=lzma
SolidCompression=yes

UninstallDisplayIcon={app}/{#MyAppExeName}
InfoBeforeFile=..\InnoSetup\Info.txt
OutPutdir=..\InnoSetup
SetupIconFile=..\img\ico.ico
PrivilegesRequired=admin
VersionInfoVersion=0.3.3.000
AllowNoIcons=no
DisableProgramGroupPage=yes
WizardStyle=modern

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: 6.1; Check: not IsAdminInstallMode

[Files]
Source: "..\InnoSetup\build\YUVviewer.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\InnoSetup\build\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; 注意: 不要在任何共享系统文件上使用“Flags: ignoreversion”

[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{group}\{cm:ProgramOnTheWeb,{#MyAppName}}"; Filename: "{#MyAppURL}"
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: quicklaunchicon

[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent

[Code]
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
if CurUninstallStep = usUninstall then
DeleteFile(ExpandConstant('{app}\YUVviewer.ini'));
end;
31 changes: 31 additions & 0 deletions build_deb.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/sh

# 定义版本号
YVYVIEWER_MAJARVERSION="0"
YVYVIEWER_SUBVERSION="3"
YVYVIEWER_REVISION="3"

YVYVIEWER_VERSION="V"$YVYVIEWER_MAJARVERSION""$YVYVIEWER_SUBVERSION""$YVYVIEWER_REVISION""

rm -rf ./dpkg/YUVviewer_Linux_"$YVYVIEWER_VERSION"_x86_64
rm -f ./dpkg/YUVviewer_Linux_"$YVYVIEWER_VERSION"_x86_64.deb

cp -r ./dpkg/YUVviewer ./dpkg/YUVviewer_Linux_"$YVYVIEWER_VERSION"_x86_64
mkdir -p ./dpkg/YUVviewer_Linux_"$YVYVIEWER_VERSION"_x86_64/opt/YUVviewer
cp ./build-YUVviewer-Desktop_Qt_5_12_2_GCC_64bit-Release/YUVviewer ./dpkg/YUVviewer_Linux_"$YVYVIEWER_VERSION"_x86_64/opt/YUVviewer/YUVviewer

export PATH=/opt/Qt5.12.2/5.12.2/gcc_64/bin:$PATH
export LD_LIBRARY_PATH=/home/xiaoming/Desktop/opencv/lib:/opt/Qt5.12.2/5.12.2/gcc_64/lib:$LD_LIBRARY_PATH
export QT_PLUGIN_PATH=/opt/Qt5.12.2/5.12.2/gcc_64/plugins:$QT_PLUGIN_PATH
export QML2_IMPORT_PATH=/opt/Qt5.12.2/5.12.2/gcc_64/qml:$QML2_IMPORT_PATH
./tools/linuxdeployqt ./dpkg/YUVviewer_Linux_"$YVYVIEWER_VERSION"_x86_64/opt/YUVviewer/YUVviewer -appimage
rm -rf ./dpkg/YUVviewer_Linux_"$YVYVIEWER_VERSION"_x86_64/opt/YUVviewer/doc ./dpkg/YUVviewer_Linux_"$YVYVIEWER_VERSION"_x86_64/opt/YUVviewer/default.png ./dpkg/YUVviewer_Linux_"$YVYVIEWER_VERSION"_x86_64/opt/YUVviewer/AppRun ./dpkg/YUVviewer_Linux_"$YVYVIEWER_VERSION"_x86_64/opt/YUVviewer/default.desktop
cp ./img/ico.png ./dpkg/YUVviewer_Linux_"$YVYVIEWER_VERSION"_x86_64/opt/YUVviewer/YUVviewer.png

sed -i "s/Version: 0.33/Version: $YVYVIEWER_MAJARVERSION.$YVYVIEWER_SUBVERSION$YVYVIEWER_REVISION/g" ./dpkg/YUVviewer_Linux_"$YVYVIEWER_VERSION"_x86_64/DEBIAN/control
InstalledSize=94515.2 # TODO:
sed -i "s/Installed-Size: 81203.2/Installed-Size: $InstalledSize/g" ./dpkg/YUVviewer_Linux_"$YVYVIEWER_VERSION"_x86_64/DEBIAN/control

chmod 755 ./dpkg/YUVviewer_Linux_"$YVYVIEWER_VERSION"_x86_64/* -R

dpkg -b ./dpkg/YUVviewer_Linux_"$YVYVIEWER_VERSION"_x86_64 ./dpkg/YUVviewer_Linux_"$YVYVIEWER_VERSION"_x86_64.deb
20 changes: 20 additions & 0 deletions build_setup.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
@echo off

set "PATH=D:\Qt\Qt5.9.2\5.9.2\mingw53_32\bin;D:/Qt/Qt5.9.2/Tools/mingw530_32\bin;C:\Program Files (x86)\Inno Setup 6;%PATH%"

if exist ".\InnoSetup\build" (
rmdir /Q /S .\InnoSetup\build
)

xcopy /y .\build-YUVviewer-Desktop_Qt_5_9_2_MinGW_32bit-Release\release\YUVviewer.exe .\InnoSetup\build\

windeployqt --dir .\InnoSetup\build .\InnoSetup\build\YUVviewer.exe

xcopy /y D:\Qt\opencv4.2.0\x64\mingw\bin\libopencv_imgproc420.dll .\InnoSetup\build\
xcopy /y D:\Qt\opencv4.2.0\x64\mingw\bin\libopencv_core420.dll .\InnoSetup\build\

echo "wait inno build setup..."
compil32 /cc ".\InnoSetup\build_setup.iss"
echo "build success!"

pause
3 changes: 3 additions & 0 deletions dpkg/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# dpkg
/YUVviewer_*
*.deb
12 changes: 12 additions & 0 deletions dpkg/YUVviewer/DEBIAN/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Package: yuvviewer
Version: 0.33
Architecture: amd64
Section: utils
Depends:
Recommends:
Source: YUVviewer
Installed-Size: 81203.2
Priority: extra
Maintainer: zhiliao007 <[email protected]> QQxiaoming <[email protected]>
Description: YUVviewer tools
Homepage: https://github.com/zhiliao007/YUVviewer
2 changes: 2 additions & 0 deletions dpkg/YUVviewer/DEBIAN/postrm
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
rm -rf /opt/YUVviewer/YUVViewer.ini
1 change: 1 addition & 0 deletions dpkg/YUVviewer/usr/bin/YUVviewer
10 changes: 10 additions & 0 deletions dpkg/YUVviewer/usr/share/applications/YUVviewer.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Icon=/opt/YUVviewer/YUVviewer.png
Name=YUVviewer
Exec=/usr/bin/YUVviewer
Commen=YUVviewer Tools
Categories=Utility;
Binary file added tools/linuxdeployqt
Binary file not shown.
32 changes: 32 additions & 0 deletions tools/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# 编译linuxdeployqt

## 获取源码

```shell
git clone https://github.com/probonopd/linuxdeployqt.git

cd linuxdeployqt
```

## 屏蔽以下代码

```c++
// openSUSE Leap 15.0 uses glibc 2.26 and is used on OBS
if (strverscmp (glcv, "2.27") >= 0) { //注释版本检查
qInfo() << "ERROR: The host system is too new.";
qInfo() << "Please run on a system with a glibc version no newer than what comes with the oldest";
qInfo() << "currently still-supported mainstream distribution (xenial), which is glibc 2.23.";
qInfo() << "This is so that the resulting bundle will work on most still-supported Linux distributions.";
qInfo() << "For more information, please see";
qInfo() << "https://github.com/probonopd/linuxdeployqt/issues/340";
return 1;
}
```
```shell
camke .
make
cp ./tools/linuxdeployqt ../linuxdeployqt
```

0 comments on commit 6a952c5

Please sign in to comment.