{
    "name": "lua-5.3",
    "buildsystem": "simple",
    "build-commands": [
        "make -j $FLATPAK_BUILDER_N_JOBS CFLAGS=\"$CFLAGS -fPIC -DLUA_USE_LINUX\" linux",
        "make TO_LIB=liblua.so.5.3.5 INSTALL_TOP=$FLATPAK_DEST install",
        "ln -sf liblua.so.5.3.5 $FLATPAK_DEST/lib/liblua.so",
        "ln -sf liblua.so.5.3.5 $FLATPAK_DEST/lib/liblua.so.5.3",
        "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/lua53.pc",
        "ln -sf lua.pc $FLATPAK_DEST/lib/pkgconfig/lua5.3.pc",
        "ln -sf lua.pc $FLATPAK_DEST/lib/pkgconfig/lua-5.3.pc"
    ],
    "sources": [
        {
            "type": "archive",
            "url": "https://www.lua.org/ftp/lua-5.3.5.tar.gz",
            "sha256": "0c2eed3f960446e1a3e4b9a1ca2f3ff893b6ce41942cf54d5dd59ab4b3b058ac"
        },
        {
            "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"
    ]
}
