diff options
Diffstat (limited to 'nixpkgs/pkgs/development/compilers/fpc')
-rw-r--r-- | nixpkgs/pkgs/development/compilers/fpc/binary.nix | 20 | ||||
-rw-r--r-- | nixpkgs/pkgs/development/compilers/fpc/default.nix | 19 | ||||
-rw-r--r-- | nixpkgs/pkgs/development/compilers/fpc/lazarus.nix | 2 | ||||
-rw-r--r-- | nixpkgs/pkgs/development/compilers/fpc/libqt5pas.nix | 24 | ||||
-rw-r--r-- | nixpkgs/pkgs/development/compilers/fpc/mark-paths.patch | 109 |
5 files changed, 158 insertions, 16 deletions
diff --git a/nixpkgs/pkgs/development/compilers/fpc/binary.nix b/nixpkgs/pkgs/development/compilers/fpc/binary.nix index f160150d8b5..c7e3ec30b49 100644 --- a/nixpkgs/pkgs/development/compilers/fpc/binary.nix +++ b/nixpkgs/pkgs/development/compilers/fpc/binary.nix @@ -1,18 +1,24 @@ { stdenv, fetchurl }: -stdenv.mkDerivation { - name = "fpc-3.0.0-binary"; +stdenv.mkDerivation rec { + pname = "fpc-binary"; + version = "3.2.0"; src = if stdenv.hostPlatform.system == "i686-linux" then fetchurl { - url = "mirror://sourceforge/project/freepascal/Linux/3.0.0/fpc-3.0.0.i386-linux.tar"; - sha256 = "0h3f1dgs1zsx7vvk9kg67anjvgw5sslfbmjblif7ishbcp3k3g5k"; + url = "mirror://sourceforge/project/freepascal/Linux/${version}/fpc-${version}.i386-linux.tar"; + sha256 = "0y0510b2fbxbqz28967xx8b023k6q9fv5yclfrc1yc9mg8fyn411"; } else if stdenv.hostPlatform.system == "x86_64-linux" then fetchurl { - url = "mirror://sourceforge/project/freepascal/Linux/3.0.0/fpc-3.0.0.x86_64-linux.tar"; - sha256 = "1m2xx3nda45cb3zidbjgdr8kddd19zk0khvp7xxdlclszkqscln9"; + url = "mirror://sourceforge/project/freepascal/Linux/${version}/fpc-${version}-x86_64-linux.tar"; + sha256 = "0gfbwjvjqlx0562ayyl08khagslrws758al2yhbi4bz5rzk554ni"; + } + else if stdenv.hostPlatform.system == "aarch64-linux" then + fetchurl { + url = "mirror://sourceforge/project/freepascal/Linux/${version}/fpc-${version}.aarch64-linux.tar"; + sha256 = "1h481ngg3m8nlsg9mw7rr1bn2c4sj4wzqny9bxyq3xvcral12r71"; } else throw "Not supported on ${stdenv.hostPlatform.system}."; @@ -21,4 +27,4 @@ stdenv.mkDerivation { meta = { description = "Free Pascal Compiler from a binary distribution"; }; -} +} diff --git a/nixpkgs/pkgs/development/compilers/fpc/default.nix b/nixpkgs/pkgs/development/compilers/fpc/default.nix index 42804677dc0..6e7ffefca21 100644 --- a/nixpkgs/pkgs/development/compilers/fpc/default.nix +++ b/nixpkgs/pkgs/development/compilers/fpc/default.nix @@ -3,23 +3,26 @@ let startFPC = import ./binary.nix { inherit stdenv fetchurl; }; in stdenv.mkDerivation rec { - version = "3.0.4"; + version = "3.2.0"; pname = "fpc"; src = fetchurl { url = "mirror://sourceforge/freepascal/fpcbuild-${version}.tar.gz"; - sha256 = "0xjyhlhz846jbnp12y68c7nq4xmp4i65akfbrjyf3r62ybk18rgn"; + sha256 = "0f38glyn3ffmqww432snhx2b8wyrq0yj1njkp4zh56lqrvm19fgr"; }; buildInputs = [ startFPC gawk ]; glibc = stdenv.cc.libc.out; - preConfigure = - if stdenv.hostPlatform.system == "i686-linux" || stdenv.hostPlatform.system == "x86_64-linux" then '' - sed -e "s@'/lib/ld-linux[^']*'@'''@" -i fpcsrc/compiler/systems/t_linux.pas - 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 - '' else ""; + # Patch paths for linux systems. Other platforms will need their own patches. + patches = [ + ./mark-paths.patch # mark paths for later substitution in postPatch + ]; + postPatch = '' + # 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" ]; diff --git a/nixpkgs/pkgs/development/compilers/fpc/lazarus.nix b/nixpkgs/pkgs/development/compilers/fpc/lazarus.nix index 701dcae2fcf..31a0727da90 100644 --- a/nixpkgs/pkgs/development/compilers/fpc/lazarus.nix +++ b/nixpkgs/pkgs/development/compilers/fpc/lazarus.nix @@ -37,7 +37,7 @@ stdenv.mkDerivation rec { postInstall = '' wrapProgram $out/bin/startlazarus --prefix NIX_LDFLAGS ' ' \ "$(echo "$NIX_LDFLAGS" | sed -re 's/-rpath [^ ]+//g')" \ - --prefix NIX_${binutils.infixSalt}_LDFLAGS ' ' \ + --prefix NIX_LDFLAGS_${binutils.suffixSalt} ' ' \ "$(echo "$NIX_LDFLAGS" | sed -re 's/-rpath [^ ]+//g')" \ --prefix LCL_PLATFORM ' ' "$LCL_PLATFORM" \ --prefix PATH ':' "${fpc}/bin:${gdb}/bin:${gnumake}/bin:${binutils}/bin" diff --git a/nixpkgs/pkgs/development/compilers/fpc/libqt5pas.nix b/nixpkgs/pkgs/development/compilers/fpc/libqt5pas.nix new file mode 100644 index 00000000000..82cdd394e78 --- /dev/null +++ b/nixpkgs/pkgs/development/compilers/fpc/libqt5pas.nix @@ -0,0 +1,24 @@ +{ stdenv, lazarus, qt5 }: + +stdenv.mkDerivation { + pname = "libqt5pas"; + inherit (lazarus) version src; + + sourceRoot = "lazarus/lcl/interfaces/qt5/cbindings"; + + postPatch = '' + substituteInPlace Qt5Pas.pro \ + --replace "target.path = \$\$[QT_INSTALL_LIBS]" "target.path = $out/lib" + ''; + + nativeBuildInputs = with qt5; [ qmake ]; + + buildInputs = with qt5; [ qtbase qtx11extras ]; + + meta = with stdenv.lib; { + description = "Free Pascal Qt5 binding library"; + homepage = "https://wiki.freepascal.org/Qt5_Interface#libqt5pas"; + maintainers = with maintainers; [ sikmir ]; + inherit (lazarus.meta) license platforms; + }; +} diff --git a/nixpkgs/pkgs/development/compilers/fpc/mark-paths.patch b/nixpkgs/pkgs/development/compilers/fpc/mark-paths.patch new file mode 100644 index 00000000000..707c5352de7 --- /dev/null +++ b/nixpkgs/pkgs/development/compilers/fpc/mark-paths.patch @@ -0,0 +1,109 @@ +diff --git a/fpcsrc/compiler/systems/t_linux.pas b/fpcsrc/compiler/systems/t_linux.pas +index a7398fb9..8e46fec0 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} +@@ -164,7 +164,7 @@ begin + LibrarySearchPath.AddLibraryPath(sysrootpath,'=/usr/lib/i386-linux-gnu',true); + {$endif i386} + {$ifdef aarch64} +- LibrarySearchPath.AddLibraryPath(sysrootpath,'=/usr/lib/aarch64-linux-gnu',true); ++ LibrarySearchPath.AddLibraryPath(sysrootpath,'=@syslibpath@',true); + {$endif aarch64} + {$ifdef powerpc} + LibrarySearchPath.AddLibraryPath(sysrootpath,'=/usr/lib/powerpc-linux-gnu',true); +@@ -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} |