Ubuntu 8.04 Hardy

versión corta:

Para instalar Perl 6 sobre Ubuntu Hardy hace falta actualizar el subversion. Para resolver las dependencias automaticamente se adiciona el repositorio de backports y se instala el subversion desde ahi.

You should be able to use any of the listed mirrors by adding a line to your /etc/apt/sources.list like this:
deb http://cz.archive.ubuntu.com/ubuntu hardy-backports main 

Luego se descarga el rakudo, el rakudo descarga el parrot como parte de su proceso de instalación.

cd /opt/src
git clone http://github.com/rakudo/rakudo.git
cd rakudo
perl Configure.pl --gen-parrot
make


probamos ..:

./perl6 -e 'say "hello world \n"'

et voila!


versión larga:

Probamos a ver si en los repositorios hay algo ...

osvaldo@vostro:~$ apt-cache show parrot
Package: parrot
Priority: optional
Section: universe/interpreters
Installed-Size: 2296
Maintainer: Ubuntu MOTU Developers <ubuntu-motu@lists.ubuntu.com>
Original-Maintainer: Florian Ragwitz <rafl@debian.org>
Architecture: amd64
Version: 0.4.13-1ubuntu3
Depends: libc6 (>= 2.7-1), libgdbm3, libgmp3c2, libicu38 (>= 3.8-5), libncurses5 (>= 5.6+20071006-3), libparrot0.4.13, libreadline5 (>= 5.2)
Recommends: perl
Suggests: parrot-doc
Filename: pool/universe/p/parrot/parrot_0.4.13-1ubuntu3_amd64.deb
Size: 436168
MD5sum: 8909382489823bf7d7f8c2d7d4489d94
SHA1: 6c78fabb0df076004c558f0a44ce3d6c987eb224
SHA256: a4a24d87140b7963c422f440a186b11b79e33ea05c94765ad1810dad009ceeee
Description: virtual machine to execute bytecode for interpreted languages
Parrot is a virtual machine designed to execute bytecode for interpreted
languages efficiently. Parrot will be the target for the Perl 6 compiler.
There is already a partial Perl 6 compiler as well as compilers in various
stages of completion for a wide range of other languages.
Bugs: mailto:ubuntu-users@lists.ubuntu.com
Origin: Ubuntu

bien, hay un parrot. Lo instalamos ...

osvaldo@vostro:~$ sudo apt-get install parrot
Reading package lists... Done
Building dependency tree      
Reading state information... Done
The following extra packages will be installed:
 libparrot0.4.13
Suggested packages:
 parrot-doc
The following NEW packages will be installed:
 libparrot0.4.13 parrot
0 upgraded, 2 newly installed, 0 to remove and 2 not upgraded.
Need to get 1505kB of archives.
After this operation, 6775kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://ec.archive.ubuntu.com hardy/universe libparrot0.4.13 0.4.13-1ubuntu3 [1069kB]
Get:2 http://ec.archive.ubuntu.com hardy/universe parrot 0.4.13-1ubuntu3 [436kB]                                                                        
Fetched 1505kB in 56s (26.8kB/s)                                                                                                                        
Selecting previously deselected package libparrot0.4.13.
(Reading database ... 261466 files and directories currently installed.)
Unpacking libparrot0.4.13 (from .../libparrot0.4.13_0.4.13-1ubuntu3_amd64.deb) ...
Selecting previously deselected package parrot.
Unpacking parrot (from .../parrot_0.4.13-1ubuntu3_amd64.deb) ...
Setting up libparrot0.4.13 (0.4.13-1ubuntu3) ...
Setting up parrot (0.4.13-1ubuntu3) ...


No tengo un perl 6 en los repositorios de ubuntu....

Lo bajamos entonces de su sitio oficial http://www.rakudo.org/how-to-get-rakudo


sudo mkdir /opt/src
sudo chown osvaldo.osvaldo /opt/src
cd /opt/src
git clone git://github.com/rakudo/rakudo.git


osvaldo@vostro:/opt/src$ git clone git://github.com/rakudo/rakudo.git
github.com[0: 65.74.177.129]: errno=Connection timed out/
fatal: unable to connect a socket (Connection timed out)
fetch-pack from 'git://github.com/rakudo/rakudo.git' failed.

hum... estaba cerrado el puerto para utilizar git directamente.

Lo copiamos de un pendrive.


perl Configure.pl --gen-parrot
....
Finished install_dev_files.pl

Reading configuration information from parrot_install/bin/parrot_config ...
Parrot revision r40521 required (currently r0)

To automatically checkout (svn) and build a copy of parrot r40521,
try re-running Configure.pl with the '--gen-parrot' option.
Or, use the '--parrot-config' option to explicitly specify
the location of parrot_config to be used to build Rakudo Perl.
osvaldo@vostro:/opt/src/rakudo$

No me sirve la version de parrot que tiene el repositorio de ubuntu...
desinstalo el paquete ...

sudo apt-get remove parrot

Al invocar el Configure.pl con la opción --gen-parrot le estamos diciendo al rakudo que descargue directamente el parrot. La versión que tenia el repositorio de Ubuntu Hardy era la 0.4 y la estable en el sitio de parrot.org era la 1.4.

Trato de instalar rakudo de nuevo ...


perl Configure.pl --gen-parrot


Checking out Parrot r40521 via svn...
svn: This client is too old to work with working copy 'parrot'; please get a newer Subversion client

tengo una version muy vieja del subversion....

Esta vez me doy cuenta de ese error que sale el inicio.

Trato de instalar parrot de fuentes e independiente del rakudo.

Parrot

http://docs.parrot.org/parrot/latest/html/docs/intro.pod.html

svn co https://svn.parrot.org/parrot/trunk parrot
perl Configure.pl


make
make test

Create a file called hello.pir that contains the following code.

 .sub main
     print "Hello world!\n"
 .end

Then run it by typing:

parrot hello.pir


funciono!

Ahora instalo descargo el rakudo pero utilizando el protocolo http en vez del git (el proxy solo permitia salida al puerto 80) ...


osvaldo@vostro:/opt/src$ git clone http://github.com/rakudo/rakudo.git
Initialized empty Git repository in /opt/src/rakudo/.git/
Getting alternates list for http://github.com/rakudo/rakudo.git
Getting pack list for http://github.com/rakudo/rakudo.git
Getting index for pack 116dfc3e3630470b33ba3151b47fa441cfd25191

...
cd rakudo

osvaldo@vostro:/opt/src/rakudo$ perl Configure.pl


Reading configuration information from parrot_config ...

Creating Makefile ...
Cleaning up ...

You can now use 'make' to build Rakudo Perl.
After that, you can use 'make test' to run some local tests,
or 'make spectest' to check out (via svn) a copy of the Perl 6
official test suite and run its tests.



osvaldo@vostro:/opt/src/rakudo$ make
/usr/local/bin/parrot  /usr/local/lib/parrot/1.4.0-devel/library/PGE/Perl6Grammar.pbc \
   --output=src/gen_grammar.pir --encoding=utf8 \
   src/parser/grammar.pg src/parser/grammar-oper.pg
"load_bytecode" couldn't find file 'PCT/HLLCompiler.pbc'
current instr.: 'parrot;PGE;Perl6Grammar;Compiler;__onload' pc 30 (runtime/parrot/library/PGE/Perl6Grammar.pir:78)
called from Sub 'parrot;PGE;Perl6Grammar;Compiler;main' pc -1 ((unknown file):-1)
make: *** [src/gen_grammar.pir] Error 1
osvaldo@vostro:/opt/src/rakudo$


Me tira ese error....

leyendo el readme de rakudo:

perldoc README
You can use "--parrot-config=/path/to/parrot_config" instead of "--gen-parrot" to point to an already installed Parrot that must include its
development environment. You can build such a Parrot from source using Parrot’s "make install-dev" target, or install prebuilt "parrot-devel"
and/or "libparrot-dev" packages.  The version of this already installed Parrot must satisfy a minimum specified by the Rakudo being built. The latest version of Rakudo (called HEAD on github) often requires one newer than the preceding monthly Parrot release.

Aprovecho que tenia ya el parrot y le compilo la opción el ambiente de desarrollo.

osvaldo@vostro:/opt/src/parrot$ sudo make install-dev

Detalle a tener en cuenta, parrot_config es un ejecutable no un path.

osvaldo@vostro:/opt/src/parrot$ whereis parrot_config
parrot_config: /usr/local/bin/parrot_config

Intentamos compilar el rakudo con el parrot_config de nuestro parrot instalado aparte.

perl Configure.pl --parrot-config=/usr/local/bin/parrot_config
...
/usr/bin/perl build/gen_setting_pm.pl src/setting/traits.pm src/setting/Any-list.pm src/setting/Any-num.pm src/setting/Any-str.pm src/setting/Array.pm src/setting/Attribute.pm src/setting/Bool.pm src/setting/Buf.pm src/setting/Code.pm src/setting/Hash.pm src/setting/Int.pm src/setting/IO.pm src/setting/IO/Socket.pm src/setting/IO/Socket/INET.pm src/setting/Junction.pm src/setting/List.pm src/setting/Match.pm src/setting/Num.pm src/setting/NYI.pm src/setting/Object.pm src/setting/Operators.pm src/setting/Pair.pm src/setting/Range.pm src/setting/Str.pm src/setting/Temporal.pm src/setting/Whatever.pm  > src/gen_setting.pm
/usr/local/bin/parrot  perl6_s1.pbc --target=pir src/gen_setting.pm > src/gen_setting.pir
Class '[ 'parrot' ; 'Random' ]' not found
current instr.: 'onload' pc 14441 (src/builtins/any-num.pir:27)
called from Sub 'perl6;Perl6;Compiler;main' pc -1 ((unknown file):-1)
make: *** [perl6.pbc] Error 1
osvaldo@vostro:/opt/src/rakudo$ 

Más errores ...

Voy a probar instalando una version mas moderna del subversion para poder compilar el rakudo como recomienda el tutorial de Victor (donde el proceso de instalación de rakudo descarga el parrot).

La última versión de subversion es la 1.6.3

La que tengo instalada es ...

osvaldo@vostro:/opt/src/rakudo$ svn --version
svn, version 1.4.6 (r28521)
  compiled Aug  7 2009, 01:03:22

No en balde tira errores ;)

Para evitar estar instalando el subversion de fuentes (standalone) buscamos en los backports de Ubuntu.

https://help.ubuntu.com/community/UbuntuBackports

De ahi bajamos el paquete desde la url seleccionando la arquitectura que nos toca...
http://packages.ubuntu.com/hardy-backports/devel/subversion



osvaldo@vostro:~/Desktop$ ls -lh *deb
-rw------- 1 osvaldo osvaldo 1.2M 2009-08-15 15:59 subversion_1.5.1dfsg1-1ubuntu2~hardy2_amd64.deb


osvaldo@vostro:~/Desktop$ sudo dpkg -i subversion_1.5.1dfsg1-1ubuntu2~hardy2_amd64.deb
(Reading database ... 261471 files and directories currently installed.)
Preparing to replace subversion 1.4.6dfsg1-2ubuntu1.1 (using subversion_1.5.1dfsg1-1ubuntu2~hardy2_amd64.deb) ...
Unpacking replacement subversion ...
dpkg: dependency problems prevent configuration of subversion:
subversion depends on libsvn1 (= 1.5.1dfsg1-1ubuntu2~hardy2); however:
 Version of libsvn1 on system is 1.4.6dfsg1-2ubuntu1.1.
dpkg: error processing subversion (--install):
dependency problems - leaving unconfigured
Errors were encountered while processing:
subversion
osvaldo@vostro:~/Desktop$

Falta  una dependencia...

le adiciono el repositorio al sources.list

You should be able to use any of the listed mirrors by adding a line to your /etc/apt/sources.list like this:
deb http://cz.archive.ubuntu.com/ubuntu hardy-backports main

apt-get update

osvaldo@vostro:~/Desktop$ sudo apt-get install subversion
Reading package lists... Done
Building dependency tree      
Reading state information... Done
subversion is already the newest version.
You might want to run `apt-get -f install' to correct these:
The following packages have unmet dependencies:
 subversion: Depends: libsvn1 (= 1.5.1dfsg1-1ubuntu2~hardy2) but 1.4.6dfsg1-2ubuntu1.1 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
osvaldo@vostro:~/Desktop$ apt-get -f install
E: Could not open lock file /var/lib/dpkg/lock - open (13 Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
osvaldo@vostro:~/Desktop$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree      
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
 libparrot0.4.13
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
 libsvn1
The following packages will be upgraded:
 libsvn1
1 upgraded, 0 newly installed, 0 to remove and 21 not upgraded.
1 not fully installed or removed.
Need to get 785kB of archives.
After this operation, 307kB of additional disk space will be used.
Do you want to continue [Y/n]? y

En los backports estaba la versión 1.5.1 no la 1.6, pero habiamos encontrado esto:

http://stackoverflow.com/questions/831723/where-to-find-prebuilt-binaries-for-subversion-1-6-for-ubuntu-or-debian
You don't need the 1.6 version to work with your Windows working copies. SVN is clever enough to recognise the features provided by clients, and only allow those features through - so your 1.5.4 client can connect to your 1.6 server without any problem; as can your Windows 1.6 client.

ahora voy a instalar ...

osvaldo@vostro:/opt/src/rakudo$ perl Configure.pl --gen-parrot

me hace ok el svn del parrot y sigue ...
....
./parrot -o runtime/parrot/library/libpcre.pbc runtime/parrot/library/libpcre.pir
./parrot -o runtime/parrot/library/postgres.pbc runtime/parrot/library/postgres.pir
make -C src/dynpmc
make[1]: Entering directory `/opt/src/rakudo/parrot/src/dynpmc'
/usr/bin/perl /opt/src/rakudo/tools/build/pmc2c.pl --dump dynlexpad.pmc
Can't open perl script "/opt/src/rakudo/tools/build/pmc2c.pl": No such file or directory
make[1]: *** [dynlexpad.dump] Error 2
make[1]: Leaving directory `/opt/src/rakudo/parrot/src/dynpmc'
make: *** [dynpmc.dummy] Error 2

Un error de path, el directorio tools/build no estaba en /opt/src/rakudo/tools/build sino en /opt/src/rakudo/parrot/tools/build.

Volvi de vuelta y empece de cero

rm -fr /opt/src/rakudo
cd /opt/src
git clone http://github.com/rakudo/rakudo.git
cd rakudo
perl Configure.pl --gen-parrot
make
...
...
/opt/src/rakudo/parrot_install/bin/parrot perl6_s1.pbc --target=pir src/gen_setting.pm > src/gen_setting.pir
/opt/src/rakudo/parrot_install/bin/parrot -o perl6.pbc perl6.pir
/opt/src/rakudo/parrot_install/bin/pbc_to_exe perl6.pbc
cc -o perl6.o -I/opt/src/rakudo/parrot_install/include/1.4.0-devel -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBIAN -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHASATTRIBUTE_CONST -DHASATTRIBUTE_DEPRECATED -DHASATTRIBUTE_MALLOC -DHASATTRIBUTE_NONNULL -DHASATTRIBUTE_NORETURN -DHASATTRIBUTE_PURE -DHASATTRIBUTE_UNUSED -DHASATTRIBUTE_WARN_UNUSED_RESULT -falign-functions=16 -fvisibility=hidden -funit-at-a-time -maccumulate-outgoing-args -W -Wall -Waggregate-return -Wcast-align -Wcast-qual -Wchar-subscripts -Wcomment -Wdisabled-optimization -Wendif-labels -Wextra -Wformat -Wformat-extra-args -Wformat-nonliteral -Wformat-security -Wformat-y2k -Wimplicit -Wimport -Winit-self -Winline -Winvalid-pch -Wmissing-braces -Wmissing-field-initializers -Wno-missing-format-attribute -Wmissing-include-dirs -Wpacked -Wparentheses -Wpointer-arith -Wreturn-type -Wsequence-point -Wno-shadow -Wsign-compare -Wstrict-aliasing -Wstrict-aliasing=2 -Wswitch -Wswitch-default -Wtrigraphs -Wundef -Wunknown-pragmas -Wno-unused -Wvariadic-macros -Wwrite-strings -Wbad-function-cast -Wc++-compat -Wdeclaration-after-statement -Werror=declaration-after-statement -Wimplicit-function-declaration -Wimplicit-int -Wmain -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wnonnull -DHAS_GETTEXT -c perl6.c
Compiled: perl6.o
cc -o perl6 perl6.o /opt/src/rakudo/parrot_install/lib/1.4.0-devel/parrot_config.o -Wl,-rpath=/opt/src/rakudo/parrot_install/lib -L/opt/src/rakudo/parrot_install/lib -lparrot -Wl,-E -L/usr/local/lib -Wl,-E -ldl -lm -lpthread -lcrypt  
Linked: perl6.manifest


et voila!
pruebo que haya quedado bien instalado...

osvaldo@vostro:/opt/src/rakudo$ make test
/usr/bin/perl t/harness t/00-parrot t/01-sanity
t/00-parrot/01-literals.t .......... ok     
t/00-parrot/02-op-math.t ........... ok     
t/00-parrot/03-op-logic.t .......... ok     
t/00-parrot/04-op-cmp.t ............ ok     
t/00-parrot/05-var-array.t ......... ok     
t/00-parrot/05-var.t ............... ok     
t/00-parrot/06-op-inplace.t ........ ok     
t/00-parrot/07-op-string.t ......... ok     
t/00-parrot/08-regex.t ............. ok     
t/00-parrot/09-pir.t ............... ok   
t/01-sanity/01-tap.t ............... ok     
t/01-sanity/02-counter.t ........... ok   
t/01-sanity/03-equal.t ............. ok   
t/01-sanity/04-if.t ................ ok   
t/01-sanity/05-sub.t ............... ok   
t/01-sanity/06-use.t ............... ok   
t/01-sanity/07-binding.t ........... ok   
t/01-sanity/07-defined.t ........... ok   
t/01-sanity/07-end-blocks.t ........ ok   
t/01-sanity/07-for.t ............... ok   
t/01-sanity/07-isa.t ............... ok   
t/01-sanity/07-range.t ............. ok   
t/01-sanity/07-ref.t ............... ok   
t/01-sanity/07-simple-multisubs.t .. ok   
t/01-sanity/07-split.t ............. ok   
t/01-sanity/07-substr.t ............ ok   
t/01-sanity/07-try.t ............... ok   
t/01-sanity/08-say.t ............... ok     
t/01-sanity/09-types.t ............. ok   
All tests successful.
Files=29, Tests=236, 61 wallclock secs ( 0.20 usr 0.04 sys + 54.88 cusr 3.05 csys = 58.17 CPU)
Result: PASS
osvaldo@vostro:/opt/src/rakudo$ 


probamos ..:

./perl6 -e 'say "hello world \n"'

Comments