nixpkgs-suyu/pkgs/development/compilers/fpc/default.nix

45 lines
1.2 KiB
Nix
Raw Normal View History

{ stdenv, fetchurl, gawk }:
let startFPC = import ./binary.nix { inherit stdenv fetchurl; }; in
stdenv.mkDerivation rec {
2014-08-31 20:47:45 +02:00
version = "2.6.4";
name = "fpc-${version}";
src = fetchurl {
url = "mirror://sourceforge/freepascal/fpcbuild-${version}.tar.gz";
2014-08-31 20:47:45 +02:00
sha256 = "1akdlp4n9ai1gnn4yq236i5rx03rs5sjfgk60myb7nb9lk7kp74d";
};
buildInputs = [ startFPC gawk ];
preConfigure =
if stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux" then ''
sed -e "s@'/lib/ld-linux[^']*'@'''@" -i fpcsrc/compiler/systems/t_linux.pas
sed -e "s@'/lib64/ld-linux[^']*'@'''@" -i fpcsrc/compiler/systems/t_linux.pas
'' else "";
2014-08-31 20:47:45 +02:00
makeFlags = "NOGDB=1 FPC=${startFPC}/bin/fpc";
installFlags = "INSTALL_PREFIX=\${out}";
postInstall = ''
for i in $out/lib/fpc/*/ppc*; do
ln -fs $i $out/bin/$(basename $i)
done
mkdir -p $out/lib/fpc/etc/
$out/lib/fpc/*/samplecfg $out/lib/fpc/${version} $out/lib/fpc/etc/
'';
2014-08-31 20:47:45 +02:00
passthru = {
bootstrap = startFPC;
};
meta = {
description = "Free Pascal Compiler from a source distribution";
maintainers = [stdenv.lib.maintainers.raskin];
platforms = stdenv.lib.platforms.linux;
2014-08-31 20:47:45 +02:00
inherit version;
};
}