← Back to team overview

linuxdcpp-team team mailing list archive

[Branch ~dcplusplus-team/dcplusplus/trunk] Rev 2172: asciidoc-ified compile instructions

 

------------------------------------------------------------
revno: 2172
author: iceman50 <bdcdevel@xxxxxxxxx>
committer: poy <poy@xxxxxxxxxx>
branch nick: repo
timestamp: Wed 2010-06-30 18:08:57 +0200
message:
  asciidoc-ified compile instructions
modified:
  Compile.txt
  help/SConscript
  help/credits.html
  help/gen_compile.py


--
lp:dcplusplus
https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk

Your team Dcplusplus-team is subscribed to branch lp:dcplusplus.
To unsubscribe from this branch go to https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk/+edit-subscription
=== modified file 'Compile.txt'
--- Compile.txt	2009-03-27 15:18:26 +0000
+++ Compile.txt	2010-06-30 16:08:57 +0000
@@ -1,96 +1,135 @@
-The most important thing about compiling: It works for me.
-
-How to compile in n easy steps:
-
-1a) With GCC:
-    Install Mingw from www.mingw.org. You'll need w32api, binutils, mingw-runtime, gcc-core and
-    gcc-g++, see their site for installation instructions. I just untar the files into a folder
-    named mingw and add mingw\bin to my path. I've never used the installer, but that maybe works
-    as well. GCC 4.2+ is required (Technology preview release currently). I use the dw2 variant of
-    gcc, but if you want to experiment you can try the potentially slower sjlj. After installing
-    gcc, you will need to go to the bin folder of your mingw installation and copy g++-dw2/sjlj.exe
-    and gcc-dw2/sjlj.exe to g++.exe and gcc.exe respectively.
-    Note; Make sure gcc/g++ is in your path and before any cygwin installation.
-
-    Download HTML Help Workshop from <http://msdn2.microsoft.com/en-us/library/ms670169.aspx>. Copy
-    the include and library files to the respective directories in the htmlhelp folder.
-
-1b) Or with Microsoft Visual C++ 9.0 (2008) with at least Service Pack 1:
-	Get <https://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=17034&amp;wa=wsignin1.0>,
-	a hotfixed-hotfix which fixes SP1.
-
-    Download OpenSSL from www.openssl.org and compile it. You should get libraries called
-    libeay32.lib and ssleay32.lib; copy them in openssl/lib.
-
-    To compile DC++ in debug mode, OpenSSL libraries have to be compiled in debug mode too
-    (read their instructions file; it's a matter of adding "debug" in the do_* file you use).
-    Rename debug libraries to libeay32d.lib and ssleay32d.lib; put them in openssl/lib.
-
-Note; If you get errors about a missing file "natupnp.h", you need to download the Platform SDK from MS
-and copy the file to the include directory of your compiler (or add it to the include path...).
-
-2) Install recent stable release (at least version 0.98.5) of SCons (www.scons.org).
-   Make sure SCons and Python are in your PATH.
-
-3) Install gettext (http://www.gnu.org/software/gettext/). The easiest way to do this is to get the
-   precompiled binaries from http://www.gimp.org/~tml/gimp/win32/downloads.html, you'll need 
-   gettext-runtime and gettext-tools, at least version 0.17. These links should work:
-   http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/gettext-runtime-0.17.zip
-   http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/gettext-tools-0.17.zip
-
-   Make sure gettext is in your PATH.
-
-4) If you want to compile help files, make sure you have HTML Help Workshop (link in 1a) with
-   hhc.exe in your PATH, and Perl.
-
-5) Open a command prompt and type "scons" followed by some options:
-	"tools=mingw" - Use mingw for building (default)
-	"tools=default" - Use msvc for building (yes, the option value is strange)
-	"mode=debug" - Compile a debug build (default)
-	"mode=release" - Compile an optimized release build
-
-	To see more options, type "scons -h".
-	Tip: You can create a file custom.py and put your options in there.
-
-   You can choose which targets to build; eg:
-	scons build/debug-mingw/dwt
-   will only build DWT with MinGW in debug mode. By default, when no target is specified, SCons builds all targets.
-   For more possible arguments, consult the SCons manual.
-
-Note; If you have problems, use google. It works for me.
-
-Note; DC++ requires tr1 containers to be compiled. Those are already provided when using MinGW and
-MSVC 9 SP1. Other ways of getting tr1 containers are using boost or STLPort (make sure to turn off
-nativestl (see "scons -h") and compile/install STLPort in the stlport directory), but in these
-cases you will probably encounter compile problems.
-
-By the way, with doxygen, graphviz and some luck you can use the supplied doxygen configuration file
-to generate some nice docs...just check that the paths in doxyfile are correct (graphviz)...
-
-Linux / Unix:
-Look at linuxdcpp.berlios.de for the *nix port of DC++ - they'll gladly accept any help. 
-
-Submitting patches
-
-If you think you've done something that more people could use, you can always submit a patch for inclusion in the
-original distribution. I will then consider whether I like the patch or not based on things that might seem to be 
-completely random, which just might be the case. Popular reasons for rejecting a patch include, but are not limited to,
-ugly code, abusable features, features that I don't like that bloat the application and incompatibility with other 
-modifications I've already done. 
-
-To increase the chances of your patch being accepted, do like this:
-1) Check out the latest code from BZR (see https://code.launchpad.net/dcplusplus for instructions)
-2) Make your modification. If you make other modifications apart from the one you want to submit, do them
-   on a separate copy of the DC++ source code and then copy them to this folder.
-3) In the source root folder (the one with this file in it) do "bzr diff > my-patch.diff". In alternative,
-   commit to your local branch and send a merge instruction using bzr send. See a bzr howto for detailed instructions.
-4) Open a bug at https://bugs.launchpad.net/dcplusplus and attach your patch. If this doesn't suit you, 
-   send the patch along with a description to the dcplusplus-devel mailing list (more information here: 
-   http://sourceforge.net/mail/?group_id=40287). Please make sure to include a copyright handover notice (see below).
-
-In order to avoid future licensing issues, I ask you to give me copyright over any submitted code. 
-If you don't like this policy, you are free to start your own distribution (as
-many have done), and if you're lucky it might become more popular than the original =). Please
-state explicitly when submitting the patch that you give me copyright over the code if the submission is larger 
-than trivial.
-
+= Compiling DC++
+
+
+1.	Application and Dependency versions needed
+
+		* A modern C++ compiler; see #2.
+
+		* Python - 2.5.x
+		<http://www.python.org>
+
+		Note: Python 3.x is incompatible with SCons as of writing this.
+		Make sure that Python is in your PATH environment variable.
+
+		* SCons - 0.98.5 but using the most recent version is recommended
+		<http://www.scons.org/download.php>
+
+		Note: SCons relies on Python so you need to have Python installed first.
+		Make sure that SCons is in your PATH environment variable.
+
+		* Perl - 5.12.0.1 (ActivePerl or Cygwin, only needed to build help files)
+		<http://www.perl.org/get.html>
+
+		Make sure that Perl is in your PATH environment variable.
+
+		* gettext runtime & tools - 0.17 or later
+		<http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/>
+
+		Make sure that the gettext tools are in your PATH environment variable.
+
+		* Html Help Workshop (only needed to build help files)
+		<http://msdn.microsoft.com/en-us/library/ms669985%28VS.85%29.aspx>
+
+		Go to your HTML Help Workshop include directory (HTML Help Workshop/include) and copy
+		htmlhelp.h to the htmlhelp/include directory of the DC++ source.
+		Go to your HTML Help Workshop lib directory (HTML Help Workshop\lib) and copy htmlhelp.lib
+		to the htmlhelp/lib directory of the DC++ source.
+		Make sure that hhc.exe is in your PATH environment variable.
+
+		* asciidoc (only needed to build help files)
+		<http://www.methods.co.nz/asciidoc/>
+
+		Make sure that asciidoc is in your PATH environment variable.
+
+
+2. Compiler
+
+	a. MinGW (GCC 4.5 or later):
+	<http://sourceforge.net/projects/mingw/files/>
+
+		You'll need w32api, binutils, mingw-runtime, gcc-core, gcc-g++, and some deps like libmpc.
+		See their site for installation instructions. I just untar the files into a folder named
+		MinGW and add MinGW\bin to my PATH.
+		Note; the sjlj variant is slower than the dwarf variant; the latter is recommended.
+
+		Also grab natupnp.h and move it to MinGW\include (needs to be obtained from the .Net 1.1 SDK)
+		<http://www.microsoft.com/downloads/details.aspx?FamilyID=9b3a2ca6-3647-4070-9f41-a333c6b9181d&DisplayLang=en>
+
+	b. Microsoft Visual C++ 9.0 (2008) with at least Service Pack 1:
+
+		Get <https://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=17034&amp;wa=wsignin1.0>,
+		a hotfixed-hotfix which fixes SP1.
+
+		Download OpenSSL from www.openssl.org and compile it. You should get libraries called
+		libeay32.lib and ssleay32.lib; copy them in openssl/lib.
+
+		To compile DC++ in debug mode, OpenSSL libraries have to be compiled in debug mode too
+		(read their instructions file; it's a matter of adding "debug" in the do_* file you use).
+		Rename debug libraries to libeay32d.lib and ssleay32d.lib; put them in openssl/lib.
+
+	c. Other:
+
+		You are on your own.
+
+		DC++ requires tr1 containers to be compiled. Those are already provided when using MinGW and
+		MSVC 9 SP1. Other ways of getting tr1 containers are using boost or STLPort (make sure to turn off
+		nativestl (see "scons -h") and compile/install STLPort in the stlport directory), but in these
+		cases you will probably encounter compile problems.
+
+3. Starting the build process
+
+	Open a command prompt and type "scons" followed by some options:
+
+		"tools=mingw" - Use mingw for building (default)
+		"tools=default" - Use msvc for building (yes, the option value is strange)
+		"mode=debug" - Compile a debug build (default)
+		"mode=release" - Compile an optimized release build
+
+		To see more options, type "scons -h".
+
+		Tip: You can create a file custom.py and put your options in there.
+
+		You can choose which targets to build; eg:
+		  scons build/debug-mingw/dwt
+		will only build DWT with MinGW in debug mode. By default, when no target is specified, SCons builds all targets.
+		For more possible arguments, consult the SCons manual.
+
+		If you have problems, use google. It works for me.
+
+4.  Other information and submitting patches
+
+		a. By the way, with doxygen, graphviz and some luck you can use the supplied doxygen
+		configuration file to generate some nice docs...just check that the paths in doxyfile are
+		correct (graphviz)...
+
+		b. Linux / Unix:
+
+			Look at <http://launchpad.net/linuxdcpp> for the *nix port of DC++ - they'll gladly accept any help. 	
+
+		c. Submitting patches
+
+			If you think you've done something that more people could use, you can always submit a
+			patch for inclusion in the original distribution. I will then consider whether I like
+			the patch or not based on things that might seem to be completely random, which just
+			might be the case. Popular reasons for rejecting a patch include, but are not limited
+			to, ugly code, abusable features, features that I don't like that bloat the application
+			and incompatibility with other modifications I've already done.
+
+			To increase the chances of your patch being accepted, do it like this:
+			1) Check out the latest code from BZR (see <https://code.launchpad.net/dcplusplus> for instructions)
+			2) Make your modification. If you make other modifications apart from the one you want to submit, do them
+			   on a separate copy of the DC++ source code and then copy them to this folder.
+			3) In the source root folder (the one with this file in it) do "bzr diff > my-patch.diff". In alternative,
+			   commit to your local branch and send a merge instruction using bzr send. See a bzr howto for detailed instructions.
+			4) Open a bug at https://bugs.launchpad.net/dcplusplus and attach your patch. If this doesn't suit you, 
+			   send the patch along with a description to the dcplusplus-devel mailing list (more information here: 
+			   <http://sourceforge.net/mail/?group_id=40287>). Please make sure to include a copyright handover notice (see below).
+
+
+		d. Licensing issues with submitted patches	
+
+			In order to avoid future licensing issues, I ask you to give me copyright over any submitted code. 
+			If you don't like this policy, you are free to start your own distribution (as
+			many have done), and if you're lucky it might become more popular than the original =). Please
+			state explicitly when submitting the patch that you give me copyright over the code if the submission is larger 
+			than trivial.

=== modified file 'help/SConscript'
--- help/SConscript	2009-10-06 14:09:49 +0000
+++ help/SConscript	2010-06-30 16:08:57 +0000
@@ -32,6 +32,10 @@
 	print 'Perl is required to run po4a scripts, skipping help build'
 	Return()
 
+if env.WhereIs('asciidoc') is None:
+	print 'asciidoc is required to process Compile.txt, skipping help build'
+	Return()
+
 # fix hhc.exe reverse return value - UGLY - taken from the NSIS build system
 old_spawn = env['SPAWN']
 def new_spawn(*args, **kw):

=== modified file 'help/credits.html'
--- help/credits.html	2010-02-06 19:38:21 +0000
+++ help/credits.html	2010-06-30 16:08:57 +0000
@@ -30,6 +30,7 @@
   <li>MikeJJ</li>
   <li>eMTee</li>
   <li>Pseudonym</li>
+  <li>iceman50</li>
 </untranslated></ul>
 <h1>Translators</h1>
 <pre>translator-credits</pre>

=== modified file 'help/gen_compile.py'
--- help/gen_compile.py	2009-03-19 22:26:48 +0000
+++ help/gen_compile.py	2010-06-30 16:08:57 +0000
@@ -1,12 +1,21 @@
 def gen_compile(target, source, env):
-	from cgi import escape
-	f_target = open(str(target[0]), "wb")
-	f_source = open(str(source[0]), "rb")
-	f_template = open(str(source[1]), "rb")
-	f_target.write(f_template.read().replace("<!-- contents -->", """
-<h1>Instructions to compile DC++</h1>
-<pre>
-""" + escape(f_source.read()) + "\n</pre>", 1))
-	f_target.close()
-	f_source.close()
-	f_template.close()
+	env.Execute('asciidoc -s -o"' + str(target[0]) + '" "' + str(source[0]) + '"')
+
+	f = open(str(source[1]), "rb")
+	template = f.read()
+	f.close()
+	template = template.split("<!-- contents -->", 1)
+
+	f = open(str(target[0]), "rb")
+	contents = f.read()
+	f.close()
+
+	import re
+	contents = re.sub(re.compile(r'<a ([^>]+)>([^<]+)</a>', re.I), r'<a \1 target="_blank" class="external">\2</a>', contents)
+
+	f = open(str(target[0]), "wb")
+	f.write(template[0]) # header
+	f.write("<h1>Compiling DC++</h1>")
+	f.write(contents)
+	f.write(template[1]) # footer
+	f.close()