# $Id$ # Main page of 'My::Project::staticbuild' # Copyright (C) 2005 Jan Kratochvil # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; exactly version 2 of June 1991 is required # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA package project::staticbuild::Index; require 5.6.0; # at least 'use warnings;' but we need some 5.6.0+ modules anyway our $VERSION=do { my @r=(q$Revision$=~/\d+/g); sprintf "%d.".("%03d"x$#r),@r; }; our $CVS_ID=q$Id$; use strict; use warnings; use My::Web; Wuse 'project::Lib'; our @ListItem=( "name"=>"staticbuild", "platform"=>"unixdevel", "priority"=>495, "download-source patches"=>"dist/staticbuild-2006-01-26-00.tar.gz", "download-Fedora Core 4 i386 binaries"=>"dist/staticbuild-2006-01-26-00-bin.tar.gz", "summary"=>"Fully static binaries build - GNU/Linux vendor independence", "license"=>"GPL", "maintenance"=>"ready", "language"=>"C", "description"=><<"HERE",

There exists too many GNU/Linux distributions - vendors - and any produced binary is not compatible with all of them due to the shared libraries and configuration files dependencies. Due to many hardcoded shared libraries it is no longer possible to just use gcc -static. These patches provide the functionality you would expect from: gcc -static

HERE ); sub handler { project::Lib->init(); print <<"HERE";

This static build framework is based on @{[ a_href 'http://fedora.redhat.com/','Fedora Core' ]} 4 (@{[ a_href 'http://download.fedora.redhat.com/pub/fedora/linux/core/4/SRPMS/','SRPMS' ]} and @{[ a_href 'http://download.fedora.redhat.com/pub/fedora/linux/core/updates/4/SRPMS/','SRPMS updates' ]}). In fact it is not important which distribution the static build is based on as the final binaries should run on any GNU/Linux system vendor/version. Just I decided for @{[ a_href 'http://fedora.redhat.com/','Fedora Core' ]}.

You must use the same package versions on the main (dynamic) build system as the static libraries are built for! Therefore you must use @{[ a_href 'http://fedora.redhat.com/','Fedora Core' ]} 4 if using the unchanged sources or even the binaries provided here.

This static build does not provide threading - neither POSIX threads nor LinuxThreads. I did not need it anywhere and it gets everything simpler and smaller this way.

You should build your sources statically (using automake(1) --enable-static) although without gcc -static. As the last step you should relink the binaries against this staticbuild libraries by hand - it is not much possible to convince automake(1) to properly relink it the minized way for you. Check the '@{[ a_href 'http://git.jankratochvil.net/?p=captive.git;a=blob_plain;hb=HEAD;f=build-static','build-static' ]}' script for an example.

This package has been used in its current or former versions for my projects:

HERE sub projectname($) { my($name)=@_; return a_href "/project/$name/",project::Lib->title(project::Lib->name_to_hashref($name)); } print <<"HERE"; HERE my $gnome="http://bugzilla.gnome.org/show_bug.cgi?id="; my $sources="http://sources.redhat.com/bugzilla/show_bug.cgi?id="; sub bug($$$) { my($prefix,$id,$desc)=@_; return "Bug ".a_href($prefix.$id,$id)." - $desc"; } my @bugs=( "GConf2-2.10.0-4"=>[], "atk-1.9.1-1"=>[], "fontconfig-2.2.3-13"=>[], "fuse-2.4.2-2.fc4"=>[], "glib2-2.6.6-1"=>[], "glibc-2.3.5-10.3"=>[ bug($sources,1043,"--enable-static-nss false warnings"), bug($sources,1044,'--enable-static-nss nsswitch "compat"'), bug($sources,1045,"--disable-shared / --enable-static-nss build fix"), bug($sources,1050,"new --enable-static-gconv"), ], "gnome-vfs2-2.10.0-5"=>[ bug($gnome, 47053,"new --with-included-filesystems"), ], "gtk2-2.6.10-2.fc4.4"=>[], "libbonobo-2.8.1-1"=>[ bug($gnome,309504,"new --disable-threads"), ], "libgnome-2.10.0-3"=>[], "libxml2-2.6.20-1.FC4"=>[], "pango-1.8.1-2"=>[], "xorg-x11-6.8.2-37.FC4.49.2"=>[], ); print <<"HERE"; HERE while (@bugs) { my $package=shift @bugs; my @buglist=@{shift @bugs}; print "\t".'"; # BEWARE: Wrong code indentation: if (@buglist) { print ""; print "\t"."\n" for @buglist; } else { print "\t".''."\n"; } } print <<"HERE";
Patched PackagePatches Submitted as Bugs
'.$package."".shift(@buglist)."
$_
-
HERE exit; } 1;