Perl

(dh-make-perl at garage.maemo.org)
(Undo revision 46000 by 114.79.28.10 (Talk) vandalism/spam)
 
(4 intermediate revisions not shown)
Line 1: Line 1:
-
'''The Perl environment on the Maemo Platform'''
+
Because Maemo is based on Debian, and because perl is such a big part of the debian OS, Maemo contains a full-blown Perl platform. This page aims to document and describe this environment so developers can take advantage of it when programming on the Maemo platform.
-
Because Maemo is based on debian, and because perl is such a big part of the debian OS, Maemo contains a full-blown Perl platform. This page aims to document and describe this environment so developers can take advantage of it when programming on the Maemo platform.
+
== Fremantle ==
 +
The current version of perl shipped with the [[Nokia N900|N900]] is 5.8.3.
-
'''Fremantle'''
+
One caveat of perl development on the N900 is that there is a fuller Perl distribution in the SDK than on the device. This means not just that there are fewer modules on the device, it means that rather fundamental Perl modules are missing form the normal Debian version of Perl on the device. This is done to save space; the device itself is embedded linux, the root files system is rather small, i.e. 228 MB.
-
The current version of perl shipped with the N900 is 5.8.3.
+
You will find it difficult to build Perl modules on the device if you do not add the necessary Perl tools, namely <code>perl</code> and <code>perl-modules</code>. Without these key tools, many of the modules used to build Perl modules won't exist on the device and you won't be able to add software written in Perl. Here is an example of what is shipped with both the SDK and device environments;
-
 
-
One caveat of perl development on the [[N900]] is that there is a fuller perl distribution in the SDK than on the device. This means not just that there are fewer modules on the device, it means that rather fundamental perl modules are missing form the normal debian version of perl on the device. This is done to save space; the device itself is embedded linux, the root files system is rather small, i.e. 228 Megs.
 
-
 
-
You will find it difficult to build perl modules on the device if you do not add the necessary perl tools, namely perl and perl-modules. Without these key tools, many of the modules used to build perl modules won't exist on the device and you won't be able to add software written in perl. Here is an example of what is shipped with both the SDK and device environments;
 
-
 
-
{| class="wikitable"
 
-
|  | '''In the SDK'''
 
-
| style="background:LightBlue" | '''On device'''
 
-
|}
 
{| class="wikitable"
{| class="wikitable"
-
| | liblocale-gettext-perl  ''1.01-17osso2''<BR>  
+
|+ Installed Perl packages
-
libtimedate-perl  ''1.1600-4osso''<BR>
+
|-
-
perl ''5.8.3-3osso10''<BR>
+
! In the SDK !! On device
-
perl-base ''5.8.3-3osso10''<BR>
+
|-
-
perl-modules ''5.8.3-3osso10''<BR>
+
| liblocale-gettext-perl  ''1.01-17osso2''<br/>  
-
| style="background:LightBlue" | liblocale-gettext-perl  ''1.01-17osso2''<BR>  
+
libtimedate-perl  ''1.1600-4osso''<br/>
 +
perl ''5.8.3-3osso10''<br/>
 +
perl-base ''5.8.3-3osso10''<br/>
 +
perl-modules ''5.8.3-3osso10''<br/>
 +
| liblocale-gettext-perl  ''1.01-17osso2''<br/>  
perl-base ''5.8.3-3osso10''
perl-base ''5.8.3-3osso10''
|}
|}
Line 32: Line 28:
  deb http://repository.maemo.org fremantle/tools free non-free
  deb http://repository.maemo.org fremantle/tools free non-free
 +
If you wish to add Perl modules what I recommend is to bring in the necessary tools, namely the <code>perl</code> package and the <code>perl-modules</code> package. You can do that by adding the repositories that supply modules to the SDK. Of course you can build Perl yourself, but it is already built for the device's architecture and it is in a known good state, so it is much easier to just take the already built Perl binaries for the N900. (There are later versions of Perl built and packaged for the device, I'll eventually provide links to those, until then, you'll have to rely on Google.)
-
 
+
Once you have added the SDK repositories to your <code>/etc/apt/sources.list</code>, simply run:
-
If you wish to add perl modules what I recommend is to bring in the necessary tools, namely the perl package and the perl-modules package. You can do that by adding the repositories that supply modules to the SDK. Of course you can build perl yourself, but it is already built for the device's architecture and it is in a known good state, so it is much easier to just take the already built perl binaries for the N900. (There are later versions of perl built and packaged for the device, I'll eventually provide links to those, until then, you'll have to rely on google.)
+
apt-get update
-
 
+
apt-get install perl perl-modules
-
Once you have added the SDK repositories to your /etc/apt/sources.list, simply run apt-get update and apt-get install perl perl-modules.
+
Now you should be ready to start bringing other modules in.
Now you should be ready to start bringing other modules in.
Line 43: Line 39:
I have packaged one module so far, I hope to bring in many more perl modules. If you package something for the device, why not contribute your module to the maemo repos and/or ask me to pull it into the [http://gitorious.org/maemo-perl-packages/maemo-perl-packages/trees/master gitorious repo that] I have set up?
I have packaged one module so far, I hope to bring in many more perl modules. If you package something for the device, why not contribute your module to the maemo repos and/or ask me to pull it into the [http://gitorious.org/maemo-perl-packages/maemo-perl-packages/trees/master gitorious repo that] I have set up?
-
 
-
[[Category:Software]]
 
=== dh-make-perl at garage.maemo.org ===
=== dh-make-perl at garage.maemo.org ===
-
Just ported dh-make-perl for Maemo fremantle. The packages ported are available at [http://dh-make-perl.garage.maemo.org]. It includes among
+
Just ported <code>dh-make-perl</code> for Maemo fremantle. The packages ported are available at [http://dh-make-perl.garage.maemo.org]. It includes among
Some notes for people who want to port perl modules for ARM. I found out that I had to change the following (change your proxy settings as appropiate):
Some notes for people who want to port perl modules for ARM. I found out that I had to change the following (change your proxy settings as appropiate):
-
# Environment vars
+
<source lang="bash">
-
SBOX_REDIRECT_IGNORE=/usr/bin/perl
+
# Environment vars
-
export  SBOX_REDIRECT_IGNORE
+
SBOX_REDIRECT_IGNORE=/usr/bin/perl
-
unset PERL5LIB
+
export  SBOX_REDIRECT_IGNORE
-
export PATH=/usr/bin/dh7:/usr/bin:$PATH
+
unset PERL5LIB
-
export DISPLAY=:2
+
export PATH=/usr/bin/dh7:/usr/bin:$PATH
-
export http_proxy=http://172.16.0.1:3128
+
export DISPLAY=:2
-
export https_proxy=http://172.16.0.1:3128
+
export http_proxy=http://172.16.0.1:3128
-
export ftp_proxy=http://172.16.0.1:3128
+
export https_proxy=http://172.16.0.1:3128
-
export GIT_SSL_NO_VERIFY=1
+
export ftp_proxy=http://172.16.0.1:3128
-
echo "127.0.0.1 localhost" > /etc/hosts
+
export GIT_SSL_NO_VERIFY=1
 +
echo "127.0.0.1 localhost" > /etc/hosts
 +
</source>
-
Nasty script to substitute /usr/bin/man which breaks dh_installdocs
+
Nasty script to substitute <code>/usr/bin/man</code> which breaks <code>dh_installdocs</code>
-
#!/bin/bash
+
<source lang="bash">
-
n=$#
+
#!/bin/bash
 +
n=$#
 +
echo "$# $1 $2 $n"
 +
while [ $n -ne 1 ]; do
  echo "$# $1 $2 $n"
  echo "$# $1 $2 $n"
-
while [ $n -ne 1 ]; do
 
-
  echo "$# $1 $2 $n"
 
-
  p=$1
 
-
  shift
 
-
  n=$#
 
-
done
 
  p=$1
  p=$1
-
  echo $p
+
  shift
-
/usr/lib/man-db/manconv -f UTF-8:ISO-8859-1 -t UTF-8//IGNORE  $p
+
n=$#
 +
done
 +
p=$1
 +
echo $p
 +
/usr/lib/man-db/manconv -f UTF-8:ISO-8859-1 -t UTF-8//IGNORE  $p
 +
</source>
 +
Some packages ported include ssleay and some others which are needed prerequisites for <code>dh-make-perl</code>.
-
Some packages ported include ssleay and some others which are needed prerrequisites for dh-make-perl.
+
[[Category:Software]]
 +
[[Category:Development]]

Latest revision as of 06:28, 15 December 2011

Because Maemo is based on Debian, and because perl is such a big part of the debian OS, Maemo contains a full-blown Perl platform. This page aims to document and describe this environment so developers can take advantage of it when programming on the Maemo platform.

[edit] Fremantle

The current version of perl shipped with the N900 is 5.8.3.

One caveat of perl development on the N900 is that there is a fuller Perl distribution in the SDK than on the device. This means not just that there are fewer modules on the device, it means that rather fundamental Perl modules are missing form the normal Debian version of Perl on the device. This is done to save space; the device itself is embedded linux, the root files system is rather small, i.e. 228 MB.

You will find it difficult to build Perl modules on the device if you do not add the necessary Perl tools, namely perl and perl-modules. Without these key tools, many of the modules used to build Perl modules won't exist on the device and you won't be able to add software written in Perl. Here is an example of what is shipped with both the SDK and device environments;

Installed Perl packages
In the SDK On device
liblocale-gettext-perl 1.01-17osso2

libtimedate-perl 1.1600-4osso
perl 5.8.3-3osso10
perl-base 5.8.3-3osso10
perl-modules 5.8.3-3osso10

liblocale-gettext-perl 1.01-17osso2

perl-base 5.8.3-3osso10

The SDK repositories are here:

deb http://repository.maemo.org fremantle/sdk free non-free
deb http://repository.maemo.org fremantle/tools free non-free

If you wish to add Perl modules what I recommend is to bring in the necessary tools, namely the perl package and the perl-modules package. You can do that by adding the repositories that supply modules to the SDK. Of course you can build Perl yourself, but it is already built for the device's architecture and it is in a known good state, so it is much easier to just take the already built Perl binaries for the N900. (There are later versions of Perl built and packaged for the device, I'll eventually provide links to those, until then, you'll have to rely on Google.)

Once you have added the SDK repositories to your /etc/apt/sources.list, simply run:

apt-get update
apt-get install perl perl-modules

Now you should be ready to start bringing other modules in.

[edit] Git repo at Gitorious

I have packaged one module so far, I hope to bring in many more perl modules. If you package something for the device, why not contribute your module to the maemo repos and/or ask me to pull it into the gitorious repo that I have set up?

[edit] dh-make-perl at garage.maemo.org

Just ported dh-make-perl for Maemo fremantle. The packages ported are available at [1]. It includes among

Some notes for people who want to port perl modules for ARM. I found out that I had to change the following (change your proxy settings as appropiate):

# Environment vars
SBOX_REDIRECT_IGNORE=/usr/bin/perl
export  SBOX_REDIRECT_IGNORE
unset PERL5LIB
export PATH=/usr/bin/dh7:/usr/bin:$PATH
export DISPLAY=:2
export http_proxy=http://172.16.0.1:3128
export https_proxy=http://172.16.0.1:3128
export ftp_proxy=http://172.16.0.1:3128
export GIT_SSL_NO_VERIFY=1
echo "127.0.0.1 localhost" > /etc/hosts

Nasty script to substitute /usr/bin/man which breaks dh_installdocs

#!/bin/bash
n=$#
echo "$# $1 $2 $n"
while [ $n -ne 1 ]; do
 echo "$# $1 $2 $n"
 p=$1
 shift
 n=$#
done
p=$1
echo $p
/usr/lib/man-db/manconv -f UTF-8:ISO-8859-1 -t UTF-8//IGNORE  $p

Some packages ported include ssleay and some others which are needed prerequisites for dh-make-perl.

Retrieved from "http://wiki.maemo.org/Perl"