originally from: http://www.kudos.byethost15.com/freeguide/Compiling_XMLTV_from_source.htm

Note from Robert: 
these instructions can also be used to build a local (non exe) install of XMLTV.  You don't need the Activestate Perl Development Kit and simply do a "nmake install" instead of "nmake xmltv.exe". As you can see, quite a bit is still involved, for most folks, it's easier to just grab the exe distribution (or alpha-exe http://alpha-exe.xmltv.org ).

CREATING   XMLTV.EXE   FROM SOURCE

How to produce a (working) Windows executable direct from the CVS repository

This guide owes much to Robert Eden, Ed Avis, Davide Chiarini and Andy Balaam

January 17, 2007

Download CamelPack from  http://stennie.org/camelpack/ using the installer .
This is to install most of the necessary software that is necessary to compile XMLTV.exe from source. You need all 3 programs.

 Note: this installer provides options to download and install the following into default locations that work for compiling from CPAN.
·                     ActiveState's Active Perl (c:\perl\)
·                     BloodShed Dev-C++ 5 (c:\dev-cpp) .. will optionally be added to end of %PATH% environment var
·                     Microsoft Nmake (c:\perl\bin)

 If all is well, you should be able to compile a module like Text::CSV_XS:

Typing C:\>perl -MCPAN -e shell   should give you the cpan environment ......
Set up gcc environment - 3.4.2 (mingw-special)
cpan shell -- CPAN exploration and modules installation (v1.7601)ReadLine support enabled
cpan> test Text::CSV_XS   (type this in at the cpan prompt)
# ... time passes ... #
Nmake test – OK
The only other piece of software necessary is unfortunately not free although you can download a 30 day working copy
from http://www.activestate.com/Products/Perl_Dev_Kit/?utm_source=ASPN_Perl&utm_medium=banner&utm_campaign=PerlDevKit
After installing the PDK you are ready to start wrestling with Perl modules.
As I wanted to compile XMLTV directly from source, I set up the software to download directly from SourceForce. This 
is done with a piece of software called TortoiseCVS which “Checks out” a copy of the source code from the SourceForge
“Repository”
1.	Install TortoiseCVS from http://sourceforge.net/project/showfiles.php?group_id=142108
2. Right click from within Windows Explorer and choose CVS Checkout.
3. A screen will appear from the Checkout Module of TortoiseCVS. Under CVSROOT, enter the following text
 :pserver:anonymous@xmltv.cvs.sourceforge.net:/cvsroot/xmltv
This will set all the various parameters for anonymous access. Use Fetch List to get the module names and then choose 
xmltv. Go to the tab Options and use Enter Your Own Folder Name to download to the correct folder. I created a short
folder name without spaces in the root which I called XMLTV_Source. This is important The source files will now be
downloaded into XMLTV_Source where they can be updated at any time by right-clicking Update from within the folder.
This folder will be our working folder for compiling the Perl modules.
 4.                Install Expat from ftp://ftp.jclark.com/pub/xml/expat.zip  just install it with its default settings and forget it.
Starting to compile
The first step is to install all the various PERL modules that XMLTV needs, and there are a lot of them
I used 2 command line windows under Windows XP for convenience to avoid changing directories.
At the command line enter> ppm       to run the Perl Package Manager  (EXIT to quit)
First set PPM to have 3 good repositories to seach. At the ppm prompt enter….

ppm> repos add University_of_Winnipeg http://theoryx5.uwinnipeg.ca/cgi-bin/ppmserver?urn:/PPMServer58
ppm> repos add crazyinsomniac  http://crazyinsomniac.perlmonk.org/perl/ppm/5.8
ppm> repos add Bribes  http://www.bribes.org/perl/ppm
 At the ppm prompt > ppm repos
 MUST return… 
 Repositories:
[1] ActiveState Package Repository
[2] University_of_Winnipeg
[3] crazyinsomniac
[4] Bribes


if not use repos help
 If you haven’t got a good sources for downloading modules from you won't be able to find the more difficult ones !
Now we have a decent source for PRECOMPILED modules, which have the advantage that they automatically know if there are dependent packages.
 We will start with the first module on this list
 ppm> search Class-MethodMaker (In PPM for Windows the colons are replaced by a hyphen) returns........
Searching in Active Repositories
1. Class-MethodMaker [2.03] Routines for parsing/manipulating dates and time.

ppm>
ppm> install 1 
 (this will install the package)- don’t be put off if the package, once found, does not install the first time. Just repeat the install. Install the highest version that you can find.This procedure is repeated for all the other modules in the list (use the same version or higher if you can find it)
Class-MethodMaker v2.02
HTML-Tagset v3.03
TermReadKey v2.21
XML-LibXML-Common v0.13 DO NOT FORGET TO SAY YES TO install libxml2.dll !!!!
XML-NamespaceSupport v1.08
Date-Manip v5.42a
HTML-TableExtract v1.08 (multiple installs)
Lingua-Preferred-0.2.4 
PerlIO-gzip v0.15
Tk-TableMatrix v1.1   
XML-LibXML v1.58
XML-Twig v3.15
XML-Writer-0.500
WWW-Mechanize (version 1.02 or higher)
HTTP-Cache-Transparent
Unicode-UTF8simple
File-Slurp
Log-Tracemessages
DB_File
These will probably be already installed but it is best to check

Tk v804.027
URI v1.30
XML-Parser v2.34
HTML-Parser v3.36
libwww-perl v5.79
Compress-Zlib v1.33
Unicode-String v2.07
HTML-Tree v3.18
Lingua-EN-Numbers-Ordinate v0.01
SOAP-Lite v0.60

The following modules need to be installed from CPAN, so use exit to quit PPM and type cpan to run cpan
To install the first of the 3 missing modules type> install IO::Scalar  
And then add the other 2

IO::Scalar  from CPAN
HTML::FormatText get from CPAN
Term::ProgressBar v2.06 from CPAN
Text::Bidi from CPAN   (only install if you need Hebrew for the Israel grabber)
needs to downloaded as a compressed file and installed as shown below. Cannot be used direct from CPAN

Text-Kakasi-2.04 is only required for the Japanese grabber – DO NOT INSTALL
 The modules than are not available as shown above, should be installed in order from the pre-requisites download from 
SourceForge http://sourceforge.net/project/showfiles.php?group_id=39046&package_id=91929
 This is more laborious and can be tricky as they don’t sort themselves out like the pre-compiled ppms.
1.    cd to directory of required module
2.    at prompt enter >  makefile.pl
3.    at prompt enter >  nmake
4.    at prompt enter >  nmake test
5.    at prompt enter >  nmake install
Everything must run without errors
 When all the modules on the list have been installed it is time to do a Makefile.pl
At the command prompt, pointing to the directory where your source files are, in this case XMLTV_Source, 
enter >   makefile.pl
 When asked to accept the default config, say NO and step through the code while checking for warnings of dependencies. 
The only warnings should be for Text-Kakasi and the library for Hebrew, neither of which are used.
When makefile has finished, enter >  nmake
The compilation should run to the end. If it doesn’t then there is something seriously wrong.You will see error 
messages on the left hand side of the screen. These refer to missing or incorrectly installed modules.
Once nmake runs error free you can go for  it and try to build the exe

 
enter > nmake xmltv.exe
 the result is an executable in your XMLTV_Source folder.
Each time you have performed a make and wish to repeat a makefile you will get a warning to do a distclean. 
Just enternmake distclean to clean out any files from the last nmake
I had absolutely no knowledge of Perl and have now performed this dubious operation twice. The first time was on my usual PC ( Windows XP SP2) and the second the day after on a new portable also with XP to document installation on a virgin PC.
The first time it took me 14 hours to get a working exe. The second time took me 2 hours including documenting 
everything and writing this at the same time.
My best advice is to follow this script. Every time that anything asks you something, reply with YES. At no time did I configure anything or add anything to the PATH environment. During my first attempt I spent 4 hours trying to get 
libxml2.dll to function. The answer was simple, you are trying to do something a lot like Linux on a Windows machine, so it is important that your source code is not on a different drive than C and that there are no spaces in your path names.
 Have fun
 Richard