Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
GNOME
GIMP
Commits
136d3b29
Commit
136d3b29
authored
Mar 12, 1999
by
Marc Lehmann
Browse files
see plug-ins/perl/Changes
parent
63199ed6
Changes
7
Hide whitespace changes
Inline
Side-by-side
plug-ins/perl/Changes
View file @
136d3b29
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.
...
...
plug-ins/perl/Gimp.xs
View file @
136d3b29
...
...
@@ -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);
...
...
plug-ins/perl/Gimp/Net.pm
View file @
136d3b29
...
...
@@ -127,11 +127,13 @@ sub unlock {
sub
set_trace
{
my
(
$trace
)
=
@_
;
my
$old_level
=
$trace_level
;
if
(
ref
$trace
)
{
$trace_res
=
$trace
;
}
els
e
{
}
els
if
(
defined
$trace
)
{
$trace_level
=
$trace
;
}
$old_level
;
}
sub
start_server
{
...
...
plug-ins/perl/Gimp/Util.pm
View file @
136d3b29
...
...
@@ -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
{
$
$_
});
}
...
...
plug-ins/perl/Makefile.PL
View file @
136d3b29
...
...
@@ -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
;
}
plug-ins/perl/etc/config.pl.in
View file @
136d3b29
...
...
@@ -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.'\"';
plug-ins/perl/etc/configure.in
View file @
136d3b29
...
...
@@ -39,3 +39,4 @@ AC_OUTPUT(config.pl)
echo "now invoking perl to complete the configuration..."
exec $PERL $MAKEFILE_PL --writemakefile PREFIX="$prefix"
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment