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.
This commit is contained in:
parent
596de92ca7
commit
f928b91f34
5 changed files with 155 additions and 20 deletions
|
@ -1,18 +1,19 @@
|
||||||
{ stdenv, fetchurl }:
|
{ stdenv, fetchurl }:
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation rec {
|
||||||
name = "fpc-3.0.0-binary";
|
pname = "fpc-binary";
|
||||||
|
version = "3.2.0";
|
||||||
|
|
||||||
src =
|
src =
|
||||||
if stdenv.hostPlatform.system == "i686-linux" then
|
if stdenv.hostPlatform.system == "i686-linux" then
|
||||||
fetchurl {
|
fetchurl {
|
||||||
url = "mirror://sourceforge/project/freepascal/Linux/3.0.0/fpc-3.0.0.i386-linux.tar";
|
url = "mirror://sourceforge/project/freepascal/Linux/${version}/fpc-${version}.i386-linux.tar";
|
||||||
sha256 = "0h3f1dgs1zsx7vvk9kg67anjvgw5sslfbmjblif7ishbcp3k3g5k";
|
sha256 = "0y0510b2fbxbqz28967xx8b023k6q9fv5yclfrc1yc9mg8fyn411";
|
||||||
}
|
}
|
||||||
else if stdenv.hostPlatform.system == "x86_64-linux" then
|
else if stdenv.hostPlatform.system == "x86_64-linux" then
|
||||||
fetchurl {
|
fetchurl {
|
||||||
url = "mirror://sourceforge/project/freepascal/Linux/3.0.0/fpc-3.0.0.x86_64-linux.tar";
|
url = "mirror://sourceforge/project/freepascal/Linux/${version}/fpc-${version}-x86_64-linux.tar";
|
||||||
sha256 = "1m2xx3nda45cb3zidbjgdr8kddd19zk0khvp7xxdlclszkqscln9";
|
sha256 = "0gfbwjvjqlx0562ayyl08khagslrws758al2yhbi4bz5rzk554ni";
|
||||||
}
|
}
|
||||||
else throw "Not supported on ${stdenv.hostPlatform.system}.";
|
else throw "Not supported on ${stdenv.hostPlatform.system}.";
|
||||||
|
|
||||||
|
|
|
@ -3,23 +3,26 @@
|
||||||
let startFPC = import ./binary.nix { inherit stdenv fetchurl; }; in
|
let startFPC = import ./binary.nix { inherit stdenv fetchurl; }; in
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
version = "3.0.4";
|
version = "3.2.0";
|
||||||
pname = "fpc";
|
pname = "fpc";
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "mirror://sourceforge/freepascal/fpcbuild-${version}.tar.gz";
|
url = "mirror://sourceforge/freepascal/fpcbuild-${version}.tar.gz";
|
||||||
sha256 = "0xjyhlhz846jbnp12y68c7nq4xmp4i65akfbrjyf3r62ybk18rgn";
|
sha256 = "0f38glyn3ffmqww432snhx2b8wyrq0yj1njkp4zh56lqrvm19fgr";
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [ startFPC gawk ];
|
buildInputs = [ startFPC gawk ];
|
||||||
glibc = stdenv.cc.libc.out;
|
glibc = stdenv.cc.libc.out;
|
||||||
|
|
||||||
preConfigure =
|
# Patch paths for linux systems. Other platforms will need their own patches.
|
||||||
if stdenv.hostPlatform.system == "i686-linux" || stdenv.hostPlatform.system == "x86_64-linux" then ''
|
patches = [
|
||||||
sed -e "s@'/lib/ld-linux[^']*'@'''@" -i fpcsrc/compiler/systems/t_linux.pas
|
./mark-paths.patch # mark paths for later substitution in postPatch
|
||||||
sed -e "s@'/lib64/ld-linux[^']*'@'''@" -i fpcsrc/compiler/systems/t_linux.pas
|
];
|
||||||
sed -e "s@/lib64[^']*@${glibc}/lib@" -i fpcsrc/compiler/systems/t_linux.pas
|
postPatch = ''
|
||||||
'' else "";
|
# substitute the markers set by the mark-paths patch
|
||||||
|
substituteInPlace fpcsrc/compiler/systems/t_linux.pas --subst-var-by dynlinker-prefix "${glibc}"
|
||||||
|
substituteInPlace fpcsrc/compiler/systems/t_linux.pas --subst-var-by syslibpath "${glibc}/lib"
|
||||||
|
'';
|
||||||
|
|
||||||
makeFlags = [ "NOGDB=1" "FPC=${startFPC}/bin/fpc" ];
|
makeFlags = [ "NOGDB=1" "FPC=${startFPC}/bin/fpc" ];
|
||||||
|
|
||||||
|
|
100
pkgs/development/compilers/fpc/mark-paths.patch
Normal file
100
pkgs/development/compilers/fpc/mark-paths.patch
Normal file
|
@ -0,0 +1,100 @@
|
||||||
|
diff --git a/fpcsrc/compiler/systems/t_linux.pas b/fpcsrc/compiler/systems/t_linux.pas
|
||||||
|
index a7398fb9..a1e41ecb 100644
|
||||||
|
--- a/fpcsrc/compiler/systems/t_linux.pas
|
||||||
|
+++ b/fpcsrc/compiler/systems/t_linux.pas
|
||||||
|
@@ -135,13 +135,13 @@ begin
|
||||||
|
LibrarySearchPath.AddLibraryPath(sysrootpath,'=/usr/lib64',true);
|
||||||
|
{ /lib64 should be the really first, so add it before everything else }
|
||||||
|
LibrarySearchPath.AddLibraryPath(sysrootpath,'=/lib',true);
|
||||||
|
- LibrarySearchPath.AddLibraryPath(sysrootpath,'=/lib64',true);
|
||||||
|
+ LibrarySearchPath.AddLibraryPath(sysrootpath,'=@syslibpath@',true);
|
||||||
|
{$else}
|
||||||
|
{$ifdef powerpc64}
|
||||||
|
if target_info.abi<>abi_powerpc_elfv2 then
|
||||||
|
- LibrarySearchPath.AddLibraryPath(sysrootpath,'=/lib64;=/usr/lib64;=/usr/X11R6/lib64',true)
|
||||||
|
+ LibrarySearchPath.AddLibraryPath(sysrootpath,'=/@syslibpath@;=/usr/lib64;=/usr/X11R6/lib64',true)
|
||||||
|
else
|
||||||
|
- LibrarySearchPath.AddLibraryPath(sysrootpath,'=/lib64;=/usr/lib/powerpc64le-linux-gnu;=/usr/X11R6/powerpc64le-linux-gnu',true);
|
||||||
|
+ LibrarySearchPath.AddLibraryPath(sysrootpath,'=/@syslibpath@;=/usr/lib/powerpc64le-linux-gnu;=/usr/X11R6/powerpc64le-linux-gnu',true);
|
||||||
|
{$else powerpc64}
|
||||||
|
LibrarySearchPath.AddLibraryPath(sysrootpath,'=/lib;=/usr/lib;=/usr/X11R6/lib',true);
|
||||||
|
{$endif powerpc64}
|
||||||
|
@@ -185,53 +185,53 @@ begin
|
||||||
|
end;
|
||||||
|
|
||||||
|
{$ifdef m68k}
|
||||||
|
- const defdynlinker='/lib/ld.so.1';
|
||||||
|
+ const defdynlinker='@dynlinker-prefix@/lib/ld.so.1';
|
||||||
|
{$endif m68k}
|
||||||
|
|
||||||
|
{$ifdef i386}
|
||||||
|
- const defdynlinker='/lib/ld-linux.so.2';
|
||||||
|
+ const defdynlinker='@dynlinker-prefix@/lib/ld-linux.so.2';
|
||||||
|
{$endif}
|
||||||
|
|
||||||
|
{$ifdef x86_64}
|
||||||
|
- const defdynlinker='/lib64/ld-linux-x86-64.so.2';
|
||||||
|
+ const defdynlinker='@dynlinker-prefix@/lib64/ld-linux-x86-64.so.2';
|
||||||
|
{$endif x86_64}
|
||||||
|
|
||||||
|
{$ifdef sparc}
|
||||||
|
- const defdynlinker='/lib/ld-linux.so.2';
|
||||||
|
+ const defdynlinker='@dynlinker-prefix@/lib/ld-linux.so.2';
|
||||||
|
{$endif sparc}
|
||||||
|
|
||||||
|
{$ifdef powerpc}
|
||||||
|
- const defdynlinker='/lib/ld.so.1';
|
||||||
|
+ const defdynlinker='@dynlinker-prefix@/lib/ld.so.1';
|
||||||
|
{$endif powerpc}
|
||||||
|
|
||||||
|
{$ifdef powerpc64}
|
||||||
|
- const defdynlinkerv1='/lib64/ld64.so.1';
|
||||||
|
- const defdynlinkerv2='/lib64/ld64.so.2';
|
||||||
|
+ const defdynlinkerv1='@dynlinker-prefix@/lib64/ld64.so.1';
|
||||||
|
+ const defdynlinkerv2='@dynlinker-prefix@/lib64/ld64.so.2';
|
||||||
|
var defdynlinker: string;
|
||||||
|
{$endif powerpc64}
|
||||||
|
|
||||||
|
{$ifdef arm}
|
||||||
|
{$ifdef FPC_ARMHF}
|
||||||
|
- const defdynlinker='/lib/ld-linux-armhf.so.3';
|
||||||
|
+ const defdynlinker='@dynlinker-prefix@/lib/ld-linux-armhf.so.3';
|
||||||
|
{$else FPC_ARMHF}
|
||||||
|
{$ifdef FPC_ARMEL}
|
||||||
|
- const defdynlinker='/lib/ld-linux.so.3';
|
||||||
|
+ const defdynlinker='@dynlinker-prefix@/lib/ld-linux.so.3';
|
||||||
|
{$else FPC_ARMEL}
|
||||||
|
- const defdynlinker='/lib/ld-linux.so.2';
|
||||||
|
+ const defdynlinker='@dynlinker-prefix@/lib/ld-linux.so.2';
|
||||||
|
{$endif FPC_ARMEL}
|
||||||
|
{$endif FPC_ARMHF}
|
||||||
|
{$endif arm}
|
||||||
|
|
||||||
|
{$ifdef aarch64}
|
||||||
|
-const defdynlinker='/lib/ld-linux-aarch64.so.1';
|
||||||
|
+const defdynlinker='@dynlinker-prefix@/lib/ld-linux-aarch64.so.1';
|
||||||
|
{$endif aarch64}
|
||||||
|
|
||||||
|
{$ifdef mips}
|
||||||
|
- const defdynlinker='/lib/ld.so.1';
|
||||||
|
+ const defdynlinker='@dynlinker-prefix@/lib/ld.so.1';
|
||||||
|
{$endif mips}
|
||||||
|
|
||||||
|
{$ifdef sparc64}
|
||||||
|
- const defdynlinker='/lib64/ld-linux.so.2';
|
||||||
|
+ const defdynlinker='@dynlinker-prefix@/lib64/ld-linux.so.2';
|
||||||
|
{$endif sparc64}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -266,9 +266,9 @@ begin
|
||||||
|
libctype:=uclibc;
|
||||||
|
end
|
||||||
|
{$ifdef i386}
|
||||||
|
- else if FileExists(sysrootpath+'/lib/ld-linux.so.1',false) then
|
||||||
|
+ else if FileExists(sysrootpath+'@dynlinker-prefix@/lib/ld-linux.so.1',false) then
|
||||||
|
begin
|
||||||
|
- DynamicLinker:='/lib/ld-linux.so.1';
|
||||||
|
+ DynamicLinker:='@dynlinker-prefix@/lib/ld-linux.so.1';
|
||||||
|
libctype:=glibc2;
|
||||||
|
end
|
||||||
|
{$endif i386}
|
|
@ -34,6 +34,10 @@ mkDerivation rec {
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
substituteInPlace gameServer/CMakeLists.txt \
|
substituteInPlace gameServer/CMakeLists.txt \
|
||||||
--replace mask evaluate
|
--replace mask evaluate
|
||||||
|
|
||||||
|
# compile with fpc >= 3.2.0
|
||||||
|
# https://github.com/archlinux/svntogit-community/blob/75a1b3900fb3dd553d5114bbc8474d85fd6abb02/trunk/PKGBUILD#L26
|
||||||
|
sed -i 's/procedure ShiftWorld(Dir: LongInt); inline;/procedure ShiftWorld(Dir: LongInt);/' hedgewars/uWorld.pas
|
||||||
'';
|
'';
|
||||||
|
|
||||||
cmakeFlags = [
|
cmakeFlags = [
|
||||||
|
|
|
@ -1,7 +1,26 @@
|
||||||
{ stdenv, autoreconfHook, fetchFromGitHub, pkgconfig
|
{ stdenv
|
||||||
, lua, fpc, pcre, portaudio, freetype, libpng
|
, autoreconfHook
|
||||||
, SDL2, SDL2_image, SDL2_gfx, SDL2_mixer, SDL2_net, SDL2_ttf
|
, fetchFromGitHub
|
||||||
, ffmpeg, sqlite, zlib, libX11, libGLU, libGL }:
|
, fetchpatch
|
||||||
|
, pkgconfig
|
||||||
|
, lua
|
||||||
|
, fpc
|
||||||
|
, pcre
|
||||||
|
, portaudio
|
||||||
|
, freetype
|
||||||
|
, libpng
|
||||||
|
, SDL2
|
||||||
|
, SDL2_image
|
||||||
|
, SDL2_gfx
|
||||||
|
, SDL2_mixer
|
||||||
|
, SDL2_net, SDL2_ttf
|
||||||
|
, ffmpeg
|
||||||
|
, sqlite
|
||||||
|
, zlib
|
||||||
|
, libX11
|
||||||
|
, libGLU
|
||||||
|
, libGL
|
||||||
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
sharedLibs = [
|
sharedLibs = [
|
||||||
|
@ -23,6 +42,14 @@ in stdenv.mkDerivation rec {
|
||||||
nativeBuildInputs = [ pkgconfig autoreconfHook ];
|
nativeBuildInputs = [ pkgconfig autoreconfHook ];
|
||||||
buildInputs = [ fpc libpng ] ++ sharedLibs;
|
buildInputs = [ fpc libpng ] ++ sharedLibs;
|
||||||
|
|
||||||
|
patches = [
|
||||||
|
(fetchpatch {
|
||||||
|
name = "fpc-3.2-support.patch";
|
||||||
|
url = "https://github.com/UltraStar-Deluxe/USDX/commit/1b8e8714c1523ef49c2fd689a1545d097a3d76d7.patch";
|
||||||
|
sha256 = "02zmjymj9w1mkpf7armdpf067byvml6lprs1ca4lhpkv45abddp4";
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
substituteInPlace src/config.inc.in \
|
substituteInPlace src/config.inc.in \
|
||||||
--subst-var-by libpcre_LIBNAME libpcre.so.1
|
--subst-var-by libpcre_LIBNAME libpcre.so.1
|
||||||
|
|
Loading…
Reference in a new issue