1 { lib, stdenv, fetchurl, gawk }:
3 let startFPC = import ./binary.nix { inherit stdenv fetchurl; }; in
5 stdenv.mkDerivation rec {
10 url = "mirror://sourceforge/freepascal/fpcbuild-${version}.tar.gz";
11 sha256 = "0f38glyn3ffmqww432snhx2b8wyrq0yj1njkp4zh56lqrvm19fgr";
14 buildInputs = [ startFPC gawk ];
15 glibc = stdenv.cc.libc.out;
17 # Patch paths for linux systems. Other platforms will need their own patches.
19 ./mark-paths.patch # mark paths for later substitution in postPatch
22 # substitute the markers set by the mark-paths patch
23 substituteInPlace fpcsrc/compiler/systems/t_linux.pas --subst-var-by dynlinker-prefix "${glibc}"
24 substituteInPlace fpcsrc/compiler/systems/t_linux.pas --subst-var-by syslibpath "${glibc}/lib"
27 makeFlags = [ "NOGDB=1" "FPC=${startFPC}/bin/fpc" ];
29 installFlags = [ "INSTALL_PREFIX=\${out}" ];
32 for i in $out/lib/fpc/*/ppc*; do
33 ln -fs $i $out/bin/$(basename $i)
35 mkdir -p $out/lib/fpc/etc/
36 $out/lib/fpc/*/samplecfg $out/lib/fpc/${version} $out/lib/fpc/etc/
44 description = "Free Pascal Compiler from a source distribution";
45 homepage = "https://www.freepascal.org";
46 maintainers = [ maintainers.raskin ];
47 license = with licenses; [ gpl2 lgpl2 ];
48 platforms = platforms.linux;