cross: xdg-utils: build xdg-screensaver, and simplify a bit

This commit is contained in:
2024-02-13 08:05:26 +00:00
parent 9c18aa2765
commit 44c2f8bcc0
2 changed files with 15 additions and 20 deletions

View File

@@ -26,6 +26,11 @@ let
// (if title != null then { name = title; } else {}) // (if title != null then { name = title; } else {})
) else null; ) else null;
in [ in [
(fetchpatch' {
saneCommit = "20c9492d303be7cbad560e3d83bc47ab4b1e93f7";
title = "procmail: support cross compilation";
hash = "sha256-cC9GBF5tCeJ2GDSjMjlG4hYStIJPEoRBAK9/KhJiiIo=";
})
(fetchpatch' { (fetchpatch' {
# fixes build on moby by avoiding broken `lockfileProgs` # fixes build on moby by avoiding broken `lockfileProgs`
prUrl = "https://github.com/NixOS/nixpkgs/pull/286533"; prUrl = "https://github.com/NixOS/nixpkgs/pull/286533";
@@ -33,13 +38,6 @@ in [
hash = "sha256-IAt07OSGaX8QHaOzlmYFTZJpvmXjYFA6/IFPsMzQVW8="; hash = "sha256-IAt07OSGaX8QHaOzlmYFTZJpvmXjYFA6/IFPsMzQVW8=";
merged.staging = "202402061152"; 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' { (fetchpatch' {
prUrl = "https://github.com/NixOS/nixpkgs/pull/280925"; prUrl = "https://github.com/NixOS/nixpkgs/pull/280925";
title = "j4-dmenu-desktop: pin to gcc12"; # 2024/01/14: fix build title = "j4-dmenu-desktop: pin to gcc12"; # 2024/01/14: fix build

View File

@@ -2302,16 +2302,11 @@ in with final; {
# 2023/07/30: upstreaming is blocked on unar (gnustep), unless i also make that optional # 2023/07/30: upstreaming is blocked on unar (gnustep), unless i also make that optional
xarchiver = mvToNativeInputs [ libxslt ] prev.xarchiver; 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 xdg-utils = let
buildResholve = buildPackages.resholve.overrideAttrs (resholve': { buildResholve = buildPackages.resholve.overrideAttrs (resholve': {
meta = (resholve'.meta or { }) // { knownVulnerabilities = [ ]; }; meta = (resholve'.meta or { }) // { knownVulnerabilities = [ ]; };
}); });
in (prev.xdg-utils.override { in (prev.xdg-utils.override {
procmail = emptyDirectory; #< does not cross compile, but only used by xdg-screensaver
resholve = buildResholve; resholve = buildResholve;
}).overrideAttrs (xdg-utils': let }).overrideAttrs (xdg-utils': let
patchedResholve = buildResholve.overrideAttrs (resholve': { patchedResholve = buildResholve.overrideAttrs (resholve': {
@@ -2328,14 +2323,16 @@ in with final; {
# ''; # '';
# have to patch all `resholve` invocations AGAIN because even though `buildPackages.resholve` is the right architecture now, # have to patch all `resholve` invocations AGAIN because even though `buildPackages.resholve` is the right architecture now,
preFixup = lib.replaceStrings [ # the `resholve` passthru args refer to itself, in a way which `overrideAttrs` can't patch.
"${buildResholve}/bin/resholve --overwrite bin/xdg-screensaver" #< fails to resholve when optional `procmail` dep isn't available # also, xdg-screensaver resholve fails because `perl -e` is treated differently on native v.s. cross,
"${buildResholve}/bin/resholve" # so "fake" it as external and then manually patch it (resholve has a better way to do that, but not easily patchable from here).
] [ preFixup = (lib.replaceStrings
"${patchedResholve}/bin/resholve --version" [ "${buildResholve}/bin/resholve" "RESHOLVE_FAKE='external:" ]
"${patchedResholve}/bin/resholve" [ "${patchedResholve}/bin/resholve" "RESHOLVE_FAKE='external:perl;" ]
] xdg-utils'.preFixup) + ''
xdg-utils'.preFixup; substituteInPlace $out/bin/xdg-screensaver \
--replace-fail ' perl -e' ' ${perl}/bin/perl -e'
'';
} }
); );
} }