- Podman installed (or Docker as alternative)
- Darwin 0.15.0+ installed
- Git repository cloned
- Dependencies installed with
darwin installfrom Source
Build Darwin from source code for development or custom deployments.
- Customize Darwin for your specific needs
- Contribute to Darwin development
- Learn how Darwin works internally
- Get latest features before official releases
Perfect for quick testing or when you just need a working binary
# Download and compile in one step
curl -L https://github.com/OUIsolutions/Darwin/releases/download/0.15.0/darwin.c -o darwin.c && gcc darwin.c -o darwin.outThat's it! You now have a working darwin.out executable.
- Podman installed (or Docker as alternative)
- Darwin 0.15.0+ installed
- Git repository cloned
# Clone the repository
git clone https://github.com/OUIsolutions/Darwin.git
cd Darwin
# Install dependencies first (required before running blueprints)
darwin install
# Linux static build (small, portable)
darwin run_blueprint --target linux_bin
# RPM-based static build (RedHat, Fedora, CentOS)
darwin run_blueprint --target rpm_static_build
# Debian static build (Ubuntu, Debian)
darwin run_blueprint --target debian_static_build# Install dependencies first (required before running blueprints)
darwin install
# Windows 32-bit build
darwin run_blueprint --target windowsi32_build
# Install dependencies first (required before running blueprints)
darwin install
# Build all Linux variants
darwin run_blueprint --target linux_bin rpm_static_build debian_static_build
# Build all Windows variants
darwin run_blueprint --target windowsi32_build windows64_build
# Build everything at once
darwin run_blueprint --target allWhat you get:
release/linux_bin.out- Linux executablerelease/windows64.exe/release/windowsi32.exe- Windows executablesrelease/amalgamation.c- Source amalgamation
Why Containers? They provide consistent build environments regardless of your host system!
- GCC compiler
- Git repository cloned
# Clone repository
git clone https://github.com/OUIsolutions/Darwin.git
cd Darwin
# Install dependencies first (required before running blueprints)
darwin install
# Generate amalgamation and compile with GCC
darwin run_blueprint --target amalgamation
# The above generates release/amalgamation.c, then compile it:
gcc release/amalgamation.c -o release/darwin.out# Install required packages
sudo apt update
sudo apt install -y gcc git curl podman
# Install Darwin if you don't have it
curl -L https://github.com/OUIsolutions/Darwin/releases/download/0.15.0/darwin.out -o darwin.out
sudo chmod +x darwin.out
sudo mv darwin.out /usr/bin/darwin# Install required packages
sudo dnf install -y gcc git curl podman
# Install Darwin
curl -L https://github.com/OUIsolutions/Darwin/releases/download/0.15.0/darwin.out -o darwin.out
sudo chmod +x darwin.out
sudo mv darwin.out /usr/bin/darwinWhen to use: You only need the C source code
# Clone repository
git clone https://github.com/OUIsolutions/Darwin.git
cd Darwin
# Install dependencies first (required before running blueprints)
darwin install
# Generate only the C amalgamation
darwin run_blueprint --target amalgamationOutput: release/amalgamation.c - Complete C source code in a single file
# Compile with your preferred settings
gcc release/amalgamation.c -o darwin.out
# Or with optimizations
gcc -O3 -DNDEBUG release/amalgamation.c -o darwin.out
# Or statically linked
gcc -static release/amalgamation.c -o darwin.outbuilds/
├── amalgamation_build.lua # Generate C amalgamation
├── linux_bin.lua # Linux static binary
├── debian_static_build.lua # Debian package
├── rpm_static_build.lua # RPM package
├── windowsi32_build.lua # Windows 32-bit binary
└── windows64_build.lua # Windows 64-bit binary
| Target | What it does | Output | Container |
|---|---|---|---|
amalgamation |
Generate C amalgamation | release/amalgamation.c |
No |
linux_bin |
Linux static build | release/linux_bin.out |
Yes |
debian_static_build |
Debian package build | release/debian_static.deb |
Yes |
rpm_static_build |
RPM package build | release/rpm_static_build.rpm |
Yes |
windowsi32_build |
Windows 32-bit build | release/windowsi32.exe |
Yes |
windows64_build |
Windows 64-bit build | release/windows64.exe |
Yes |
- Install Dependencies - Run
darwin installto set up required dependencies - Dependency Collection - Gather all required C files
- Amalgamation - Combine into single C file
- Container Setup - Prepare build environment (if using containers)
- Compilation - Build executable with appropriate flags
- Testing - Verify the build works correctly
- Packaging - Place results in
release/folder
# Install Darwin first
curl -L https://github.com/OUIsolutions/Darwin/releases/download/0.15.0/darwin.out -o darwin.out
sudo chmod +x darwin.out
sudo mv darwin.out /usr/bin/darwin# Install Podman on Ubuntu/Debian
sudo apt update
sudo apt install -y podman
# Install Podman on Fedora/RHEL
sudo dnf install -y podman
# Install Podman on Arch Linux
sudo pacman -S podman# Check Podman/Docker is running
podman --version
# or
docker --version
# Check if you can pull images
podman pull alpine:latest
# or
docker pull alpine:latest
# The blueprint system will automatically choose the available container engine# Make sure you have permissions
sudo chmod +x darwin.out
# For container builds, check user permissions
sudo usermod -aG podman $USER
# Log out and log back in# Check you have all dependencies
gcc --version
podman --version
darwin --version # Should be 0.020 or higher
# For GCC builds, ensure you have development tools
sudo apt install build-essential # Ubuntu/Debian
sudo dnf groupinstall "Development Tools" # Fedora/RHELNote: The new blueprint system handles containerization automatically based on your system configuration.
# The containerization is handled internally by the blueprint system
# Install dependencies first (required)
darwin install
# Simply run your desired target
darwin run_blueprint --target linux_bin
# All builds work with the available container engine (Podman/Docker)
darwin run_blueprint --target windowsi32_build windows64_build| Build Type | Benefits |
|---|---|
linux_bin |
Small, secure, fully static |
debian_static_build |
Compatible, well-tested |
rpm_static_build |
Enterprise-ready |
windowsi32_build |
Legacy Windows support |
windows64_build |
Modern Windows support |
Edit the build scripts to add custom flags:
-- In builds/amalgamation_build.lua, modify the compilation section
local custom_flags = "-O3 -march=native -DCUSTOM_FEATURE"
-- Add your custom flags to the compilation commandAdd your own C libraries to the build:
-- In builds/amalgamation_build.lua
project.add_c_include("my_custom_lib.h")
project.add_c_file("my_custom_lib.c")Create different Darwin versions:
# Debug build (amalgamation only)
CFLAGS="-g -DDEBUG" darwin run_blueprint --target amalgamation
gcc -g -DDEBUG release/amalgamation.c -o darwin_debug.out- Make Changes to Darwin source code
- Rebuild using your preferred method
- Test the new functionality
- Repeat until satisfied
# Quick development cycle
edit_source_files()
# Install dependencies first (required)
darwin install
# Generate amalgamation and compile
darwin run_blueprint build/ --mode folder amalgamation_build
gcc release/darwin.c -o release/darwin.out
# Test
./release/darwin.out test_script.lua -o test.out
./test.out# Create test scripts
echo 'print("Testing custom Darwin")' > test1.lua
echo 'print("Feature test:", 42 + 58)' > test2.lua
# Test compilation
./release/darwin.out test1.lua -o test1.out
./release/darwin.out test2.lua -o test2.out
# Run tests
./test1.out
./test2.out