{
    "name": "lua-5.4",
    "buildsystem": "simple",
    "build-commands": [
        "make -j $FLATPAK_BUILDER_N_JOBS CFLAGS=\"$CFLAGS -fPIC -DLUA_USE_LINUX\" linux",
        "make TO_LIB=liblua.so.5.4.6 INSTALL_TOP=$FLATPAK_DEST install",
        "ln -sf liblua.so.5.4.6 $FLATPAK_DEST/lib/liblua.so",
        "ln -sf liblua.so.5.4.6 $FLATPAK_DEST/lib/liblua.so.5.4",
        "make INSTALL_TOP=${FLATPAK_DEST} pc > lua.pc",
        "cat lua.pc.in >> lua.pc",
        "install -Dm644 lua.pc $FLATPAK_DEST/lib/pkgconfig/lua.pc",
        "ln -sf lua.pc $FLATPAK_DEST/lib/pkgconfig/lua54.pc",
        "ln -sf lua.pc $FLATPAK_DEST/lib/pkgconfig/lua5.4.pc",
        "ln -sf lua.pc $FLATPAK_DEST/lib/pkgconfig/lua-5.4.pc"
    ],
    "sources": [
        {
            "type": "archive",
            "url": "https://www.lua.org/ftp/lua-5.4.6.tar.gz",
            "sha256": "7d5ea1b9cb6aa0b59ca3dde1c6adcb57ef83a1ba8e5432c0ecd06bf439b3ad88"
        },
        {
            "type": "patch",
            "path": "makefile-add-liblua.so-rule.patch"
        },
        {
            "type": "file",
            "path": "lua.pc.in"
        },
        {
            "type": "patch",
            "path": "luaconf.patch"
        }
    ],
    "cleanup": [
        "/bin",
        "/include",
        "/lib/pkgconfig",
        "/man"
    ]
}
