From aae4a8db7a3e6c14e6d0e21391be760863cfb972 Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Sat, 11 Aug 2007 20:55:40 +0000 Subject: [PATCH] Added Free Pascal Compiler. svn path=/nixpkgs/trunk/; revision=9102 --- .../compilers/fpc/binary-builder.sh | 10 ++++++++ pkgs/development/compilers/fpc/binary.nix | 18 +++++++++++++ pkgs/development/compilers/fpc/default.nix | 25 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 4 +++ 4 files changed, 57 insertions(+) create mode 100755 pkgs/development/compilers/fpc/binary-builder.sh create mode 100644 pkgs/development/compilers/fpc/binary.nix create mode 100644 pkgs/development/compilers/fpc/default.nix diff --git a/pkgs/development/compilers/fpc/binary-builder.sh b/pkgs/development/compilers/fpc/binary-builder.sh new file mode 100755 index 000000000000..a827821958f9 --- /dev/null +++ b/pkgs/development/compilers/fpc/binary-builder.sh @@ -0,0 +1,10 @@ +source $stdenv/setup + +tar xf $src +tarballdir=$(pwd) +for i in *.tar; do tar xf $i; done +mkdir $out +cd $out +for i in $tarballdir/*.gz; do tar xf $i; done +ln -fs $out/lib/fpc/*/ppc386 $out/bin + diff --git a/pkgs/development/compilers/fpc/binary.nix b/pkgs/development/compilers/fpc/binary.nix new file mode 100644 index 000000000000..b76441e38d68 --- /dev/null +++ b/pkgs/development/compilers/fpc/binary.nix @@ -0,0 +1,18 @@ +args: +args.stdenv.mkDerivation { + name = "fpc-2.0.4-binary"; + + src = args. + fetchurl { + url = ftp://ftp.chg.ru/pub/lang/pascal/fpc/dist/i386-linux-2.0.4/fpc-2.0.4.i386-linux.tar; + sha256 = "0b2szv2anbf58h4i5mlph93afv9qdx6i0jqggba04d3anjbl9gfy"; + }; + + builder = ./binary-builder.sh; + + meta = { + description = " + Free Pascal Compiler from a binary distribution. +"; + }; +} diff --git a/pkgs/development/compilers/fpc/default.nix b/pkgs/development/compilers/fpc/default.nix new file mode 100644 index 000000000000..8a5f9b7dc5e6 --- /dev/null +++ b/pkgs/development/compilers/fpc/default.nix @@ -0,0 +1,25 @@ +args: +if ((args ? startFPC) && (args.startFPC != null)) + then +args.stdenv.mkDerivation { + name = "fpc-2.0.4"; + + src = args. + fetchurl { + url = ftp://ftp.chg.ru/pub/lang/pascal/fpc/dist/source-2.0.4/fpcbuild-2.0.4.tar.gz; + sha256 = "0sxgmslxy891why3d5pwn7zh4w3wj75apmhc7l5czmfhn3f0gcsc"; + }; + + buildInputs = [args.startFPC args.gawk]; + + installFlags = "INSTALL_PREFIX=\${out}"; + postInstall = "ln -fs $out/lib/fpc/*/ppc386 $out/bin; + mkdir -p $out/lib/fpc/etc/ ; + $out/lib/fpc/*/samplecfg $out/lib/fpc/2.* $out/lib/fpc/etc/;"; + + meta = { + description = " + Free Pascal Compiler from a source distribution. +"; + }; +} else (import ./default.nix (args // {startFPC = (import ./binary.nix args);})) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index fa1510973835..52687cb42679 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -701,6 +701,10 @@ rec { }; }; + fpc = import ../development/compilers/fpc { + inherit fetchurl stdenv gawk; + }; + g77 = import ../build-support/gcc-wrapper { name = "g77"; nativeTools = false;