--[[
 LYAML binding for Lua 5.1, 5.2, 5.3, 5.4 & 5.5
 Copyright (C) 2013-2026 Gary V. Vaughan
]]

luke_format = 0

package  = 'lyaml'
version  = '$USER'

defines  = {
   {PACKAGE = '"$package"'},
   {VERSION = '"$version"'},
   'NDEBUG',
   '_FORTIFY_SOURCE=2',
   platforms   = {
      aix      = {'_ALL_SOURCE'},
      bsd      = {'_BSD_SOURCE'},
      freebsd  = {'__BSD_VISIBLE'},
      macosx   = {'_DARWIN_C_SOURCE'},
   },
}

external_dependencies   = {
   {YAML = {
      library = {checksymbol='yaml_document_initialize', library='yaml'},
   }},
}

incdirs  = {
   'ext/include',
   '$LUA_INCDIR',
}

ldocs    = 'build-aux/config.ld.in'

modules  = {
   {['yaml'] = {
      'ext/yaml/yaml.c',
      'ext/yaml/emitter.c',
      'ext/yaml/parser.c',
      'ext/yaml/scanner.c',
   }},

   {['lyaml']            = 'lib/lyaml/init.lua'},
   {['lyaml.explicit']   = 'lib/lyaml/explicit.lua'},
   {['lyaml.functional'] = 'lib/lyaml/functional.lua'},
   {['lyaml.implicit']   = 'lib/lyaml/implicit.lua'},
}

-- `luke release` builds lyaml before committing it, without LuaRocks to
-- say where libyaml and lua.h are, so pass them yourself.  With
-- Homebrew, for example:
--
--    build-aux/luke release version=X.Y YAML_DIR=/opt/homebrew \
--       LUA_INCDIR=/opt/homebrew/include/lua5.5
release  = {
   news               = 'NEWS.md',
   rockspec           = 'lyaml-dev-1.rockspec',
   check_dependencies = true,
   add                = {'doc/api/'},
   replacements       = {
      {['README.md']  = {
         {['?branch=master'] = '?branch=release-v@version@'},
      }},
   },
   ['gh-pages']       = {
      {api          = 'doc/api/'},
      {['index.md'] = 'doc/lyaml.md'},
      '_config.yml.in',
   },
}
