public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Alexandre Restovtsev" <tetromino@gmail.com>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/gnome:master commit in: gnome-extra/evolution-data-server/files/, gnome-extra/evolution-data-server/
Date: Sat, 26 May 2012 08:10:22 +0000 (UTC)	[thread overview]
Message-ID: <1338019784.3685687379f40316a9d3eacdf4d53d2259d756d9.tetromino@gentoo> (raw)

commit:     3685687379f40316a9d3eacdf4d53d2259d756d9
Author:     Alexandre Rostovtsev <tetromino <AT> gentoo <DOT> org>
AuthorDate: Sat May 26 08:09:44 2012 +0000
Commit:     Alexandre Restovtsev <tetromino <AT> gmail <DOT> com>
CommitDate: Sat May 26 08:09:44 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gnome.git;a=commit;h=36856873

gnome-extra/evolution-data-server: sync with gx86

fix-la-relink-command is now a package in portage.

---
 .../evolution-data-server-9999.ebuild              |    4 +-
 .../files/fix_relink_command.pl                    |  108 --------------------
 2 files changed, 2 insertions(+), 110 deletions(-)

diff --git a/gnome-extra/evolution-data-server/evolution-data-server-9999.ebuild b/gnome-extra/evolution-data-server/evolution-data-server-9999.ebuild
index fcdf1c8..9921c8d 100644
--- a/gnome-extra/evolution-data-server/evolution-data-server-9999.ebuild
+++ b/gnome-extra/evolution-data-server/evolution-data-server-9999.ebuild
@@ -50,6 +50,7 @@ RDEPEND=">=dev-libs/glib-2.30:2
 "
 DEPEND="${RDEPEND}
 	dev-lang/perl
+	dev-util/fix-la-relink-command
 	dev-util/gperf
 	>=dev-util/intltool-0.35.5
 	sys-devel/bison
@@ -116,8 +117,7 @@ src_install() {
 	# every .la file's relink_command field, forcing libtool to look there
 	# first during relinking. This will mangle the .la files installed by
 	# make install, but we don't care because we will be punting them anyway.
-	perl "${FILESDIR}/fix_relink_command.pl" . ||
-		die "fix_relink_command.pl failed"
+	fix-la-relink-command . || die "fix-la-relink-command failed"
 	gnome2_src_install
 
 	if use ldap; then

diff --git a/gnome-extra/evolution-data-server/files/fix_relink_command.pl b/gnome-extra/evolution-data-server/files/fix_relink_command.pl
deleted file mode 100755
index 12106c3..0000000
--- a/gnome-extra/evolution-data-server/files/fix_relink_command.pl
+++ /dev/null
@@ -1,108 +0,0 @@
-#!/usr/bin/perl
-# Fix the relink_command field of .la files in the specified directory tree
-# to add "-L$dir/.libs" for every .la file that is specified in a relative
-# $dir; place these new -L directives before the first relative .la file.
-#
-# E.g. :
-# relink_command="(cd /tmp/foo/libfoo; /bin/sh /tmp/foo/libtool --silent --tag CC --mode=relink gcc -O2 foo.lo bar/libbar.la ../baz/libbaz.la /usr/lib/libfrob.la -lm)"
-# will become
-# relink_command="(cd /tmp/foo/libfoo; /bin/sh /tmp/foo/libtool --silent --tag CC --mode=relink gcc -O2 foo.lo -Lbar/.libs -L../baz/.libs bar/libbar.la ../baz/libbaz.la /usr/lib/libfrob.la -lm)"
-#
-# Such a procedure should ensure that during relinking, libraries in the
-# local build tree will be looked at before libraries installed systemwide.
-#
-# Limitations: it is assumed that relink_command is one line. It is assumed
-# that any spaces in paths are escaped using '\'.
-#
-# Copyright (c) 2011 Alexandre Rostovtsev <tetromino@gmail.com>
-#
-# This program is free software; you can redistribute it and/or modify it 
-# under the same terms as Perl itself.
-use strict;
-use warnings;
-
-use Cwd qw(realpath);
-use File::Basename;
-use File::Find;
-
-my %processed = ();
-sub process_la_file {
-    my $filename = $_; # relative to cwd
-    my $pretty_filename = $File::Find::name; # relative to initial cwd
-    if (-d $filename) { return; }
-
-    # don't process a single .la file multiple times (e.g. if symlinked)
-    my $realpath = realpath($filename);
-    if ($processed{$realpath}) {
-        print "$pretty_filename ($realpath) was already processed\n";
-	return;
-    } else {
-        $processed{$realpath}++;
-    }
-
-    # preserve the .la file's mtime in order to avoid triggering make rules
-    my $mtime = (stat $filename)[9];
-    open(my $fh, '<', $filename) or die $!;
-    my $text;
-    my $changes; # whether the file has been changed
-    while (<$fh>) {
-        if (/relink_command=/) {
-            my ($start, $added, $end);
-	    my $ignore = 0; # number of words to not check for similariy to
-	                    # an .la filename, following and including the
-                            # current word
-	    # split by unescaped spaces
-	    for my $word (split /(?<!\\) /) {
-	        if ($word =~ /^-/) {
-                    # ignore command-line options; ignore filename after -o
-                    $ignore++;
-                    $ignore++ if $word eq '-o' ;
-                }
-	    	if ($word =~ m:^[^/].*\.la\W*$: and not $ignore) {
-                    $added .= "-L" . dirname($word) . "/.libs ";
-                    $end .= "$word ";
-                    $changes++;
-                } else {
-                    if ($end) {
-                        $end .= "$word ";
-                    } else {
-                        $start .= "$word ";
-                    }
-                }
-                $ignore-- if $ignore > 0;
-	    }
-	    $_ = "$start$added$end";
-            print "Added '$added' to relink_command in $pretty_filename\n" if $changes;
-	}
-	$text .= $_;
-    }
-    close $fh;
-    if ($changes) {
-        open($fh, '>', $filename) or die $!;
-        print $fh $text;
-        close $fh;
-        # Perl's utime does not support sub-second time :/
-        # And Time::HiRes doesn't help. As a workaround, round up the number of
-        # seconds in order to avoid triggering make rules.
-        utime $mtime + 1, $mtime + 1, $filename;
-    }
-}
-
-if (not @ARGV or $ARGV[0] eq '-h' or $ARGV[0] eq '--help') {
-    warn <<endhelp;
-Usage: fix_relink_command.pl [LAFILENAMES or DIRECTORIES]
-
-Adds extra -L\$dir/.libs arguments to the relink_command field of .la files
-in order to ensure that during relinking, libraries in the local build tree
-will be looked at before ones installed systemwide.
-
-If a filename is given, will process that .la file. If a directory is given,
-will recursively process all .la files in it (but will not recurse into
-symlinked or hidden directories).
-endhelp
-    exit;
-}
-
-find({ wanted => \&process_la_file,
-       preprocess => sub {grep { if (-d $_) { /^[^.]/ } else { /\.la$/ } } sort @_}
-     }, @ARGV);



             reply	other threads:[~2012-05-26  8:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-26  8:10 Alexandre Restovtsev [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-08-10 13:17 [gentoo-commits] proj/gnome:master commit in: gnome-extra/evolution-data-server/files/, gnome-extra/evolution-data-server/ Priit Laes
2012-08-24 17:08 Priit Laes
2013-03-03 12:50 Priit Laes
2013-03-03 15:07 Priit Laes
2013-03-25 13:19 Nirbheek Chauhan
2013-11-13 13:15 Priit Laes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1338019784.3685687379f40316a9d3eacdf4d53d2259d756d9.tetromino@gentoo \
    --to=tetromino@gmail.com \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox