Set the revision mechanism independent from the VCS name
This commit is contained in:
parent
62f1ed054b
commit
eb7a85b8f9
2
.gitignore
vendored
2
.gitignore
vendored
@ -63,7 +63,7 @@ tags
|
|||||||
# /libs/ardour/
|
# /libs/ardour/
|
||||||
/libs/ardour/version.cc
|
/libs/ardour/version.cc
|
||||||
/libs/ardour/ardour/version.h
|
/libs/ardour/ardour/version.h
|
||||||
/libs/ardour/svn_revision.cc
|
/libs/ardour/revision.cc
|
||||||
/libs/ardour/config_text.cc
|
/libs/ardour/config_text.cc
|
||||||
|
|
||||||
# /libs/gtkmm2ext/
|
# /libs/gtkmm2ext/
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
#include "pbd/file_utils.h"
|
#include "pbd/file_utils.h"
|
||||||
|
|
||||||
#include "ardour/svn_revision.h"
|
#include "ardour/revision.h"
|
||||||
#include "ardour/version.h"
|
#include "ardour/version.h"
|
||||||
#include "ardour/filesystem_paths.h"
|
#include "ardour/filesystem_paths.h"
|
||||||
|
|
||||||
@ -582,7 +582,7 @@ About::About ()
|
|||||||
set_website_label (_("http://ardour.org/"));
|
set_website_label (_("http://ardour.org/"));
|
||||||
set_version ((string_compose(_("%1\n(built from revision %2)"),
|
set_version ((string_compose(_("%1\n(built from revision %2)"),
|
||||||
VERSIONSTRING,
|
VERSIONSTRING,
|
||||||
svn_revision)));
|
revision)));
|
||||||
|
|
||||||
Gtk::Button* config_button = manage (new Button (_("Config")));
|
Gtk::Button* config_button = manage (new Button (_("Config")));
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
|
|
||||||
#include <jack/jack.h>
|
#include <jack/jack.h>
|
||||||
|
|
||||||
#include "ardour/svn_revision.h"
|
#include "ardour/revision.h"
|
||||||
#include "ardour/version.h"
|
#include "ardour/version.h"
|
||||||
#include "ardour/ardour.h"
|
#include "ardour/ardour.h"
|
||||||
#include "ardour/audioengine.h"
|
#include "ardour/audioengine.h"
|
||||||
@ -485,7 +485,7 @@ int main (int argc, char *argv[])
|
|||||||
cout << PROGRAM_NAME
|
cout << PROGRAM_NAME
|
||||||
<< VERSIONSTRING
|
<< VERSIONSTRING
|
||||||
<< _(" (built using ")
|
<< _(" (built using ")
|
||||||
<< svn_revision
|
<< revision
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
<< _(" and GCC version ") << __VERSION__
|
<< _(" and GCC version ") << __VERSION__
|
||||||
#endif
|
#endif
|
||||||
|
@ -17,11 +17,11 @@
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __ardour_svn_revision_h__
|
#ifndef __ardour_revision_h__
|
||||||
#define __ardour_svn_revision_h__
|
#define __ardour_revision_h__
|
||||||
|
|
||||||
namespace ARDOUR {
|
namespace ARDOUR {
|
||||||
extern const char* svn_revision;
|
extern const char* revision;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
#include <glibmm.h>
|
#include <glibmm.h>
|
||||||
|
|
||||||
#include "ardour/svn_revision.h"
|
#include "ardour/revision.h"
|
||||||
#include "ardour/session.h"
|
#include "ardour/session.h"
|
||||||
#include "ardour/session_metadata.h"
|
#include "ardour/session_metadata.h"
|
||||||
|
|
||||||
@ -89,7 +89,7 @@ BroadcastInfo::set_originator_ref_from_session (Session const & /*session*/)
|
|||||||
/* Serial number is 12 chars */
|
/* Serial number is 12 chars */
|
||||||
|
|
||||||
std::ostringstream serial_number;
|
std::ostringstream serial_number;
|
||||||
serial_number << "ARDOUR" << "r" << std::setfill('0') << std::right << std::setw(5) << svn_revision;
|
serial_number << "ARDOUR" << "r" << std::setfill('0') << std::right << std::setw(5) << revision;
|
||||||
|
|
||||||
snprintf_bounded_null_filled (info->originator_reference, sizeof (info->originator_reference), "%2s%3s%12s%02d%02d%02d%9d",
|
snprintf_bounded_null_filled (info->originator_reference, sizeof (info->originator_reference), "%2s%3s%12s%02d%02d%02d%9d",
|
||||||
SessionMetadata::Metadata()->country().c_str(),
|
SessionMetadata::Metadata()->country().c_str(),
|
||||||
|
@ -204,7 +204,7 @@ libardour_sources = [
|
|||||||
'source_factory.cc',
|
'source_factory.cc',
|
||||||
'speakers.cc',
|
'speakers.cc',
|
||||||
'strip_silence.cc',
|
'strip_silence.cc',
|
||||||
'svn_revision.cc',
|
'revision.cc',
|
||||||
'tape_file_matcher.cc',
|
'tape_file_matcher.cc',
|
||||||
'template_utils.cc',
|
'template_utils.cc',
|
||||||
'tempo.cc',
|
'tempo.cc',
|
||||||
|
@ -88,9 +88,9 @@ if test x$STRIP != xall -a x$STRIP != xnone -a x$STRIP != xsome ; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
release_version=`grep -m 1 '[^A-Za-z_]LINUX_VERSION = ' ../../wscript | awk '{ print $3 }' | sed "s/'//g"`
|
release_version=`grep -m 1 '[^A-Za-z_]LINUX_VERSION = ' ../../wscript | awk '{ print $3 }' | sed "s/'//g"`
|
||||||
svn_version=`grep -m 1 'svn_revision =' ../../libs/ardour/svn_revision.cc | cut -d'"' -f 2`
|
revision=`grep -m 1 'revision =' ../../libs/ardour/revision.cc | cut -d'"' -f 2`
|
||||||
echo "Version is $release_version / $svn_version"
|
echo "Version is $release_version / $revision"
|
||||||
info_string="$release_version/$svn_version built on `hostname` by `whoami` on `date`"
|
info_string="$release_version/$revision built on `hostname` by `whoami` on `date`"
|
||||||
echo "Info string is $info_string"
|
echo "Info string is $info_string"
|
||||||
|
|
||||||
# Figure out our CPU type
|
# Figure out our CPU type
|
||||||
@ -131,11 +131,11 @@ fi
|
|||||||
# setup directory structure
|
# setup directory structure
|
||||||
|
|
||||||
if [ -z "${BUILDTYPE}" ]; then
|
if [ -z "${BUILDTYPE}" ]; then
|
||||||
APPDIR=${APPNAME}_${ARCH}-${release_version}_${svn_version}
|
APPDIR=${APPNAME}_${ARCH}-${release_version}_${revision}
|
||||||
APP_VER_NAME=${APPNAME}-${release_version}_${svn_version}
|
APP_VER_NAME=${APPNAME}-${release_version}_${revision}
|
||||||
else
|
else
|
||||||
APPDIR=${APPNAME}_${ARCH}-${release_version}_${svn_version}-${BUILDTYPE}
|
APPDIR=${APPNAME}_${ARCH}-${release_version}_${revision}-${BUILDTYPE}
|
||||||
APP_VER_NAME=${APPNAME}-${release_version}_${svn_version}-${BUILDTYPE}
|
APP_VER_NAME=${APPNAME}-${release_version}_${revision}-${BUILDTYPE}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
APPBIN=$APPDIR/bin
|
APPBIN=$APPDIR/bin
|
||||||
@ -535,7 +535,7 @@ done
|
|||||||
#
|
#
|
||||||
# Add the uninstaller
|
# Add the uninstaller
|
||||||
#
|
#
|
||||||
sed -e "s/%REPLACE_PGM%/${APPNAME}/" -e "s/%REPLACE_VENDOR%/${VENDOR}/" -e "s/%REPLACE_VERSION%/${release_version}/" -e "s/%REPLACE_BUILD%/${svn_version}/" -e "s/%REPLACE_TYPE%/${BUILDTYPE}/" < uninstall.sh.in > $APPBIN/${APP_VER_NAME}.uninstall.sh
|
sed -e "s/%REPLACE_PGM%/${APPNAME}/" -e "s/%REPLACE_VENDOR%/${VENDOR}/" -e "s/%REPLACE_VERSION%/${release_version}/" -e "s/%REPLACE_BUILD%/${revision}/" -e "s/%REPLACE_TYPE%/${BUILDTYPE}/" < uninstall.sh.in > $APPBIN/${APP_VER_NAME}.uninstall.sh
|
||||||
chmod a+x $APPBIN/${APP_VER_NAME}.uninstall.sh
|
chmod a+x $APPBIN/${APP_VER_NAME}.uninstall.sh
|
||||||
|
|
||||||
#Sanity Check file
|
#Sanity Check file
|
||||||
|
@ -63,10 +63,10 @@ if [ x$DEBUG = xT ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
release_version=`grep -m 1 '[^A-Za-z_]LINUX_VERSION = ' ../../wscript | awk '{print $3}' | sed "s/'//g"`
|
release_version=`grep -m 1 '[^A-Za-z_]LINUX_VERSION = ' ../../wscript | awk '{print $3}' | sed "s/'//g"`
|
||||||
svn_version=`grep -m 1 'svn_revision =' ../../libs/ardour/svn_revision.cc | cut -d'"' -f 2`
|
revision=`grep -m 1 'revision =' ../../libs/ardour/revision.cc | cut -d'"' -f 2`
|
||||||
|
|
||||||
X86_BUNDLE="${APPNAME}_x86-${release_version}_${svn_version}"
|
X86_BUNDLE="${APPNAME}_x86-${release_version}_${revision}"
|
||||||
X86_64_BUNDLE="${APPNAME}_x86_64-${release_version}_${svn_version}"
|
X86_64_BUNDLE="${APPNAME}_x86_64-${release_version}_${revision}"
|
||||||
|
|
||||||
if [ ! -z ${BUILDTYPE} ]; then
|
if [ ! -z ${BUILDTYPE} ]; then
|
||||||
X86_BUNDLE="${X86_BUNDLE}-${BUILDTYPE}"
|
X86_BUNDLE="${X86_BUNDLE}-${BUILDTYPE}"
|
||||||
@ -122,22 +122,22 @@ fi
|
|||||||
if [ -z ${BUILDTYPE} ]; then
|
if [ -z ${BUILDTYPE} ]; then
|
||||||
if [ "${SINGLE_ARCH}" = "T" ]; then
|
if [ "${SINGLE_ARCH}" = "T" ]; then
|
||||||
if [ "${X86_BUNDLE_OK}" = "T" ]; then
|
if [ "${X86_BUNDLE_OK}" = "T" ]; then
|
||||||
PACKAGE="${APPNAME}_32bit-${release_version}_${svn_version}"
|
PACKAGE="${APPNAME}_32bit-${release_version}_${revision}"
|
||||||
else
|
else
|
||||||
PACKAGE="${APPNAME}_64bit-${release_version}_${svn_version}"
|
PACKAGE="${APPNAME}_64bit-${release_version}_${revision}"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
PACKAGE="${APPNAME}-${release_version}_${svn_version}"
|
PACKAGE="${APPNAME}-${release_version}_${revision}"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
if [ "${SINGLE_ARCH}" = "T" ]; then
|
if [ "${SINGLE_ARCH}" = "T" ]; then
|
||||||
if [ "${X86_BUNDLE_OK}" = "T" ]; then
|
if [ "${X86_BUNDLE_OK}" = "T" ]; then
|
||||||
PACKAGE="${APPNAME}_32bit-${release_version}_${svn_version}-${BUILDTYPE}"
|
PACKAGE="${APPNAME}_32bit-${release_version}_${revision}-${BUILDTYPE}"
|
||||||
else
|
else
|
||||||
PACKAGE="${APPNAME}_64bit-${release_version}_${svn_version}-${BUILDTYPE}"
|
PACKAGE="${APPNAME}_64bit-${release_version}_${revision}-${BUILDTYPE}"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
PACKAGE="${APPNAME}-${release_version}_${svn_version}-${BUILDTYPE}"
|
PACKAGE="${APPNAME}-${release_version}_${revision}-${BUILDTYPE}"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -64,9 +64,9 @@ done
|
|||||||
|
|
||||||
#release_version=`grep -m 1 '[^A-Za-z_]OSX_VERSION = ' ../../wscript | cut -d' ' -f 3 | sed "s/'//g"`
|
#release_version=`grep -m 1 '[^A-Za-z_]OSX_VERSION = ' ../../wscript | cut -d' ' -f 3 | sed "s/'//g"`
|
||||||
release_version=3.0
|
release_version=3.0
|
||||||
svn_version=`grep -m 1 'svn_revision =' ../../libs/ardour/svn_revision.cc | cut -d' ' -f 8 | sed 's/[^0-9]//g'`
|
revision=`grep -m 1 'revision =' ../../libs/ardour/revision.cc | cut -d' ' -f 8 | sed 's/[^0-9]//g'`
|
||||||
echo "Version is $release_version / $svn_version"
|
echo "Version is $release_version / $revision"
|
||||||
info_string="$release_version/$svn_version built on `hostname` by `whoami` on `date`"
|
info_string="$release_version/$revision built on `hostname` by `whoami` on `date`"
|
||||||
echo "Info string is $info_string"
|
echo "Info string is $info_string"
|
||||||
|
|
||||||
# setup directory structure
|
# setup directory structure
|
||||||
@ -166,12 +166,12 @@ env="<key>LSEnvironment</key><dict>$env<key>ARDOUR_BUNDLED</key><string>true</st
|
|||||||
|
|
||||||
# edit plist
|
# edit plist
|
||||||
sed -e "s?@ENV@?$env?g" \
|
sed -e "s?@ENV@?$env?g" \
|
||||||
-e "s?@VERSION@?$release_version/$svn_version?g" \
|
-e "s?@VERSION@?$release_version/$revision?g" \
|
||||||
-e "s?@INFOSTRING@?$info_string?g" < Info.plist.in > Info.plist
|
-e "s?@INFOSTRING@?$info_string?g" < Info.plist.in > Info.plist
|
||||||
# and plist strings
|
# and plist strings
|
||||||
sed -e "s?@APPNAME@?$appname?" \
|
sed -e "s?@APPNAME@?$appname?" \
|
||||||
-e "s?@ENV@?$env?g" \
|
-e "s?@ENV@?$env?g" \
|
||||||
-e "s?@VERSION@?$release_version/$svn_version?g" \
|
-e "s?@VERSION@?$release_version/$revision?g" \
|
||||||
-e "s?@INFOSTRING@?$info_string?g" < InfoPlist.strings.in > Resources/InfoPlist.strings || exit 1
|
-e "s?@INFOSTRING@?$info_string?g" < InfoPlist.strings.in > Resources/InfoPlist.strings || exit 1
|
||||||
|
|
||||||
# copy static files
|
# copy static files
|
||||||
@ -497,9 +497,9 @@ fi
|
|||||||
|
|
||||||
echo "Building DMG ..."
|
echo "Building DMG ..."
|
||||||
|
|
||||||
# UC_DMG=$APPNAME-${release_version}-${svn_version}-UC.dmg
|
# UC_DMG=$APPNAME-${release_version}-${revision}-UC.dmg
|
||||||
# FINAL_DMG=$APPNAME-${release_version}-${svn_version}.dmg
|
# FINAL_DMG=$APPNAME-${release_version}-${revision}.dmg
|
||||||
UC_DMG=$APPNAME-${release_version}-${svn_version}.dmg
|
UC_DMG=$APPNAME-${release_version}-${revision}.dmg
|
||||||
VOLNAME=$APPNAME-$release_version
|
VOLNAME=$APPNAME-$release_version
|
||||||
|
|
||||||
# TODO use mktemp
|
# TODO use mktemp
|
||||||
|
16
wscript
16
wscript
@ -84,22 +84,22 @@ def create_stored_revision():
|
|||||||
if os.path.exists('.git'):
|
if os.path.exists('.git'):
|
||||||
rev = fetch_git_revision();
|
rev = fetch_git_revision();
|
||||||
print("ardour.git version: " + rev + "\n")
|
print("ardour.git version: " + rev + "\n")
|
||||||
elif os.path.exists('libs/ardour/svn_revision.cc'):
|
elif os.path.exists('libs/ardour/revision.cc'):
|
||||||
print("Using packaged svn revision")
|
print("Using packaged revision")
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
print("Missing libs/ardour/svn_revision.cc. Blame the packager.")
|
print("Missing libs/ardour/revision.cc. Blame the packager.")
|
||||||
sys.exit(-1)
|
sys.exit(-1)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
text = '#include "ardour/svn_revision.h"\n'
|
text = '#include "ardour/revision.h"\n'
|
||||||
text += 'namespace ARDOUR { const char* svn_revision = \"%s\"; }\n' % rev
|
text += 'namespace ARDOUR { const char* revision = \"%s\"; }\n' % rev
|
||||||
print('Writing revision info to libs/ardour/svn_revision.cc using ' + rev)
|
print('Writing revision info to libs/ardour/revision.cc using ' + rev)
|
||||||
o = open('libs/ardour/svn_revision.cc', 'w')
|
o = open('libs/ardour/revision.cc', 'w')
|
||||||
o.write(text)
|
o.write(text)
|
||||||
o.close()
|
o.close()
|
||||||
except IOError:
|
except IOError:
|
||||||
print('Could not open libs/ardour/svn_revision.cc for writing\n')
|
print('Could not open libs/ardour/revision.cc for writing\n')
|
||||||
sys.exit(-1)
|
sys.exit(-1)
|
||||||
|
|
||||||
def set_compiler_flags (conf,opt):
|
def set_compiler_flags (conf,opt):
|
||||||
|
Loading…
Reference in New Issue
Block a user