diff options
Diffstat (limited to 'Documentation')
10 files changed, 96 insertions, 28 deletions
diff --git a/Documentation/BuildingGenerics.txt b/Documentation/BuildingGenerics.txt new file mode 100644 index 0000000..66f3347 --- /dev/null +++ b/Documentation/BuildingGenerics.txt @@ -0,0 +1,6 @@ +To cause scons to search for dependencies instead of using cached results, add force-configure=1 to the commandline: +scons force-configure=1 + +Swift is usually built with Qt4. If you want to build it against Qt5, add the line +qt5 = 1 +to your config.py diff --git a/Documentation/BuildingOnUnix.txt b/Documentation/BuildingOnUnix.txt index 46e1939..ef74387 100644 --- a/Documentation/BuildingOnUnix.txt +++ b/Documentation/BuildingOnUnix.txt @@ -3,6 +3,6 @@ Prerequisites - GCC - Python -- OpenSSL -- Qt Open Source Edition (optional; not needed for Swiften) +- OpenSSL (and development package) +- Qt Open Source Edition (and development package. Optional; not needed for Swiften) Building @@ -19,4 +19,5 @@ Building Running tests ------------- +If you want to run the unit tests (only interesting if you're doing development work) - Run ./scons test=unit diff --git a/Documentation/BuildingOnWindows.txt b/Documentation/BuildingOnWindows.txt index fe2080c..a2d9948 100644 --- a/Documentation/BuildingOnWindows.txt +++ b/Documentation/BuildingOnWindows.txt @@ -2,6 +2,8 @@ Prerequisites ------------ - Microsoft Visual C++ Express Edition -- Python +- Windows SDK +- Python (2.5 <= version < 3) - OpenSSL + * OpenSSL is optional - without it the Windows platform crypto will be used * Download and extract the Windows binary version of OpenSSL from http://www.slproweb.com/products/Win32OpenSSL.html @@ -10,4 +12,5 @@ Prerequisites Building Qt for Microsoft Visual C++ ------------------------------------ +- These steps are optional - the pre-packaged Qt is fine - From the 'Visual C++' 'Programs' group, launch the Visual C++ command prompt - Go to the dir where you installed Qt @@ -23,5 +26,5 @@ Building Swift - Create a file 'config.py' with the following contents, reflecting your local setup: - openssl = "path\to\openssl" + openssl = "path\to\openssl" #optional qt = "path\to\qt" - Run 'scons' @@ -36,2 +39,26 @@ Running tests scons test=all for running all tests. + +Packaging Swift +--------------- +For packaging use: +- Microsoft Visual C++ Express 2008 +- No OpenSSL +- WiX +- config.py should contain: + qt = "c:\\qt\\4.7.4" + vcredist = "c:\\Program Files\\Common Files\\Merge Modules" + debug = 1 + optimize = 1 + wix_bindir = "c:\\program files\\Windows Installer XML v3.5\\bin" +- run + scons dist=1 + +Notes +----- +- The settings debug = 1 and optimize = 1 are strictly required if you use + a precompiled Qt release from the Qt Project; otherwise you will get linker + errors +- On 64-bit Windows it's "Program Files (x86)" instead of "Program Files" in the + paths +- Currently only 32-bit builds of the Swift client are supported diff --git a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/.gitignore b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/.gitignore index 91c939b..aca6fe1 100644 --- a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/.gitignore +++ b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/.gitignore @@ -3,2 +3,3 @@ EchoBot? *.h.xml EchoComponent +Swiften.cpp diff --git a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot2.cpp b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot2.cpp index deeb852..8b81489 100644 --- a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot2.cpp +++ b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot2.cpp @@ -13,5 +13,5 @@ using namespace Swift; using namespace boost; -Client* client; +static Client* client; void handleConnected(); diff --git a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoComponent.cpp b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoComponent.cpp index 397bc21..a6e6ca0 100644 --- a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoComponent.cpp +++ b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoComponent.cpp @@ -1,4 +1,4 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2013 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. @@ -15,7 +15,6 @@ using namespace boost; class EchoComponent { public: - EchoComponent(EventLoop* eventLoop, NetworkFactories* networkFactories) : jid("echo.wonderland.lit") { - component = new Component(eventLoop, networkFactories, - jid, "EchoSecret"); + EchoComponent(NetworkFactories* networkFactories) : jid("echo.wonderland.lit") { + component = new Component(jid, "EchoSecret", networkFactories); component->onConnected.connect(bind(&EchoComponent::handleConnected, this)); component->onMessageReceived.connect( @@ -63,5 +62,5 @@ int main(int, char**) { BoostNetworkFactories networkFactories(&eventLoop); - EchoComponent bot(&eventLoop, &networkFactories); + EchoComponent bot(&networkFactories); eventLoop.run(); diff --git a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/SConscript b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/SConscript index c6349bd..5d27b70 100644 --- a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/SConscript +++ b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/SConscript @@ -2,6 +2,13 @@ Import("env") example_env = env.Clone() -example_env.MergeFlags(example_env["SWIFTEN_FLAGS"]) -example_env.MergeFlags(example_env["SWIFTEN_DEP_FLAGS"]) +example_env.UseFlags(example_env["SWIFTEN_FLAGS"]) +example_env.UseFlags(example_env["SWIFTEN_DEP_FLAGS"]) + +# Precompile Swiften header +# This is useful to slightly speed up compilation. +# if example_env["PLATFORM"] == "win32": +# example_env.WriteVal("Swiften.cpp", example_env.Value("#include <Swiften/Swiften.h>\n")) +# example_env["PCH"] = example_env.PCH("Swiften.cpp")[0] +# example_env["PCHSTOP"] = "Swiften/Swiften.h" for i in range(1,7) : @@ -15,4 +22,8 @@ if env["PLATFORM"] == "win32" : if int(env["MSVS_VERSION"].split(".")[0]) >= 10 : cpp0x = True +elif env["PLATFORM"] == "hpux" : + pass +elif env["PLATFORM"] == "sunos" : + pass else : if env["CCVERSION"].split(".") >= ["4", "5", "0"] : diff --git a/Documentation/SwiftenDevelopersGuide/SConscript b/Documentation/SwiftenDevelopersGuide/SConscript index c50641f..ba0eb0b 100644 --- a/Documentation/SwiftenDevelopersGuide/SConscript +++ b/Documentation/SwiftenDevelopersGuide/SConscript @@ -35,5 +35,7 @@ def generateDocBookCode(env, target, source) : calloutLines.append("<callout arearefs=\"%(cobID)s\" id=\"%(coID)s\"><para>%(text)s</para></callout>" % {"cobID": cobID, "coID": coID, "text": m.group(1)}) newProgramLines.append(line) - callouts = "<calloutlist>" + "\n".join(calloutLines) + "</calloutlist>" if len(calloutLines) > 0 else "" + callouts = "" + if len(calloutLines) > 0 : + callouts = "<calloutlist>" + "\n".join(calloutLines) + "</calloutlist>" return ("\n".join(newProgramLines), callouts) diff --git a/Documentation/SwiftenDevelopersGuide/Swiften Developers Guide.xml b/Documentation/SwiftenDevelopersGuide/Swiften Developers Guide.xml index fae79e4..345d049 100644 --- a/Documentation/SwiftenDevelopersGuide/Swiften Developers Guide.xml +++ b/Documentation/SwiftenDevelopersGuide/Swiften Developers Guide.xml @@ -118,4 +118,19 @@ list of C(++) compiler flags. </para> + + <para> + An example of setting up a build of a Swiften application using SCons is shown + in <xref linkend="Example-SCons"/>. + </para> + + <example id="Example-SCons"> + <title><literal>SConstruct</literal> file to build Swiften application with SCons</title> + <programlisting> +env = Environment() +env["SWIFTEN_CONFIG"] = "/path/to/swiften-config" +env.MergeFlags(env.subst("!$SWIFTEN_CONFIG --cflags --libs")) +env.Program("EchoBot.cpp") + </programlisting> + </example> </sect1> diff --git a/Documentation/TranslatingSwift.txt b/Documentation/TranslatingSwift.txt index 178f1e2..44dc335 100644 --- a/Documentation/TranslatingSwift.txt +++ b/Documentation/TranslatingSwift.txt @@ -7,6 +7,11 @@ have Qt (with Qt Linguist installed). Starting a new translation -------------------------- -- Run the following command to generate a clean translation template 'swift.ts': +- If you have a source tree checkout, run the following command to generate a clean + translation template 'swift.ts': + scons update_translations=1 Swift/Translations/swift.ts + + If you don't have a source tree checkout, download swift_ts from + http://swift.im/translations/master - Rename the new 'swift.ts' file to swift_<LANGUAGE-CODE>.ts, e.g. "swift_nl.ts" for Dutch @@ -16,17 +21,12 @@ Starting a new translation - Submit your finished translation file to the Swift development team. -If you have trouble generating the translation file yourself, you can ask the -Swift development team to provide you with a new translation template for your -language. - Updating an existing translation -------------------------------- -- Run the following command to update an existing translation template: +- If you have a source tree checkout, run the following command to update an existing + translation template: scons update_translations=1 Swift/Translations/<your-translation-file> - -If you have trouble updating the translation file yourself, you can ask the -Swift development team to provide you with a new translation template for your -language. +- If you don't have a source tree checkout, get the latest version of your translation + from http://swift.im/translations/master @@ -43,5 +43,5 @@ development environment for Swift), or automatically: translation file in Contents/Resources/translations - On Linux, in /usr/share/swift/translations -- Automatically: +- Automatically (with source tree checkout): - Ensure your translation file is in Swift/Translations/swift_<YOURLANGUAGE>.ts - Build Swift (for more details, see the building documentation): @@ -50,7 +50,13 @@ development environment for Swift), or automatically: put them in the right place. -Finally, run Swift. If your system isn't set up to use your language, set the -LANG environment variable to the name of your language before running Swift. -For example: - set LANG=nl (on Windows) +Finally, run Swift. If your system isn't set up to use your language, you can +override the language: +- For Swift compiled with Qt < 4.8: Set the LANG environment variable to the name of your language + before running Swift. For example: + set LANG=nl (on Windows, or, alternatively, edit the User Environment Variables in Control Panel) export LANG=nl (on Linux or Mac OS X, in Bash) +- For Swift compiled with Qt >= 4.8: Use the '--language' parameter for Swift: + For example: + Swift.exe --language nl (on Windows, from cmd or by editing the shortcut) + open Swift.app --args --language nl (on Mac OS X, from Terminal) + swift-im --language nl (on Linux) |