summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2003-09-13 21:07:32 +0000
committerMike Frysinger <vapier@gentoo.org>2003-09-13 21:07:32 +0000
commite9b75793527b326809d92e15901812fb9047c424 (patch)
treef5867d912aa5e46e823d71a559902a2a5d486035 /net-p2p/dc-gui
parentadded Kumba's changes for mips (diff)
downloadgentoo-2-e9b75793527b326809d92e15901812fb9047c424.tar.gz
gentoo-2-e9b75793527b326809d92e15901812fb9047c424.tar.bz2
gentoo-2-e9b75793527b326809d92e15901812fb9047c424.zip
split up interface file to cut down on ram usage #28209
Diffstat (limited to 'net-p2p/dc-gui')
-rw-r--r--net-p2p/dc-gui/ChangeLog11
-rw-r--r--net-p2p/dc-gui/dc-gui-0.75.ebuild12
-rw-r--r--net-p2p/dc-gui/files/split_interface_fast.pl126
3 files changed, 143 insertions, 6 deletions
diff --git a/net-p2p/dc-gui/ChangeLog b/net-p2p/dc-gui/ChangeLog
index ce7b89c3f1fb..f86fe06ff96b 100644
--- a/net-p2p/dc-gui/ChangeLog
+++ b/net-p2p/dc-gui/ChangeLog
@@ -1,12 +1,17 @@
# ChangeLog for net-p2p/dc-gui
# Copyright 2002-2003 Gentoo Technologies, Inc.; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-p2p/dc-gui/ChangeLog,v 1.17 2003/07/24 00:24:01 agenkin Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-p2p/dc-gui/ChangeLog,v 1.18 2003/09/13 21:07:32 vapier Exp $
+
+*dc-gui-0.75 (23 Jul 2003)
+
+ 13 Sep 2003; Mike Frysinger <vapier@gentoo.org> :
+ Added a perl script to split up the interface file. The current one
+ seems to take like 500+megs of ram to compile. Thanks go out to
+ Michal 'Spock' Januszewski <spock@o2.pl> for the script #28209.
25 Jun 2003; Martin Holzer <mholzer@gentoo.org> dc-gui-0.74.ebuild:
Fixed DEPEND. Closes #23473.
-*dc-gui-0.75 (23 Jul 2003)
-
23 Jul 2003; Arcady Genkin <agenkin@gentoo.org> :
Version bumped.
diff --git a/net-p2p/dc-gui/dc-gui-0.75.ebuild b/net-p2p/dc-gui/dc-gui-0.75.ebuild
index 8bff1d0c3002..e7c15d54b53f 100644
--- a/net-p2p/dc-gui/dc-gui-0.75.ebuild
+++ b/net-p2p/dc-gui/dc-gui-0.75.ebuild
@@ -1,8 +1,6 @@
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-p2p/dc-gui/dc-gui-0.75.ebuild,v 1.1 2003/07/24 00:24:01 agenkin Exp $
-
-IUSE="nls"
+# $Header: /var/cvsroot/gentoo-x86/net-p2p/dc-gui/dc-gui-0.75.ebuild,v 1.2 2003/09/13 21:07:32 vapier Exp $
MY_P=${PN/-/_}2-${PV}
S=${WORKDIR}/${MY_P}
@@ -13,6 +11,7 @@ HOMEPAGE="http://ac2i.tzo.com/dctc/"
SLOT="2"
LICENSE="GPL-2"
KEYWORDS="~x86 ~ppc"
+IUSE="nls"
DEPEND="=dev-libs/glib-2*
=x11-libs/gtk+-2*
@@ -21,6 +20,13 @@ DEPEND="=dev-libs/glib-2*
>=net-p2p/dctc-0.85.4"
RDEPEND="nls? ( sys-devel/gettext )"
+src_unpack() {
+ unpack ${A}
+ cd ${S}/src
+ cp ${FILESDIR}/split_interface_fast.pl .
+ perl split_interface_fast.pl || die "could not split interface up"
+}
+
src_compile() {
econf `use_enable nls` || die
emake || die
diff --git a/net-p2p/dc-gui/files/split_interface_fast.pl b/net-p2p/dc-gui/files/split_interface_fast.pl
new file mode 100644
index 000000000000..a13c83b7b85f
--- /dev/null
+++ b/net-p2p/dc-gui/files/split_interface_fast.pl
@@ -0,0 +1,126 @@
+#!/usr/bin/perl
+# interface.c splitter for dc_gui2
+# (c) 2003 by Micha³ 'Spock' Januszewski
+
+open(SRC,"<interface.c");
+open(EXT,">interface_extern.h");
+open(NSRC,">interface_new.c");
+
+$maxlines = 500;
+
+my @temp;
+my @objects;
+
+while ($line = <SRC> ) {
+
+ if ($line =~ /static ([A-Za-z0-9_\ \[\]]+)/) {
+ print EXT "extern $1;\n";
+ $line =~ s/static//;
+ }
+
+ push @temp,$line;
+ last if ($line =~ /create_app1 \(void\)/);
+}
+
+while ($line = <SRC>) {
+
+ last if ($line =~ /^\s+$/);
+
+ if ($line =~ /(G[A-Za-z0-9]+ \*[A-Za-z0-9_]+)(.*)/) {
+ push @objects,"$1$2";
+ print EXT "extern $1;\n";
+ }
+}
+
+$done = 0;
+
+$cnt = 0;
+$linecnt = 0;
+$back = $line;
+
+while ($line = <SRC>) {
+
+ last if ($line =~ /return app1/);
+
+ if ($linecnt == 0) {
+ open(SPLIT,">interface$cnt.c");
+
+ print SPLIT "#include <sys/types.h>\n#include <sys/stat.h>\n#include <unistd.h>\n#include <string.h>\n#include <stdio.h>\n";
+ print SPLIT "#include <gnome.h>\n#include \"callbacks.h\"\n#include \"interface.h\"\n#include \"support.h\"\n#include \"interface_extern.h\"\n";
+ print SPLIT "#define GLADE_HOOKUP_OBJECT(component,widget,name) gtk_object_set_data_full (GTK_OBJECT (component), name, gtk_widget_ref (widget), (GtkDestroyNotify) gtk_widget_unref)\n";
+ print SPLIT "#define GLADE_HOOKUP_OBJECT_NO_REF(component,widget,name) gtk_object_set_data (GTK_OBJECT (component), name, widget)\n\n";
+ print SPLIT "void create_app1_part$cnt (void) {\n\n";
+ }
+
+ print SPLIT $line;
+ $linecnt++;
+
+ if ($linecnt == $maxlines) {
+
+ # we don't want an unfinished line to be broken between two functions
+ while ($line !~ /;\s*\n$/) {
+ $line = <SRC>;
+ print SPLIT $line;
+ }
+
+ $linecnt = 0;
+ print SPLIT " return;\n}\n";
+ close(SPLIT);
+ $cnt++;
+ }
+}
+print SPLIT " return;\n}\n";
+close(SPLIT);
+
+while ($dat = shift @temp) {
+ if ($dat =~ /^GtkWidget*/ && !$done) {
+ for ($i = 0; $i < $#objects+1; $i++) {
+ print NSRC $objects[$i]."\n";
+ }
+ print NSRC "\n";
+ $done = 1;
+
+ for ($i = 0; $i < $cnt+1; $i++) {
+ print NSRC "void create_app1_part$i (void);\n";
+ }
+
+ print NSRC "\n";
+
+ }
+ print NSRC $dat
+}
+
+print NSRC "{\n";
+
+for ($i = 0; $i < $cnt+1; $i++) {
+ print NSRC " create_app1_part$i ();\n";
+}
+
+print NSRC $line;
+
+while ($line = <SRC>) {
+ print NSRC $line;
+}
+
+
+close(SRC);
+close(EXT);
+close(NSRC);
+
+$cnt++;
+$t = "interface.c";
+
+for ($i = 0; $i < $cnt; $i++) {
+ $t .= " interface$i.c";
+}
+
+`sed -i 's/interface.c/$t/' Makefile.in`;
+
+$t = 'interface.$(OBJEXT)';
+
+for ($i = 0; $i < $cnt; $i++) {
+ $t .= " interface$i.".'$(OBJEXT)';
+}
+
+`sed -i 's/interface.\$\(OBJEXT\)/$t/' Makefile.in`;
+`mv -f interface_new.c interface.c`;