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,13 @@
diff --git a/imake.c b/imake.c
index c20cd4a..ec2589b 100644
--- a/imake.c
+++ b/imake.c
@@ -959,7 +959,7 @@ get_libc_version(FILE *inFile)
{
char aout[4096], *tmpdir;
FILE *fp;
- const char *format = "%s -o %s -x c -";
+ const char *format = "f=$(mktemp imakeXXXXXX.c); cat > $f; %s $f -o %s";
char *cc;
int len;
char *command;

View File

@@ -0,0 +1,41 @@
Disable imake autodetection for:
- LinuxDistribution to avoid injection of /usr paths
- gcc to avoid use uf /usr/bin/gcc
https://github.com/NixOS/nixpkgs/issues/135337
--- a/imake.c
+++ b/imake.c
@@ -1065,6 +1065,7 @@ get_distrib(FILE *inFile)
fprintf (inFile, "%s\n", "#define LinuxWare 11");
fprintf (inFile, "%s\n", "#define LinuxYggdrasil 12");
+#if 0 /* disable system autodetection. Fall through to LinuxUnknown. */
# ifdef CROSSCOMPILE
if (CrossCompiling) {
fprintf (inFile, "%s\n",
@@ -1090,6 +1091,7 @@ get_distrib(FILE *inFile)
* at the content of /etc/debian_version */
return;
}
+#endif
/* what's the definitive way to tell what any particular distribution is? */
fprintf (inFile, "%s\n", "#define DefaultLinuxDistribution LinuxUnknown");
@@ -1337,6 +1339,7 @@ get_gcc_version(FILE *inFile, char *name)
static boolean
get_gcc(char *cmd)
{
+#if 0 /* disable gcc autodetection. Fall through to explicitly set. */
struct stat sb;
static const char* gcc_path[] = {
#if defined(linux) || \
@@ -1385,6 +1388,9 @@ get_gcc(char *cmd)
}
}
return FALSE;
+#endif
+ strcpy (cmd, IMAKE_COMPILETIME_CPP);
+ return TRUE;
}
#ifdef CROSSCOMPILE

View File

@@ -0,0 +1,99 @@
{
lib,
stdenv,
fetchurl,
fetchpatch,
tradcpp,
xorg-cf-files,
pkg-config,
xorgproto,
writeScript,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "imake";
version = "1.0.10";
src = fetchurl {
url = "mirror://xorg/individual/util/imake-${finalAttrs.version}.tar.xz";
hash = "sha256-dd7LzqjXs1TPNq3JZ15TxHkO495WoUvYe0LI6KrS7PU=";
};
patches = [
# Disable imake autodetection for:
# - LinuxDistribution to avoid injection of /usr paths
# - gcc to avoid use uf /usr/bin/gcc
# https://github.com/NixOS/nixpkgs/issues/135337
./disable-autodetection.patch
# uberhack to workaround broken 'gcc -x c'
#
# Our cc-wrapper is broken whenever the '-x' flag is used:
# 'gcc -x c foo.c -o bar' doesn't work the same way as 'gcc foo.c -o bar'
# does. (Try both with NIX_DEBUG=1.)
#
# What happens is that passing '-x' causes linker-related flags (such as
# -Wl,-dynamic-linker) not to be added, just like if '-c' is passed.
# The bug happens outside the multiple-outputs branch as well, but it
# doesn't break imake there. It only breaks in multiple-outputs because
# linking without -Wl,-dynamic-linker produces a binary with an invalid
# ELF interpreter path. (Which arguably, is a bug in its own.)
# (copied from the commit message on 0100b270694ecab8aaa13fa5f3d30639b50d7777)
./cc-wrapper-uberhack.patch
# Add support for RISC-V
(fetchpatch {
url = "https://gitlab.freedesktop.org/xorg/util/imake/-/commit/a37ee515742f58359b4248742fa06d504f2dce1b.patch";
hash = "sha256-2aoXBm1JmNjS5vqGKEyX/qYUVJ8kYIzh/eq3WKU3uQ4=";
})
# Add support for LoongArch
(fetchpatch {
url = "https://gitlab.freedesktop.org/xorg/util/imake/-/commit/b4d568b7aa2db5525f63b1bc9486dc5e2ed36bd0.patch";
hash = "sha256-m35H3v5IFslqx5QaszPFAJ+g2HfDYyxbX+h+7/8/59M=";
})
];
strictDeps = true;
nativeBuildInputs = [ pkg-config ];
buildInputs = [ xorgproto ];
configureFlags = [
"ac_cv_path_RAWCPP=${stdenv.cc.targetPrefix}cpp"
];
env = {
CFLAGS = "-DIMAKE_COMPILETIME_CPP='\"${
if stdenv.hostPlatform.isDarwin then "${tradcpp}/bin/cpp" else "gcc"
}\"'";
};
preInstall = ''
mkdir -p $out/lib/X11/config
ln -s ${xorg-cf-files}/lib/X11/config/* $out/lib/X11/config
'';
inherit tradcpp xorg-cf-files;
setupHook = ./setup-hook.sh;
passthru = {
updateScript = writeScript "update-${finalAttrs.pname}" ''
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p common-updater-scripts
version="$(list-directory-versions --pname ${finalAttrs.pname} \
--url https://xorg.freedesktop.org/releases/individual/util/ \
| sort -V | tail -n1)"
update-source-version ${finalAttrs.pname} "$version"
'';
};
meta = {
description = "Obsolete C preprocessor interface to the make utility";
homepage = "https://gitlab.freedesktop.org/xorg/util/imake";
license = with lib.licenses; [
mitOpenGroup
x11
];
mainProgram = "imake";
maintainers = [ ];
platforms = lib.platforms.unix;
};
})

View File

@@ -0,0 +1,19 @@
export IMAKECPP="@tradcpp@/bin/tradcpp"
imakeConfigurePhase() {
runHook preConfigure
echoCmd 'configuring with imake'
if [ -z "${imakefile:-}" -a ! -e Imakefile ]; then
echo "no Imakefile, doing nothing"
else
xmkmf -a
fi
runHook postConfigure
}
if [ -z "${dontUseImakeConfigure-}" -a -z "${configurePhase-}" ]; then
configurePhase=imakeConfigurePhase
fi