# -*- mode: python -*-

# All of jhbuild is Python, so there are all sorts of interesting
# things you can do to customize your build with python commands.

# The URL for repositories can be overridden. This is how you'd set
# your developer access to a git repo.
#
# repos["git.gnome.org"] = "git@gitlab.gnome.org:GNOME"

#  _gtk_osx_default_build designates a suffix that if set will load a
#  second customization file after jhbuildrc-custom. For example,
#    _gtk_osx_default_build = "fw-10.4"
# would load the file .jhbuildrc-fw-10.4. This is a default that can
# be overridded by setting the environment variable $JHB to a
# different suffix.
#
# You can also read environment variables and decide what to do based
# on their values:

_target = os.environ.get("TARGET")
if _target is None:
    # The default setup...
    # checkoutroot = os.path.expanduser("~/Source/gtk")
    # prefix = "/opt/gtk"
    pass
#
# 

# The moduleset can be overridden.
#
# moduleset = "gtk-osx"

# As can the default modules to build.
#
# modules = [ "meta-gtk-osx-gtk3", "meta-gstreamer" ]

# You can skip modules.
#
# skip.append("python3")
#
#or put them back:
#
# if "python3" in skip:
#	skip.remove("python3")

# See the jhbuild configuration file reference,
# https://developer.gnome.org/jhbuild/stable/config-reference.html.en
# for complete documentation of more ways to customize your build.

# Uncomment the following if SIP (see https://developer.apple.com/library/prerelease/mac/documentation/Security/Conceptual/System_Integrity_Protection_Guide/RuntimeProtections/RuntimeProtections.html)
# causes shell-script build failures. You'll also need to edit those
# shell scripts to change the shebang from /bin/sh to $PREFIX/bin/bash.
# Note that /usr/bin/env bash won't work, because it will also strip
# the DYLD_* and LD_* environment variables!
# Note as well that any installed dependencies must use their full
# paths for their id (use install_name_tool -id to fix). Boost is a
# particular violator of this rule.
# if "bash" in skip:
#     skip.remove("bash")

# In addition, you can override _exec_prefix (used to set $M4 and
# $LIBTOOLIZE); by default it's set to prefix. You might want to reset
# it if you want to bootstrap to one directory and build in another
# (or more likely, several others). Mind that this is fiddly and
# requires tweaking a bunch of things to get autoconf to consistently
# find the right m4 files. Not really recommended. Similarly, you can
# override tarballdir so that you need download tarballs only once for
# multiple builds. This works just as you'd expect and can save quite
# a bit of time if you're maintaining several trees.

# _exec_prefix = os.path.join(os.path.expanduser("~"), "Source", "bootstrap")
# tarballdir = os.path.join(os.path.expanduser("~"), "Source", "Download")

# .jhbuildrc has a master function, setup_sdk(target, architecture)
# which sets up the build environment. You *must* call it in jhbuildrc-custom.

# Target is the earliest version of MacOS on which the result binary
# can run, in the form "10.X" or "native" (the default). It sets
# MACOS_DEPLOYMENT_TARGET and the -macosx-version-min CFLAG.

# Unlike earlier SDKs, recent versions of Xcode have included SDKs
# that can successfully compile programs that will run on earlier
# versions of macOS, so it's reasonable to build for e.g. 10.13 while
# running 11.2 and the Xcode 12.2 that ships with it.

# Architecture is a list for backwards compatibility; it can contain
# "x86_64" and "arm64" and defaults to the machine's architecture if
# left out. Passing both architectures will in theory build a
# universal binary but this is untested.

# There are also some utility functions which you may find useful:
#
# environ_append(key, value, separator=' '), environ_prepend(key,
# value, separator=' '), and environ_remove(key, value, separator=':')
# append, prepend, or remove value to/from the environment variable key
# with separator between the value and the existing text of the
# variable. This is primarily intended for manipulating search paths.
#
# append_autogenargs(module, args) and remove_autogenargs(module,
# args) add or remove args from the list of arguments passed to the
# module's autogen-sh attribute during the configure phase of the
# module's build.
#
# setup_debug() and setup_release() add either "-O0 -ggdb3" or
# "-O2" respectively to CFLAGS, CXXFLAGS, and OBJCFLAGS.

#  Set up a particular target and SDK: For default operation, set the
# architecture and SDK for the native machine:
setup_sdk()

# Comment out the previous and uncomment this one to build for all
# systems running Mojave and later:
# setup_sdk(target="10.14")

