Improve auto updater
This commit is contained in:
1 parent
39a50241e4
commit
a151e4e948
6 files changed
+109
-15
No files matched your search
+38
-6
@@ -16,6 +16,38 @@ SET( PLAYUVER_VERSION_MINOR "5" )
|
||||
SET( PLAYUVER_VERSION_PATCH "1" )
|
||||
SET( PLAYUVER_VERSION "${PLAYUVER_VERSION_MAJOR}.${PLAYUVER_VERSION_MINOR}.${PLAYUVER_VERSION_PATCH}")
|
||||
|
||||
# To be switched on when releasing.
|
||||
OPTION(RELEASE_BUILD "Remove Git revision from program version (use for stable releases)" ON)
|
||||
|
||||
# Get current version.
|
||||
set(PLAYUVER_VERSION_STRING "${PLAYUVER_VERSION}")
|
||||
if(NOT RELEASE_BUILD AND EXISTS ${CMAKE_SOURCE_DIR}/.git)
|
||||
# Probably a Git workspace; determine the revision.
|
||||
find_package(Git QUIET)
|
||||
if(GIT_FOUND)
|
||||
exec_program(${GIT_EXECUTABLE}
|
||||
${CMAKE_SOURCE_DIR}
|
||||
ARGS "describe --tags"
|
||||
OUTPUT_VARIABLE PLAYUVER_GIT_REVISION
|
||||
RETURN_VALUE TAG_RESULT
|
||||
)
|
||||
# git describe --tags failed; maybe the repository was checked with depth=1.
|
||||
if(NOT ${TAG_RESULT} EQUAL 0)
|
||||
exec_program(${GIT_EXECUTABLE}
|
||||
${CMAKE_SOURCE_DIR}
|
||||
ARGS "describe --always"
|
||||
OUTPUT_VARIABLE PLAYUVER_GIT_REVISION
|
||||
)
|
||||
endif()
|
||||
message(STATUS "PlaYUVer Git revision: ${PLAYUVER_GIT_REVISION}")
|
||||
set(PLAYUVER_VERSION_STRING "${PLAYUVER_VERSION} (rev. ${PLAYUVER_GIT_REVISION})")
|
||||
else()
|
||||
message(STATUS "PlaYUVer Git revision could not be determined")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
SET(UPDATE_CHANNEL "stable" CACHE STRING "Update channel" )
|
||||
|
||||
######################################################################################
|
||||
# CMake Defin1itions
|
||||
######################################################################################
|
||||
@@ -62,8 +94,7 @@ ENDIF()
|
||||
SET_PACKAGE_PROPERTIES(FFmpeg PROPERTIES URL "http://ffmpeg.org/" DESCRIPTION "Libav library support in PlaYUVerStream" TYPE OPTIONAL)
|
||||
|
||||
ADD_FEATURE_INFO(SSE USE_SSE "SSE instructions support" )
|
||||
ADD_FEATURE_INFO(Fervor USE_FERVOR "Fervor lib includes check for updates feature.")
|
||||
ADD_FEATURE_INFO(WErrors PLAYUVER_WERROR "Warnings as errors" )
|
||||
ADD_FEATURE_INFO(WErrors USE_WERROR "Warnings as errors" )
|
||||
|
||||
IF( WIN32 )
|
||||
INCLUDE( cmake/Win32.cmake )
|
||||
@@ -73,6 +104,7 @@ ENDIF()
|
||||
# Configuration
|
||||
######################################################################################
|
||||
CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h )
|
||||
CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/PlaYUVerUpdate.xml.in ${CMAKE_CURRENT_BINARY_DIR}/PlaYUVerUpdate-${UPDATE_CHANNEL}.xml )
|
||||
|
||||
######################################################################################
|
||||
# Target App
|
||||
@@ -83,10 +115,10 @@ IF (NOT CMAKE_BUILD_TYPE )
|
||||
ENDIF()
|
||||
|
||||
SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall" )
|
||||
#
|
||||
# IF( PLAYUVER_WERROR )
|
||||
# SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror" )
|
||||
# ENDIF()
|
||||
|
||||
IF( USE_WERROR )
|
||||
SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror" )
|
||||
ENDIF()
|
||||
|
||||
SET( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g" )
|
||||
SET( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2" )
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<rss
|
||||
version="2.0"
|
||||
xmlns:atom="http://www.w3.org/2005/Atom"
|
||||
xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle"
|
||||
xmlns:fervor="https://github.com/pypt/fervor"
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/">
|
||||
|
||||
<channel>
|
||||
<title>Your Great App's Changelog</title>
|
||||
<link>http://pypt.github.com/fervor/Appcast.xml</link>
|
||||
<description>Most recent changes with links to updates.</description>
|
||||
<language>en</language>
|
||||
<atom:link href="http://pypt.github.com/fervor/Appcast.xml" rel="self" type="application/rss+xml" />
|
||||
|
||||
<item>
|
||||
<title>Version @PLAYUVER_VERSION@</title>
|
||||
<pubDate>Mon, 09 Jan 2006 19:20:11 +0000</pubDate>
|
||||
<guid isPermaLink="true">http://192.168.96.201/share/PlaYUVerProject/ReleaseNotes-@UPDATE_CHANNEL@.html</guid>
|
||||
|
||||
<!-- One of those (<link> is preferred by Fervor, <sparkle:releaseNotesLink> is used by Sparkle) -->
|
||||
<link>http://192.168.96.201/share/PlaYUVerProject/ReleaseNotes-@UPDATE_CHANNEL@.html</link> <!-- or -->
|
||||
<sparkle:releaseNotesLink>http://192.168.96.201/share/PlaYUVerProject/ReleaseNotes-@UPDATE_CHANNEL@.html</sparkle:releaseNotesLink>
|
||||
|
||||
<!--
|
||||
See QtGlobal's QT_OS_* constants for valid platform versions.
|
||||
-->
|
||||
|
||||
<!-- Windows version. -->
|
||||
<enclosure
|
||||
url="http://sourceforge.net/projects/playuver/files/playuver-@UPDATE_CHANNEL@-windows-amd64.zip/download "
|
||||
fervor:version="2"
|
||||
fervor:platform="Q_OS_WIN32"
|
||||
fervor:dependencies="ALL"
|
||||
type="application/octet-stream" />
|
||||
|
||||
<!-- Linux version. -->
|
||||
<enclosure
|
||||
url="http://sourceforge.net/projects/playuver/files/playuver-@UPDATE_CHANNEL@-linux-amd64.zip/download"
|
||||
fervor:version="2.0"
|
||||
fervor:platform="Q_OS_LINUX"
|
||||
fervor:dependencies="ALL"
|
||||
type="application/octet-stream" />
|
||||
|
||||
|
||||
</item>
|
||||
|
||||
</channel>
|
||||
</rss>
|
||||
+16
-4
@@ -89,21 +89,30 @@ set(plaYUver_App_RCC
|
||||
resources/playuver.qrc
|
||||
)
|
||||
|
||||
OPTION( USE_FERVOR "Add Fervor support" OFF )
|
||||
|
||||
|
||||
IF( USE_FERVOR )
|
||||
|
||||
SET( FERVOR_DIR ${CMAKE_CURRENT_SOURCE_DIR}/external/fervor )
|
||||
|
||||
IF(EXISTS ${FERVOR_DIR} )
|
||||
|
||||
SET( FERVOR_APP_NAME ${PROJECT_NAME} )
|
||||
SET( FERVOR_APP_VERSION ${PLAYUVER_VERSION} )
|
||||
|
||||
ADD_SUBDIRECTORY( ${FERVOR_DIR} )
|
||||
|
||||
INCLUDE_DIRECTORIES( ${FERVOR_DIR} )
|
||||
LIST(APPEND APP_LINKER_LIBS "Fervor" )
|
||||
|
||||
LIST(APPEND APP_LINKER_LIBS Fervor )
|
||||
|
||||
FIND_PACKAGE( Qt5 REQUIRED Network WebKit WebKitWidgets )
|
||||
|
||||
LIST(APPEND QT_LINKER_LIBS Qt5::Network Qt5::Webkit Qt5::WebKitWidgets )
|
||||
LIST(APPEND QT_LINKER_LIBS Qt5::Network Qt5::WebKit Qt5::WebKitWidgets )
|
||||
LIST(APPEND QT_MODULES Network WebKit WebKitWidgets )
|
||||
|
||||
LIST(APPEND LINKER_LIBS ${FERVOR_DEPENDENCIES} )
|
||||
# LIST(APPEND APP_LINKER_LIBS ${FERVOR_DEPENDENCIES} )
|
||||
INCLUDE_DIRECTORIES( ${FERVOR_INCLUDE_DIRS} )
|
||||
|
||||
SET(QT_USE_QTNETWORK true)
|
||||
@@ -130,6 +139,9 @@ IF( USE_FERVOR )
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
SET_PACKAGE_PROPERTIES(Fervor PROPERTIES URL "http://ffmpeg.org/" DESCRIPTION "Fervor lib includes check for updates feature" TYPE OPTIONAL )
|
||||
ADD_FEATURE_INFO(Fervor USE_FERVOR "Fervor lib includes check for updates feature.")
|
||||
|
||||
IF( USE_QT4 )
|
||||
QT4_WRAP_UI( plaYUver_App_UI_Wrap ${plaYUver_App_UI} )
|
||||
QT4_ADD_RESOURCES( plaYUver_App_RCC ${plaYUver_App_RCC} )
|
||||
@@ -160,7 +172,7 @@ ENDIF()
|
||||
|
||||
ADD_EXECUTABLE( ${PROJECT_NAME} ${plaYUver_App_SRCS} ${HEADERS_MOC_FILES} ${plaYUver_App_UI_Wrap} ${plaYUver_App_RCC} ${WINDOWS_RES_FILE} )
|
||||
|
||||
TARGET_LINK_LIBRARIES( ${PROJECT_NAME} PlaYUVerLib PlaYUVerModules ${QT_LINKER_LIBS} ${APP_LINKER_LIBS} )
|
||||
TARGET_LINK_LIBRARIES( ${PROJECT_NAME} PlaYUVerLib PlaYUVerModules ${APP_LINKER_LIBS} ${QT_LINKER_LIBS} )
|
||||
|
||||
IF( NOT USE_QT4 )
|
||||
QT5_USE_MODULES( ${PROJECT_NAME} ${QT_MODULES} )
|
||||
|
||||
+3
-2
@@ -132,9 +132,10 @@ int main( int argc, char *argv[] )
|
||||
plaYUVerApp mainwindow;
|
||||
mainwindow.show();
|
||||
mainwindow.parseArgs( argc, argv );
|
||||
|
||||
#ifdef USE_FERVOR
|
||||
FvUpdater::sharedUpdater()->SetFeedURL("http://192.168.96.201/share/pixLRA/plaYUVer/PlaYUVerUpdate.xml");
|
||||
FvUpdater::sharedUpdater()->SetDependencies(DEPENDENCIES_STRING);
|
||||
FvUpdater::sharedUpdater()->SetFeedURL("http://192.168.96.201/share/pixLRA/plaYUVer/PlaYUVerUpdate-" UPDATE_CHANNEL ".xml");
|
||||
FvUpdater::sharedUpdater()->SetDependencies("ALL");
|
||||
#endif
|
||||
|
||||
return application.exec();
|
||||
|
||||
+1
-1
@@ -23,10 +23,10 @@
|
||||
*/
|
||||
|
||||
#include <QtDebug>
|
||||
#include "plaYUVerApp.h"
|
||||
#ifdef USE_FERVOR
|
||||
#include "fvupdater.h"
|
||||
#endif
|
||||
#include "plaYUVerApp.h"
|
||||
#include "PlaYUVerSubWindowHandle.h"
|
||||
#include "VideoHandle.h"
|
||||
#include "QualityHandle.h"
|
||||
|
||||
+2
-2
@@ -31,9 +31,9 @@
|
||||
#define PLAYUVER_VERSION_MINOR @PLAYUVER_VERSION_MINOR@
|
||||
#define PLAYUVER_VERSION_PATCH @PLAYUVER_VERSION_PATCH@
|
||||
#define PLAYUVER_VERSION @PLAYUVER_VERSION@
|
||||
#define PLAYUVER_VERSION_STRING "@PLAYUVER_VERSION@"
|
||||
#define PLAYUVER_VERSION_STRING "@PLAYUVER_VERSION_STRING@"
|
||||
|
||||
#define DEPENDENCIES_STRING "@DEPENDENCIES_STRING@"
|
||||
#define UPDATE_CHANNEL "@UPDATE_CHANNEL@"
|
||||
|
||||
/* CPU features */
|
||||
#cmakedefine USE_SSE
|
||||
|
||||
Reference in new issue
Block a user