lol

musl-obstack: fix build on darwin

usertam dc44a14c 7b7a9a6a

+32 -1
+27
pkgs/by-name/mu/musl-obstack/0001-ignore-obstack_free-alias-on-darwin.patch
··· 1 + From 44679bc1a03302aa6b1eb19220d9723e9e0e4d3f Mon Sep 17 00:00:00 2001 2 + From: usertam <code@usertam.dev> 3 + Date: Fri, 16 May 2025 23:29:41 +0800 4 + Subject: [PATCH] ignore obstack_free alias on darwin 5 + 6 + clang will complain "error: aliases are not supported on darwin". 7 + --- 8 + obstack.c | 2 ++ 9 + 1 file changed, 2 insertions(+) 10 + 11 + diff --git a/obstack.c b/obstack.c 12 + index 1f2f4c7..b9be9dd 100644 13 + --- a/obstack.c 14 + +++ b/obstack.c 15 + @@ -294,7 +294,9 @@ _obstack_free (struct obstack *h, void *obj) 16 + abort (); 17 + } 18 + 19 + +#ifndef __APPLE__ 20 + extern __typeof(_obstack_free) obstack_free __attribute__((alias("_obstack_free"))); 21 + +#endif 22 + 23 + _OBSTACK_SIZE_T 24 + _obstack_memory_used (struct obstack *h) 25 + -- 26 + 2.48.1 27 +
+5 -1
pkgs/by-name/mu/musl-obstack/package.nix
··· 17 17 sha256 = "sha256-oydS7FubUniMHAUWfg84OH9+CZ0JCrTXy7jzwOyJzC8="; 18 18 }; 19 19 20 + patches = lib.optionals stdenv.isDarwin [ 21 + ./0001-ignore-obstack_free-alias-on-darwin.patch 22 + ]; 23 + 20 24 nativeBuildInputs = [ 21 25 autoreconfHook 22 26 pkg-config ··· 27 31 meta = with lib; { 28 32 homepage = "https://github.com/void-linux/musl-obstack"; 29 33 description = "An extraction of the obstack functions and macros from GNU libiberty for use with musl-libc"; 30 - platforms = platforms.linux; 34 + platforms = platforms.unix; 31 35 license = licenses.lgpl21Plus; 32 36 maintainers = [ maintainers.pjjw ]; 33 37 };