diff --git a/.gitignore b/.gitignore index 3dc99e9..c7c374a 100644 --- a/.gitignore +++ b/.gitignore @@ -38,7 +38,7 @@ CMakeLists.txt.user Makefile # Executable -KShare +./KShare # Other *.out diff --git a/AppVeyor/appveyor.yml b/AppVeyor/appveyor.yml new file mode 100644 index 0000000..33853c3 --- /dev/null +++ b/AppVeyor/appveyor.yml @@ -0,0 +1,27 @@ +environment: + QTDIR: C:\Qt\5.9\mingw53_32 +build_script: + - dir + - mkdir build + - cd build + - set PATH=%PATH%;%QTDIR%\bin;C:\Qt\Tools\mingw530_32\bin;C:\MinGW\msys\1.0\bin + - git submodule update --init --recursive + - curl -kLO https://ffmpeg.zeranoe.com/builds/win64/dev/ffmpeg-3.3.2-win64-dev.zip + - 7z x ffmpeg-3.3.2-win64-dev.zip + - set FFMPEG_DEV_PATH=%CD%\ffmpeg-3.3.2-win64-dev + - curl -kLO https://ffmpeg.zeranoe.com/builds/win64/shared/ffmpeg-3.3.2-win64-shared.zip + - 7z x ffmpeg-3.3.2-win64-shared.zip + - set FFMPEG_SHARED_PATH=%cd%\ffmpeg-3.3.2-win64-shared + - ps: Start-FileDownload https://downloads.sourceforge.net/project/qtav/depends/QtAV-depends-windows-x86%2Bx64.7z av.7z + - 7z x av.7z > NUL + - xcopy ffmpeg-3.3.2-win64-shared\* %QTDIR% /e /i /Y + - xcopy ffmpeg-3.3.2-win64-dev\* %QTDIR% /e /i /Y + - xcopy QtAV-depends-windows-x86+x64\* %QTDIR% /e /i /Y + - qmake CONFIG+=nopkg ../KShare.pro + - mingw32-make.exe -j8 + - copy release\KShare.exe ..\KShare.exe + - cd .. + - bash -xe AppVeyor\make_installer.sh +artifacts: + - path: KShare.exe + - path: installer.exe diff --git a/AppVeyor/make_installer.sh b/AppVeyor/make_installer.sh new file mode 100644 index 0000000..40ba302 --- /dev/null +++ b/AppVeyor/make_installer.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +function addFile { + cp $1 . + echo "Source: \"$(basename $1)\"; DestDir: \"{app}\"; Flags: ignoreversion" >> installer.iss +} +ver=$(cat main.cpp | grep setApplicationVersion | sed "s/\\s*a.setApplicationVersion(\"//g" | sed "s/\");//g") + +cd packages/windows +cp ../../KShare.exe . || exit 1 +# BOOOOOOIII Feeels good, it's not powershell. + +sed "s/;VER;/$ver/" installer.iss.pattern.top > installer.iss + +addFile ../../build/ffmpeg-3.3.2-win64-shared/bin/avcodec-57.dll +#addFile ../../build/ffmpeg-3.3.2-win64-shared/bin/avdevice-57.dll +#addFile ../../build/ffmpeg-3.3.2-win64-shared/bin/avfilter-6.dll +addFile ../../build/ffmpeg-3.3.2-win64-shared/bin/avformat-57.dll +addFile ../../build/ffmpeg-3.3.2-win64-shared/bin/avutil-55.dll +#addFile ../../build/ffmpeg-3.3.2-win64-shared/bin/postproc-54.dll +#addFile ../../build/ffmpeg-3.3.2-win64-shared/bin/swresample-2.dll +addFile ../../build/ffmpeg-3.3.2-win64-shared/bin/swscale-4.dll +addFile /c/Qt/5.9/mingw53_32/bin/Qt5Core.dll +addFile /c/Qt/5.9/mingw53_32/bin/Qt5Network.dll +addFile /c/Qt/5.9/mingw53_32/bin/Qt5Gui.dll +addFile /c/Qt/5.9/mingw53_32/bin/Qt5Widgets.dll +addFile /c/Qt/5.9/mingw53_32/bin/Qt5WinExtras.dll +addFile /c/Qt/5.9/mingw53_32/bin/Qt5Network.dll +addFile /c/Qt/5.9/mingw53_32/bin/LIBSTDC++-6.DLL +addFile /c/Qt/5.9/mingw53_32/bin/LIBWINPTHREAD-1.DLL +addFile /c/Qt/5.9/mingw53_32/bin/LIBGCC_S_DW2-1.DLL + +cat installer.iss.pattern.bottom >> installer.iss +"C:\Program Files (x86)\Inno Setup 5\ISCC.exe" installer.iss +cp Output/setup.exe ../../installer.exe || exit 1 diff --git a/KShare.pro b/KShare.pro index 9676e39..d46b19e 100644 --- a/KShare.pro +++ b/KShare.pro @@ -114,7 +114,21 @@ HEADERS += mainwindow.hpp \ filenamevalidator.hpp nopkg { +# win32 { +# !exists($$(FFMPEG_DEV_PATH)\README.txt) { +# error("You must define a valid FFMPEG_DEV_PATH") +# } + +# !exists($$(FFMPEG_SHARED_PATH)\README.txt) { +# error("You must define a valid FFMPEG_SHARED_PATH") +# } + +# INCLUDEPATH += $$(FFMPEG_DEV_PATH)\include +# LIBS += -L$$(FFMPEG_DEV_PATH)\lib +# message(Set the library and include paths); +# } LIBS += -lavcodec -lavformat -lavutil -lswscale + message(nopkg); } else { CONFIG += link_pkgconfig PKGCONFIG += libavformat libavcodec libswscale libavutil @@ -154,7 +168,8 @@ DISTFILES += \ README.md \ LICENSE \ OlderSystemFix.patch \ - appveyor.yml + AppVeyor/appveyor.yml \ + AppVeyor/make_installer.sh RESOURCES += \ icon.qrc diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index b60fe2f..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,15 +0,0 @@ -enviroment: - QTDIR: C:\Qt\5.9\mingw53_32 - PATH: %PATH%;%QTDIR%\bin;C:\MinGW\bin -build_script: - - git submodule update --init --recursive - - qmake CONFIG+=nopkg KShare.pro - - curl -kLO https://ffmpeg.zeranoe.com/builds/win64/dev/ffmpeg-3.3.2-win64-dev.zip - - 7z x ffmpeg-3.3.2-win64-dev.zip - - set CPATH=ffmpeg-3.3.2-win64-dev\include;%CPATH% - - curl -kLO https://ffmpeg.zeranoe.com/builds/win64/dev/ffmpeg-3.3.2-win64-static.zip - - 7z x ffmpeg-3.3.2-win64-static.zip - - set LIBRARY_PATH=ffmpeg-3.3.2-win64-static\lib;%LIBRARY_PATH% - - mingw32-make -j8 -artifacts: - - path: release/KShare.exe diff --git a/packages/arch/KShare-Stable/.gitignore b/packages/arch/KShare-Stable/.gitignore new file mode 100644 index 0000000..0f868b8 --- /dev/null +++ b/packages/arch/KShare-Stable/.gitignore @@ -0,0 +1 @@ +PKGBUILD.sample diff --git a/packages/arch/KShare-Stable/PKGBUILD b/packages/arch/KShare-Stable/PKGBUILD new file mode 100644 index 0000000..42e737e --- /dev/null +++ b/packages/arch/KShare-Stable/PKGBUILD @@ -0,0 +1,27 @@ +# Maintainer: ArsenArsen +pkgname=kshare +pkgver=4.1 +pkgrel=1 +conflicts=("kshare-git") +pkgdesc="A ShareX inspired cross platform utility written with Qt." +arch=('i686' 'x86_64') +url="https://github.com/ArsenArsen/KShare" +license=('MIT') +provides=('kshare=$pkgver') +depends=(qt5-base qt5-x11extras xcb-util-cursor ffmpeg libxfixes) +source=(git+https://github.com/ArsenArsen/KShare.git#tag=v${pkgver}) +sha1sums=('SKIP') + +build() { + cd "${srcdir}/KShare" + git submodule update --init --recursive + qmake + make +} + +package() { + cd "${srcdir}/KShare" + mkdir -p "$pkgdir/usr/bin" + install ./KShare "$pkgdir/usr/bin/kshare" +} + diff --git a/packages/arch/KShare-Stable/release.sh b/packages/arch/KShare-Stable/release.sh new file mode 100755 index 0000000..9d2ce27 --- /dev/null +++ b/packages/arch/KShare-Stable/release.sh @@ -0,0 +1,5 @@ +sed "s/;VER;/$1/" PKGBUILD.sample > PKGBUILD +makepkg --printsrcinfo > .SRCINFO +git stage .SRCINFO PKGBUILD +git commit -m "Release $1" +git push diff --git a/packages/arch/KShare/PKGBUILD b/packages/arch/KShare/PKGBUILD new file mode 100644 index 0000000..a146935 --- /dev/null +++ b/packages/arch/KShare/PKGBUILD @@ -0,0 +1,28 @@ +# Maintainer: ArsenArsen +pkgname=kshare-git +pkgver=cfdecf06cedd9002b2fb4e1ef8df67c72fc540f94 +pkgrel=1 +conflicts=("kshare") +pkgdesc="A ShareX inspired cross platform utility written with Qt." +arch=('i686' 'x86_64') +url="https://github.com/ArsenArsen/KShare" +license=('MIT') +provides=('kshare=$pkgver') +depends=(qt5-base qt5-x11extras xcb-util-cursor ffmpeg libxfixes) +source=(git+https://github.com/ArsenArsen/KShare.git) +sha1sums=('SKIP') + +build() { + cd "${srcdir}/KShare" + git checkout dev + git submodule update --init --recursive + qmake + make +} + +package() { + cd "${srcdir}/KShare" + mkdir -p "$pkgdir/usr/bin" + install ./KShare "$pkgdir/usr/bin/kshare" +} + diff --git a/packages/arch/KShare/PKGBUILD.sample b/packages/arch/KShare/PKGBUILD.sample new file mode 100644 index 0000000..8915b05 --- /dev/null +++ b/packages/arch/KShare/PKGBUILD.sample @@ -0,0 +1,28 @@ +# Maintainer: ArsenArsen +pkgname=kshare-git +pkgver=;COMMIT; +pkgrel=1 +conflicts=("kshare") +pkgdesc="A ShareX inspired cross platform utility written with Qt." +arch=('i686' 'x86_64') +url="https://github.com/ArsenArsen/KShare" +license=('MIT') +provides=('kshare=$pkgver') +depends=(qt5-base qt5-x11extras xcb-util-cursor ffmpeg libxfixes) +source=(git+https://github.com/ArsenArsen/KShare.git) +sha1sums=('SKIP') + +build() { + cd "${srcdir}/KShare" + git checkout dev + git submodule update --init --recursive + qmake + make +} + +package() { + cd "${srcdir}/KShare" + mkdir -p "$pkgdir/usr/bin" + install ./KShare "$pkgdir/usr/bin/kshare" +} + diff --git a/packages/arch/KShare/pre-push b/packages/arch/KShare/pre-push new file mode 100755 index 0000000..7d393f0 --- /dev/null +++ b/packages/arch/KShare/pre-push @@ -0,0 +1,12 @@ +#!/bin/bash +if [[ `git rev-parse --abbrev-ref HEAD 2>/dev/null` == "dev" ]] +then + HASH=`git rev-parse --verify HEAD` + sed "s/;COMMIT;/c$HASH/g" /media/arsen/Data/Packages/KShare/PKGBUILD.sample > /media/arsen/Data/Packages/KShare/PKGBUILD + cd /media/arsen/Data/Packages/KShare + makepkg --printsrcinfo > .SRCINFO + git stage . + git commit -m "UPDATE $HASH" + git push +fi + diff --git a/packages/windows/LICENSE.txt b/packages/windows/LICENSE.txt new file mode 100644 index 0000000..f2610ef --- /dev/null +++ b/packages/windows/LICENSE.txt @@ -0,0 +1 @@ +BLANK: FILL IN BEFORE RELEASE diff --git a/packages/windows/installer.iss.pattern.bottom b/packages/windows/installer.iss.pattern.bottom new file mode 100644 index 0000000..cedf697 --- /dev/null +++ b/packages/windows/installer.iss.pattern.bottom @@ -0,0 +1,11 @@ +;Source: "FILE"; DestDir: "{app}"; Flags: ignoreversion +; NOTE: Don't use "Flags: ignoreversion" on any shared system files + +[Icons] +Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}" +Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}" +Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon + +[Run] +Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent + diff --git a/packages/windows/installer.iss.pattern.top b/packages/windows/installer.iss.pattern.top new file mode 100644 index 0000000..6887350 --- /dev/null +++ b/packages/windows/installer.iss.pattern.top @@ -0,0 +1,37 @@ +; Script generated by the Inno Script Studio Wizard. +; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! + +#define MyAppName "KShare" +#define MyAppVersion ";VER;" +#define MyAppPublisher "ArsenArsen" +#define MyAppURL "http://kshare.arsenarsen.com/" +#define MyAppExeName "KShare.exe" + +[Setup] +; NOTE: The value of AppId uniquely identifies this application. +; Do not use the same AppId value in installers for other applications. +; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) +AppId={{4D052A58-8982-4FB0-A542-22D1E3936AA9} +AppName={#MyAppName} +AppVersion={#MyAppVersion} +;AppVerName={#MyAppName} {#MyAppVersion} +AppPublisher={#MyAppPublisher} +AppPublisherURL={#MyAppURL} +AppSupportURL={#MyAppURL} +AppUpdatesURL={#MyAppURL} +DefaultDirName={pf}\{#MyAppName} +DefaultGroupName={#MyAppName} +LicenseFile=LICENSE.txt +OutputBaseFilename=setup +Compression=lzma +SolidCompression=yes + +[Languages] +Name: "english"; MessagesFile: "compiler:Default.isl" + +[Tasks] +Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked + +[Files] +Source: "KShare.exe"; DestDir: "{app}"; Flags: ignoreversion +