maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   [Announce] Free Pascal Compiler on extras-devel (https://talk.maemo.org/showthread.php?t=73701)

AapoRantalainen 2011-06-02 19:29

[Announce] Free Pascal Compiler on extras-devel
 
Free Pascal Compiler [1] version 2.4.4 [2] is now on extras-devel [3]. It contains packages:
Code:

fpc-2.4.4          - Free Pascal - SDK-2.4.4 metapackage
fp-compiler-2.4.4  - Free Pascal - Compiler
fp-units-rtl-2.4.4  - Free Pascal - Runtime Library
fp-units-2.4.4      - Free Pascal - base units
fp-utils-2.4.4      - Free Pascal - Utils

Compiler and units-rtl are needed for compiling. Units contains big set of units/packages [4] packed in one debian-package, you need it if you want do 'anything non-trivial'.

Packages are optified, if you are interested in to compile Pascal on N900-device. You need binutils installed, because it needs additionally 'as' and 'ld' [5].

--------
Usage: hello
#install (to scratchbox)
Code:

apt-get install fp-compiler-2.4.4
make file
Code:

program Hello;
  begin
  writeln ('Hello, world.')
end.

Compile it with
Code:

fpc hello.pas
(With sb2, use sb2 -e fpc hello.pas)

Copy to device and run, no additional dependencies on phone (I don't know why "rtl"="runtime library", because it is not needed on phone).

--------
Usage2: gles-2.0 test
#Install also units (~70M unpacked)
Code:

apt-get install fp-units-2.4.4
wget http://cc.oulu.fi/~rantalai/gles20demo.pp
fpc gles20demo.pp

--------
Some technical
All maemo specific is on own git [6].

As you might know the FPC compiler is written in Pascal, so getting it on Maemo repository [7] needed some tricks. There were several approaches:
* Crosscompile it. E.g. i386 fpc can produce arm-binaries. This is kinda tricky with autobuilder.
* Use older version of FPC
-Make binary-only-package (on non-free-repository) which contains fpc-binary.
-Bundle old fpc-binary with sources.

I used last option (you can try another ones). This is not big deal, because it is used only for first round of compiling, then it is compiled second time with new compiler. So at the end, resulting binary (fpc-2.4.4) is always compiled with fpc-2.4.4. Drawback is, that package can only be used with arm, i386 and x64 (it contains those pre-compiled binaries).



[1] http://www.freepascal.org/
[2] From May 22th, 2011
[3] http://maemo.org/packages/view/fpc-2.4.4/
[4] http://wiki.freepascal.org/Unit
[5] http://www.freepascal.org/faq.var#unix-asldmissing
[6] https://gitorious.org/maemo-fpc
[7] I found several talks and posts: fpc is used for long time on Maemo.

AapoRantalainen 2011-08-29 19:07

Re: [Announce] Free Pascal Compiler on extras-devel
 
It seems, that compiler on fremantle autobuilder is not handling x86 targets.

It will give linking error for every library I have tried, e.g.
Code:

/scratchbox/compilers/cs2007q3-glibc2.5-i486/bin/sbox-i486-pc-linux-gnu-ld: cannot find -llua5.
Easiest workaround is (on debian/rules)
Code:

ifneq (,$(findstring arm-linux,$(DEB_BUILD_GNU_TYPE)))
    make
else
    touch name_of_binary
endif

and then, of course, packages are useless on x86.

AapoRantalainen 2012-06-26 15:46

Re: [Announce] Free Pascal Compiler on extras-devel
 
New upstream version: fpc-2.6.0 on extras-devel.

Install package fpc-2.6.0 and you will get everything you need.

---------
Just for notes: Repackaged from Debian Sid.

Code:

wget http://ftp.de.debian.org/debian/pool/main/f/fpc/fpc_2.6.0.orig.tar.gz
wget http://ftp.de.debian.org/debian/pool/main/f/fpc/fpc_2.6.0-3.debian.tar.gz
tar xvf fpc_2.6.0.orig.tar.gz
tar xvf fpc_2.6.0-3.debian.tar.gz
rm fpc_2.6.0-3.debian.tar.gz  fpc_2.6.0.orig.tar.gz
mv fpcbuild-2.6.0/* .
rmdir fpcbuild-2.6.0/
echo "1.0" > debian/source/format

sed -i 's/Build-Depends: debhelper (>= 7), fp-compiler, fp-units-base, fp-units-fcl, fp-utils,/Build-Depends: debhelper (>= 5), fp-compiler-2.4.4, fp-units-2.4.4, fp-utils-2.4.4,/g' debian/control
sed -i 's/Build-Depends: debhelper (>= 7), fp-compiler, fp-units-base, fp-units-fcl, fp-utils,/Build-Depends: debhelper (>= 5), fp-compiler-2.4.4, fp-units-2.4.4, fp-utils-2.4.4,/g' debian/control.in

sed -i 's/Build-Depends-Indep: hevea/Build-Depends-Indep:/g' debian/control
sed -i 's/Build-Depends-Indep: hevea/Build-Depends-Indep:/g' debian/control.in

(I just got bored with script-like instructions)
Add to debian/rules
+FPCMAKE=/opt/fpc/bin/fpcmake
(because last version (2.4) was optified).


debian/rules
Foreach:
-mv -t foo bar
+mv bar foo
-cp -t foo bar
+cp bar foo
(as builders cp and mv are out dated)

debian/rules
Skip making of documentation, just empty package. Because it is using 'hevea', which is difficult to package (because it needs ocaml).

debian/control
remove 'Breaks' (as dpkg in sb1 doesn't understand it (and it is not funny to use dpkg --force-depends, when apt-get would be easier)).

debian/control
For fp-units-gfx-2.6.0: no depends on libsvgalib.
For fp-units-multimedia-2.6.0: depends on liba52-0.7.4-dev, no a52dec-dev
For fp-units-multimedia-2.6.0: no depends on libdts-dev

trx 2012-06-26 20:33

Re: [Announce] Free Pascal Compiler on extras-devel
 
I don't know if you are aware of it, TxPad has ObjPas(FPC) and Delphi syntax highlighting(and is written in Lazarus/FPC), so its useful for people using this...

Its sources are also useful because they have Maemo specific workarounds and problems solved..

Thanks for the package(s) btw ;)

TRX.

Necrofenser 2012-07-03 21:11

Re: [Announce] Free Pascal Compiler on extras-devel
 
When i try to installfpc-2.6.0 package i get this error:

Code:

home/user # apt-get install fpc-2.6.0
Reading package lists... Done
Building dependency tree     
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
  fpc-2.6.0: Depends: fp-units-gtk-2.6.0 (>= 2.6.0-maemo4) but it is not going to be installed
            Depends: fp-units-gnome1-2.6.0 (>= 2.6.0-maemo4) but it is not going to be installed
            Depends: fp-units-multimedia-2.6.0 (>= 2.6.0-maemo4) but it is not going to be installed
E: Broken packages


AapoRantalainen 2012-08-16 13:05

Re: [Announce] Free Pascal Compiler on extras-devel
 
Quote:

Originally Posted by Necrofenser (Post 1231310)
Code:

home/user # apt-get install fpc-2.6.0

You need first add SDK repository:
Code:

root
echo "deb http://repository.maemo.org/ fremantle/sdk free non-free" >> /etc/apt/sources.list.d/hildon-application-manager.list
apt-get update
apt-get install fpc-2.6.0

But it needs 45MB from rootfs (it warns about 120MB) as this is primarily targeted for used by autobuilder. Last version (2.4) contained more optification.

problem 2013-03-08 19:26

Re: [Announce] Free Pascal Compiler on extras-devel
 
I enabled extras-devel and the SDK repository as shown above but when I try 'apt-get install fpc-2.6.0' I get the following:
Code:

The following packages have unmet dependencies:
  fpc-2.6.0: Depends: fp-units-gtk-2.6.0 (>= 2.6.0-maemo4) but it is not going to be installed
            Depends: fp-units-gnome1-2.6.0 (>= 2.6.0-maemo4) but it is not going to be installed
E: Broken packages

:( what to do ?

problem 2013-03-10 18:59

Re: [Announce] Free Pascal Compiler on extras-devel
 
Is there a way to tell apt-get to ignore the broken dependencies ?
I don't think I need those gtk thingies.

Estel 2013-03-11 01:50

Re: [Announce] Free Pascal Compiler on extras-devel
 
http://lmgtfy.com/?q=apt+force+ignore+dependencies

problem 2013-03-11 06:54

Re: [Announce] Free Pascal Compiler on extras-devel
 
Quote:

Originally Posted by Estel (Post 1328259)

Would it be safe ?
I only have 64MB left on rootfs.

Estel 2013-03-13 02:01

Re: [Announce] Free Pascal Compiler on extras-devel
 
I have no clue why you want to ignore dependencies of nicely packaged thing, so I can't tell if it's safe.

Otherwise, instead of ignoring them, I would just re-package it to optify more things (if possible).

AapoRantalainen 2013-03-20 12:23

Re: [Announce] Free Pascal Compiler on extras-devel
 
Quote:

Originally Posted by problem (Post 1327722)
I enabled extras-devel and the SDK repository as shown above but when I try 'apt-get install fpc-2.6.0' I get the following:
Code:

The following packages have unmet dependencies:
  fpc-2.6.0: Depends: fp-units-gtk-2.6.0 (>= 2.6.0-maemo4) but it is not going to be installed
            Depends: fp-units-gnome1-2.6.0 (>= 2.6.0-maemo4) but it is not going to be installed
E: Broken packages

:( what to do ?

This is about not-properly working repositories. Packages are working. Today it seemed that repositories are working good, and I got this installed.
1) enable sdk-repository
2) enable extras-devel
3) update
4) install fpc

ernesbolso_94 2013-07-30 14:35

Re: [Announce] Free Pascal Compiler on extras-devel
 
Quote:

Originally Posted by Necrofenser (Post 1231310)
When i try to installfpc-2.6.0 package i get this error:

Code:

home/user # apt-get install fpc-2.6.0
Reading package lists... Done
Building dependency tree     
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
  fpc-2.6.0: Depends: fp-units-gtk-2.6.0 (>= 2.6.0-maemo4) but it is not going to be installed
            Depends: fp-units-gnome1-2.6.0 (>= 2.6.0-maemo4) but it is not going to be installed
            Depends: fp-units-multimedia-2.6.0 (>= 2.6.0-maemo4) but it is not going to be installed
E: Broken packages


I have the same problem that Necrofenser has, what i could do to fix it?

ernesbolso_94 2013-08-05 18:38

Re: [Announce] Free Pascal Compiler on extras-devel
 
Quote:

Originally Posted by AapoRantalainen (Post 1021209)
Free Pascal Compiler [1] version 2.4.4 [2] is now on extras-devel [3]. It contains packages:
Code:

fpc-2.4.4          - Free Pascal - SDK-2.4.4 metapackage
fp-compiler-2.4.4  - Free Pascal - Compiler
fp-units-rtl-2.4.4  - Free Pascal - Runtime Library
fp-units-2.4.4      - Free Pascal - base units
fp-utils-2.4.4      - Free Pascal - Utils

Compiler and units-rtl are needed for compiling. Units contains big set of units/packages [4] packed in one debian-package, you need it if you want do 'anything non-trivial'.

Packages are optified, if you are interested in to compile Pascal on N900-device. You need binutils installed, because it needs additionally 'as' and 'ld' [5].

--------
Usage: hello
#install (to scratchbox)
Code:

apt-get install fp-compiler-2.4.4
make file
Code:

program Hello;
  begin
  writeln ('Hello, world.')
end.

Compile it with
Code:

fpc hello.pas
(With sb2, use sb2 -e fpc hello.pas)

Copy to device and run, no additional dependencies on phone (I don't know why "rtl"="runtime library", because it is not needed on phone).

--------
Usage2: gles-2.0 test
#Install also units (~70M unpacked)
Code:

apt-get install fp-units-2.4.4
wget http://cc.oulu.fi/~rantalai/gles20demo.pp
fpc gles20demo.pp

--------
Some technical
All maemo specific is on own git [6].

As you might know the FPC compiler is written in Pascal, so getting it on Maemo repository [7] needed some tricks. There were several approaches:
* Crosscompile it. E.g. i386 fpc can produce arm-binaries. This is kinda tricky with autobuilder.
* Use older version of FPC
-Make binary-only-package (on non-free-repository) which contains fpc-binary.
-Bundle old fpc-binary with sources.

I used last option (you can try another ones). This is not big deal, because it is used only for first round of compiling, then it is compiled second time with new compiler. So at the end, resulting binary (fpc-2.4.4) is always compiled with fpc-2.4.4. Drawback is, that package can only be used with arm, i386 and x64 (it contains those pre-compiled binaries).



[1] http://www.freepascal.org/
[2] From May 22th, 2011
[3] http://maemo.org/packages/view/fpc-2.4.4/
[4] http://wiki.freepascal.org/Unit
[5] http://www.freepascal.org/faq.var#unix-asldmissing
[6] https://gitorious.org/maemo-fpc
[7] I found several talks and posts: fpc is used for long time on Maemo.

Please, could you tell me what i have to do tu install properly fpc on my n900 step by step, i really need fpc for my studies

AapoRantalainen 2013-08-05 18:51

Re: [Announce] Free Pascal Compiler on extras-devel
 
What happens if you then run:
Code:

apt-get install fpc fpc-2.6.0 fp-units-gtk-2.6.0 fp-units-gnome1-2.6.0 fp-units-multimedia-2.6.0
It might give list of another packages, and then you can continue (example):
Code:

apt-get install fpc fpc-2.6.0 fp-units-gtk-2.6.0 fp-units-gnome1-2.6.0 fp-units-multimedia-2.6.0 libgtk2.0-dev libogg-dev libvorbis-dev libpango1.0-dev libcairo2-dev libc6-dev
Until it tells why it can't install them.

ernesbolso_94 2013-08-05 20:24

Re: [Announce] Free Pascal Compiler on extras-devel
 
Quote:

Originally Posted by AapoRantalainen (Post 1365100)
What happens if you then run:
Code:

apt-get install fpc fpc-2.6.0 fp-units-gtk-2.6.0 fp-units-gnome1-2.6.0 fp-units-multimedia-2.6.0
It might give list of another packages, and then you can continue (example):
Code:

apt-get install fpc fpc-2.6.0 fp-units-gtk-2.6.0 fp-units-gnome1-2.6.0 fp-units-multimedia-2.6.0 libgtk2.0-dev libogg-dev libvorbis-dev libpango1.0-dev libcairo2-dev libc6-dev
Until it tells why it can't install them.



I believe that i have problems with SDK repository because i couldnt update repositorys when SDK are enable, when i run
Code:

apt-get install fpc fpc-2.6.0
its say me
Code:

E: Malformed line 6 in source list /etc/apt/sources.list.d/hildon-application-manager.list (absolute dist)
E: The list of sources could not be read.

Did you know what i have to do to fix it? thanks in advance

Wikiwide 2013-08-05 21:20

Re: [Announce] Free Pascal Compiler on extras-devel
 
Open (in vim or leafpad) this file (/etc/apt/sources.list/hildon-application-manager.list) and see whether you see anything wrong in line 6
Best wishes.

AapoRantalainen 2013-08-05 21:20

Re: [Announce] Free Pascal Compiler on extras-devel
 
Quote:

Originally Posted by ernesbolso_94 (Post 1365114)
I

Code:

E: Malformed line 6 in source list /etc/apt/sources.list.d/hildon-application-manager.list (absolute dist)
E: The list of sources could not be read.

Did you know what i have to do to fix it? thanks in advance


"Malformed line" really means that line is broken. Fix/remove it.

SDK-line should be:
Code:

deb http://repository.maemo.org/ fremantle/sdk free non-free
Use copy/paste.


All times are GMT. The time now is 05:40.

vBulletin® Version 3.8.8