It is currently Fri Mar 29, 2024 5:42 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 58 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: Getting Perl to work in Gimp
PostPosted: Fri Jan 07, 2011 9:38 pm  (#1) 
Offline
GimpChat Member
User avatar

Joined: Oct 19, 2010
Posts: 376
Location: North Central Ohio, USA
First things first: Based on the limited amount of information I've been able to find, it seems that there is a problem getting Perl to work with Gimp under Windows. So, depending on how this turns out, this thread may not work for those using Windows. Can a Windows user confirm general Perl dysfunction for me?

This thread came about as a few of us were discussing a nifty plug-in called Autosave and getting it working in Gimp. You can read more about it and get it here from the Gimp Plugin Registry, if you're interested. The reason it was a bit of a challenge is that there's not much documentation - although to be fair the plug-in author has provided assistance in getting the plug-in to work for persons who asked in the comments area, and as recently as June of 2010. Based on my own experiences, the problems I experienced were not due to the Autosave plug-in, but due to the Gimp-perl plug-in. As best I can tell (and please correct me if I'm wrong, someone), the Gimp-perl plug-in has not been worked on since 2004-2005. Gimp has changed a lot in 6 years.

Gimp-perl provides perl scripting capabilities to Gimp, very similar to how Python does. It can be argued that there's no need to add yet another scripting language to Gimp, and that's fine. In order to get the Autosave plug-in to work, you can either make Gimp-perl work, or rewrite the plug-in in another language.

Here's what I did:
1. Get the Gimp-perl archive from here.
2. Unpack it into a directory. For those using Ubuntu and similar Linux, file-roller or your archive manager should allow you to recreate the enclosed file structure and extract the files.
3. Change to the extracted directory. If you do read the README, it says that you need to have a recent version of Perl, Gtk, Gimp and the Perl Data Language. Truthfully, if you are running a recent version of your Linux-based OS, you will most likely have more up-to-date versions of the dependencies, as the version of Gimp required is 2.2 or better.
4. The README will next tell you to run the following command in a terminal:
perl Makefile.PL
Don't waste your time, it's probably not ready yet. There are some perl dependencies that have to be satisfied before this will run successfully.
5. Do this:
sudo perl -MCPAN -e 'install ExtUtils::Depends'
sudo perl -MCPAN -e 'install ExtUtils::PkgConfig'
sudo apt-get install libsexy-dev

6. Now the perl dependencies should be satisfied, so now run
perl Makefile.PL
Assuming this makefile is able to run successfully, you are now ready for the usual:
sudo make
sudo make test
sudo make install

It's worth noting that there are some interesting perl scripts in the examples directory. It you move them to you plugins directory they will become usable in Gimp.

7. Now it's likely I goofed somewhere along the line, but when all this was done, Gimp couldn't find Gimp-perl. Gimp was looking for the perl stuff in a directory that didn't exist: /opt/bin/. Rather than uninstall and possibly really screwing something up, I elected to create the missing directory and put in a symbolic link there that pointed to my actual perl installation in /usr/bin. I used the following command in a terminal:
sudo ln -s /usr/bin/perl /opt/bin/perl
If you are not familiar with this command ln -s (that's a lower-case 'L') is a command that allows you to make a link between a file - sort of like a detour sign, and the -s option specifies that the link is symbolic. /usr/bin/perl is the actual file that I want the OS to find and /opt/bin/perl is the symbolic link that this command creates - the detour sign, if you will.

Here's what I found out. The Gimp-perl plug-in seems to suffer from the same age-related problems that many old Script-Fu/Scheme plug-in do. It seems to use deprecated procedure names that give Gimp hiccups that you will notice if you start Gimp from the command line. If you don't then you will see errors when running the examples. The errors did not seem to affect the operation of the scripts.

Autosave will appear on the Gimp File Menu, and there are three menu options. First is to disable the plug-in, next to enable, and third to set configuration options.

As always, your mileage may vary. I think I got lucky in getting Gimp-perl to work with just me and Google. If you need more in-depth help you may wish to contact rain, the author/poster of Autosave, through the GimpPlugin Registry as he/she seems willing to offer any assistance if asked. I'm willing to help anybody who wants to take a swing at it also, but "I ain't no professional." :hehe

_________________
Life Truth: #12
My cat is a worst typist than I am.


Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: Getting Perl to work in Gimp
PostPosted: Fri Jan 07, 2011 9:56 pm  (#2) 
Offline
Global Moderator
User avatar

Joined: Oct 06, 2010
Posts: 4039
Your discovery of #5 made all the difference for me being able to compile. Had you not been able to distinguish what you needed from your google searches, I wouldn't have it compiled now. I gave up on it last year. See how great gimpchat really is? Many thanks, Bob!

_________________
"In order to attain the impossible, one must attempt the absurd."
~ Miguel de Cervantes


Top
 Post subject: Re: Getting Perl to work in Gimp
PostPosted: Fri Jan 07, 2011 11:14 pm  (#3) 
Offline
GimpChat Member
User avatar

Joined: Oct 19, 2010
Posts: 376
Location: North Central Ohio, USA
You're welcome, mahvin!

I'm really surprised (thinking about this further) that this hasn't been written in Python. Maybe my surprise is due to my ignorance - as in, I don't know what python is capable of compared to perl; and I know next to nothing about perl. I was only good at programming in BASICA under DOS. :rofl

_________________
Life Truth: #12
My cat is a worst typist than I am.


Top
 Post subject: Re: Getting Perl to work in Gimp
PostPosted: Sat Jan 08, 2011 4:30 am  (#4) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
No way to get it to work in windows as msys or cygwin doesnt understand sudo command or a few others.
msysgit is possible along with cyg-apt, but anything like sudo or any other linux commands are not available i don't think.
Oh well maybe someone will come along and script it in Python or SCM. =)

Thanks for all your work in this though Bob! :coolthup :tyspin

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: Getting Perl to work in Gimp
PostPosted: Sat Jan 08, 2011 8:00 am  (#5) 
Offline
GimpChat Member
User avatar

Joined: Oct 19, 2010
Posts: 376
Location: North Central Ohio, USA
Rod,
Right, there's no such animal as sudo on a Windows machine. The closest thing you'd have is "Run as Administrator" on certain versions. I didn't really expect it to directly cross over, what I was after from Windows users was some feedback about whether or not they can install and run Perl itself. If they cannot get Perl to install and run, then any Perl script will fail. :(

_________________
Life Truth: #12
My cat is a worst typist than I am.


Top
 Post subject: Re: Getting Perl to work in Gimp
PostPosted: Sat Jan 08, 2011 8:19 am  (#6) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
Yes i do have Perl installed, in C:\Perl\bin.
When i was compiling gimp-2.7.2 or trying to compile it i should say, i had perl working fine.
But i had to copy it into a bin folder named "opt" - C:\cygwin\bin\opt\Perl

although the compiler found it fine in C:\Perl\bin - Gimp is a strange monkey to build in windows

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: Getting Perl to work in Gimp
PostPosted: Sat Jan 08, 2011 9:02 am  (#7) 
Offline
GimpChat Member
User avatar

Joined: Oct 19, 2010
Posts: 376
Location: North Central Ohio, USA
Here's the reason I asked: In my search for Perl-related things, I happened across the Camelbox project. It seems to be capable of installing Perl, and all of the bits and bytes that Gimp uses such as Gtk, pango, cairo, etc. on a 32-bit Windows machine

I was intrigued as most of this stuff is a challenge (usually) when trying to get Gimp up and running on Windows - or it was, anyhow. I ran the installer just a few minutes ago on my VirtualBox Win XP 32-bit and at the very least, the installer reported no problems and installed a ton of software, even MinGW! (One of the options, the one I selected, was "Bloatware", referred to as the whole enchilada in the installer.)

I'm in the very early stages of testing this, so other than a successful installation, I don't have any other info. And my machine hasn't started spamming Chinese ED cures, so I'm hopeful. :rofl I already have a working Gimp 2.6.11 install on this VM, so...we will see where it leads.

If you are interested in checking this out, look here:Camelbox.
Quote:
What is Camelbox?¶

A complete build of Perl for 32-bit Windows that includes:

* A nice Windows installer that automatically downloads and installs the correct archive files
* All of the core Gtk2-Perl modules (Gtk2, Glib, Cairo), as well as their equivalent C libraries compiled for Windows.
* A working CPAN module
* Bonus (!) Perl modules, including DBI/DBD[SQLite|mysql|Pg|ODBC] and friends
* Extra binaries, utilities, development libraries/headers for compiling even more Perl modules from CPAN
* Lots of Perl/GTK documenation in HTML format
* Windows shortcuts for applications, demos, documentation, and links to doumentation/tutorials on the web

all neatly packaged and ready to install!

_________________
Life Truth: #12
My cat is a worst typist than I am.


Top
 Post subject: Re: Getting Perl to work in Gimp
PostPosted: Sat Jan 08, 2011 11:59 pm  (#8) 
Offline
GimpChat Member

Joined: Apr 12, 2010
Posts: 5870
No problem to install Perl on win , camelbox seems a very good resource

_________________
My 3D Gallery on Deviantart http://photocomix2.deviantart.com/
Main gallery http://www.flickriver.com/photos/photocomix-mandala/
Mandala and simmetry http://www.flickriver.com/photos/photocomix_mandala/

Image

Mrs Wilbress


Top
 Post subject: Re: Getting Perl to work in Gimp
PostPosted: Sun Jan 09, 2011 12:01 am  (#9) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
Thanks Bob, and PC i' will check it out.
I have Perl already but wth. :)

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: Getting Perl to work in Gimp
PostPosted: Sun Jan 09, 2011 8:07 am  (#10) 
Offline
GimpChat Member
User avatar

Joined: Oct 19, 2010
Posts: 376
Location: North Central Ohio, USA
Rod,
I noticed this morning in the Autosave plugin comments at the Gimp Plugin Registry that a poster named wacmaster is also trying to get this running using Camelbox. You may want to check there now and then and see if he makes any progress. (Actually he beat me to it - I planned on posting there this morning once I got everyone off to church and the house quieted down. It's enough of a challenge to switch back and forth between my Linux host and the XP VM and keeping my brain straight without all the cats/dogs/people noise that accompanies a Sunday morning! :gaah )

_________________
Life Truth: #12
My cat is a worst typist than I am.


Top
 Post subject: Re: Getting Perl to work in Gimp
PostPosted: Sun Jan 09, 2011 3:51 pm  (#11) 
Offline
GimpChat Member
User avatar

Joined: Oct 19, 2010
Posts: 376
Location: North Central Ohio, USA
Rod,

Have you compiled Gimp 2.6.x from source on Windows? I think I need some of the development libraries to try and figure this out - I "cheated" on my Windows Gimp and waited for the 2.6.11 installer - so I don't have any of the Windows source stuff. Or if you can point me to a how-to or guide...

My thinking is that if I can get a good compile of a production version of gimp, I should have and be able to track down the files I need on my own system.

Thanks in advance.

_________________
Life Truth: #12
My cat is a worst typist than I am.


Top
 Post subject: Re: Getting Perl to work in Gimp
PostPosted: Sun Jan 09, 2011 4:00 pm  (#12) 
Offline
GimpChat Member

Joined: Apr 12, 2010
Posts: 5870
i fear all guides specific for Win are awfully outdated

_________________
My 3D Gallery on Deviantart http://photocomix2.deviantart.com/
Main gallery http://www.flickriver.com/photos/photocomix-mandala/
Mandala and simmetry http://www.flickriver.com/photos/photocomix_mandala/

Image

Mrs Wilbress


Top
 Post subject: Re: Getting Perl to work in Gimp
PostPosted: Sun Jan 09, 2011 4:22 pm  (#13) 
Offline
GimpChat Member
User avatar

Joined: Oct 19, 2010
Posts: 376
Location: North Central Ohio, USA
PC,
I noticed that as I was searching, which prompted me to ask Rod. I knew he had tried to compile 2.7.x, but I don't remember if he was successful. I've never compiled in Windows from the command line, so I was looking for some guidance before I jump in and mess something up. :)

Since Camelbox installed compilers and such I wanted to try it that way before digging through my Windows disks for Microsoft Visual Studio.

_________________
Life Truth: #12
My cat is a worst typist than I am.


Top
 Post subject: Re: Getting Perl to work in Gimp
PostPosted: Mon Jan 10, 2011 10:28 am  (#14) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
I tried to compile the Gimp-perl module.Windows just doesn't have the capability to do it.
I am pretty sure the reason is just like you said, no actual compiled libraries.

I should have kept all the gimp files i was actually able to compile, unfortunately i deleted them all.
There is a humongous amount of binaries you will need to compile Gimp.You can dl them all here.
ftp://ftp.gnu.org/pub/gnu/

My advice would be to download and install CYGWIN the entire package (about 700mb)
Don't mess around with Msys or MinGW i couldnt get either to work correctly. (configuration file cannot find paths)
That is what i ended up doing so i would have everything in a decent directory tree i needed for compiling BABL and GEGL.Which you need to compile Gimp.

In order to get everything you need for a decent compile for Gimp, you need all those dependencies.

Then download the gimp src files and un-tar it manually. (RAR or 7zip)
Or if you have unzip installed in your bin folder just run your reg untar command in the terminal.
NOW - cd to the gimp file and run configure ( ./configure)
Each time you get an error, for a missing file or dev or lib package, open cygwin and grab the package from there.
Or you can dl this nifty little program named apt-cyg - http://code.google.com/p/apt-cyg/
Do this because cygwin places the files exactly where they need to be after it compiles them for you.
Just keep running configure until you get your configure script to run all the way through.
You will need BABL and GEGL compiled to run a decent compile. It's required and the configure script will let you know that.I had no problems getting either to compile though so that shouldn't be a problem.

When i tried to compile 2.7.2 i ran into one last problem which was from the developer, and as far as i know hasn't been fixed.The compile runs all the way up to creating an actual exe for gimp 2.7.2, and fails.
You may not have this problem if you compile 2.6 versions. (i didn't try any of those)

Good luck either way, i gave up and uninstalled cygwin and msys, and camelbox...lol
Ill wait for the developers to get the next version out, or a scriptor to write a autosave file in scm or python.

Compiling gets my blood pressure too high. =)

Oh and btw wacmaster = Rod ;)

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: Getting Perl to work in Gimp
PostPosted: Mon Jan 10, 2011 10:30 am  (#15) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
You should check the thread i created for compiling 2.7.2 because there is a lot of info there also.

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: Getting Perl to work in Gimp
PostPosted: Mon Jan 10, 2011 11:07 am  (#16) 
Offline
GimpChat Member
User avatar

Joined: Oct 19, 2010
Posts: 376
Location: North Central Ohio, USA
Rod wrote:
Oh and btw wacmaster = Rod ;)
*notes alias* :hehe
What version of Windows were you trying to compile for?

I'm feeling a bit masochistic, so I will see how it goes through Camelbox.

One thing I have noticed is that it seems like most of these packages for adding languages come with Gtk, which is a good thing - as long as you don't end up with multiple copies/different versions which would bump the confusion up a notch. Camelbox can install it with Perl, PyGtk can with Python. You really have to pay attention to the installers and any directions, since some installers don't check for existing software very well. I noticed the same thing with various games for Windows. Some come with their own bundles of DirectX and try to install without checking to see what was there.

_________________
Life Truth: #12
My cat is a worst typist than I am.


Top
 Post subject: Re: Getting Perl to work in Gimp
PostPosted: Tue Jan 11, 2011 6:25 pm  (#17) 
Offline
GimpChat Member
User avatar

Joined: Oct 19, 2010
Posts: 376
Location: North Central Ohio, USA
Rod,
I was reading over your posts in the thread "Hey RobA", specifically this post
Rod wrote:
Oh you know what i am going to try the path to the pkg-config.exe and see what happens. =)
PKG_CONFIG - C:\msys\1.0\mingw\bin\pkg-config.exe

Is that the compiler directive for the config script or did you set an environment variable? It looked a little odd; I think I'm at the same point you were then with getting the gegl config not locating the babl library installation.

Appreciate any feedback. :tyspin

_________________
Life Truth: #12
My cat is a worst typist than I am.


Top
 Post subject: Re: Getting Perl to work in Gimp
PostPosted: Wed Jan 12, 2011 5:44 am  (#18) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
That's an environment variable Bob. =)
Which is what worked because i was trying to open the pkgconfig folder and not the exe file in the bin folder.

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: Getting Perl to work in Gimp
PostPosted: Wed Jan 12, 2011 5:51 am  (#19) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
Also try setting these environment variables too
BABL_LIB = your path
GEGL_LIB = your path

The config script looks for those variables, along with others.
If you get it compiled id be appreciative of a copy...lol =)

Good luck Bob!

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: Getting Perl to work in Gimp
PostPosted: Wed Jan 12, 2011 8:09 am  (#20) 
Offline
GimpChat Member
User avatar

Joined: Oct 19, 2010
Posts: 376
Location: North Central Ohio, USA
Thanks, Rod.

We'll see how things go. One thing about doing this on a virtual machine on a single-core host is that it's slow enough I can start a process than go outside and clear snow, then come in for a break and check the output. Rinse and repeat as necessary. :hehe

Thinking out loud: I wonder if one of the reasons we are having troubles in general with this process is because we are trying to do this from within Windows. How would it go if the build environment was set up in Linux and cross-compiled for Windows. On one forum I read speculation that this was the method used to produce many of the Windows versions of Linux software. I should already have most of what I need as far a Gimp, and included libraries, seeing that I successfully compiled 2.6.11 in Linux. Hmm. I may need some Windows-specific libraries. Let me keep trying to compile in Windows and see how it goes, but this may be an alternative.

_________________
Life Truth: #12
My cat is a worst typist than I am.


Top
Post new topic Reply to topic  [ 58 posts ]  Go to page 1, 2, 3  Next

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Attachment(s) Paintbrush doesnt work and none of the solutions on the internet work

13

No new posts Attachment(s) Plugins don't work

2

No new posts Attachment(s) HELP! I Cant get Spiderpaint to work

5

No new posts Scripts that don't work properly

5

No new posts CAN NOT GET GMIC TO SHOW OR WORK

2



* Login  



Powered by phpBB3 © phpBB Group