Skip to content

Latest commit

 

History

History
113 lines (72 loc) · 2.94 KB

File metadata and controls

113 lines (72 loc) · 2.94 KB

Building CLPR From Source

Overview

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.

Prerequisites

  • Git for cloning the repository
  • Internet connection for downloading dependencies
  • Linux environment (recommended)

Build Process

Step 1: Clone the Repository

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-Operation

This downloads the complete source code including:

  • Source files in the src/ directory
  • Build configuration in darwinconf.lua
  • Documentation and examples

Step 2: Install Darwin Build System

Darwin is required to build CLPR from source. It handles dependency management and compilation.

Linux Installation

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/darwin

Verify Installation

Check that Darwin is properly installed:

darwin --version

Step 3: Build the Project

Execute the build process using the Darwin configuration file:

darwin run_blueprint darwinconf.lua --target all

This command will:

  • Read the build configurations in the build directory
  • Download required dependencies automatically
  • Compile the source code
  • Generate release files
  • Generate type annotations file

Step 4: Verify Build Output

After successful compilation, the following files will be generated in the release/ directory:

release/
├── embed.lua
├── lib.lua
└── types.lua

Generated Files

  • lib.lua: The main CLPR library file for standard usage
  • embed.lua: A standalone version that can be embedded directly into other projects
  • types.lua: Type annotations file of the available modules and its methods

Using the Built Library

Standard Usage

Use lib.lua as you would use the pre-built version:

---@type ClprModule
local clpr = require("release/lib")

-- Continue with normal CLPR usage

Embedded Usage

The embed.lua file contains the complete library and can be included directly in your project without external dependencies.

Troubleshooting

Build Failures

  • 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

Permission Issues

  • Make sure you have write permissions in the project directory
  • Run Darwin with appropriate permissions if needed

Missing Dependencies

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.