Compiling the Subversion slrn under Windows 7
I have long been a huge fan of the Usenet client slrn and I have used it under Linux for some years. However even in my early days I was somewhat intrigued by the claim seen on the slrn website that my favourite newsreader would also run under Windows. After a little experimentation with the Windows binaries generously provided by Thomas Wiegner I decided that I would emulate my customary practice under Linux and compile the development version of slrn under the 32 bit Windows 7, albeit running Windows under Virtualbox. I eventually succeeded in an endeavour that many regarded as a little crazy and subsequently decided to write this page so that others might perhaps follow my example. Please feel free to use the email link at the base of this page to pass on any comments, remember that you will be the very first as there has been a resounding silence concerning this page since I first posted it!
Some required tools...
Most of the tools required to build the svn slrn are not included in a default installation of the 32 bit Windows 7. The first requirement is a decent compiler:
MinGW...
The best choice is MinGW | Minimalist GNU for Windows, and certainly MinGW is mentioned several times in the slrn documentation. Install the full MinGW package to C:/MinGW and also add MinGW to the Windows 7 $PATH manually by right-clicking on My Computer, going to 'Advanced System Settings' and then 'Environmental Variables' and then typing the paths in, I would suggest both C:/MinGW/bin and C:/MinGW/local/bin. Have a look at the existing syntax for $PATH and follow it closely for your own additions. I would also suggest that while you are there you should add C:/slrn to the $PATH and also create a new $NNTPSERVER variable with your news server details.
S-Lang & libiconv...
To take the compiler for a test run the next step is to download the required S-Lang library as well as WinRAR or Winzip to actually decompress the archive. Compiling instructions for S-Lang under Windows are quite clear and can be found in the file INSTALL.pc, I will not insult your intelligence by running these quite precise instructions but I would suggest that the default installation of C:/MinGW/local would be best. Also needed is libiconv and I personally use the binary, developer and dependency packages from the GnuWin32 project, all of which can simply be decompressed into C:/MinGW/local. This is a slightly older version than is currently available but it works well enough on my system.
TortoiseSVN...
A subversion client is also required and in the world of Windows 7 you cannot really go past TortoiseSVN, a fairly impressive piece of software that does not have a parallel in the Linux world. The ugly details of the subversion address and commands for slrn can be seen here. This will download a recent copy of the development slrn which can now be compiled.
Compiling slrn...
A great deal of manual editing to the source code is required before compilation can proceed. A very small amount of this tweaking I sorted out myself but the vast majority resulted from the guidance graciously provided by John E. Davis, Thomas Wiegner and various helpful people from the slrn-users mailing list. First the file src/makefile.g32 needs to be altered and my own settings can be seen below:
prefix = C:/MinGW/local# <--- edit this SLANGINC = $(prefix)/include# <--- edit this SLANGLIB = $(prefix)/lib# <--- edit this SLRN_CONF_DIR = $(prefix)/etc# <--- maybe edit this SLRN_LIB_DIR = $(prefix)/share/slrn# SLRN_SLANG_DIR = $(SLRN_LIB_DIR)/slang# SLANG_INC = -I$(SLANGINC) SLANG_LIB = -L$(SLANGLIB) -lslang -liconv
Next the file src/slrnconf.h needs to be edited and the following line added to complete the libiconv setup:
#define HAVE_ICONV 1
The same file needed the following also to be carefully added to allow 64bit article addressing by the Windows slrn, the required lines were originally marked '#undefine':
#define HAVE_LONG_LONG 1 #define HAVE_ATOLL 1 #define HAVE_STRTOLL 1 /* Does your compiler support vsnprintf()? */ #define HAVE_VSNPRINTF 1
Then another small change to enable slrnpull support in slrn requires the editing of src/win32/slrnfeat.def. I will admit that this little snippet took me a little while to work out:
SLRN_HAS_PULL_SUPPORT 1
Optionally you may also edit the file src/slrnfeat.hin with the following to stop the compiler complaining that the slrnpull root directory had not been defined, I prefer to hard-code as many settings as possible for my own 'personalised' copy of slrn:
/* This must be set to an absolute pathname. */ #define SLRNPULL_ROOT_DIR "/var/spool/slrnpull"
And at last there was an opportunity to run the compiler from the src directory and build firstly the slrn executable and secondly the slrnpull executable:
mingw32-make -f makefile.g32 mingw32-make -f makefile.g32 slrnpull.exe
Now simply copy the contents of macros directory to C:/MinGW/local/share/slrn/slang and copy the sample slrn.rc file as well as the slrn and slrnpull executables to C:/slrn. All the 'hard-lifting is done!
Completing the setup...
This page is really aimed at getting the subversion slrn successfully compiled under Windows 7 rather than giving a general setup guide for slrn, such guides can be seen on the slrn website. Nevertheless there are a few small issues specific to Windows that I thought I would address here if only to remind myself of some of the issues I have sorted out when reloading time comes around!
Sending email
The ability to send email replies from within slrn is something that should be used rarely but it can be quite handy. My peronal favourite to accomplish this is an Australian application known disarmingly as fake sendmail for windows. Drop this into C:/slrn/sendmail and reference it from slrn.rc as follows:
% Sends mail with 'fake sendmail for windows'. set sendmail_command "C:/slrn/sendmail/sendmail.exe -t <"
You will need to spend a few minutes editing the file sendmail.ini and then this great little piece of software will not give you any trouble at all.
Selecting an editor
slrn of course does not ship with an editor and I would suggest for a typical Windows 7 user that gvim is a fine choice. It will need a setting something like the following in slrn.rc:
% Set your favourite editor. Use %s for the file name and %d for the line % where the cursor should be placed (usually at the beginning of the body). set editor_command "C:/Vim/vim72/gvim +%d %s"
Note that as usual it is best to install software such as gvim to a location without spaces in the directory names, it just makes life so much easier.
Setting slrnpull
To successfully run slrnpull the following settings are required in slrn.rc:
set spool_inn_root "/var/spool/slrnpull" set spool_root "/var/spool/slrnpull/news" set spool_nov_root "/var/spool/slrnpull/news" set read_active 1 set use_slrnpull 1 set post_object "slrnpull" set server_object "spool"
This is the bare minimum to successfully point slrn towards the spool and let me tell you that slrnpull runs very nicely under Windows 7! A final thought is the addition of the following:
Some final slrn.rc settings
There are a couple of very Windows-specific settings to note and probably a few I have forgotten as well. The following is required to get a decent display of the thread tree on Windows 7's console:
set simulate_graphic_chars 1
The following is required to launch Firefox from URLs within slrn:
set non_Xbrowser "start \"\" \"C:/Program\ Files/Mozilla\ Firefox/firefox.exe\" \"%s\""
This one is not very pretty, although it works well enough, I will keep looking inot this one to see if a cleaner method can be used. That should just about do it but I shall add any more Windows-specific requirements as I come across them.
Starting with a batch file
Thomas Wiegner's Windows binary has a nice batch file, required to start slrn under Windows 7, and I have borrowed liberally from it:
rem This is a batch file for slrn under windows set SLRNHOME=c:\slrn set LANG=en_AU.UTF-8 set TMP=c:\WINDOWS\Temp slrn.exe
I would suggest that you run slrnpull.exe directly from the commandline rather than from this batch file, although please feel free to disregard this advice. The combination of slrn.rc settings and compilation settings suggested in this guide means that slrnpull usage becomes very simple and the program can easily be manipulated directly from the commandline.
The final result...
I run the 32 bit Windows 7 as a guest with a Slackware 13.1 host on VirtualBox 3.2.6 and even with this slightly limiting setup the performance of slrn and slrnpull is pretty impressive. The final results from this effort read:
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\andrew>slrn --version
slrn pre1.0.0-18
* Note: This version is a developer preview.
S-Lang Library Version: 2.2.2
Compiled at: Jan 12 2010 20:20:17
Operating System: Win32
COMPILE TIME OPTIONS:
Backends: +nntp +slrnpull +spool
External programs / libs: -canlock -inews -ssl -uudeview +iconv
Features: +decoding +emphasized_text +end_of_thread +fake_refs +gen_msgid
-grouplens +msgid_cache +piping +rnlock +spoilers -strict_from
Using 64 bit integers for article numbers.
DEFAULTS:
Default server object: nntp
Default posting mechanism: nntp
I suspect that perhaps not all that many Windows users be reading down this far on an admittedly fairly complex page, but in part this page functions as my own backup and a method to organise my own thoughts, in this hopefully it has been a success. I will update the page with any corrections that come in and also endeavour to keep it updated once development restarts on slrn. It should be fun!
And in conclusion...
I have enjoyed writing this page as it has taken me right out of my comfort zone and forced me to learn a few small and valuable lessons. Please contact me with any errors of fact that you have found, any errors of opinion will probably remain uncorrected. I would be very keen in particular to hear from anybody who has managed to compile slrn under the 64 bit version of Windows 7, which has defeated me so far. In the meantime I am having a great time exploring slrn and Usenet, what about you?