mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-25 15:39:27 -05:00
merged changes from master
This commit is contained in:
commit
311358bcda
43
build_scripts/Windows/GetRsVersion.bat
Normal file
43
build_scripts/Windows/GetRsVersion.bat
Normal file
@ -0,0 +1,43 @@
|
||||
@:: Usage:
|
||||
@:: call GetRsVersion.bat Define Variable
|
||||
|
||||
@setlocal
|
||||
@echo off
|
||||
|
||||
set Define=%~1
|
||||
if "%Define%"=="" (
|
||||
echo.
|
||||
echo Parameter error
|
||||
endlocal
|
||||
exit /B1
|
||||
)
|
||||
|
||||
set Variable=%~2
|
||||
if "%Variable%"=="" (
|
||||
echo.
|
||||
echo Parameter error
|
||||
endlocal
|
||||
exit /B1
|
||||
)
|
||||
|
||||
set Result=
|
||||
set VersionFile="%~dp0..\..\libretroshare\src\retroshare\rsversion.h"
|
||||
|
||||
if not exist "%VersionFile%" (
|
||||
echo.
|
||||
echo Version file doesn't exist.
|
||||
echo %VersionFile%
|
||||
endlocal
|
||||
exit /B1
|
||||
)
|
||||
|
||||
for /F "usebackq tokens=1,2,3" %%A in (%VersionFile%) do (
|
||||
if "%%A"=="#define" (
|
||||
if "%%B"=="%Define%" (
|
||||
set Result=%%~C
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
endlocal & set %Variable%=%Result%
|
||||
exit /B 0
|
@ -24,32 +24,27 @@ if "%MinGWDir%" NEQ "" set NSIS_PARAM=%NSIS_PARAM% /DMINGWDIR="%MinGWDir%"
|
||||
if "%OutDir%" NEQ "" set NSIS_PARAM=%NSIS_PARAM% /DOUTDIR="%OutDir%"
|
||||
|
||||
:: Scan version from source
|
||||
set Revision=
|
||||
set BuildAdd=
|
||||
set VersionFile="%SourceDir%\libretroshare\src\retroshare\rsversion.h"
|
||||
call "%~dp0GetRsVersion.bat" RS_REVISION_STRING Revision
|
||||
if errorlevel 1 goto exit
|
||||
call "%~dp0GetRsVersion.bat" RS_BUILD_NUMBER_ADD BuildAdd
|
||||
if errorlevel 1 goto exit
|
||||
|
||||
if not exist "%VersionFile%" (
|
||||
if "%Revision%"=="" (
|
||||
echo.
|
||||
echo Version file doesn't exist.
|
||||
echo Version not found in
|
||||
echo %VersionFile%
|
||||
goto :exit
|
||||
goto exit
|
||||
)
|
||||
|
||||
for /F "usebackq tokens=1,2,3" %%A in (%VersionFile%) do (
|
||||
if "%%A"=="#define" (
|
||||
if "%%B"=="RS_BUILD_NUMBER_ADD" (
|
||||
set BuildAdd=%%~C
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
if "%BuildAdd%"=="" (
|
||||
echo.
|
||||
echo Version not found in
|
||||
echo %VersionFile%
|
||||
goto :exit
|
||||
goto exit
|
||||
)
|
||||
|
||||
set NSIS_PARAM=%NSIS_PARAM% /DBUILDADD=%BuildAdd%
|
||||
set NSIS_PARAM=%NSIS_PARAM% /DREVISION=%Revision% /DBUILDADD=%BuildAdd%
|
||||
|
||||
:: Create installer
|
||||
"%NSIS_EXE%" %NSIS_PARAM% "%~dp0retroshare.nsi"
|
||||
|
@ -42,7 +42,7 @@
|
||||
!GetDllVersion "${RELEASEDIR}\retroshare-gui\src\release\RetroShare.exe" VERSION_
|
||||
|
||||
!define VERSION ${VERSION_1}.${VERSION_2}.${VERSION_3}${BUILDADD}
|
||||
!define REVISION ${VERSION_4}
|
||||
;!define REVISION ${VERSION_4}
|
||||
|
||||
# Check version
|
||||
!ifndef REVISION
|
||||
@ -53,6 +53,9 @@
|
||||
!error "REVISION is not defined"
|
||||
!endif
|
||||
|
||||
# Date
|
||||
!define /date Date "%Y%m%d"
|
||||
|
||||
# Application name and version
|
||||
!define APPNAME "RetroShare"
|
||||
!define APPNAMEANDVERSION "${APPNAME} ${VERSION}"
|
||||
@ -68,7 +71,7 @@
|
||||
# Main Install settings
|
||||
Name "${APPNAMEANDVERSION}"
|
||||
InstallDirRegKey HKLM "Software\${APPNAME}" ""
|
||||
OutFile "${OUTDIR_}RetroShare_${VERSION}_${REVISION}_setup.exe"
|
||||
OutFile "${OUTDIR_}RetroShare-${VERSION}-${Date}-${REVISION}-setup.exe"
|
||||
BrandingText "${APPNAMEANDVERSION}"
|
||||
RequestExecutionlevel highest
|
||||
# Use compression
|
||||
|
@ -189,9 +189,16 @@ linux-g++-64 {
|
||||
}
|
||||
|
||||
version_detail_bash_script {
|
||||
QMAKE_EXTRA_TARGETS += write_version_detail
|
||||
PRE_TARGETDEPS = write_version_detail
|
||||
write_version_detail.commands = ./version_detail.sh
|
||||
linux-* {
|
||||
QMAKE_EXTRA_TARGETS += write_version_detail
|
||||
PRE_TARGETDEPS = write_version_detail
|
||||
write_version_detail.commands = ./version_detail.sh
|
||||
}
|
||||
win32 {
|
||||
QMAKE_EXTRA_TARGETS += write_version_detail
|
||||
PRE_TARGETDEPS = write_version_detail
|
||||
write_version_detail.commands = $$PWD/version_detail.bat
|
||||
}
|
||||
}
|
||||
|
||||
#################### Cross compilation for windows under Linux ####################
|
||||
|
@ -8,4 +8,5 @@
|
||||
//
|
||||
// Do not forget the 0x, since the RS_REVISION_NUMBER should be an integer.
|
||||
//
|
||||
#define RS_REVISION_STRING "01234567"
|
||||
#define RS_REVISION_NUMBER 0x01234567
|
||||
|
@ -2,4 +2,11 @@
|
||||
#define RS_MINOR_VERSION 6
|
||||
#define RS_BUILD_NUMBER 0
|
||||
#define RS_BUILD_NUMBER_ADD "x" // <-- do we need this?
|
||||
#define RS_REVISION_NUMBER $WCREV$
|
||||
|
||||
// The revision number should be the 4 first bytes of the git revision hash, which is obtained using:
|
||||
// git log --pretty="%H" | head -1 | cut -c1-8
|
||||
//
|
||||
// Do not forget the 0x, since the RS_REVISION_NUMBER should be an integer.
|
||||
//
|
||||
#define RS_REVISION_STRING "$REV$"
|
||||
#define RS_REVISION_NUMBER 0x$REV$
|
||||
|
@ -1,2 +0,0 @@
|
||||
@echo off
|
||||
"D:\Programme\TortoiseSVN\bin\SubWCRev" . util\rsversion.in util\rsversion.h
|
48
libretroshare/src/version_detail.bat
Normal file
48
libretroshare/src/version_detail.bat
Normal file
@ -0,0 +1,48 @@
|
||||
@echo off
|
||||
|
||||
setlocal enabledelayedexpansion
|
||||
|
||||
:: Search git in PATH
|
||||
set GitPath=
|
||||
for %%P in ("%PATH:;=" "%") do (
|
||||
if exist "%%~P.\git.exe" (
|
||||
set GitPath=%%~P
|
||||
goto found_git
|
||||
)
|
||||
)
|
||||
|
||||
:found_git
|
||||
if "%GitPath%"=="" (
|
||||
echo git not found in PATH. Version update cancelled.
|
||||
endlocal
|
||||
exit /B 0
|
||||
)
|
||||
|
||||
echo Update version
|
||||
|
||||
:: Retrieve git information
|
||||
set RsHash=
|
||||
|
||||
pushd "%~dp0"
|
||||
for /f "tokens=1*" %%A in ('"git log --pretty=format:"%%H" --max-count=1"') do set RsHash=%%A
|
||||
popd
|
||||
|
||||
if "%RsHash%"=="" (
|
||||
echo Git hash not found.
|
||||
endlocal
|
||||
exit /B 1
|
||||
)
|
||||
|
||||
:: Create file
|
||||
set InFile=%~dp0retroshare\rsversion.in
|
||||
set OutFile=%~dp0retroshare\rsversion.h
|
||||
if exist "%OutFile%" del /Q "%OutFile%"
|
||||
|
||||
for /f "tokens=* delims= " %%a in (%InFile%) do (
|
||||
set line=%%a
|
||||
set line=!line:$REV$=%RsHash:~0,8%!
|
||||
echo !line!>>"%OutFile%"
|
||||
)
|
||||
|
||||
endlocal
|
||||
exit /B 0
|
4
retroshare-gui/src/gui/help/version.html.in
Normal file
4
retroshare-gui/src/gui/help/version.html.in
Normal file
@ -0,0 +1,4 @@
|
||||
Retroshare Gui version :
|
||||
Git version : $Branch$
|
||||
$Hash$
|
||||
$Date$
|
@ -5,11 +5,11 @@
|
||||
IDI_ICON1 ICON "logo/logo_64.ico"
|
||||
|
||||
#define STRINGIZER(version) #version
|
||||
#define VERSION_STRING(major,minor,build,buildadd,revision) STRINGIZER(major) "." STRINGIZER(minor) "." STRINGIZER(build) buildadd "." STRINGIZER(revision)
|
||||
#define VERSION_STRING(major,minor,build,buildadd,revision) STRINGIZER(major) "." STRINGIZER(minor) "." STRINGIZER(build) buildadd "." revision
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION RS_MAJOR_VERSION,RS_MINOR_VERSION,RS_BUILD_NUMBER,RS_REVISION_NUMBER
|
||||
PRODUCTVERSION RS_MAJOR_VERSION,RS_MINOR_VERSION,RS_BUILD_NUMBER,RS_REVISION_NUMBER
|
||||
FILEVERSION RS_MAJOR_VERSION,RS_MINOR_VERSION,RS_BUILD_NUMBER,0
|
||||
PRODUCTVERSION RS_MAJOR_VERSION,RS_MINOR_VERSION,RS_BUILD_NUMBER,0
|
||||
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
|
||||
FILEFLAGS 0
|
||||
FILEOS VOS_NT_WINDOWS32
|
||||
@ -22,11 +22,11 @@ BEGIN
|
||||
BEGIN
|
||||
VALUE "CompanyName", ""
|
||||
VALUE "FileDescription", "RetroShare"
|
||||
VALUE "FileVersion", VERSION_STRING(RS_MAJOR_VERSION, RS_MINOR_VERSION, RS_BUILD_NUMBER, RS_BUILD_NUMBER_ADD, RS_REVISION_NUMBER)
|
||||
VALUE "FileVersion", VERSION_STRING(RS_MAJOR_VERSION, RS_MINOR_VERSION, RS_BUILD_NUMBER, RS_BUILD_NUMBER_ADD, RS_REVISION_STRING)
|
||||
VALUE "InternalName", "RetroShare"
|
||||
VALUE "OriginalFilename", "RetroShare.exe"
|
||||
VALUE "ProductName", "RetroShare"
|
||||
VALUE "ProductVersion", VERSION_STRING(RS_MAJOR_VERSION, RS_MINOR_VERSION, RS_BUILD_NUMBER, RS_BUILD_NUMBER_ADD, RS_REVISION_NUMBER)
|
||||
VALUE "ProductVersion", VERSION_STRING(RS_MAJOR_VERSION, RS_MINOR_VERSION, RS_BUILD_NUMBER, RS_BUILD_NUMBER_ADD, RS_REVISION_STRING)
|
||||
VALUE "LegalCopyright", ""
|
||||
END
|
||||
END
|
||||
|
@ -118,10 +118,17 @@ linux-g++-64 {
|
||||
}
|
||||
|
||||
version_detail_bash_script {
|
||||
DEFINES += ADD_LIBRETROSHARE_VERSION_INFO
|
||||
QMAKE_EXTRA_TARGETS += write_version_detail
|
||||
PRE_TARGETDEPS = write_version_detail
|
||||
write_version_detail.commands = ./version_detail.sh
|
||||
linux-* {
|
||||
DEFINES += ADD_LIBRETROSHARE_VERSION_INFO
|
||||
QMAKE_EXTRA_TARGETS += write_version_detail
|
||||
PRE_TARGETDEPS = write_version_detail
|
||||
write_version_detail.commands = ./version_detail.sh
|
||||
}
|
||||
win32 {
|
||||
QMAKE_EXTRA_TARGETS += write_version_detail
|
||||
PRE_TARGETDEPS = write_version_detail
|
||||
write_version_detail.commands = $$PWD/version_detail.bat
|
||||
}
|
||||
}
|
||||
|
||||
install_rs {
|
||||
|
@ -1,2 +0,0 @@
|
||||
@echo off
|
||||
"D:\Programme\TortoiseSVN\bin\SubWCRev" . util\rsguiversion.in util\rsguiversion.cpp
|
59
retroshare-gui/src/version_detail.bat
Normal file
59
retroshare-gui/src/version_detail.bat
Normal file
@ -0,0 +1,59 @@
|
||||
@echo off
|
||||
|
||||
setlocal enabledelayedexpansion
|
||||
|
||||
:: Search git in PATH
|
||||
set GitPath=
|
||||
for %%P in ("%PATH:;=" "%") do (
|
||||
if exist "%%~P.\git.exe" (
|
||||
set GitPath=%%~P
|
||||
goto found_git
|
||||
)
|
||||
)
|
||||
|
||||
:found_git
|
||||
if "%GitPath%"=="" (
|
||||
echo git not found in PATH. Version update cancelled.
|
||||
endlocal
|
||||
exit /B 0
|
||||
)
|
||||
|
||||
echo Update version
|
||||
|
||||
:: Retrieve git information
|
||||
set RsBranch=
|
||||
set RsHash=
|
||||
|
||||
pushd "%~dp0"
|
||||
for /f "tokens=1*" %%A in ('"git log --pretty=format:"%%H" --max-count=1"') do set RsHash=%%A
|
||||
for /f "tokens=*" %%A in ('git rev-parse --abbrev-ref HEAD') do set RsBranch=%%A
|
||||
popd
|
||||
|
||||
if "%RsBranch%"=="" (
|
||||
echo Git branch not found.
|
||||
endlocal
|
||||
exit /B 1
|
||||
)
|
||||
if "%RsHash%"=="" (
|
||||
echo Git hash not found.
|
||||
endlocal
|
||||
exit /B 1
|
||||
)
|
||||
|
||||
set RsDate=%date% %TIME%
|
||||
|
||||
:: Create file
|
||||
set InFile=%~dp0gui\help\version.html.in
|
||||
set OutFile=%~dp0gui\help\version.html
|
||||
if exist "%OutFile%" del /Q "%OutFile%"
|
||||
|
||||
for /f "tokens=* delims= " %%a in (%InFile%) do (
|
||||
set line=%%a
|
||||
set line=!line:$Hash$=%RsHash%!
|
||||
set line=!line:$Branch$=%RsBranch%!
|
||||
set line=!line:$Date$=%RsDate%!
|
||||
echo !line!>>"%OutFile%"
|
||||
)
|
||||
|
||||
endlocal
|
||||
exit /B 0
|
Loading…
Reference in New Issue
Block a user