Skip to content

dehesselle/jhb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

396 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bootstrapped JHBuild for macOS

jhb_icon pipeline status Latest Release

This project (on GitLab, GitHub) is my take on setting up JHBuild on macOS in order to build GTK-based apps. It is inspired by and uses components of gtk-osx, but deviates from it in a few significant ways:

  • It uses a FSH-inspired directory layout.

  • It is fully self-contained to its directories, allowing for co-existence of multiple installations in locations of your choosing.

  • It uses a relocatable Python.framework to bootstrap itself until it can build its own Python to become self-sufficient.

prerequisites

Make sure the following prerequisites are met:

  • A clean environment is key. This is the most inconvenient requirement as it will likely conflict with how you are currently using your Mac, but it is vital.

    • Software and libraries - usually installed via package managers like Homebrew, MacPorts, Fink etc. - are known to cause problems depending on installation prefix. You cannot have software installed in the following locations:
      • /usr/local
      • /opt/homebrew
      • /opt/local
    • Uninstall Xquartz.
    • Undo any customizations in dotfiles like .profile, .bashrc etc. that interfere with the environment.
      • If in doubt, use a dedicated user account instead.
  • There are version recommendations based on known working setups.

    • macOS >= 11
    • Xcode >= 13
    • macOS SDK 11.3 (from Xcode 13.0)
  • An internet connection is required to download all the packages.

usage

  1. Clone the latest version of this repository.

    git clone https://github.com/dehesselle/jhb
    cd jhb
    # checkout tag with highest version number
    git checkout $(git tag | grep "^v" | sort -V | tail -1)
    # pull in submodules
    git submodule update --init --recursive
  2. 💁 This is an optional step. You are encouraged to skip this!
    By default we're going to use /Users/Shared/work (see directories.sh) to build and install everything as that is a user-independent but user-writable location present on every macOS installation. If you're not comfortable with that, run e.g.

    export WRK_DIR=$HOME/my_custom_location
  3. Bootstrap JHBuild by running the following command.

    usr/bin/bootstrap

    This is the equivalent to gtk-osx's jhbuild bootstrap-gtk-osx, i.e. build and install all the modules from boostrap.modules. A few additional modules will be built as well (see jhb.modules) to make life easier on macOS.

    Depending on wether you've skipped step 2 or not, the bootstrapping process will either download and extract an archive containing everything pre-built (and you're done in a minute) or start to build everything from source (this will take a while).

  4. Install your own module sets (*.modules). It is important that you keep them all together in a dedicated directory (including a patches subdirectory if any local patches are being used) as that whole directory is going to be copied to your bootstrapped jhb.

    # specify your main file here
    usr/bin/jhb configure $HOME/my_modulesets/my_main_set.modules

real-world examples

This is not theoretical work but the result of refactoring and outsourcing parts of Inkscape's build pipeline so it can be reused to build other GTK-based apps on macOS. Here you can see this being used in production:

credits

The jhb logo uses modified versions of

license

GPL-2.0-or-later

About

Bootstrap JHBuild on macOS.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published