diff options
author | Remko Tronçon <git@el-tramo.be> | 2011-04-29 21:36:05 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2011-04-29 21:36:05 (GMT) |
commit | fa41e2adea4ddbb2eb0d05cbfa0dec7e290d55d5 (patch) | |
tree | cb23841b9c569acc513c9e0971f775365c48b7ae | |
parent | 0ad85cdec57d49b697215103cc73463eacc76eb5 (diff) | |
parent | 27042edc19e393b24e7953c668a7cec820b710d8 (diff) | |
download | swift-contrib-fa41e2adea4ddbb2eb0d05cbfa0dec7e290d55d5.zip swift-contrib-fa41e2adea4ddbb2eb0d05cbfa0dec7e290d55d5.tar.bz2 |
Merge branch 'swift-1.x'
* swift-1.x:
Build Swiften as a DLL in Debian package.
Added versioning to Swiften.
Conflicts:
BuildTools/Copyrighter.py
-rwxr-xr-x | BuildTools/Copyrighter.py | 2 | ||||
-rwxr-xr-x | Swift/Packaging/Debian/debian/rules | 2 | ||||
-rw-r--r-- | Swiften/.gitignore | 1 | ||||
-rw-r--r-- | Swiften/SConscript | 23 |
4 files changed, 22 insertions, 6 deletions
diff --git a/BuildTools/Copyrighter.py b/BuildTools/Copyrighter.py index 589459d..8916316 100755 --- a/BuildTools/Copyrighter.py +++ b/BuildTools/Copyrighter.py @@ -136,7 +136,7 @@ elif sys.argv[1] == "check-all-copyrights" : for (path, dirs, files) in os.walk(".") : if "3rdParty" in path or ".sconf" in path or "Swift.app" in path : continue - for filename in [os.path.join(path, file) for file in files if (file.endswith(".cpp") or file.endswith(".h")) and not "ui_" in file and not "moc_" in file and not "qrc_" in file and not "BuildVersion.h" in file and not "Swiften.h" in file and not "swiften-config.h" in file and not "linit.cpp" in file ] : + for filename in [os.path.join(path, file) for file in files if (file.endswith(".cpp") or file.endswith(".h")) and not "ui_" in file and not "moc_" in file and not "qrc_" in file and not "BuildVersion.h" in file and not "Swiften.h" in file and not "Version.h" in file and not "swiften-config.h" in file and not "linit.cpp" in file ] : ok &= check_copyright(filename) if not ok : sys.exit(-1) diff --git a/Swift/Packaging/Debian/debian/rules b/Swift/Packaging/Debian/debian/rules index bbda401..0c84852 100755 --- a/Swift/Packaging/Debian/debian/rules +++ b/Swift/Packaging/Debian/debian/rules @@ -13,7 +13,7 @@ install: build dh_testroot dh_prep dh_installdirs - scons optimize=1 debug=1 allow_warnings=1 qt=/usr/share/qt4 docbook_xsl=/usr/share/xml/docbook/stylesheet/docbook-xsl docbook_xml=/usr/share/xml/docbook/schema/dtd/4.5 SWIFT_INSTALLDIR=$(CURDIR)/debian/swift-im/usr $(CURDIR)/debian/swift-im + scons $(SCONS_FLAGS) optimize=1 debug=1 allow_warnings=1 swiften_dll=1 qt=/usr/share/qt4 docbook_xsl=/usr/share/xml/docbook/stylesheet/docbook-xsl docbook_xml=/usr/share/xml/docbook/schema/dtd/4.5 SWIFT_INSTALLDIR=$(CURDIR)/debian/swift-im/usr SWIFTEN_INSTALLDIR=$(CURDIR)/debian/swift-im/usr $(CURDIR)/debian/swift-im #mv $(CURDIR)/debian/swift-im/usr/bin/swift $(CURDIR)/debian/swift-im/usr/bin/swift-im #mv $(CURDIR)/debian/swift-im/usr/share/pixmaps/swift.xpm $(CURDIR)/debian/swift-im/usr/share/pixmaps/swift-im.xpm #mv $(CURDIR)/debian/swift-im/usr/share/swift $(CURDIR)/debian/swift-im/usr/share/swift-im diff --git a/Swiften/.gitignore b/Swiften/.gitignore index c21d6aa..de234f5 100644 --- a/Swiften/.gitignore +++ b/Swiften/.gitignore @@ -1,3 +1,4 @@ *.a *.o Swiften.h +Version.h diff --git a/Swiften/SConscript b/Swiften/SConscript index 41de5b5..53f9201 100644 --- a/Swiften/SConscript +++ b/Swiften/SConscript @@ -1,4 +1,4 @@ -import os +import os, re, Version Import("env") @@ -9,9 +9,19 @@ Import("env") swiften_dep_modules = ["BOOST", "GCONF", "LIBIDN", "ZLIB", "OPENSSL", "LIBXML", "EXPAT", "AVAHI"] if env["SCONS_STAGE"] == "flags" : + env["SWIFTEN_VERSION"] = Version.getBuildVersion(env.Dir("#").abspath, "swift") + version_match = re.match("(\d+)\.(\d+).*", env["SWIFTEN_VERSION"]) + if version_match : + env["SWIFTEN_VERSION_MAJOR"] = int(version_match.group(1)) + env["SWIFTEN_VERSION_MINOR"] = int(version_match.group(2)) + else : + env["SWIFTEN_VERSION_MAJOR"] = 0 + env["SWIFTEN_VERSION_MINOR"] = 0 + env["SWIFTEN_VERSION_PATCH"] = 0 + swiften_env = env.Clone() swiften_env["LIBPATH"] = [Dir(".")] - swiften_env["LIBS"] = ["Swiften"] + swiften_env["LIBS"] = ["Swiften" + str(swiften_env["SWIFTEN_VERSION_MAJOR"])] dep_env = env.Clone() for module in swiften_dep_modules : if env.get(module + "_BUNDLED", False) : @@ -198,9 +208,9 @@ if env["SCONS_STAGE"] == "build" : ]) if ARGUMENTS.get("swiften_dll", False) : - swiften_lib = myenv.SharedLibrary("Swiften", sources + swiften_env["SWIFTEN_OBJECTS"]) + swiften_lib = myenv.SharedLibrary("Swiften" + str(swiften_env["SWIFTEN_VERSION_MAJOR"]), sources + swiften_env["SWIFTEN_OBJECTS"]) else : - swiften_lib = myenv.StaticLibrary("Swiften", sources + swiften_env["SWIFTEN_OBJECTS"]) + swiften_lib = myenv.StaticLibrary("Swiften" + str(swiften_env["SWIFTEN_VERSION_MAJOR"]), sources + swiften_env["SWIFTEN_OBJECTS"]) env.Append(UNITTEST_SOURCES = [ File("Avatars/UnitTest/VCardUpdateAvatarManagerTest.cpp"), @@ -354,6 +364,11 @@ if env["SCONS_STAGE"] == "build" : swiften_env.WriteVal("Swiften.h", swiften_env.Value(swiften_header)) swiften_includes.append("Swiften/Swiften.h") + version_header = "#pragma once\n\n" + version_header += "#define SWIFTEN_VERSION 0x%02X%02X%02X\n" % (swiften_env["SWIFTEN_VERSION_MAJOR"], swiften_env["SWIFTEN_VERSION_MINOR"], swiften_env["SWIFTEN_VERSION_PATCH"]) + swiften_env.WriteVal("Version.h", swiften_env.Value(version_header)) + swiften_includes.append("Swiften/Version.h") + # Install swiften if swiften_env.get("SWIFTEN_INSTALLDIR", "") : swiften_env.Install(os.path.join(swiften_env["SWIFTEN_INSTALLDIR"], "lib"), swiften_lib) |