Skip to content
Permalink
Browse files

fpc: 3.0.0 -> 3.0.2

  • Loading branch information
peterhoeg committed Jun 26, 2018
1 parent a8c7103 commit 244318bd592cf911be0c2b7842c9cc3ad616e569

This file was deleted.

@@ -1,24 +1,53 @@
{ stdenv, fetchurl }:

stdenv.mkDerivation {
name = "fpc-2.6.0-binary";

src =
if stdenv.system == "i686-linux" then
fetchurl {
url = "mirror://sourceforge/project/freepascal/Linux/2.6.0/fpc-2.6.0.i386-linux.tar";
sha256 = "08yklvrfxvk59bxsd4rh1i6s3cjn0q06dzjs94h9fbq3n1qd5zdf";
}
else if stdenv.system == "x86_64-linux" then
fetchurl {
url = "mirror://sourceforge/project/freepascal/Linux/2.6.0/fpc-2.6.0.x86_64-linux.tar";
sha256 = "0k9vi75k39y735fng4jc2vppdywp82j4qhzn7x4r6qjkad64d8lx";
}
else throw "Not supported on ${stdenv.system}.";

builder = ./binary-builder.sh;

meta = {
let
version = "3.0.4";

arch = {
"x86_64-linux" = "x86_64-linux";
"i686-linux" = "i386-linux";
}.${stdenv.system};

sha256 = {
# 2.6.4
# "x86_64-linux" = "0f9vvafjyg3pmb9hw7r62hfqjcwin9hlzj5lgx22qxvxj9pkhv0r";
"x86_64-linux" = "0xzxh689iyjfmkqkhcqg9plrjmdx82hbyywyyc7jm0n92fpmp5ky";
"i686-linux" = "111klvrfxvk59bxsd4rh1i6s3cjn0q06dzjs94h9fbq3n1qd5zdf";
}.${stdenv.system};

in stdenv.mkDerivation {
name = "fpc-binary-${version}";

src = fetchurl {
url = "mirror://sourceforge/project/freepascal/Linux/${version}/fpc-${version}.${arch}.tar";
inherit sha256;
};

dontConfigure = true;
dontBuild = true;
dontFixup = true;
dontStrip = true;

installPhase = ''
runHook preInstall
mkdir -p $out
tarballdir=$(pwd)
for i in *.tar; do tar xvf $i; done
echo "Deploying binaries..."
for i in $tarballdir/*.gz; do tar --directory=$out -xvf $i; done
echo 'Creating ppc* symlink...'
for i in $out/lib/fpc/*/ppc*; do
ln -fs $i $out/bin/$(basename $i)
done
runHook postInstall
'';

meta = with stdenv.lib; {
description = "Free Pascal Compiler from a binary distribution";
maintainers = with maintainers; [ raskin peterhoeg ];
platforms = [ "x86_64-linux" "i686-linux" ];
inherit version;
};
}
}
@@ -1,28 +1,36 @@
{ stdenv, fetchurl, gawk }:

let startFPC = import ./binary.nix { inherit stdenv fetchurl; }; in
let
isx86Linux = (stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux");
startFPC = import ./binary.nix { inherit stdenv fetchurl; };

stdenv.mkDerivation rec {
version = "3.0.0";
in stdenv.mkDerivation rec {
version = "3.0.2";
name = "fpc-${version}";

src = fetchurl {
url = "mirror://sourceforge/freepascal/fpcbuild-${version}.tar.gz";
sha256 = "1v40bjp0kvsi8y0mndqvvhnsqjfssl2w6wpfww51j4rxblfkp4fm";
# 3.0.0
# sha256 = "1111bjp0kvsi8y0mndqvvhnsqjfssl2w6wpfww51j4rxblfkp4fm";
# 3.0.2
sha256 = "0x8vajb3brmh078hxz0pydym1wbxf1dxca7lzxlh268z6q5fsqgj";
# 3.0.4
# sha256 = "0xjyhlhz846jbnp12y68c7nq4xmp4i65akfbrjyf3r62ybk18rgn";
};

buildInputs = [ startFPC gawk ];

preConfigure =
if stdenv.system == "i686-linux" || stdenv.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
'' else "";
# TODO: we need to substitute the paths here to crti.o
preConfigure = stdenv.lib.optionalString isx86Linux ''
sed -i fpcsrc/compiler/systems/t_linux.pas \
-e "s@'/lib/ld-linux[^']*'@'''@" \
-e "s@'/lib64/ld-linux[^']*'@'''@"
'';

makeFlags = "NOGDB=1 FPC=${startFPC}/bin/fpc";

installFlags = "INSTALL_PREFIX=\${out}";

postInstall = ''
for i in $out/lib/fpc/*/ppc*; do
ln -fs $i $out/bin/$(basename $i)
@@ -35,10 +43,9 @@ stdenv.mkDerivation rec {
bootstrap = startFPC;
};

meta = {
meta = with stdenv.lib; {
description = "Free Pascal Compiler from a source distribution";
maintainers = [stdenv.lib.maintainers.raskin];
platforms = stdenv.lib.platforms.linux;
inherit (startFPC.meta) maintainers platforms;
inherit version;
};
}

0 comments on commit 244318b

Please sign in to comment.
You can’t perform that action at this time.