Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at 21.11 50 lines 1.5 kB view raw
1{ lib, stdenv, fetchurl, gawk }: 2 3let startFPC = import ./binary.nix { inherit stdenv fetchurl; }; in 4 5stdenv.mkDerivation rec { 6 version = "3.2.0"; 7 pname = "fpc"; 8 9 src = fetchurl { 10 url = "mirror://sourceforge/freepascal/fpcbuild-${version}.tar.gz"; 11 sha256 = "0f38glyn3ffmqww432snhx2b8wyrq0yj1njkp4zh56lqrvm19fgr"; 12 }; 13 14 buildInputs = [ startFPC gawk ]; 15 glibc = stdenv.cc.libc.out; 16 17 # Patch paths for linux systems. Other platforms will need their own patches. 18 patches = [ 19 ./mark-paths.patch # mark paths for later substitution in postPatch 20 ]; 21 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" 25 ''; 26 27 makeFlags = [ "NOGDB=1" "FPC=${startFPC}/bin/fpc" ]; 28 29 installFlags = [ "INSTALL_PREFIX=\${out}" ]; 30 31 postInstall = '' 32 for i in $out/lib/fpc/*/ppc*; do 33 ln -fs $i $out/bin/$(basename $i) 34 done 35 mkdir -p $out/lib/fpc/etc/ 36 $out/lib/fpc/*/samplecfg $out/lib/fpc/${version} $out/lib/fpc/etc/ 37 ''; 38 39 passthru = { 40 bootstrap = startFPC; 41 }; 42 43 meta = with lib; { 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; 49 }; 50}