Merge pull request #97006 from timokau/fpc-3.2.0-aarch64

fpc: 3.0.4 -> 3.2.0, add support for aarch64-linux

authored by Timo Kaufmann and committed by GitHub c25a7cd8 7ff50a7f

+185 -33
+13 -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"; 17 + } 18 + else if stdenv.hostPlatform.system == "aarch64-linux" then 19 + fetchurl { 20 + url = "mirror://sourceforge/project/freepascal/Linux/${version}/fpc-${version}.aarch64-linux.tar"; 21 + sha256 = "1h481ngg3m8nlsg9mw7rr1bn2c4sj4wzqny9bxyq3xvcral12r71"; 16 22 } 17 23 else throw "Not supported on ${stdenv.hostPlatform.system}."; 18 24 ··· 21 27 meta = { 22 28 description = "Free Pascal Compiler from a binary distribution"; 23 29 }; 24 - } 30 + }
+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
+109
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..8e46fec0 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 + @@ -164,7 +164,7 @@ begin 23 + LibrarySearchPath.AddLibraryPath(sysrootpath,'=/usr/lib/i386-linux-gnu',true); 24 + {$endif i386} 25 + {$ifdef aarch64} 26 + - LibrarySearchPath.AddLibraryPath(sysrootpath,'=/usr/lib/aarch64-linux-gnu',true); 27 + + LibrarySearchPath.AddLibraryPath(sysrootpath,'=@syslibpath@',true); 28 + {$endif aarch64} 29 + {$ifdef powerpc} 30 + LibrarySearchPath.AddLibraryPath(sysrootpath,'=/usr/lib/powerpc-linux-gnu',true); 31 + @@ -185,53 +185,53 @@ begin 32 + end; 33 + 34 + {$ifdef m68k} 35 + - const defdynlinker='/lib/ld.so.1'; 36 + + const defdynlinker='@dynlinker-prefix@/lib/ld.so.1'; 37 + {$endif m68k} 38 + 39 + {$ifdef i386} 40 + - const defdynlinker='/lib/ld-linux.so.2'; 41 + + const defdynlinker='@dynlinker-prefix@/lib/ld-linux.so.2'; 42 + {$endif} 43 + 44 + {$ifdef x86_64} 45 + - const defdynlinker='/lib64/ld-linux-x86-64.so.2'; 46 + + const defdynlinker='@dynlinker-prefix@/lib64/ld-linux-x86-64.so.2'; 47 + {$endif x86_64} 48 + 49 + {$ifdef sparc} 50 + - const defdynlinker='/lib/ld-linux.so.2'; 51 + + const defdynlinker='@dynlinker-prefix@/lib/ld-linux.so.2'; 52 + {$endif sparc} 53 + 54 + {$ifdef powerpc} 55 + - const defdynlinker='/lib/ld.so.1'; 56 + + const defdynlinker='@dynlinker-prefix@/lib/ld.so.1'; 57 + {$endif powerpc} 58 + 59 + {$ifdef powerpc64} 60 + - const defdynlinkerv1='/lib64/ld64.so.1'; 61 + - const defdynlinkerv2='/lib64/ld64.so.2'; 62 + + const defdynlinkerv1='@dynlinker-prefix@/lib64/ld64.so.1'; 63 + + const defdynlinkerv2='@dynlinker-prefix@/lib64/ld64.so.2'; 64 + var defdynlinker: string; 65 + {$endif powerpc64} 66 + 67 + {$ifdef arm} 68 + {$ifdef FPC_ARMHF} 69 + - const defdynlinker='/lib/ld-linux-armhf.so.3'; 70 + + const defdynlinker='@dynlinker-prefix@/lib/ld-linux-armhf.so.3'; 71 + {$else FPC_ARMHF} 72 + {$ifdef FPC_ARMEL} 73 + - const defdynlinker='/lib/ld-linux.so.3'; 74 + + const defdynlinker='@dynlinker-prefix@/lib/ld-linux.so.3'; 75 + {$else FPC_ARMEL} 76 + - const defdynlinker='/lib/ld-linux.so.2'; 77 + + const defdynlinker='@dynlinker-prefix@/lib/ld-linux.so.2'; 78 + {$endif FPC_ARMEL} 79 + {$endif FPC_ARMHF} 80 + {$endif arm} 81 + 82 + {$ifdef aarch64} 83 + -const defdynlinker='/lib/ld-linux-aarch64.so.1'; 84 + +const defdynlinker='@dynlinker-prefix@/lib/ld-linux-aarch64.so.1'; 85 + {$endif aarch64} 86 + 87 + {$ifdef mips} 88 + - const defdynlinker='/lib/ld.so.1'; 89 + + const defdynlinker='@dynlinker-prefix@/lib/ld.so.1'; 90 + {$endif mips} 91 + 92 + {$ifdef sparc64} 93 + - const defdynlinker='/lib64/ld-linux.so.2'; 94 + + const defdynlinker='@dynlinker-prefix@/lib64/ld-linux.so.2'; 95 + {$endif sparc64} 96 + 97 + 98 + @@ -266,9 +266,9 @@ begin 99 + libctype:=uclibc; 100 + end 101 + {$ifdef i386} 102 + - else if FileExists(sysrootpath+'/lib/ld-linux.so.1',false) then 103 + + else if FileExists(sysrootpath+'@dynlinker-prefix@/lib/ld-linux.so.1',false) then 104 + begin 105 + - DynamicLinker:='/lib/ld-linux.so.1'; 106 + + DynamicLinker:='@dynlinker-prefix@/lib/ld-linux.so.1'; 107 + libctype:=glibc2; 108 + end 109 + {$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 \
+34 -7
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 = [ ··· 12 31 13 32 in stdenv.mkDerivation rec { 14 33 pname = "ultrastardx"; 15 - version = "unstable-2019-01-07"; 34 + version = "2020.4.0"; 16 35 src = fetchFromGitHub { 17 36 owner = "UltraStar-Deluxe"; 18 37 repo = "USDX"; 19 - rev = "3df142590f29db1505cc58746af9f8cf7cb4a6a5"; 20 - sha256 = "0853rg7vppkmw37wm9xm0m0wab3r09ws6w04xs2wgwj1mwl0d70j"; 38 + rev = "v${version}"; 39 + sha256 = "0vmfv8zpyf8ymx3rjydpd7iqis080lni94vb316vfxkgvjmqbhym"; 21 40 }; 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 \
+13 -10
pkgs/tools/system/ddrescueview/default.nix
··· 1 1 { stdenv, lib, fetchurl, fpc, lazarus, atk, cairo, gdk-pixbuf, glib, gtk2, libX11, pango }: 2 2 3 - stdenv.mkDerivation rec { 4 - name = "ddrescueview-0.4alpha3"; 3 + let 4 + versionBase = "0.4"; 5 + versionSuffix = "alpha4"; 6 + in stdenv.mkDerivation rec { 7 + pname = "ddrescueview"; 8 + version = "${versionBase}${versionSuffix}"; 9 + name = "ddrescueview-0.4alpha4"; 5 10 6 11 src = fetchurl { 7 - name = "${name}.tar.xz"; 8 - url = "mirror://sourceforge/ddrescueview/ddrescueview-source-0.4%7Ealpha3.tar.xz"; 9 - sha256 = "0603jisxkswfyh93s3i20f8ns4yf83dmgmy0lg5001rvaw9mkw9j"; 12 + name = "ddrescueview-${versionBase}${versionSuffix}.tar.xz"; 13 + url = "mirror://sourceforge/ddrescueview/ddrescueview-source-${versionBase}~${versionSuffix}.tar.xz"; 14 + sha256 = "0v159nlc0lrqznbbwi7zda619is5h2rjk55gz6cl807j0kd19ycc"; 10 15 }; 16 + sourceRoot = "ddrescueview-source-${versionBase}~${versionSuffix}/source"; 11 17 12 18 nativeBuildInputs = [ fpc lazarus ]; 13 19 14 20 buildInputs = [ atk cairo gdk-pixbuf glib gtk2 libX11 pango ]; 15 - 16 - sourceRoot = "source"; 17 21 18 22 NIX_LDFLAGS = "--as-needed -rpath ${lib.makeLibraryPath buildInputs}"; 19 23 ··· 24 28 installPhase = '' 25 29 install -Dt $out/bin ddrescueview 26 30 cd ../resources/linux 27 - install -Dt $out/share/applications ddrescueview.desktop 28 - install -Dt $out/share/icons/hicolor/32x32/apps ddrescueview.xpm 29 - install -Dt $out/share/man/man1 ddrescueview.1 31 + mkdir -p "$out/share" 32 + cp -ar applications icons man $out/share 30 33 ''; 31 34 32 35 meta = with lib; {