Compiling the git slrn under Windows 8
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 versions of first Windows 7 and now Windows 8, albeit running Windows under Virtualbox. By this I mean compile slrn under a Windows environment rather than cross-compile for Windows from within a Linux environment. 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.
Contents of this page...
Although best read from top to bottom I have included some navigation for those who would prefer to browse rather than read in detail:
- Some required tools... Windows 8 lacks more than a few basic tools to work with the slrn code but these are an easy downoad away:
- Classic Shell... Download and install a much more usable interface than the Windows 8 Metro!
- MinGW... Download and install the best Open Source programming toolset for compiling native Windows application,
- Git for Windows... My choice of a suitable git client for Windows so we can download the slrn source.
- Console2... A greatly superior terminal application for Windows.
- Compiling slrn... Getting to grips with the slrn source, as well as some other required libraries.
- S-Lang... Downloading, compiling and installing S-Lang 2.3.0, a required dependency for slrn.
- libiconv... Downloading and installing libiconv 1.9.2 for support with some different character sets.
- openssl... Downloading and installing openssl 0.9.8h so slrn can make an ssl connection to the remote server.
- slrn... Downloading and compiling the slrn source from its git repository.
- Completing the setup... A few tips to make slrn work nicely with Windows:
- Sending email... 'Reply via email' with 'Fake Sendmail for Windows'.
- Selecting an editor... Selecting an editor to work with slrn, in this case GVim.
- Setting slrnpull... Some basic settings for running slrnpull.
- Some final slrn.rc settings... A few other titbits.
- Starting with a batch file... A Windows batch file to launch slrn.
- The final result... A quick look at the final result!
Please feel free to use the email link at the base of this page to pass on any comments, I am always keen to improve on the information presented in this page and also to hear from fellow slrn enthusiasts!
Some required tools...
Windows 8 is a decent operating system, as long as the Metro interface is ignored! To successfully compile slrn and friends some extra tools will be required including a very nice application to at least temporarily bypass the default Metro, a decent compiler and some git software. First up for my new best friend Classic Shell.
The first tool that you should definitely install is the open source application Classic Shell. This will allow you to retreat to a more usable interface than Metro to setup slrn and then allow you to easily return to the full Metro interface if you wish. This is a very, very nice application and I highly recommend it for all Windows 8 users, and most definitely it will be required to follow this slrn guide. I have done a few experiments with the Preview release of Windows 10 and with the improvements to the interface Classic Shell may no longer be required. We shall see! The next requirement is a decent compiler:
The best choice is MinGW | Minimalist GNU for Windows. Install MinGW's C compiler only, using the nice automated installer, to
C:/MinGW, see some further notes here about MinGW installation in general.. Feel free to install more of the MinGW packages but this is all that is required to build S-Lang and slrn itself. You will need to then add MinGW to the Windows $PATH, this has been a little hidden in Windows 8 and can be found by the following route:
Windows Key + X --> System --> Advanced System Settings --> Environment Variables
You should then permanently and cautiously add minGW to the $PATH by following these directions. On my system I add in the following at the end of the System
$PATH statement, against the MinGW advice to use the
You can also create a new
$NNTPSERVER System variable and place your NNTP server details in here, this will make things a little less complex later. Please note that I am using
C:/slrn to place user configuration files for slrn, some might like to place these in the appropriate Windows 'User' directory. I shall leave that to you to make the necessary adjustments if you wish to do this. It would be nice if the MinGW installer woulod take care of some of this!!
Git for Windows...
A git client is also required and in the world of Windows 8 you could do as I have done and download Git For Windows. I personally found the gui more than a little confusing but a commandline is also available with all the familiar commands. To use Git for Windows in this manner simply right click on the desired location, select 'Git Bash' and there will be a familiar command prompt to type all of the usual git commands. If anybody is using a better git client I would love to hear from you and will put the details in here.
The native Windows terminal application has improved since Windows XP days but it is certainly a pale shadow of any Terminal application under Linux. Fortunately there is a nice Open Source replacement called Console2 and I personally use a fork which has a nice installer and also automatically allows an open Console2 window in any location. The SourceForge site makes the 32bit version a little hard to find but I found my copy here and so should you! Setup is pretty easy, I use the Consolas font and this looks fine with slrn and slrnpull. I note in the Windows 10 Preview that the native terminal application has improved a little but not much...
Compiling slrn is pretty straightforward with the latest git but before actually coming to grips with slrn we will need to get the S-Lang dependency downloaded, compiled and installed.
We will need to download the required S-Lang library, I have used 2.3.0, and I use WinRAR to actually decompress the downloaded archive. Compiling instructions for S-Lang under Windows are quite clear and can be found in the file
INSTALL.pc, have a look at the details then open a command window in the opened archive and run the following three commands in sequence:
mkfiles\m32init.bat mingw32-make mingw32-make install
This installs S-Lang to the default
C:/MinGW/local and slrn will pick this up when we compile its source code.
slrn benefits from compiling against the external library libiconv and I use the binary, developer and dependency packages from the GnuWin32 project, all of which can simply be decompressed with WinRAR into
C:/MinGW/local. This is a slightly older version than is currently available but it works well enough on my system. Some manual tweaking of the slrn code is required to use libiconv and these details are below.
slrn can benefit from compiling against the external library openssl and after some experimentation I am using the binary and developer packages again from the GnuWin32 project. I am not sure if this is the best version to use or if there is an easier way to do this, feel free to suggest any improvements for this teechnique! The openssl archives can simply be decompressed into
C:/MinGW/local and then the slrn code will need to be tweaked slightly so that slrn will use these openssl files, details below.
Compiling the slrn source code under Windows has become a lot easer with the release of slrn pre1.0.2-3, thanks very much to JED for the new build system! We will need the latest git version to take advantage of these improvements so open a command prompt, as detailed above, and type the following:
git clone git://git.jedsoft.org/git/slrn.git
This will give you the latest development version of slrn, this is currently the same as release version 1.0.2. Before compiling this we will need to tweak the code a little to use the external libraries libiconv and openssl. Open the file
src/win32/makefile.m32in and alter it to reflect the following:
SSL_LIBS = -lssl -lcrypto -lgdi32 MISCLIBS = $(SSL_LIBS) -lwsock32 -lwinspool -liconv
Then open the file
src/slrnconf.h and add the following:
/* Add support for libiconv */ #define HAVE_ICONV 1
Also alter the line in
src/slrnconf.h that deals with ssl support by changing the zero value to one:
#define SLRN_HAS_SSL_SUPPORT 1
After this slrn can then be compiled from the root directory with the following three commands in sequence, note that this will now compile and install both slrn and slrnpull:
slsh win32/m32config.sl mingw32-make mingw32-make install
And thanks to the beautiful build system for this version of slrn that is all that is required, but there is still some more work to do to complete the setup.
Completing the setup...
This page is really aimed at getting the git slrn successfully compiled under Windows 8 rather than giving a general setup guide for slrn,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!
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. According to the Fake Sendmail website there will no longer be any development of this fine application which is a great pity.
Selecting an editor...
slrn of course does not ship with an editor and I would suggest for a typical Windows 8 user that GVim is a fine choice, I use version 7.3.46 as the newest version had a few syntax changes that I could not work out. It will need a setting something like the following in
% 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/vim73/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. Some may be interested in the additions I have made to the default
_vimrc file that make the GVim plus slrn experience a little more comfortable:
" My changes to the default _vimrc that make " editing with GVim for slrn a little easier: set guifont=Consolas:h13 " Looks good on my system, also used for Terminal. colors darkblue " Background colour for the Gvim window. nnoremap Q gq} " Q command to reformat paragraphs and list. set nobackup " No backup files littering the place. set textwidth=70 " Text width to keep Usenet happy. set encoding=utf-8 " Required for 'foreign' text. set fileencoding=utf-8 " Required for 'foreign' text.
I am no GVim master so I would be very happy to hear of any better options that I should be using, but these are working fine for me at the moment.
To successfully run slrnpull the following settings are required in
set spool_inn_root "/MinGW/local/var/spool/news/slrnpull" set spool_root "/MinGW/local/var/spool/news/slrnpull/news" set spool_nov_root "/MinGW/local/var/spool/news/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 8! 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 8'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 into 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 8, 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 directly from the commandline rather than from this batch file, although please feel free to disregard this advice and let me know your preferred way of running both slrnpull and slrn itself. On my own system slrnpull is used directly from the commandline and this suits my own usage just fine.
The final result...
I run the 32 bit Windows 8 as a guest with a Slackware 14.1 host on VirtualBox 4.3.8 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.2.9200] (c) 2012 Microsoft Corporation. All rights reserved. C:\Users\andrew>slrn --version slrn pre1.0.3-1 * Note: This version is a developer preview. S-Lang Library Version: 2.3.0 Compiled on: Nov 27 2014 12:52:52 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 C:\Users\andrew>
I suspect that perhaps not all that many Windows users will 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 when slrn development moves further onward. 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. If you are feeling generous perhaps you could also assist me keep this page alive by assisting with the hosting bills for this site, if not please feel free to utilise this page in any way you see fit and remember: "Have Fun!".