push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
pkgdir=$(pwd)/pkg
deploydir=$(pwd)/deploy
undmg $src
mkdir $out
mkdir $pkgdir
mkdir $deploydir
pkg=*.mpkg/Contents/Packages/*.pkg
xar -xf $pkg -C $pkgdir
pushd $deploydir
cat $pkgdir/Payload | gunzip -dc | cpio -i
popd
echo $deploydir
cp -r $deploydir/usr/local/* $out

View File

@@ -0,0 +1,12 @@
tar xf $src
cd */
tarballdir=$(pwd)
for i in *.tar; do tar xvf $i; done
echo "Deploying binaries.."
mkdir $out
cd $out
for i in $tarballdir/*.gz; do tar xvf $i; done
echo 'Creating ppc* symlink..'
for i in $out/lib/fpc/*/ppc*; do
ln -fs $i $out/bin/$(basename $i)
done

View File

@@ -0,0 +1,55 @@
{
stdenv,
fetchurl,
undmg,
cpio,
xar,
lib,
}:
stdenv.mkDerivation rec {
pname = "fpc-binary";
version = "3.2.2";
src =
if stdenv.hostPlatform.system == "i686-linux" then
fetchurl {
url = "mirror://sourceforge/project/freepascal/Linux/${version}/fpc-${version}.i386-linux.tar";
sha256 = "f62980ac0b2861221f79fdbff67836aa6912a4256d4192cfa4dfa0ac5b419958";
}
else if stdenv.hostPlatform.system == "x86_64-linux" then
fetchurl {
url = "mirror://sourceforge/project/freepascal/Linux/${version}/fpc-${version}.x86_64-linux.tar";
sha256 = "5adac308a5534b6a76446d8311fc340747cbb7edeaacfe6b651493ff3fe31e83";
}
else if stdenv.hostPlatform.system == "aarch64-linux" then
fetchurl {
url = "mirror://sourceforge/project/freepascal/Linux/${version}/fpc-${version}.aarch64-linux.tar";
sha256 = "b39470f9b6b5b82f50fc8680a5da37d2834f2129c65c24c5628a80894d565451";
}
else if stdenv.hostPlatform.isDarwin then
fetchurl {
url = "mirror://sourceforge/project/freepascal/Mac%20OS%20X/${version}/fpc-${version}.intelarm64-macosx.dmg";
sha256 = "05d4510c8c887e3c68de20272abf62171aa5b2ef1eba6bce25e4c0bc41ba8b7d";
}
else
throw "Not supported on ${stdenv.hostPlatform.system}.";
nativeBuildInputs = lib.optionals stdenv.hostPlatform.isDarwin [
undmg
xar
cpio
];
builder =
if stdenv.hostPlatform.isLinux then
./binary-builder.sh
else if stdenv.hostPlatform.isDarwin then
./binary-builder-darwin.sh
else
throw "Not supported on ${stdenv.hostPlatform}.";
meta = {
description = "Free Pascal Compiler from a binary distribution";
};
}

View File

@@ -0,0 +1,119 @@
{
lib,
stdenv,
fetchurl,
gawk,
fetchpatch,
undmg,
cpio,
xar,
libiconv,
}:
let
startFPC = import ./binary.nix {
inherit
stdenv
fetchurl
undmg
cpio
xar
lib
;
};
in
stdenv.mkDerivation rec {
version = "3.2.2";
pname = "fpc";
src = fetchurl {
url = "mirror://sourceforge/freepascal/fpcbuild-${version}.tar.gz";
sha256 = "85ef993043bb83f999e2212f1bca766eb71f6f973d362e2290475dbaaf50161f";
};
buildInputs = [
startFPC
gawk
];
glibc = stdenv.cc.libc.out;
# Patch paths for linux systems. Other platforms will need their own patches.
patches = [
./mark-paths.patch # mark paths for later substitution in postPatch
]
++ lib.optional stdenv.hostPlatform.isAarch64 (fetchpatch {
# backport upstream patch for aarch64 glibc 2.34
url = "https://gitlab.com/freepascal.org/fpc/source/-/commit/a20a7e3497bccf3415bf47ccc55f133eb9d6d6a0.patch";
hash = "sha256-xKTBwuOxOwX9KCazQbBNLhMXCqkuJgIFvlXewHY63GM=";
stripLen = 1;
extraPrefix = "fpcsrc/";
});
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"
substituteInPlace fpcsrc/compiler/systems/t_darwin.pas \
--replace-fail "LibrarySearchPath.AddLibraryPath(sysrootpath,'=/usr/lib',true)" "LibrarySearchPath.AddLibraryPath(sysrootpath,'$SDKROOT/usr/lib',true)"
# Replace the `codesign --remove-signature` command with a custom script, since `codesign` is not available
# in nixpkgs
# Remove the -no_uuid strip flag which does not work on llvm-strip, only
# Apple strip.
substituteInPlace fpcsrc/compiler/Makefile \
--replace \
"\$(CODESIGN) --remove-signature" \
"${./remove-signature.sh}" \
--replace "ifneq (\$(CODESIGN),)" "ifeq (\$(OS_TARGET), darwin)" \
--replace "-no_uuid" ""
'';
preConfigure = lib.optionalString stdenv.hostPlatform.isDarwin ''
NIX_LDFLAGS="-syslibroot $SDKROOT -L${lib.getLib libiconv}/lib"
'';
makeFlags = [
"NOGDB=1"
"FPC=${startFPC}/bin/fpc"
];
# disabled by default in fpcsrc/compiler/llvm/agllvm.pas
hardeningDisable = [ "pie" ];
installFlags = [ "INSTALL_PREFIX=\${out}" ];
postInstall = ''
for i in $out/lib/fpc/*/ppc*; do
ln -fs $i $out/bin/$(basename $i)
done
mkdir -p $out/lib/fpc/etc/
$out/lib/fpc/*/samplecfg $out/lib/fpc/${version} $out/lib/fpc/etc/
# Generate config files in /etc since on darwin, ppc* does not follow symlinks
# to resolve the location of /etc
mkdir -p $out/etc
$out/lib/fpc/*/samplecfg $out/lib/fpc/${version} $out/etc
'';
passthru = {
bootstrap = startFPC;
};
meta = with lib; {
description = "Free Pascal Compiler from a source distribution";
homepage = "https://www.freepascal.org";
maintainers = [ maintainers.raskin ];
license = with licenses; [
gpl2
lgpl2
];
platforms = platforms.unix;
# See:
# * <https://gitlab.com/freepascal.org/fpc/source/-/issues/41045>
# * <https://gitlab.com/freepascal.org/fpc/source/-/merge_requests/887>
broken = stdenv.cc.isClang && stdenv.hostPlatform.isx86_64;
};
}

View File

@@ -0,0 +1,155 @@
{
stdenv,
lib,
fetchurl,
makeWrapper,
writeText,
fpc,
gtk2,
glib,
pango,
atk,
gdk-pixbuf,
libXi,
xorgproto,
libX11,
libXext,
gdb,
gnumake,
binutils,
withQt ? false,
qtbase ? null,
libqtpas ? null,
wrapQtAppsHook ? null,
}:
# TODO:
# 1. the build date is embedded in the binary through `$I %DATE%` - we should dump that
let
version = "4.0-0";
# as of 2.0.10 a suffix is being added. That may or may not disappear and then
# come back, so just leave this here.
majorMinorPatch = v: builtins.concatStringsSep "." (lib.take 2 (lib.splitVersion v));
overrides = writeText "revision.inc" (
lib.concatStringsSep "\n" (
lib.mapAttrsToList (k: v: "const ${k} = '${v}';") {
# this is technically the SVN revision but as we don't have that replace
# it with the version instead of showing "Unknown"
RevisionStr = version;
}
)
);
qtVersion = lib.versions.major qtbase.version;
in
stdenv.mkDerivation rec {
pname = "lazarus-${LCL_PLATFORM}";
inherit version;
src = fetchurl {
url = "mirror://sourceforge/lazarus/Lazarus%20Zip%20_%20GZip/Lazarus%20${majorMinorPatch version}/lazarus-${version}.tar.gz";
hash = "sha256-vIM7RxzXqCYSiavND1OhFjuMcG5FmD+zq6kmEiM5z8s=";
};
postPatch = ''
cp ${overrides} ide/${overrides.name}
'';
buildInputs = [
# we need gtk2 unconditionally as that is the default target when building applications with lazarus
fpc
gtk2
glib
libXi
xorgproto
libX11
libXext
pango
atk
stdenv.cc
gdk-pixbuf
]
++ lib.optionals withQt [
libqtpas
qtbase
];
# Disable parallel build, errors:
# Fatal: (1018) Compilation aborted
enableParallelBuilding = false;
nativeBuildInputs = [
makeWrapper
]
++ lib.optional withQt wrapQtAppsHook;
makeFlags = [
"FPC=fpc"
"PP=fpc"
"LAZARUS_INSTALL_DIR=${placeholder "out"}/share/lazarus/"
"INSTALL_PREFIX=${placeholder "out"}/"
"REQUIRE_PACKAGES+=tachartlazaruspkg"
"bigide"
];
LCL_PLATFORM = if withQt then "qt${qtVersion}" else "gtk2";
NIX_LDFLAGS = lib.concatStringsSep " " (
[
"-L${lib.getLib stdenv.cc.cc}/lib"
"-lX11"
"-lXext"
"-lXi"
"-latk-1.0"
"-lc"
"-lcairo"
"-lgcc_s"
"-lgdk-x11-2.0"
"-lgdk_pixbuf-2.0"
"-lglib-2.0"
"-lgtk-x11-2.0"
"-lpango-1.0"
]
++ lib.optionals withQt [
"-L${lib.getLib libqtpas}/lib"
"-lQt${qtVersion}Pas"
]
);
preBuild = ''
mkdir -p $out/share "$out/lazarus"
tar xf ${fpc.src} --strip-components=1 -C $out/share -m
substituteInPlace ide/packages/ideconfig/include/unix/lazbaseconf.inc \
--replace '/usr/fpcsrc' "$out/share/fpcsrc"
'';
postInstall =
let
ldFlags = ''$(echo "$NIX_LDFLAGS" | sed -re 's/-rpath [^ ]+//g')'';
in
''
wrapProgram $out/bin/startlazarus \
--prefix NIX_LDFLAGS ' ' "${ldFlags}" \
--prefix NIX_LDFLAGS_${binutils.suffixSalt} ' ' "${ldFlags}" \
--prefix LCL_PLATFORM ' ' "$LCL_PLATFORM" \
--prefix PATH ':' "${
lib.makeBinPath [
fpc
gdb
gnumake
binutils
]
}"
'';
meta = with lib; {
description = "Graphical IDE for the FreePascal language";
homepage = "https://www.lazarus.freepascal.org";
license = licenses.gpl2Plus;
maintainers = with maintainers; [ raskin ];
platforms = platforms.linux;
};
}

View File

@@ -0,0 +1,44 @@
{
stdenv,
lib,
lazarus,
qmake,
qtbase,
# Not in Qt6 anymore
qtx11extras ? null,
}:
let
qtVersion = lib.versions.major qtbase.version;
in
stdenv.mkDerivation {
pname = "libqtpas";
inherit (lazarus) version src;
sourceRoot = "lazarus/lcl/interfaces/qt${qtVersion}/cbindings";
postPatch = ''
substituteInPlace Qt${qtVersion}Pas.pro \
--replace 'target.path = $$[QT_INSTALL_LIBS]' "target.path = $out/lib"
'';
nativeBuildInputs = [ qmake ];
buildInputs = [
qtbase
]
++ lib.optionals (qtVersion == "5") [
qtx11extras
];
dontWrapQtApps = true;
meta = with lib; {
description = "Free Pascal Qt${qtVersion} binding library";
homepage =
"https://wiki.freepascal.org/Qt${qtVersion}_Interface"
+ lib.optionalString (qtVersion == "5") "#libqt5pas";
maintainers = with maintainers; [ sikmir ];
inherit (lazarus.meta) license platforms;
};
}

View File

@@ -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}
@@ -165,7 +165,7 @@ begin
{$endif i386}
{$ifdef aarch64}
LibrarySearchPath.AddLibraryPath(sysrootpath,'=/usr/lib64',true);
- 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);
@@ -186,53 +186,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}
@@ -267,9 +267,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}

View File

@@ -0,0 +1 @@
codesign_allocate -r -i "$1" -o "$1"