#
# This file is used to configure the Omnibus projects in this repo. It contains
# some minimal configuration examples for working with Omnibus. For a full list
# of configurable options, please see the documentation for +omnibus/config.rb+.
#

# Build internally
# ------------------------------
# By default, Omnibus uses system folders (like +/var+ and +/opt+) to build and
# cache components. If you would to build everything internally, you can
# uncomment the following options. This will prevent the need for root
# permissions in most cases.
#
# Uncomment this line to change the default base directory to "local"
# -------------------------------------------------------------------
# base_dir './local'
#
# Alternatively you can tune the individual values
# ------------------------------------------------
# cache_dir     './local/omnibus/cache'
# git_cache_dir './local/omnibus/cache/git_cache'
# source_dir    './local/omnibus/src'
# build_dir     './local/omnibus/build'
# package_dir   './local/omnibus/pkg'
# package_tmp   './local/omnibus/pkg-tmp'

# Disable git caching
# ------------------------------
# use_git_caching false

# Windows architecture defaults - set to x86 unless otherwise specified.
# ------------------------------
env_omnibus_windows_arch = (ENV["OMNIBUS_WINDOWS_ARCH"] || "").downcase
env_omnibus_windows_arch = :x86 unless %w{x86 x64}.include?(env_omnibus_windows_arch)

windows_arch   env_omnibus_windows_arch
# use_internal_sources ENV.fetch("OMNIBUS_USE_INTERNAL_SOURCES", false)

# Enable S3 asset caching
# ------------------------------
use_s3_caching true
s3_access_key  ENV["AWS_ACCESS_KEY_ID"]
s3_secret_key  ENV["AWS_SECRET_ACCESS_KEY"]
s3_bucket      "cinc-omnibus-cache"
s3_endpoint    "https://s3.osuosl.org"
s3_force_path_style true

# Enable ccache for compiler caching
# ------------------------------
# Wraps CC/CXX with ccache so identical compiles return cached object
# files. Has no effect if ccache isn't on PATH (a warning is logged)
# — that branch is what skips MSVC-only Windows configurations.
# ccache_dir defaults to base_dir/cache/ccache which is persistent on
# self-hosted runners (FreeBSD, macOS, Windows); containerized Linux
# builds override ccache_dir to ${TOP_DIR}/cache/ccache in build.sh so
# the GitLab CI cache picks it up.
use_ccache      true
ccache_max_size "10G"

# Customize compiler bits
# ------------------------------
build_retries 0
fetcher_read_timeout 120
workers 8 if aix?

# Load additional software
# ------------------------------
# software_gems ['omnibus-software', 'my-company-software']
# local_software_dirs ['/path/to/local/software']
