lol

fpc: 3.0.4 -> 3.2.0

There was no 3.1 for some reason. The old sed-based path patching was
broken and resulted in syntax errors since it was a bit over-eager.
Instead of fixing it, I decided to replace it with a patch file which is
easier to inspect and will fail in a more obvious way next time.

The patch is now applied unconditionally, since it actually applies to
all linux platforms. The changes are localized to linux-specific code,
so it does not hurt to apply it on non-linux platforms as well.

Hedgewars needs a small fix to work with the new version. Done in the
same commit to avoid a broken commit.

+155 -20
+8 -7
pkgs/development/compilers/fpc/binary.nix
··· 1 1 { stdenv, fetchurl }: 2 2 3 - stdenv.mkDerivation { 4 - name = "fpc-3.0.0-binary"; 3 + stdenv.mkDerivation rec { 4 + pname = "fpc-binary"; 5 + version = "3.2.0"; 5 6 6 7 src = 7 8 if stdenv.hostPlatform.system == "i686-linux" then 8 9 fetchurl { 9 - url = "mirror://sourceforge/project/freepascal/Linux/3.0.0/fpc-3.0.0.i386-linux.tar"; 10 - sha256 = "0h3f1dgs1zsx7vvk9kg67anjvgw5sslfbmjblif7ishbcp3k3g5k"; 10 + url = "mirror://sourceforge/project/freepascal/Linux/${version}/fpc-${version}.i386-linux.tar"; 11 + sha256 = "0y0510b2fbxbqz28967xx8b023k6q9fv5yclfrc1yc9mg8fyn411"; 11 12 } 12 13 else if stdenv.hostPlatform.system == "x86_64-linux" then 13 14 fetchurl { 14 - url = "mirror://sourceforge/project/freepascal/Linux/3.0.0/fpc-3.0.0.x86_64-linux.tar"; 15 - sha256 = "1m2xx3nda45cb3zidbjgdr8kddd19zk0khvp7xxdlclszkqscln9"; 15 + url = "mirror://sourceforge/project/freepascal/Linux/${version}/fpc-${version}-x86_64-linux.tar"; 16 + sha256 = "0gfbwjvjqlx0562ayyl08khagslrws758al2yhbi4bz5rzk554ni"; 16 17 } 17 18 else throw "Not supported on ${stdenv.hostPlatform.system}."; 18 19 ··· 21 22 meta = { 22 23 description = "Free Pascal Compiler from a binary distribution"; 23 24 }; 24 - } 25 + }
+11 -8
pkgs/development/compilers/fpc/default.nix
··· 3 3 let startFPC = import ./binary.nix { inherit stdenv fetchurl; }; in 4 4 5 5 stdenv.mkDerivation rec { 6 - version = "3.0.4"; 6 + version = "3.2.0"; 7 7 pname = "fpc"; 8 8 9 9 src = fetchurl { 10 10 url = "mirror://sourceforge/freepascal/fpcbuild-${version}.tar.gz"; 11 - sha256 = "0xjyhlhz846jbnp12y68c7nq4xmp4i65akfbrjyf3r62ybk18rgn"; 11 + sha256 = "0f38glyn3ffmqww432snhx2b8wyrq0yj1njkp4zh56lqrvm19fgr"; 12 12 }; 13 13 14 14 buildInputs = [ startFPC gawk ]; 15 15 glibc = stdenv.cc.libc.out; 16 16 17 - preConfigure = 18 - if stdenv.hostPlatform.system == "i686-linux" || stdenv.hostPlatform.system == "x86_64-linux" then '' 19 - sed -e "s@'/lib/ld-linux[^']*'@'''@" -i fpcsrc/compiler/systems/t_linux.pas 20 - sed -e "s@'/lib64/ld-linux[^']*'@'''@" -i fpcsrc/compiler/systems/t_linux.pas 21 - sed -e "s@/lib64[^']*@${glibc}/lib@" -i fpcsrc/compiler/systems/t_linux.pas 22 - '' else ""; 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 + ''; 23 26 24 27 makeFlags = [ "NOGDB=1" "FPC=${startFPC}/bin/fpc" ]; 25 28
+100
pkgs/development/compilers/fpc/mark-paths.patch
··· 1 + diff --git a/fpcsrc/compiler/systems/t_linux.pas b/fpcsrc/compiler/systems/t_linux.pas 2 + index a7398fb9..a1e41ecb 100644 3 + --- a/fpcsrc/compiler/systems/t_linux.pas 4 + +++ b/fpcsrc/compiler/systems/t_linux.pas 5 + @@ -135,13 +135,13 @@ begin 6 + LibrarySearchPath.AddLibraryPath(sysrootpath,'=/usr/lib64',true); 7 + { /lib64 should be the really first, so add it before everything else } 8 + LibrarySearchPath.AddLibraryPath(sysrootpath,'=/lib',true); 9 + - LibrarySearchPath.AddLibraryPath(sysrootpath,'=/lib64',true); 10 + + LibrarySearchPath.AddLibraryPath(sysrootpath,'=@syslibpath@',true); 11 + {$else} 12 + {$ifdef powerpc64} 13 + if target_info.abi<>abi_powerpc_elfv2 then 14 + - LibrarySearchPath.AddLibraryPath(sysrootpath,'=/lib64;=/usr/lib64;=/usr/X11R6/lib64',true) 15 + + LibrarySearchPath.AddLibraryPath(sysrootpath,'=/@syslibpath@;=/usr/lib64;=/usr/X11R6/lib64',true) 16 + else 17 + - LibrarySearchPath.AddLibraryPath(sysrootpath,'=/lib64;=/usr/lib/powerpc64le-linux-gnu;=/usr/X11R6/powerpc64le-linux-gnu',true); 18 + + LibrarySearchPath.AddLibraryPath(sysrootpath,'=/@syslibpath@;=/usr/lib/powerpc64le-linux-gnu;=/usr/X11R6/powerpc64le-linux-gnu',true); 19 + {$else powerpc64} 20 + LibrarySearchPath.AddLibraryPath(sysrootpath,'=/lib;=/usr/lib;=/usr/X11R6/lib',true); 21 + {$endif powerpc64} 22 + @@ -185,53 +185,53 @@ begin 23 + end; 24 + 25 + {$ifdef m68k} 26 + - const defdynlinker='/lib/ld.so.1'; 27 + + const defdynlinker='@dynlinker-prefix@/lib/ld.so.1'; 28 + {$endif m68k} 29 + 30 + {$ifdef i386} 31 + - const defdynlinker='/lib/ld-linux.so.2'; 32 + + const defdynlinker='@dynlinker-prefix@/lib/ld-linux.so.2'; 33 + {$endif} 34 + 35 + {$ifdef x86_64} 36 + - const defdynlinker='/lib64/ld-linux-x86-64.so.2'; 37 + + const defdynlinker='@dynlinker-prefix@/lib64/ld-linux-x86-64.so.2'; 38 + {$endif x86_64} 39 + 40 + {$ifdef sparc} 41 + - const defdynlinker='/lib/ld-linux.so.2'; 42 + + const defdynlinker='@dynlinker-prefix@/lib/ld-linux.so.2'; 43 + {$endif sparc} 44 + 45 + {$ifdef powerpc} 46 + - const defdynlinker='/lib/ld.so.1'; 47 + + const defdynlinker='@dynlinker-prefix@/lib/ld.so.1'; 48 + {$endif powerpc} 49 + 50 + {$ifdef powerpc64} 51 + - const defdynlinkerv1='/lib64/ld64.so.1'; 52 + - const defdynlinkerv2='/lib64/ld64.so.2'; 53 + + const defdynlinkerv1='@dynlinker-prefix@/lib64/ld64.so.1'; 54 + + const defdynlinkerv2='@dynlinker-prefix@/lib64/ld64.so.2'; 55 + var defdynlinker: string; 56 + {$endif powerpc64} 57 + 58 + {$ifdef arm} 59 + {$ifdef FPC_ARMHF} 60 + - const defdynlinker='/lib/ld-linux-armhf.so.3'; 61 + + const defdynlinker='@dynlinker-prefix@/lib/ld-linux-armhf.so.3'; 62 + {$else FPC_ARMHF} 63 + {$ifdef FPC_ARMEL} 64 + - const defdynlinker='/lib/ld-linux.so.3'; 65 + + const defdynlinker='@dynlinker-prefix@/lib/ld-linux.so.3'; 66 + {$else FPC_ARMEL} 67 + - const defdynlinker='/lib/ld-linux.so.2'; 68 + + const defdynlinker='@dynlinker-prefix@/lib/ld-linux.so.2'; 69 + {$endif FPC_ARMEL} 70 + {$endif FPC_ARMHF} 71 + {$endif arm} 72 + 73 + {$ifdef aarch64} 74 + -const defdynlinker='/lib/ld-linux-aarch64.so.1'; 75 + +const defdynlinker='@dynlinker-prefix@/lib/ld-linux-aarch64.so.1'; 76 + {$endif aarch64} 77 + 78 + {$ifdef mips} 79 + - const defdynlinker='/lib/ld.so.1'; 80 + + const defdynlinker='@dynlinker-prefix@/lib/ld.so.1'; 81 + {$endif mips} 82 + 83 + {$ifdef sparc64} 84 + - const defdynlinker='/lib64/ld-linux.so.2'; 85 + + const defdynlinker='@dynlinker-prefix@/lib64/ld-linux.so.2'; 86 + {$endif sparc64} 87 + 88 + 89 + @@ -266,9 +266,9 @@ begin 90 + libctype:=uclibc; 91 + end 92 + {$ifdef i386} 93 + - else if FileExists(sysrootpath+'/lib/ld-linux.so.1',false) then 94 + + else if FileExists(sysrootpath+'@dynlinker-prefix@/lib/ld-linux.so.1',false) then 95 + begin 96 + - DynamicLinker:='/lib/ld-linux.so.1'; 97 + + DynamicLinker:='@dynlinker-prefix@/lib/ld-linux.so.1'; 98 + libctype:=glibc2; 99 + end 100 + {$endif i386}
+5 -1
pkgs/games/hedgewars/default.nix
··· 34 34 postPatch = '' 35 35 substituteInPlace gameServer/CMakeLists.txt \ 36 36 --replace mask evaluate 37 + 38 + # compile with fpc >= 3.2.0 39 + # https://github.com/archlinux/svntogit-community/blob/75a1b3900fb3dd553d5114bbc8474d85fd6abb02/trunk/PKGBUILD#L26 40 + sed -i 's/procedure ShiftWorld(Dir: LongInt); inline;/procedure ShiftWorld(Dir: LongInt);/' hedgewars/uWorld.pas 37 41 ''; 38 42 39 43 cmakeFlags = [ ··· 42 46 ]; 43 47 44 48 45 - # hslogger brings network-3 and network-bsd which conflict with 49 + # hslogger brings network-3 and network-bsd which conflict with 46 50 # network-2.6.3.1 47 51 preConfigure = '' 48 52 substituteInPlace gameServer/CMakeLists.txt \
+31 -4
pkgs/games/ultrastardx/default.nix
··· 1 - { stdenv, autoreconfHook, fetchFromGitHub, pkgconfig 2 - , lua, fpc, pcre, portaudio, freetype, libpng 3 - , SDL2, SDL2_image, SDL2_gfx, SDL2_mixer, SDL2_net, SDL2_ttf 4 - , ffmpeg, sqlite, zlib, libX11, libGLU, libGL }: 1 + { stdenv 2 + , autoreconfHook 3 + , fetchFromGitHub 4 + , fetchpatch 5 + , pkgconfig 6 + , lua 7 + , fpc 8 + , pcre 9 + , portaudio 10 + , freetype 11 + , libpng 12 + , SDL2 13 + , SDL2_image 14 + , SDL2_gfx 15 + , SDL2_mixer 16 + , SDL2_net, SDL2_ttf 17 + , ffmpeg 18 + , sqlite 19 + , zlib 20 + , libX11 21 + , libGLU 22 + , libGL 23 + }: 5 24 6 25 let 7 26 sharedLibs = [ ··· 22 41 23 42 nativeBuildInputs = [ pkgconfig autoreconfHook ]; 24 43 buildInputs = [ fpc libpng ] ++ sharedLibs; 44 + 45 + patches = [ 46 + (fetchpatch { 47 + name = "fpc-3.2-support.patch"; 48 + url = "https://github.com/UltraStar-Deluxe/USDX/commit/1b8e8714c1523ef49c2fd689a1545d097a3d76d7.patch"; 49 + sha256 = "02zmjymj9w1mkpf7armdpf067byvml6lprs1ca4lhpkv45abddp4"; 50 + }) 51 + ]; 25 52 26 53 postPatch = '' 27 54 substituteInPlace src/config.inc.in \