Building CLPR from source allows you to customize the build process and access the latest development features. This process uses the Darwin build system to compile and package the CLPR library.
- Git for cloning the repository
- Internet connection for downloading dependencies
- Linux environment (recommended)
First, clone the CLPR source code repository and navigate to the project directory:
git clone https://github.com/OUIsolutions/Return-Main-Precat-rio-Operation
cd Return-Main-Precat-rio-OperationThis downloads the complete source code including:
- Source files in the
src/directory - Build configuration in
darwinconf.lua - Documentation and examples
Darwin is required to build CLPR from source. It handles dependency management and compilation.
curl -L https://github.com/OUIsolutions/Darwin/releases/download/0.8.0/darwin.out -o darwin.out && sudo chmod +x darwin.out && sudo mv darwin.out /usr/bin/darwinCheck that Darwin is properly installed:
darwin --versionExecute the build process using the Darwin configuration file:
darwin run_blueprint darwinconf.lua --target allThis command will:
- Read the build configurations in the
builddirectory - Download required dependencies automatically
- Compile the source code
- Generate release files
- Generate type annotations file
After successful compilation, the following files will be generated in the release/ directory:
release/
├── embed.lua
├── lib.lua
└── types.lua
lib.lua: The main CLPR library file for standard usageembed.lua: A standalone version that can be embedded directly into other projectstypes.lua: Type annotations file of the available modules and its methods
Use lib.lua as you would use the pre-built version:
---@type ClprModule
local clpr = require("release/lib")
-- Continue with normal CLPR usageThe embed.lua file contains the complete library and can be included directly in your project without external dependencies.
- Ensure Darwin is properly installed and accessible in your PATH
- Check internet connectivity for dependency downloads
- Verify you have sufficient disk space for build artifacts
- Make sure you have write permissions in the project directory
- Run Darwin with appropriate permissions if needed
If the build fails due to missing dependencies, Darwin will typically provide clear error messages indicating what's missing. The dependencies are usually downloaded automatically during the build process.