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

47 lines
1.3 KiB
Nix
Raw Normal View History

{ stdenv, fetchurl, gawk }:
let startFPC = import ./binary.nix { inherit stdenv fetchurl; }; in
stdenv.mkDerivation rec {
2016-01-01 02:21:28 +01:00
version = "3.0.0";
name = "fpc-${version}";
src = fetchurl {
url = "mirror://sourceforge/freepascal/fpcbuild-${version}.tar.gz";
2016-01-01 02:21:28 +01:00
sha256 = "1v40bjp0kvsi8y0mndqvvhnsqjfssl2w6wpfww51j4rxblfkp4fm";
};
buildInputs = [ startFPC gawk ];
preConfigure =
if stdenv.hostPlatform.system == "i686-linux" || stdenv.hostPlatform.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}";
2018-08-20 00:20:07 +02:00
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;
};
2018-08-20 00:20:07 +02:00
meta = with stdenv.lib; {
description = "Free Pascal Compiler from a source distribution";
2018-08-20 00:20:07 +02:00
homepage = https://www.freepascal.org;
maintainers = [ maintainers.raskin ];
license = with licenses; [ gpl2 lgpl2 ];
platforms = platforms.linux;
2014-08-31 20:47:45 +02:00
inherit version;
};
}