mirror of https://github.com/GNOME/gimp.git
see plug-ins/perl/Changes
This commit is contained in:
parent
63199ed637
commit
136d3b29a2
|
@ -1,5 +1,10 @@
|
|||
Revision history for Gimp-Perl extension.
|
||||
|
||||
- fixed Gimp::Util::gimp_image_layertype.
|
||||
- make install checks for install directory writability
|
||||
and refuses to install if it isn't.
|
||||
- fixed a longstanding bug that caused (some) set_trace calls
|
||||
to be ignored with Gimp::Net.
|
||||
- added new convinience functions to Gimp::Util.
|
||||
- Gimp::Fu checks for the presence of Gtk and dies
|
||||
if it can't be found.
|
||||
|
|
|
@ -89,6 +89,14 @@ _exit()
|
|||
#endif
|
||||
abort();
|
||||
|
||||
# this one is for prefix mismatch check.
|
||||
char *
|
||||
_gimp_prefix()
|
||||
CODE:
|
||||
RETVAL = GIMP_PREFIX;
|
||||
OUTPUT:
|
||||
RETVAL
|
||||
|
||||
BOOT:
|
||||
{
|
||||
HV *stash = gv_stashpvn("Gimp", 4, TRUE);
|
||||
|
|
|
@ -127,11 +127,13 @@ sub unlock {
|
|||
|
||||
sub set_trace {
|
||||
my($trace)=@_;
|
||||
my $old_level = $trace_level;
|
||||
if(ref $trace) {
|
||||
$trace_res=$trace;
|
||||
} else {
|
||||
} elsif (defined $trace) {
|
||||
$trace_level=$trace;
|
||||
}
|
||||
$old_level;
|
||||
}
|
||||
|
||||
sub start_server {
|
||||
|
|
|
@ -281,7 +281,7 @@ sub gimp_image_add_new_layer {
|
|||
sub gimp_image_set_visible {
|
||||
my $image = shift;
|
||||
my %layers;
|
||||
@layers{map $$_,@_}++;
|
||||
@layers{map $$_,@_}=(1) x @_;
|
||||
for ($image->get_layers) {
|
||||
$_->set_visible ($layers{$$_});
|
||||
}
|
||||
|
@ -290,7 +290,7 @@ sub gimp_image_set_visible {
|
|||
sub gimp_image_set_invisible {
|
||||
my $image = shift;
|
||||
my %layers;
|
||||
@layers{map $$_,@_}++;
|
||||
@layers{map $$_,@_}=(1) x @_;
|
||||
for ($image->get_layers) {
|
||||
$_->set_visible (!$layers{$$_});
|
||||
}
|
||||
|
|
|
@ -46,6 +46,44 @@ Do you want me to make these tests [y]? ";
|
|||
do './config.pl';
|
||||
}
|
||||
|
||||
eval { require Gimp };
|
||||
unless($@) {
|
||||
$old_prefix = eval { Gimp::_gimp_prefix() };
|
||||
if ($@) {
|
||||
print <<EOF;
|
||||
|
||||
WARNING: I've detected an old version of Gimp-Perl installed
|
||||
already. Since I cannot detect the prefix used to install
|
||||
it I will just overwrite it. If you happen to use two
|
||||
different and incompatible versions of the Gimp with differing
|
||||
prefixes you should call configure with the --disable-perl
|
||||
switch to disable the perl extension, or consider installing
|
||||
the perl module elsewhere, using the environment variables
|
||||
PERL5LIB=/my/module/dir and PERL_MM_OPTS="PREFIX=\$PERL5LIB" to
|
||||
overwrite the installation directory (PERL_MM_OPTS) and run the
|
||||
Gimp (PERL5LIB). See "perldoc ExtUtils::MakeMaker" for a full
|
||||
discussion of your options.
|
||||
|
||||
EOF
|
||||
} else {
|
||||
if ($GIMP_PREFIX ne $old_prefix) {
|
||||
print <<EOF;
|
||||
|
||||
WARNING: I've detected another installaion of the Gimp-Perl extension.
|
||||
|
||||
This version uses the prefix '$GIMP_PREFIX'.
|
||||
The already installed version uses the prefix '$old_prefix'.
|
||||
|
||||
They don't match, which indicates that installing Gimp-Perl might
|
||||
overwrite an old but still used installation. Gimp-Perl will
|
||||
therefore be disabled, and not be installed.
|
||||
|
||||
EOF
|
||||
not_halt("prefix mismatch");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
eval "use Gtk;"; $GTK = $@ eq "";
|
||||
eval "use PDL;"; $PDL = $@ eq "";
|
||||
eval "use Parse::RecDescent;"; $PRD = $@ eq "";
|
||||
|
@ -125,10 +163,37 @@ EOF
|
|||
examples/example-fu.pl examples/example-oo.pl));
|
||||
|
||||
for(@shebang) {
|
||||
print "updating bangpath in $_\n";
|
||||
system ($Config{perlpath},"-pi","-e","\$. == 1 and \$_ = '#!$Config{perlpath}\n'",$_);
|
||||
}
|
||||
|
||||
sub MY::install {
|
||||
package MY;
|
||||
my $install = shift->SUPER::install(@_);
|
||||
($install =~ s/^install\b/really-install/m) or return $install;
|
||||
'
|
||||
install ::
|
||||
@for dir in \
|
||||
$(INSTALLPRIVLIB) \
|
||||
$(INSTALLARCHLIB) \
|
||||
$(INSTALLBIN) \
|
||||
$(INSTALLSCRIPT) \
|
||||
$(INSTALLMAN1DIR) \
|
||||
$(INSTALLMAN3DIR) ; \
|
||||
do \
|
||||
$(MKPATH) "$$dir"; \
|
||||
if test -d "$$dir" && test -w "$$dir" ; then : ; else \
|
||||
echo ; \
|
||||
echo "ERROR: installation directory \"$$dir\"" ; \
|
||||
echo " is not writable, not installing gimp-perl" ; \
|
||||
echo ; \
|
||||
exit ; \
|
||||
fi \
|
||||
done ; \
|
||||
$(MAKE) really-install
|
||||
|
||||
'.$install;
|
||||
}
|
||||
|
||||
sub MY::postamble {
|
||||
(my $GIMPTOOL2 = $GIMPTOOL) =~ s/^\.\./..\/../;
|
||||
my $postamble=<<"EOF";
|
||||
|
@ -141,7 +206,7 @@ check :: test
|
|||
clean ::
|
||||
test -f Makefile || mv -f Makefile.old Makefile
|
||||
|
||||
install :: install-plugins
|
||||
really-install :: install-plugins
|
||||
$GIMPTOOL --install-admin-bin Perl-Server
|
||||
|
||||
install-plugins:
|
||||
|
@ -176,7 +241,7 @@ WriteMakefile(
|
|||
},
|
||||
'LIBS' => [''],
|
||||
'INC' => "$CPPFLAGS $CFLAGS $GIMP_INC_NOUI $DEFS",
|
||||
'DEFINE' => ($IN_GIMP ? " -DIN_GIMP" : ""),
|
||||
'DEFINE' => ($IN_GIMP ? " -DIN_GIMP " : ""),
|
||||
'EXE_FILES' => ['scm2perl','scm2scm'],
|
||||
'realclean' => { FILES => "config.status config.cache config.log config.pl config.h" },
|
||||
'clean' => { FILES => "Makefile.old stamp-h" },
|
||||
|
@ -190,5 +255,22 @@ Hopefully, Gimp is now correctly configured. you can now enter "make",
|
|||
|
||||
EOF
|
||||
|
||||
# write an empty makefile (the last chance to stop)
|
||||
# and warn the user.
|
||||
sub not_halt {
|
||||
print STDERR "WARNING: *** perl extension will not be built ($_[0]) ***\n\n";
|
||||
open MAKEFILE,">Makefile" or die "unable to create Makefile: $!";
|
||||
print MAKEFILE <<EOF;
|
||||
all install check:
|
||||
|
||||
clean mostlyclean objclean:
|
||||
|
||||
distclean maintainer-clean: clean
|
||||
rm -f Makefile config.cache config.pl config.log config.h config.status stamp-h Makefile.old
|
||||
EOF
|
||||
close MAKEFILE;
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -26,3 +26,12 @@ if (defined $topdir) {
|
|||
$GIMP_LIBS =~ s/\$topdir/$topdir/g;
|
||||
$GIMP_LIBS_NOUI =~ s/\$topdir/$topdir/g;
|
||||
}
|
||||
|
||||
if ($IN_GIMP) {
|
||||
$GIMP_PREFIX=$prefix;
|
||||
} else {
|
||||
$GIMP_PREFIX = `$GIMPTOOL --prefix`;
|
||||
chomp $GIMP_PREFIX;
|
||||
}
|
||||
|
||||
$DEFS = ' -DGIMP_PREFIX=\"'.$GIMP_PREFIX.'\"';
|
||||
|
|
|
@ -39,3 +39,4 @@ AC_OUTPUT(config.pl)
|
|||
|
||||
echo "now invoking perl to complete the configuration..."
|
||||
exec $PERL $MAKEFILE_PL --writemakefile PREFIX="$prefix"
|
||||
|
||||
|
|
Loading…
Reference in New Issue