2010-07-28 13:55:54 +02:00
|
|
|
{ stdenv, fetchurl, gawk }:
|
2009-03-03 14:27:40 +01:00
|
|
|
|
2010-07-28 13:55:54 +02:00
|
|
|
let startFPC = import ./binary.nix { inherit stdenv fetchurl; }; in
|
2009-03-03 14:27:40 +01:00
|
|
|
|
2009-07-14 11:08:05 +02:00
|
|
|
stdenv.mkDerivation rec {
|
2020-04-01 22:39:28 +02:00
|
|
|
version = "3.0.4";
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "fpc";
|
2007-08-11 22:55:40 +02:00
|
|
|
|
2008-01-30 18:20:48 +01:00
|
|
|
src = fetchurl {
|
2013-07-14 02:09:34 +02:00
|
|
|
url = "mirror://sourceforge/freepascal/fpcbuild-${version}.tar.gz";
|
2020-04-01 22:39:28 +02:00
|
|
|
sha256 = "0xjyhlhz846jbnp12y68c7nq4xmp4i65akfbrjyf3r62ybk18rgn";
|
2009-03-03 14:27:40 +01:00
|
|
|
};
|
2007-08-11 22:55:40 +02:00
|
|
|
|
2010-07-28 13:55:54 +02:00
|
|
|
buildInputs = [ startFPC gawk ];
|
2020-04-01 22:39:28 +02:00
|
|
|
glibc = stdenv.cc.libc.out;
|
2007-08-11 22:55:40 +02:00
|
|
|
|
2009-03-03 14:27:40 +01:00
|
|
|
preConfigure =
|
2018-08-20 21:11:29 +02:00
|
|
|
if stdenv.hostPlatform.system == "i686-linux" || stdenv.hostPlatform.system == "x86_64-linux" then ''
|
2009-03-03 14:27:40 +01:00
|
|
|
sed -e "s@'/lib/ld-linux[^']*'@'''@" -i fpcsrc/compiler/systems/t_linux.pas
|
2010-11-10 17:38:22 +01:00
|
|
|
sed -e "s@'/lib64/ld-linux[^']*'@'''@" -i fpcsrc/compiler/systems/t_linux.pas
|
2020-04-01 22:39:28 +02:00
|
|
|
sed -e "s@/lib64[^']*@${glibc}/lib@" -i fpcsrc/compiler/systems/t_linux.pas
|
2009-03-03 14:27:40 +01:00
|
|
|
'' else "";
|
2008-04-08 17:10:09 +02:00
|
|
|
|
2019-10-27 14:03:25 +01:00
|
|
|
makeFlags = [ "NOGDB=1" "FPC=${startFPC}/bin/fpc" ];
|
2009-02-26 16:14:17 +01:00
|
|
|
|
2019-10-27 14:03:25 +01:00
|
|
|
installFlags = [ "INSTALL_PREFIX=\${out}" ];
|
2018-08-20 00:20:07 +02:00
|
|
|
|
2009-03-03 14:27:40 +01:00
|
|
|
postInstall = ''
|
2010-01-15 11:43:21 +01:00
|
|
|
for i in $out/lib/fpc/*/ppc*; do
|
|
|
|
ln -fs $i $out/bin/$(basename $i)
|
|
|
|
done
|
2009-03-03 14:27:40 +01:00
|
|
|
mkdir -p $out/lib/fpc/etc/
|
2009-07-14 11:08:05 +02:00
|
|
|
$out/lib/fpc/*/samplecfg $out/lib/fpc/${version} $out/lib/fpc/etc/
|
2009-03-03 14:27:40 +01:00
|
|
|
'';
|
2007-08-11 22:55:40 +02:00
|
|
|
|
2014-08-31 20:47:45 +02:00
|
|
|
passthru = {
|
|
|
|
bootstrap = startFPC;
|
|
|
|
};
|
|
|
|
|
2018-08-20 00:20:07 +02:00
|
|
|
meta = with stdenv.lib; {
|
2009-03-03 14:27:40 +01:00
|
|
|
description = "Free Pascal Compiler from a source distribution";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://www.freepascal.org";
|
2018-08-20 00:20:07 +02:00
|
|
|
maintainers = [ maintainers.raskin ];
|
|
|
|
license = with licenses; [ gpl2 lgpl2 ];
|
|
|
|
platforms = platforms.linux;
|
2014-08-31 20:47:45 +02:00
|
|
|
inherit version;
|
2007-08-11 22:55:40 +02:00
|
|
|
};
|
2009-03-03 14:27:40 +01:00
|
|
|
}
|