Skip to content
HebaruSan edited this page Aug 13, 2022 · 4 revisions

Building CKAN from the main repo is simple, but may be non-obvious to new users. This guide will explain how to build the most recent version of CKAN from source.

Build Requirements

First, check the Build Environment page to make sure you have all the tools you need to run the build process on your platform.

Build process

Clone remote repository

Next clone a copy of the code from the repo. If using command line git:

git clone --depth 1 https://github.com/KSP-CKAN/CKAN.git
cd CKAN

Build the executable

  1. cd to CKAN directory and pull the latest commits:

    cd path/to/CKAN/
    git pull
    
  2. Remove _build/ directory, if exists:

    rm -rf _build
    
  3. Run cake build script. For Windows:

    1. Open Powershell

    2. Make the build script runnable:

      Set-ExecutionPolicy -ExecutionPolicy Unrestricted
      
    3. Run the build script:

      .\build.ps1
      

    For Linux or macOS:

    ./build
    

    If nothing failed, the new ckan.exe will reside in the CKAN/_build/ directory.

Tests

The CKAN team uses tests to protect ourselves from breaking existing code.

Windows:

.\build.ps1 test

Linux or macOS:

./build test

All tests must pass before a pull request can be merged. If a test fails, look for problems with your changes and try to fix them. If you can't, it can sometimes be appropriate to update or remove an old test that is no longer applicable, but make sure you are not doing this simply because you don't understand what the test does or how to fix it.

macOS disk image (.dmg)

If you are compiling the disk image on Linux:

sudo apt-get install libplist-utils xorriso

For Linux and macOS:

./build osx

Now the disk image is in CKAN/_build/osx/.

Debian package (.deb)

Linux only:

./build deb

The package will be in CKAN/_build/deb.

Fedora package (.rpm)

Linux only:

./build rpm

The package will be in CKAN/_build/rpm/RPMS/noarch.

Clone this wiki locally