Otok public index

apotocki/flex

apotocki/flex 2.6.4 (r1, windows)

Library
flex
Variant
windows, target windows
Channel
stable
Published
2026-11-14
Recipe source
https://github.com/otok-dev/recipes.git
5da01945f38d9afb64726f84ba66490b8096ee16 in recipes/flex/2.6/windows/
Recipe SHA-256
89392cbd81b2bd4b46e3e3f49eb9bf684e7f3a8c73a18fe0790bbaadb4348760

Recipe files changed

Inputs

source.sha2568e1b71e037b524ba3f576babb0cf59182061df1f19cd86112f085a882560f60b
source.urlhttps://github.com/lexxmark/winflexbison/archive/refs/tags/v2.5.25.tar.gz

Platforms

windows

Toolchains

Recipe files

build.lua 971 bytes · raw
-- winflexbison's CMake project, its win_flex only. Its cmake_minimum_required(3.0) is below what CMake 4 accepts, hence
-- CMAKE_POLICY_VERSION_MINIMUM; it puts its programs in bin/<configuration> of the source, not in the build directory,
-- and installs them with the rest of its package flat into the prefix: the program is copied instead.
function build(slice, options, deps)
    otok.cmake{ defines = { CMAKE_POLICY_VERSION_MINIMUM = "3.5" }, targets = { "win_flex" }, install = false }
    local built = otok.glob("bin/**/win_flex.exe", slice.source)
    if #built ~= 1 then error("win_flex.exe not found once in bin/ of the source (" .. #built .. " found)") end
    local program = slice.prefix .. "/bin/win_flex.exe"
    otok.copy(built[1], program)
    -- the header of C++ scanners (%option c++), which they include
    otok.copy(slice.source .. "/flex/src/FlexLexer.h", slice.prefix .. "/include/FlexLexer.h")
    return { programs = { flex = program } }
end
recipe.toml 1219 bytes · raw
# The otok recipe of flex (https://github.com/apotocki/otok): the flex program for the builds of other recipes and for
# projects that deliver it ([tool-deps.flex] with `deliver`), on Windows: win_flex of winflexbison, flex for Windows
# built with MSVC, with m4 built in, no runtime of MSYS2 or Cygwin.
[recipe]
api = 1
library = "flex"
name = "flex"
version = "2.6.4"
revision = 1
# win_flex links the m4 and gnulib code of winflexbison's common library, GPL-3.0-or-later
license = "BSD-3-Clause-flex AND GPL-3.0-or-later"
license-files = ["flex/src/COPYING", "COPYING"]
homepage = "https://github.com/westes/flex"
documentation = "https://westes.github.io/flex/manual/"
description = "flex, the fast lexical analyzer generator: win_flex of winflexbison."
keywords = ["lexer", "parser", "generator", "tool"]

[tool]
programs = ["flex"]

[source]
url = "https://github.com/lexxmark/winflexbison/archive/refs/tags/v2.5.25.tar.gz"
sha256 = "8e1b71e037b524ba3f576babb0cf59182061df1f19cd86112f085a882560f60b"

[platforms]
supported = ["windows"]
build-on = ["windows/msvc"]

[toolchains]
cmake = { version = ">= 3.20", default-recipe = "apotocki/cmake" }
ninja = { version = ">= 1.10", default-recipe = "apotocki/ninja" }