{"id":23273207,"url":"https://github.com/rafalh/mtasa_txbuild","last_synced_at":"2025-04-06T10:24:30.734Z","repository":{"id":64573805,"uuid":"337565349","full_name":"rafalh/mtasa_txbuild","owner":"rafalh","description":"Build tools required to build scripts for Toxic server in Multi Theft Auto: San Andreas.","archived":false,"fork":false,"pushed_at":"2022-12-10T20:21:57.000Z","size":1424,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-12T15:53:19.035Z","etag":null,"topics":["mtasa","mtasa-lua","multi-theft-auto"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rafalh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-02-09T23:31:57.000Z","updated_at":"2023-06-30T19:30:49.000Z","dependencies_parsed_at":"2022-12-13T17:32:26.914Z","dependency_job_id":null,"html_url":"https://github.com/rafalh/mtasa_txbuild","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafalh%2Fmtasa_txbuild","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafalh%2Fmtasa_txbuild/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafalh%2Fmtasa_txbuild/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafalh%2Fmtasa_txbuild/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rafalh","download_url":"https://codeload.github.com/rafalh/mtasa_txbuild/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247465751,"owners_count":20943247,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mtasa","mtasa-lua","multi-theft-auto"],"created_at":"2024-12-19T19:33:21.244Z","updated_at":"2025-04-06T10:24:30.698Z","avatar_url":"https://github.com/rafalh.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"Toxic Build\n===========\n\nTool used for MTA resources compilation based on meta.xml.\n\nUsage\n-----\nDefine environment variable `TXBUILD` as path to directory where this repository has been cloned.\n\nIn every resource source directory create Makefile:\n\n\tPROJECT_NAME := \u003cresource name\u003e\n\tPROJECT_DIR  := \u003cresource organizational directory\u003e\n\n\tinclude $(TXBUILD)/generic.mak\n\nIn root source directory for all resources create `config.mak` file (customize example for your needs):\n\n\tSELF := $(dir $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)))\n\n\tPREPROCESS     := 1\n\tCOMPILE        := 1\n\tUTF8_BOM       := 0\n\tJOIN           := 0\n\tPROTECT        := 1\n\tLOADER_PATH    := $(SELF)loader.lua\n\tifeq ($(windir),)\n\t RESOURCES_PATH := /mnt/c/Program\\ Files\\ (x86)/MTA\\ San\\ Andreas\\ 1.5/server/mods/deathmatch/resources/\n\telse\n\t RESOURCES_PATH := C:/Program\\ Files\\ (x86)/MTA\\ San\\ Andreas\\ 1.5/server/mods/deathmatch/resources/\n\tendif\n\tTEMP_DIR       := build\n\nCompile resource using Make tool. On Windows you need mingw32-make (included in txbuild). For example:\n\n\t$(TXBUILD)\\mingw32-make\n\nConfiguration properties\n------------------------\n\nBehaviour of txbuild can be defined in `config.mak` files in resource directory or up to 3 levels higher in filesystem hierarchy. Configuration files on higher level has lower priority. File can define any set of following optional variables:\n\n* `PREPROCESS` - run preprocessor on every Lua file. See description of preprocessor below.\n* `COMPILE` - compile Lua files using luac_mta tool\n* `UTF8_BOM` - add UTF8 BOM to final Lua scripts\n* `JOIN` - join all Lua scripts into one big script - recommended to increase difficulty of reverse engineering\n* `PROTECT` - protect scripts by embedding them for loading by custom loader specified in `LOADER_PATH`\n* `RESOURCES_PATH` - destination path for compiled resources\n* `TEMP_DIR` - name of directory used for building\n\nPreprocessor\n------------\n\nPreprocessor runs every line starting with `#` and evaluates expressions `$(...)`. See examples below.\n\nConditional compilation:\n\n\t#if FEATURE_A\n\taddCommandHandler('a', ...)\n\t#end\n\nIncluding other file:\n\n\t#include 'a.lua'\n\nCompile-time constants:\n\n\t#define TIMEOUT 200\n\n\tsetTimer(function () end, $(TIMEOUT))\n\nProtection with loader\n----------------------\nLoader is a preprocessed Lua script used for additional protection of scripts. If `PROTECT` is set to 1 every Lua script is returned as embedded in custom loader defined using `LOADER_PATH` variable in `config.mak`. When preprocessing loader file preprocessor variable `__LUA_CHUNK_TBL__` contains table of strings from input Lua file. Loader can use preprocessor to encrypt those lines and embedd them for future execution in runtime.\n\nBuilding\n--------\nToxic Build consists of some native components that needs to be built using a C++ compiler. The project uses CMake build system. Source code is in `src` directory.\n\nOn Windows Visual Studio can be used for building (it has CMake support built-in). Alternatively MinGW can be used with a separate CMake GUI tool. Building can be avoided by downloading `txbuild-bin-win32.zip` file from [Releases](https://github.com/rafalh/mtasa_txbuild/releases) page and unpacking it in the root directory (preserving `bin` subdirectory).\n\nOn Linux GCC and CMake can be installed from distribution package manager.\n\nTo build on Ubuntu run:\n\n```bash\nsudo apt-get install build-essentials cmake\nmkdir build\ncmake ../src -DCMAKE_BUILD_TYPE=Release\nmake\n```\n\nCopyright\n---------\nCopyright (c) 2012 Rafał Harabień\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frafalh%2Fmtasa_txbuild","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frafalh%2Fmtasa_txbuild","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frafalh%2Fmtasa_txbuild/lists"}