#!/usr/bin/perl # # download all-in-one bundle from # http://win32builder.gnome.org/gtk+-bundle_3.6.4-20130921_win32.zip # # use strict; use warnings; my ($cmd,$res); print "\n"; # set environment &SetEnvironment(); $cmd = "copy C\:\\Gtk3.6.4\\lib\\libffi.dll.a C:\\Gtk3.6.4\\lib\\libffi.a"; print "$cmd\n\n"; $res =`$cmd`; print "$res\n"; $cmd = "copy C\:\\usr\\local\\lib\\girepository.lib C:\\usr\\local\\lib\\libgirepository-1.0.a"; print "$cmd\n\n"; $res =`$cmd`; print "$res\n"; # install Cairo &PpmInstall("Cairo","ppm install http://www.sisyphusion.tk/ppm/Cairo.ppd"); # install ExtUtils::PkgConfig &CpanInstall("ExtUtils::PkgConfig"); # install ExtUtils::Depends &CpanInstall("ExtUtils::Depends"); # install Glib &MakefileInstall("Glib","C\:\\usr\\local\\Glib-1.304"); # install Glib::Object::Introspection &MakefileInstall("Glib::Object::Introspection","C\:\\usr\\local\\Glib-Object-Introspection-0.020"); sub CpanInstall { print "\nInstalling $_[0]\n\n"; my $cmd = "cpan $_[0]"; print "$cmd\n\n"; my $res = `$cmd`; print "$res\n"; } sub MakefileInstall { print "\nInstalling $_[0]\n\n"; my $targetDir = $_[1]; chdir($targetDir) or die "Cant chdir to $targetDir $!"; my $currentDir = `cd`; print "\nCurrent Directory = $currentDir\n"; my $cmd = "perl Makefile.PL"; print "$cmd\n\n"; my $res = `$cmd`; print "$res\n"; $cmd = "dmake"; print "$cmd\n\n"; $res = `$cmd`; print "$res\n\n"; $cmd = "dmake install"; print "$cmd\n\n"; $res = `$cmd`; print "$res\n"; } sub PpmInstall { print "\nInstalling $_[0]\n\n"; my $cmd = $_[1]; print "$cmd\n\n"; my $res = `$cmd`; print "$res\n"; } sub SetEnvironment { $ENV{'PATH'} = "C:\\usr\\local\\bin;C:\\Gtk3.6.4\\bin;" . $ENV{'PATH'}; my $cmd = "set PATH=C:\\usr\\local\\bin;C:\\Gtk3.6.4\\bin;%PATH%"; print "$cmd\n"; my $res = `$cmd`; print "$res\n"; $ENV{'PKG_CONFIG_PATH'} = "C:\\usr\\local\\lib\\pkgconfig;C:\\Gtk3.6.4\\lib\\pkgconfig"; $cmd = "set PKG_CONFIG_PATH=C:\\usr\\local\\lib\\pkgconfig;C:\\Gtk3.6.4\\lib\\pkgconfig"; print "$cmd\n"; $res = `$cmd`; print "$res\n"; $ENV{'CPATH'} = "C:\\usr\\local\\include\\gobject-introspection-1.34.2"; $ENV{'CPATH'} = "C:\\usr\\local\\include\\libffi-3.0.11;" . $ENV{'CPATH'}; $cmd = "set CPATH=C:\\usr\\local\\include\\gobject-introspection-1.34.2"; print "$cmd\n"; $res = `$cmd`; print "$res\n"; $ENV{'GI_TYPELIB_PATH'} = "C:\\usr\\local\\lib\\girepository-1.0"; $cmd = "set GI_TYPELIB_PATH=C:\\usr\\local\\lib\\girepository-1.0"; print "$cmd\n"; $res = `$cmd`; print "$res\n"; printf("%-15.15s: $ENV{PATH}\n", "PATH"); printf("%-15.15s: $ENV{PKG_CONFIG_PATH}\n", "PKG_CONFIG_PATH"); printf("%-15.15s: $ENV{CPATH}\n", "CPATH"); printf("%-15.15s: $ENV{GI_TYPELIB_PATH}\n", "GI_TYPELIB_PATH"); }