From f3251226d1a66724c944c20b102006b540b1c8ee Mon Sep 17 00:00:00 2001 From: Cedric Lewe <0skillallluck@pm.me> Date: Thu, 7 May 2026 12:31:53 +0200 Subject: [PATCH] Fix macOS flake build broken by libfyaml.pc The nixpkgs bump in #95 pulled libfyaml-0.9.6 whose libfyaml.pc ships a stray "none required" autoconf token in Libs:, which propagates into appstream's link line on Darwin and aborts with "clang: error: no such file or directory: 'none'". appstream is a build-time dep of libadwaita, so the dev shell fails before `direnv allow` can complete. Apply a small nixpkgs overlay that strips the bad token from libfyaml's .pc files at postFixup. No-op on Linux where the token isn't emitted. --- flake.nix | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index fc5e872..69e2995 100644 --- a/flake.nix +++ b/flake.nix @@ -14,7 +14,26 @@ flake-utils.lib.eachDefaultSystem ( system: let - pkgs = import nixpkgs { inherit system; }; + # Workaround for libfyaml-0.9.6 in nixpkgs: the shipped libfyaml.pc + # contains a stray "none required" token in Libs: (an autoconf + # AC_SEARCH_LIBS artifact leaked from libfyaml.pc.in). Every consumer + # that runs `pkg-config --libs libfyaml` inherits it, and on Darwin + # clang treats "none" and "required" as missing input files, so any + # downstream build (e.g. appstream, transitively libadwaita) fails to + # link. Strip the bad token from the .pc file at fixup time. + libfyamlPcFix = final: prev: { + libfyaml = prev.libfyaml.overrideAttrs (old: { + postFixup = (old.postFixup or "") + '' + for pc in "$dev"/lib/pkgconfig/*.pc; do + substituteInPlace "$pc" --replace-quiet " none required " " " + done + ''; + }); + }; + pkgs = import nixpkgs { + inherit system; + overlays = [ libfyamlPcFix ]; + }; libraryPath = pkgs.symlinkJoin { name = "scanline-puregotk-lib-folder"; paths = with pkgs; [