From 65b9e349212e9f929f98e83a65a4591887baa659 Mon Sep 17 00:00:00 2001 From: star9029 Date: Sun, 10 Nov 2024 14:13:02 +0800 Subject: [PATCH] flex: fix include --- packages/f/flex/xmake.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/f/flex/xmake.lua b/packages/f/flex/xmake.lua index 2104b513b..c59acc50e 100644 --- a/packages/f/flex/xmake.lua +++ b/packages/f/flex/xmake.lua @@ -15,6 +15,15 @@ package("flex") add_urls("https://github.com/westes/flex/releases/download/v$(version)/flex-$(version).tar.gz") end + on_fetch(function (package) + -- If pacman::flex already installed + if is_subhost("msys") and package:is_library() then + local msys_dir = os.getenv("MINGW_PREFIX") + local header = path.join(path.directory(msys_dir), "usr/include/FlexLexer.h") + os.trycp(header, package:installdir("include")) + end + end) + on_load("macosx", "linux", "bsd", "windows", "@msys", function (package) if package:is_plat("windows") then package:add("deps", "winflexbison", {private = true})