#1 2010-09-16 05:19:21

unclepetros
Member
Registered: 2010-04-11
Posts: 88

[HowTo] Develop and Debug GCStar project

Hi,
here are some informations on how to configure your system in order to develop and debug the GCStar project.

For Ubuntu

1. Install Eclipse IDE with the following command:

Code:

sudo apt-get install eclipse

2. Install EPIC plugin for eclipse by doing the following:
Open Eclipse, and go to Help->Install New Software... window;
insert this link in the 'Work with:' field: http://e-p-i-c.sf.net/updates/testing ;
select all EPIC components, click on Next, and then Finish.

3. Install PAD-Walker perl module with the following command:

Code:

sudo apt-get install libpadwalker-perl

4. Integrates GCStar project in Eclipse:
Open Eclipse, select File->New->Project...;
select Perl Project and click Next; set project name and click Finish.
Now right click on the project just created and select Import...;
Select import from Filesystem and click Next;
choose the local folder of the GCStar version you want to develop/debug on, check the folder and click Finish.
Now go to Project->Properties->Perl Include Path and add the path to the lib/gcstar/ or lib/  folder of the project (depends on GCStar version).
Now, GCStar project should compile without error, and run in debug mode like any other eclipse project.
Note: to run the project from eclipse it is needed to rename the gcstar file in the bin folder of the project, to gcstar.pl; after this it is possible to create a Run configuration for the project.

For Windows

1. Download and install ActiveState Perl 5.10 version (32-bit) from here: http://downloads.activestate.com/Active … 294165.msi

2. Go to Control Panel -> System -> Advanced System Settings -> Environment Variables:
verify all the following path exist in the PATH variable (if any is missed, insert it) :
- C:\Perl\bin
- C:\Perl\site\bin
- C:Perl\lib

3. Open command prompt and install trouchelle repository for perl modules with the following command:

Code:

ppm repo add http://trouchelle.com/ppm10/

4. Open Perl Package Manager (ppm) (through command prompt or start men¨) and install the following perl modules:
- Module-ScanDeps
- Getopt-ArgvFile
- GLib
- MP3-Info
- MP3-Tag
- CDDB-File
- DateTime-Format-StrpTime
- Ogg-Vorbis-Header-PurePerl
- Gtk2
- Gtk2-Ex-Entry-Pango
- Cairo
- Pango
- Libxml-Perl
- XML-XSLT
- XML-XSLT-Wrapper
- Padwalker

5. Download and install latest Gtk2-Runtime from here: http://sourceforge.net/userapps/mediawi … =Downloads

6. Go to Control Panel -> System -> Advanced System Settings -> Environment Variables:
in the PATH variable you should see "C:\Program Files (x86)\GTK2-Runtime\bin" among the others;
replace this string with the following:
- %ProgramFiles(x86)%\GTK2-Runtime\bin\;
and move it at the beginning.
Click OK, close all windows and restart system.

7. Download and install Eclipse from here: http://www.eclipse.org/downloads/packag … 60/heliosr

8. Install EPIC plugin for eclipse by doing the following:
Open Eclipse, and go to Help->Install New Software... window;
insert this link in the 'Work with:' field: http://e-p-i-c.sf.net/updates/testing ;
select all EPIC components, click on Next, and then Finish.

9. Integrates GCStar project in Eclipse:
Open Eclipse, select File->New->Project...;
select Perl Project and click Next; set project name and click Finish.
Now right click on the project just created and select Import...;
Select import from Filesystem and click Next;
choose the local folder of the GCStar version you want to develop/debug on, check the folder and click Finish.
Now go to Project->Properties->Perl Include Path and add the path to the lib/gcstar/ or lib/  folder of the project (depends on GCStar version);
add also the path to the root folder of the project.
An example of the two path could be:
- C:\users\myname\workspace\GCstar\lib\gcstar
- C:\users\myname\workspace\GCstar

Now, GCStar project should compile well and run in debug mode like any other eclipse project.

Important: There is a known bug related to debug. At the moment an error is returned if we try to debug.
A workaround for this is described at http://sourceforge.net/tracker/index.ph … id=545274;
It consists in modifying the file Cwd.pm in the Perl\lib folder:
modify the following

Code:

sub _win32_cwd {
if (eval 'defined &DynaLoader::boot_DynaLoader') {

with

Code:

sub _win32_cwd {
if (defined &DynaLoader::boot_DynaLoader) {

Note 1: there are some errors due to arabic and russian words and sentences in the code. THey are not critical.
Anyhow to fix most of them, go to Project->Properties->Resources; in the Text Encoding section choose Other and select "UTF-8" encoding.
Note 2: to run the project from eclipse it is needed to rename the gcstar file in the bin folder of the project, to gcstar.pl; after this it is possible to create a Run configuration for the project.
Note 3: after all may be some errors will remain (this is in my case); don't worry; as I've said they are not critical and the project run fine.

Good develop and debug!

UnclePetros

Last edited by unclepetros (2011-02-20 12:28:10)

Offline

 

#2 2010-09-16 05:26:26

unclepetros
Member
Registered: 2010-04-11
Posts: 88

Re: [HowTo] Develop and Debug GCStar project

I had posted this in the wrong section (Support);
so I've moved it here.

Let me know if you find this useful.

UnclePetros

Offline

 

#3 2010-11-10 20:54:04

Fringale
Member
Registered: 2010-05-24
Posts: 15

Re: [HowTo] Develop and Debug GCStar project

Please sticky this topic. These step-by-step instructions are well-detailed and easy to follow, and as far as I know they're the best way to get a full-featured developing environment for GCstar (tested and used on Ubuntu).

Thanks unclepetros. smile

Offline

 

#4 2010-11-13 09:16:12

Sim209
Member
Registered: 2010-05-26
Posts: 38

Re: [HowTo] Develop and Debug GCStar project

Hi unclepetros,

Nice job, but in which way this can be usefull for us?  (pratically)
Can we debug plugin thanks to that?
in this case, i will try to follow your HowTo

Thanks,

Offline

 

#5 2010-12-01 07:23:31

unclepetros
Member
Registered: 2010-04-11
Posts: 88

Re: [HowTo] Develop and Debug GCStar project

Fringale wrote:

Thanks unclepetros. smile

Thank you Fringale,
I'm happy to see this post is useful.

Simo209 wrote:

Nice job, but in which way this can be usefull for us?  (pratically)
Can we debug plugin thanks to that?

Yes, Eclipse is a development environment, so you can debug plugins, but you can also debug entire GCStar project, you can develop a new functionality or feature, you can fix bugs, and so on.
You can run GCStar inside Eclipse, so you can control its execution; you can use breakpoints to see when program use a specific function, and what happens;
and all the other common development activity.

In order to begin, I think is enough:

- a basic programming skill
- a basic knowledge of Perl

So, Enjoy! smile

Regards
UnclePetros

P.S.: I've also write a post on how to submit changes with patch files, here

Offline

 

#6 2011-01-08 21:24:19

bjo
New member
Registered: 2011-01-08
Posts: 2

Re: [HowTo] Develop and Debug GCStar project

Hi,

Thanks for this HowTo!

I have some troubles getting the dev environement fully working.

unclepetros wrote:

For Windows

1. Download and install ActiveState Perl from here: http://www.activestate.com/activeperl/downloads

Which version of perl should be used? As I understood the very old perl-gtk is not maintained for perl version more recent than 5.8, right ? But according to what follows you use 5.12 !?
So I tried this one but then ppm cannot find the packages of perl-gtk

I used (missing in your item 2 ?):

Code:

C:\Tools>ppm repo add http://www.lostmind.de/gtk2-perl/ppm/
C:\Tools>ppm install Gtk2
ppm install failed: Can't find any package that provides Gtk2

unclepetros wrote:

2. Open command prompt and install trouchelle repository for perl modules with the following command (change ppm12 according to the ActiveStatePerl version installed):

Code:

ppm repo add http://trouchelle.com/ppm12/

3. Open ppm (through command prompt or start men¨) and install the following perl modules:
- Module-ScanDeps
- Getopt-ArgvFile
- GLib
- MP3-Info
- MP3-Tag
- CDDB-File
- DateTime-Format-StrpTime
- Ogg-Vorbis-Header-PurePerl
- Gtk2
- Cairo
- Pango
- Padwalker

After using Active Perl 5.8, I could add the perl-gtk repository and install Gtk2 and all your recommended modules, after using:

Code:

ppm rep add trouchelle.com http://trouchelle.com/ppm/

So can you confirm additional information to your Guide would be:

- Use Perl 5.8.x
- Add perl-gtk repository
- change trouchelle repository to it's 5.8 location

After doing this I encounter an error in the log when using a GCfilms new item and trying to download:

Code:

Use of uninitialized value in subroutine entry at C:/Tools/Perl/site/lib/Gtk2/SimpleList.pm line 106.
*** unhandled exception in callback:
***   Can't locate object method "set_has_tooltip" via package "Gtk2::SimpleList" at C:\_dev\gcstar\lib\gcstar/GCPlugins.pm line 250.
***  ignoring at C:/_dev/gcstar/bin/gcstar line 328.

Any clue about this problem.

Thanks a lot.

Bj÷rn.

PS: I'm developing a GCfilms plugin to lookup icollectmedia.com by barcode or name.

Offline

 

#7 2011-01-09 12:53:09

unclepetros
Member
Registered: 2010-04-11
Posts: 88

Re: [HowTo] Develop and Debug GCStar project

Hi Bjo,

bjo wrote:

Which version of perl should be used? As I understood the very old perl-gtk is not maintained for perl version more recent than 5.8, right ? But according to what follows you use 5.12 !?
So I tried this one but then ppm cannot find the packages of perl-gtk

You can install any version you like; the latest version would be the best.
But, obviously, it is more simple to find precompiled binaries for the old versions than the new ones.
I've installed, under Windows7, ActivePerl 5.10.1 Build 1007 package.
You don't need to add repo from www.lostmind.de for gtk2.
It is enough to add trouchelle repository for your own version; in my case it is ppm10, so, if I remeber well:

Code:

ppm repo add http://trouchelle.com/ppm10/

After this, open ppm GUI, and look for Gtk2 package; you should see it; right-click and install.

bjo wrote:

So can you confirm additional information to your Guide would be:

- Use Perl 5.8.x
- Add perl-gtk repository
- change trouchelle repository to it's 5.8 location

No, I recommend to use 5.10 or 5.12.
I haven't tested well 5.12 perl version, but I use perl 5.10.1 almost daily, and it works fine!
I've spent much time to look for good repositories, and I've realized trouchelle repo are the most updated ones.
May be sometimes a module has to be compiled manually, but if so, you can do it sistematically with standard commands:

Code:

perl Makefile.PL
dmake
dmake test
dmake install

You could need also the dmake command. It's available in trouchelle repository.

Try to configure again your environment, and let me know if you have problems.

Regards
UnclePetros

Last edited by unclepetros (2011-01-09 12:55:21)

Offline

 

#8 2011-02-13 17:19:10

unclepetros
Member
Registered: 2010-04-11
Posts: 88

Re: [HowTo] Develop and Debug GCStar project

Hi bjo,
I've done some tests on my notebook.
I've first tried to prepare a fully working environment with 5.12 perl version and trouchelle repository ppm12 .
Unfortunately I've figure out it is not possible; trouchelle repository for perl version 5.12 (pmm) has no precompiled binaries for Gtk2 libs (Gtk2, Glib, Cairo, Pango).
So at now, without a precompiled Gtk2 package is not possible to use 5.12 perl version.

So, after this, I've built a fully working environment with 5.10 perl version (5.10.1 build 1008) and trouchelle repository for 5.10 perl version.
I grant it works fine.

Anyhow, you are right, I forgot a few important steps in my instructions at the top of this topic;
more in detail, I forgot to mention Gtk2-runtime package installation!

Now I've updated them, with all the missing informations.

I hope now you will be able to debug successfully.

Please follow again instructions from the beginning and let me know.

Regards
UnclePetros

Last edited by unclepetros (2011-02-13 17:57:59)

Offline

 

#9 2011-02-17 22:51:51

pajdus
Member
Registered: 2007-03-08
Posts: 22

Re: [HowTo] Develop and Debug GCStar project

Hello,

I am a perl newbie and found a much helpful tool: perlcritic. It would save a lot of my time if I knew about it earlier.
On Debian based system you can install perlcritic with:

Code:

apt-get install libperl-critic-perl

Enable it in eclipse preferences (Perl EPIC / Perl::Critic) and  now you can run it from the Source menu.

Cheers,
Petr

Offline

 

#10 2011-02-20 12:18:24

unclepetros
Member
Registered: 2010-04-11
Posts: 88

Re: [HowTo] Develop and Debug GCStar project

Hi pajdus,
thank you for the info.

I'll try it in the next days.

I'll suggest to post this info as a new topic.
Here it is not so much visible.

UnclePetros

Offline

 

#11 2011-09-17 08:39:15

ubunoe
New member
Registered: 2010-12-18
Posts: 6

Re: [HowTo] Develop and Debug GCStar project

Hi !
On ubuntu 11.04 I had to install libxml-libxslt-perl package, declare gcstar/lib/gcstar and then project/clean to get rid of the errors except one :

Can't locate GCPlugins/GCcollection/GCcollectionCommon.pm in @INC (@INC contains: /home/.../EclipseWk/gcstar/lib/gcstar /etc/perl /usr/local/lib/perl/5.10.1 /usr/local/share/perl/5.10.1 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .)    GCSiteTemplate.pm    /gcstar/templates    line 36    Perl Problem

But I think that as GCSiteTemplate.pm is a template, this is not a problem. Am I right ?

Offline

 

#12 2011-10-26 17:34:58

unclepetros
Member
Registered: 2010-04-11
Posts: 88

Re: [HowTo] Develop and Debug GCStar project

Yes, you are right! smile

Sorry for the delay in the answer.

Bye
UnclePetros

Offline

 



Should you have a problem using GCstar, you can open a bug report or request some support on GCstar forums.