Skip to content
This repository has been archived by the owner on Aug 29, 2024. It is now read-only.

Commit

Permalink
use the version passed from the build script in the qmake configuration
Browse files Browse the repository at this point in the history
If it is not available, we fallback to reading the VERSION file.
  • Loading branch information
ashkulz committed Apr 16, 2014
1 parent 134d3ca commit e8880cb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions common.pri
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ win32-g++*: QMAKE_LFLAGS += -static-libgcc -static-libstdc++
QT += webkit network xmlpatterns svg

# version related information
VERSION_TEXT=$$cat($$PWD/VERSION)
VERSION_TEXT=$$(WKHTMLTOX_VERSION)
isEmpty(VERSION_TEXT): $$cat($$PWD/VERSION)
VERSION_LIST=$$split(VERSION_TEXT, "-")
count(VERSION_LIST, 1) {
VERSION=$$VERSION_TEXT
FULL_VERSION=$$VERSION
} else {
VERSION=$$member(VERSION_LIST, 0)
BUILD=$$member(VERSION_LIST, 1)
system(git rev-parse HEAD):BUILD=$$system(git rev-parse HEAD)
FULL_VERSION=$$VERSION-$$BUILD
}

Expand Down
10 changes: 7 additions & 3 deletions scripts/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ def build_msvc_winsdk71(config, basedir, clean, debug):
if clean:
rmdir(os.path.join(basedir, config))

version, simple_version = get_version(basedir)
ssl_libs = build_openssl(config, basedir)

ssldir = os.path.join(basedir, config, 'openssl')
Expand All @@ -372,6 +373,8 @@ def build_msvc_winsdk71(config, basedir, clean, debug):
rmdir('bin')
mkdir_p('bin')

os.environ['WKHTMLTOX_VERSION'] = version

shell('%s\\bin\\qmake %s\\..\\wkhtmltopdf.pro' % (qtdir, basedir))
shell('nmake')

Expand All @@ -381,7 +384,6 @@ def build_msvc_winsdk71(config, basedir, clean, debug):
continue
found = True

version, simple_version = get_version(basedir)
makensis = os.path.join(os.environ[pfile], 'NSIS', 'makensis.exe')
os.chdir(os.path.join(basedir, '..'))
shell('"%s" /DVERSION=%s /DSIMPLE_VERSION=%s /DTARGET=%s wkhtmltox.nsi' % \
Expand All @@ -404,6 +406,7 @@ def build_mingw64_cross(config, basedir, clean):
if clean:
rmdir(os.path.join(basedir, config))

version, simple_version = get_version(basedir)
ssl_libs = build_openssl(config, basedir)

ssldir = os.path.join(basedir, config, 'openssl')
Expand Down Expand Up @@ -436,12 +439,12 @@ def build_mingw64_cross(config, basedir, clean):

# set up cross compiling prefix correctly (isn't set by make install)
os.environ['QTDIR'] = qtdir
os.environ['WKHTMLTOX_VERSION'] = version
shell('%s/bin/qmake -set CROSS_COMPILE %s-' % (qtdir, MINGW_W64_PREFIX[config]))
shell('%s/bin/qmake -spec win32-g++-4.6 %s/../wkhtmltopdf.pro' % (qtdir, basedir))
shell('make')
shutil.copy('bin/libwkhtmltox0.a', 'bin/wkhtmltox.lib')

version, simple_version = get_version(basedir)
os.chdir(os.path.join(basedir, '..'))
shell('makensis -DVERSION=%s -DSIMPLE_VERSION=%s -DTARGET=%s wkhtmltox.nsi' % \
(version, simple_version, config))
Expand Down Expand Up @@ -489,7 +492,8 @@ def build_linux_schroot(config, basedir, clean):
lines.append('make install || exit 1')
lines.append('cd ../app')
lines.append('rm -f bin/*')
lines.append('GIT_DIR=../../../.git ../qt/bin/qmake ../../../wkhtmltopdf.pro')
lines.append('export WKHTMLTOX_VERSION=%s' % version)
lines.append('../qt/bin/qmake ../../../wkhtmltopdf.pro')
lines.append('make -j%d || exit 1' % CPU_COUNT)
lines.append('strip bin/wkhtmltopdf bin/wkhtmltoimage')
lines.append('cp bin/wkhtmlto* ../wkhtmltox-%s/bin' % version)
Expand Down

0 comments on commit e8880cb

Please sign in to comment.