cross: fix xdg-utils

This commit is contained in:
Colin 2024-02-13 02:43:36 +00:00
parent 4458a74e4c
commit 9c18aa2765
2 changed files with 51 additions and 0 deletions

View File

@ -26,6 +26,20 @@ let
// (if title != null then { name = title; } else {})
) else null;
in [
(fetchpatch' {
# fixes build on moby by avoiding broken `lockfileProgs`
prUrl = "https://github.com/NixOS/nixpkgs/pull/286533";
title = "xdg-utils: remove unnecessary input";
hash = "sha256-IAt07OSGaX8QHaOzlmYFTZJpvmXjYFA6/IFPsMzQVW8=";
merged.staging = "202402061152";
})
(fetchpatch' {
# fixes resholve/xdg-utils build on moby
# probably not actually necessary (but removing this now will trigger a large rebuild)
prUrl = "https://github.com/NixOS/nixpkgs/pull/287755";
title = "Remove rebuild-avoiding conditionals in resholve musl fixes";
hash = "sha256-hKuwLyw81wiHTuc9EyqEWCt9GvbGYdEfP1OP+KYvYJw=";
})
(fetchpatch' {
prUrl = "https://github.com/NixOS/nixpkgs/pull/280925";
title = "j4-dmenu-desktop: pin to gcc12"; # 2024/01/14: fix build

View File

@ -2301,4 +2301,41 @@ in with final; {
# 2023/07/30: upstreaming is blocked on unar (gnustep), unless i also make that optional
xarchiver = mvToNativeInputs [ libxslt ] prev.xarchiver;
# used by xdg-utils/resholve; can probably be folded or removed entirely, by simply using `buildPackages.resholve`
binlore = prev.binlore.override {
inherit (buildPackages) yallback yara;
};
xdg-utils = let
buildResholve = buildPackages.resholve.overrideAttrs (resholve': {
meta = (resholve'.meta or { }) // { knownVulnerabilities = [ ]; };
});
in (prev.xdg-utils.override {
procmail = emptyDirectory; #< does not cross compile, but only used by xdg-screensaver
resholve = buildResholve;
}).overrideAttrs (xdg-utils': let
patchedResholve = buildResholve.overrideAttrs (resholve': {
# resholve tries to exec `sed` and `awk`. this triggers inscrutable python2.7-specific errors.
postPatch = (resholve'.postPatch or "") + ''
substituteInPlace resholve \
--replace-fail 'p = Popen(' 'return False; p = Popen('
'';
});
in {
# postPatch = (xdg-utils'.postPatch or "") + ''
# substituteInPlace scripts/xdg-screensaver.in \
# --replace-fail 'lockfile_command=`command -v lockfile`' 'lockfile_command='
# '';
# have to patch all `resholve` invocations AGAIN because even though `buildPackages.resholve` is the right architecture now,
preFixup = lib.replaceStrings [
"${buildResholve}/bin/resholve --overwrite bin/xdg-screensaver" #< fails to resholve when optional `procmail` dep isn't available
"${buildResholve}/bin/resholve"
] [
"${patchedResholve}/bin/resholve --version"
"${patchedResholve}/bin/resholve"
]
xdg-utils'.preFixup;
}
);
}