You are not logged in.

#1 2005-03-09 01:30:46

Net@Worm
Member
From: Moscow, Russia
Registered: 2004-05-02
Posts: 214

fpc + lazarus

I have made PKGBUILD's for this packages:
----FPC----

# Created by: Net@Worm <networm@mail15.com>
pkgname=fpc
pkgver=1.9.8
pkgrel=1
pkgdesc="Free Pascal Compiler"
url="http://www.freepascal.org"
license=""
depends=()
makedepends=()
conflicts=()
replaces=()
backup=()
install=
source=(ftp://ftp.freepascal.org/pub/fpc/beta/i386-linux-$pkgver/$pkgname-$pkgver.i386-linux.tar 
    ftp://ftp.freepascal.org/pub/fpc/beta/source-$pkgver/$pkgname-$pkgver.source.tar.gz)
md5sums=()

build() {
cd $startdir/src
#export stdir=$startdir
cp ../install.sh ./
yes | sh install.sh

echo "Moving FPC to the pkg/ direcory."
echo "----"
echo ""

echo "Creating folders."
mkdir $startdir/pkg/etc
mkdir $startdir/pkg/usr
mkdir $startdir/pkg/usr/bin
mkdir $startdir/pkg/usr/lib
mkdir $startdir/pkg/usr/man
mkdir $startdir/pkg/usr/man/man1
mkdir $startdir/pkg/usr/man/man5
echo ""

echo "Moving config file."
mv /etc/fpc.cfg $startdir/pkg/etc/
echo ""

echo "Moving fpc source files..."
cp -r $startdir/src/fpc/ $startdir/pkg/usr/
echo ""

echo "...bin files..."
cd /usr/bin
mv bin2obj fp fpcsubst h2paspp postw32 ppufiles rstconv data2inc fpc fpdoc makeskel ppc386 ppumove unitdiff delp fpcmake fprcp mkxmlrpc ppdep ptop fd2pascal fpcmkcfg h2pas plex ppudump pyacc $startdir/pkg/usr/bin
echo ""

echo "...fpc main files..."
mv /usr/lib/fpc/ $startdir/pkg/usr/lib
echo ""

echo "...man files."
cd /usr/man/man1
mv bin2obj.1 fpcmake.1 makeskel.1 ppudump.1 rstconv.1 data2inc.1 fpdoc.1 plex.1 ppufiles.1 unitdiff.1 delp.1 fprcp.1 postw32.1 ppumove.1 fd2pascal.1 h2pas.1 ppc386.1 ptop.1 fpc.1 h2paspp.1 ppdep.1 pyacc.1 $startdir/pkg/usr/man/man1

cd /usr/man/man5
mv fpc.cfg.5 fpcmake.5 ptop.cfg.5 $startdir/pkg/usr/man/man5
echo ""
}

Why i install fpc to /usr/ and then copying to $startdir/pkg? Becouse if install fpc to $startdir/pkg/usr/, global fpc path set to $startdir/pkg/usr, and i dont know how to change it.

----Lazarus-CVS----
PKGBUILD:

# Created by Net@Worm
pkgname=lazarus-cvs
pkgver=0.9.6
pkgrel=1
pkgdesc="Lazarus is IDE for Free Pascal Compiler"
url="http://www.lazarus.freepascal.org"
license=""
depends=('fpc' 'cvs')
makedepends=()
conflicts=()
replaces=()
backup=()
install=lazarus.install
source=()
md5sums=()
cvsroot=(':pserver:cvs@cvs.freepascal.org:/FPC/CVS')
cvsmod=('lazarus')

build() {
  cd $startdir/src/
 cvs -z3 -d $cvsroot co $cvsmod
  cd lazarus
  make
  mkdir $startdir/pkg/usr/
  mkdir $startdir/pkg/usr/bin
  cp -r $startdir/src/lazarus $startdir/pkg/usr/
}

lazarus.install:

post_install() {
ln -s /usr/lazarus/lazarus /usr/bin/
ln -s /usr/lazarus/startlazarus /usr/bin/
}

pre_remove() {
rm /usr/bin/lazarus
rm /usr/bin/startlazarus
}

op=$1
shift

$op $*

PS: FPC source files placed to /usr/fpc

Offline

#2 2005-09-17 08:11:33

janwil
Member
From: Tartu, Estonia
Registered: 2003-08-15
Posts: 88

Re: fpc + lazarus

I tried to upgrade this PKGBUILD to 2.0.0, but without success. I also tried to extract the files from RPM and create a package, but that ended in messed permissions of system directories.

Thus I would be very grateful if someone could create good PKGBUILDs for fpc and lazarus, too. Seeing them in AUR would of course be ideal.

Thanx in advance,
Jan

Offline

#3 2005-09-17 21:12:29

citral
Member
Registered: 2005-05-07
Posts: 87

Re: fpc + lazarus

I also would really like some PKGBUILDS for these. I updated the PKGBUIKD from a different thread, but even though my PKGBUILD succesfuly makes a package, the paths in fpc are still wrong. I haven't had time yet to look into it, so if someone could fix it, we might have a useable  fpc build.  (And after that look at lazarus, which is also a bitch to install. These people try to make things easy to install, but why do they torture package mainters so much?!)

# Contributor: Hugo Ideler <hugoideler@dse.nl>
# Original PKGBUILD: Andre Naumann <anaumann@SPARCed.org>
# See http://bbs.archlinux.org/viewtopic.php?t=9318&highlight=fpc
pkgname=fpc
pkgver=2.0.0
pkgrel=1
pkgdesc="The Free Pascal Compiler is a Turbo Pascal 7.0 and Delphi compatible 32bit Pascal Compiler. It comes with fully TP 7.0 compatible run-time library."
url="http://www.freepascal.org/"
groups=
provides=
backup=("etc/fpc.cfg")
depends=('bash')
source=("http://dl.sourceforge.net/sourceforge/freepascal/fpc-$pkgver.i386-linux.tar")
#source=('ftp://ftp.de.freepascal.org/pub/fpc/snapshot/v10/source/fpc.zip' 'ftp://ftp.de.freepascal.org/pub/fpc/dist/Linux/i386/separate/binary.tar')
md5sums=('5f0a5fba632a811dcfdafe0ff80476a3')

build() {
        cd $startdir/src
        sed  -ie 's@$LIBDIR/samplecfg $LIBDIR@echo Expr Removed@' install.sh install.sh* || exit -1
        echo $startdir/pkg/usr | ./install.sh

        if [ ! -d $startdir/pkg/etc ]; then
                mkdir $startdir/pkg/etc
        fi
        echo "Writing our own config file..."
        $startdir/pkg/usr/lib/fpc/$pkgver/samplecfg $startdir/pkg/usr/lib/fpc/$PKGVER $startdir/pkg/etc || exit -1

        #cd $startdir/pkg/usr/lib/fpc/1.0.10
        #./samplecfg /usr/lib/fpc/1.0.10 $startdir/pkg/etc
}

One of the main causes of the fall of the Roman Empire was that, lacking zero,
they had no way to indicate successful termination of their C programs.

Offline

#4 2005-09-18 14:27:12

janwil
Member
From: Tartu, Estonia
Registered: 2003-08-15
Posts: 88

Re: fpc + lazarus

Well,

This PKGBUILD actually gave a package that was installable, did not mess up anything and where the compiler was able to compile "Hello, world". During package building I got the following error messages:

==> Stripping debugging symbols from libraries...
/usr/bin/strip: pkg/usr/lib/fpc/2.0.0/units/i386-linux/fcl/stchrMX9: Invalid operation
/usr/bin/strip: pkg/usr/lib/fpc/2.0.0/units/i386-linux/fcl/stchrMX9: Invalid operation
/usr/bin/strip: pkg/usr/lib/fpc/2.0.0/units/i386-linux/paszlib/stGi2O1L: Invalid operation
/usr/bin/strip: pkg/usr/lib/fpc/2.0.0/units/i386-linux/paszlib/stGi2O1L: Invalid operation

Any idea what to do about them?

Jan

Offline

#5 2005-09-18 21:09:10

citral
Member
Registered: 2005-05-07
Posts: 87

Re: fpc + lazarus

Well, something's definately not right, but it isn't too serious AFAICS, because your binaries will still work fine even if they don't get /usr/bin/strip'ed.


One of the main causes of the fall of the Roman Empire was that, lacking zero,
they had no way to indicate successful termination of their C programs.

Offline

#6 2005-09-18 21:14:09

Snowman
Developer/Forum Fellow
From: Montreal, Canada
Registered: 2004-08-20
Posts: 5,212

Re: fpc + lazarus

You could use
makepkg -n
It won't strip binaries/libraries.

Offline

#7 2005-09-19 10:25:44

janwil
Member
From: Tartu, Estonia
Registered: 2003-08-15
Posts: 88

Re: fpc + lazarus

Hi all,

I cleaned a bit citral's PKGBUILD and fixed a bug with directories.

# Contributor: Jan Willemson <janwil@hot.ee>
# Contributor: Hugo Ideler <hugoideler@dse.nl>
# Original PKGBUILD: Andre Naumann <anaumann@SPARCed.org>
# See http://bbs.archlinux.org/viewtopic.php?t=9318&highlight=fpc
pkgname=fpc
pkgver=2.0.0
pkgrel=2
pkgdesc="The Free Pascal Compiler is a Turbo Pascal 7.0 and Delphi compatible 32bit Pascal Compiler. It comes with fully TP 7.0 compatible run-time library."
url="http://www.freepascal.org/"
groups=
provides=
backup=("etc/fpc.cfg")
depends=('bash')
source=("http://dl.sourceforge.net/sourceforge/freepascal/fpc-$pkgver.i386-linux.tar")
md5sums=('5f0a5fba632a811dcfdafe0ff80476a3')

build() {
        cd $startdir/src
        sed  -ie 's@$LIBDIR/samplecfg $LIBDIR@echo Expr Removed@' install.sh install.sh* || exit -1
        echo $startdir/pkg/usr | ./install.sh

        if [ ! -d $startdir/pkg/etc ]; then
                mkdir $startdir/pkg/etc
        fi
        echo "Writing our own config file..."
        $startdir/pkg/usr/lib/fpc/$pkgver/samplecfg /usr/lib/fpc/$pkgver $startdir/pkg/etc || exit -1

} 

The result gives a package without make errors with makepkg -n. However, there are a few things namcap doesn't like:

[jan@okassiga fpc]$ namcap fpc-2.0.0-2.pkg.tar.gz
fpc        E: Dependency detected and not included (gpm) from files ['usr/bin/fp']
fpc        E: File (usr/lib/fpc/lexyacc/yylex.cod) has jan/users permissions.
fpc        E: File (usr/lib/fpc/lexyacc/yyparse.cod) has jan/users permissions.
fpc        E: Symlink (usr/bin/ppc386) points to /var/abs/local/fpc/pkg/usr/lib/fpc/2.0.0/ppc386

The last error is probably a bad one. What would be the best way to solve it?

Jan

Offline

#8 2005-09-19 13:21:09

janwil
Member
From: Tartu, Estonia
Registered: 2003-08-15
Posts: 88

Re: fpc + lazarus

Hi all,

I got rid of the first and the last errors, but the middle two (jan/users persmissions) are a mystery to me. In the pkg subdirectory, all the permissions are jan/users; after making the package, the permissions of all the files in the package are changed to root/root, except for the two files displayed in my previous message. Why is this? Do I do anything wrong or is it a bug in makepkg?

Jan

Offline

#9 2005-09-19 18:42:44

Snowman
Developer/Forum Fellow
From: Montreal, Canada
Registered: 2004-08-20
Posts: 5,212

Re: fpc + lazarus

Do you build the package with fakeroot as a regular user? If no, try that way.  If yes, you can give the files root/root permission with chown root:root <files>

Offline

#10 2005-09-19 19:41:37

janwil
Member
From: Tartu, Estonia
Registered: 2003-08-15
Posts: 88

Re: fpc + lazarus

Hi all,

Thanx for the suggestions, now I have a PKGBUILD that gives a package that namcap does not complain about (yes, I know I should not trust namcap blindly, but still). Even though it looks a kind of hacky, would it be OK for submission to AUR?

# Contributor: Jan Willemson <janwil@hot.ee>
# Contributor: Hugo Ideler <hugoideler@dse.nl>
# Original PKGBUILD: Andre Naumann <anaumann@SPARCed.org>
# See http://bbs.archlinux.org/viewtopic.php?t=9318&highlight=fpc
pkgname=fpc
pkgver=2.0.0
pkgrel=4
pkgdesc="The Free Pascal Compiler is a Turbo Pascal 7.0 and Delphi compatible 32bit Pascal Compiler. It comes with fully TP 7.0 compatible run-time library."
url="http://www.freepascal.org/"
groups=
provides=
backup=("etc/fpc.cfg")
depends=('bash' 'gpm')
source=("http://dl.sourceforge.net/sourceforge/freepascal/fpc-$pkgver.i386-linux.tar")
md5sums=('5f0a5fba632a811dcfdafe0ff80476a3')

build() {
        cd $startdir/src
        sed  -ie 's@$LIBDIR/samplecfg $LIBDIR@echo Expr Removed@' install.sh install.sh* || exit -1
        echo $startdir/pkg/usr | ./install.sh

        if [ ! -d $startdir/pkg/etc ]; then
                mkdir $startdir/pkg/etc
        fi
        echo "Writing our own config file..."
        $startdir/pkg/usr/lib/fpc/$pkgver/samplecfg /usr/lib/fpc/$pkgver $startdir/pkg/etc || exit -1
    
    cd $startdir/pkg
    rm usr/bin/ppc386
    ln -s usr/lib/fpc/2.0.0/ppc386 usr/bin
    
    chown root:root $startdir/pkg/usr/lib/fpc/lexyacc/*

} 

Best,
Jan

Offline

#11 2005-09-19 20:27:54

janwil
Member
From: Tartu, Estonia
Registered: 2003-08-15
Posts: 88

Re: fpc + lazarus

Hi again,

Of course, after posting the PKGBUILD I found another bug with the symlink. Now it's (hopefully:)) fixed.

# Contributor: Jan Willemson <janwil@hot.ee>
# Contributor: Hugo Ideler <hugoideler@dse.nl>
# Original PKGBUILD: Andre Naumann <anaumann@SPARCed.org>
# See http://bbs.archlinux.org/viewtopic.php?t=9318&highlight=fpc
pkgname=fpc
pkgver=2.0.0
pkgrel=5
pkgdesc="The Free Pascal Compiler is a Turbo Pascal 7.0 and Delphi compatible 32bit Pascal Compiler. It comes with fully TP 7.0 compatible run-time library."
url="http://www.freepascal.org/"
groups=
provides=
backup=("etc/fpc.cfg")
depends=('bash' 'gpm')
source=("http://dl.sourceforge.net/sourceforge/freepascal/fpc-$pkgver.i386-linux.tar")
md5sums=('5f0a5fba632a811dcfdafe0ff80476a3')

build() {
        cd $startdir/src
        sed  -ie 's@$LIBDIR/samplecfg $LIBDIR@echo Expr Removed@' install.sh install.sh* || exit -1
        echo $startdir/pkg/usr | ./install.sh

        if [ ! -d $startdir/pkg/etc ]; then
                mkdir $startdir/pkg/etc
        fi
        echo "Writing our own config file..."
        $startdir/pkg/usr/lib/fpc/$pkgver/samplecfg /usr/lib/fpc/$pkgver $startdir/pkg/etc || exit -1
    
    cd $startdir/pkg
    rm usr/bin/ppc386
    ln -s /usr/lib/fpc/2.0.0/ppc386 usr/bin
    
    chown root:root $startdir/pkg/usr/lib/fpc/lexyacc/*

} 

Have fun,
Jan

Offline

#12 2005-09-21 11:12:29

citral
Member
Registered: 2005-05-07
Posts: 87

Re: fpc + lazarus

Nice job! It seems to work properly here, even though I haven't given it thorough testing. I'd say, upload it to AUR, since you can always update your PKGBUILD on AUR if there is a bug in it.


One of the main causes of the fall of the Roman Empire was that, lacking zero,
they had no way to indicate successful termination of their C programs.

Offline

#13 2005-09-22 09:13:35

janwil
Member
From: Tartu, Estonia
Registered: 2003-08-15
Posts: 88

Re: fpc + lazarus

OK, I uploaded the PKGBUILD to AUR. So everybody test & vote big_smile

Jan

Offline

#14 2005-09-22 21:16:56

janwil
Member
From: Tartu, Estonia
Registered: 2003-08-15
Posts: 88

Re: fpc + lazarus

Hi again,

After somewhat finishing with FPC, I also tried Lazarus. Even though Lazarus is a bit more Arch-friendly than FreePascal, in two hours I could not write such a PKGBUILD that would satisfy me. When compiling in my home directory,  everything was fine, but when writing a PKGBUILD of the form

# Contributor Jan Willemson <janwil@hot.ee>
# This PKGBUILD does NOT work!!!
pkgname=lazarus
pkgver=0.9.8
pkgrel=1
pkgdesc="Lazarus IDE for FreePascal compiler"
url="http://www.lazarus.freepascal.org/"
backup=()
makedepends=('fpc' 'gdk-pixbuf')
depends=('')
source=(http://surfnet.dl.sourceforge.net/sourceforge/lazarus/lazarus-$pkgver.tgz)
md5sums=('2dd935abff221193140ccb540d6c110c')

build() {
  cd $startdir/src/lazarus/
  make clean all || return 1
  cd $startdir/src/lazarus/
  make PREFIX=$startdir/pkg/usr/local install
}

I got a strange error about missing RTL library. It may have something to do with the fact that the install routine of Lazarus does not use ./configure and hence for PKGBUILD it may be necessary to guess some directories in a clever way.

Anyway, in the end of the Lazarus build procedure there seems to be one static binary produced, so a simple PKGBUILD in the fashion of the first message in this thread might do the trick. Still, I would appreciate comments from some bit more experienced package maintainers.

Best regards,
Jan

Offline

#15 2005-09-24 16:15:50

citral
Member
Registered: 2005-05-07
Posts: 87

Re: fpc + lazarus

It's weird because rtl is installed with fpc.

I googled a bit, and found this link
It's not of much use, but at least we're not the only one with this problem. smile

Anyway, the Gentoo e-build seems to acknowledge the 'make install' being broken, and copies the files manually (via rsync, but we don't need to do it like that). See here

I think you could do something in the trend of:    find .. -iname '*.exts' | xargs cp


One of the main causes of the fall of the Roman Empire was that, lacking zero,
they had no way to indicate successful termination of their C programs.

Offline

#16 2006-04-30 11:22:35

citral
Member
Registered: 2005-05-07
Posts: 87

Re: fpc + lazarus

Alright, I made a lazarus package:

http://aur.archlinux.org/packages.php?d … =1&ID=4440

Enjoy and tell me if anything goes wrong!


One of the main causes of the fall of the Roman Empire was that, lacking zero,
they had no way to indicate successful termination of their C programs.

Offline

Board footer

Powered by FluxBB