Skip to content

Instantly share code, notes, and snippets.

@tresf
Last active September 9, 2021 21:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tresf/7afd58020be5274d2e583a89854d8bd1 to your computer and use it in GitHub Desktop.
Save tresf/7afd58020be5274d2e583a89854d8bd1 to your computer and use it in GitHub Desktop.

Starting Point

  • OS: MacOS Catalina 10.15.7
  • XCode: Xcode_12.4.xip (10 GB)

References

Prerequisites

  1. Install command-line tools
    xcode-select --install
  2. Clone the macos infrastrucure tools:
    git clone https://gitlab.gnome.org/Infrastructure/gimp-macos-build/
  3. Install Rust:
    curl https://sh.rustup.rs -sSf | sh -s -- -y
  4. Install Python 3:
    curl -L 'https://www.python.org/ftp/python/3.6.8/python-3.6.8-macosx10.9.pkg' > ~/Downloads/python-3.6.8-macosx10.9.pkg
    sudo installer -pkg ~/Downloads/python-3.6.8-macosx10.9.pkg -target /
  5. Install MacOS 10.12 SDK (Optional, to target older Macs)
    cd /Library/Developer/CommandLineTools/SDKs
    sudo curl -L 'https://github.com/phracker/MacOSX-SDKs/releases/download/10.15/MacOSX10.12.sdk.tar.xz' | sudo tar -xzf -
    echo 'export SDKROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX10.12.sdk' > ~/.profile
    echo 'export MACOSX_DEPLOYMENT_TARGET=10.12' >> ~/.profile
  6. Build/Install and configure JHBuild
    cd $HOME
    mkdir -p ~/.config && ln -s ~/gimp-macos-build/jhbuildrc-gtk-osx-gimp ~/.config/jhbuildrc-custom
    curl https://gitlab.gnome.org/samm-git/gtk-osx/raw/gimp/gtk-osx-setup.sh > ~/Downloads/gtk-osx-setup.sh
    chmod +x ~/Downloads/gtk-osx-setup.sh
    echo 'export PATH="$HOME/.cargo/bin:$HOME/.local/bin:$PATH:$HOME/.new_local/bin"' >> ~/.profile
    echo 'export ARCHFLAGS="-arch x86_64"' >> ~/.profile
    source ~/.profile
    PIPENV_YES=1 ~/Downloads/gtk-osx-setup.sh
    $HOME/.new_local/bin/jhbuild bootstrap-gtk-osx-gimp
    cat ~/.profile
  7. Build/Install gtk-mac-bundler
    git clone https://github.com/samm-git/gtk-mac-bundler -b fix-otool
    cd gtk-mac-bundler
    make install
  8. Build/Install bootstrap depdendencies
    jhbuild build icu55 meta-gtk-osx-freetype meta-gtk-osx-bootstrap meta-gtk-osx-core
  9. Cleanup
    rm -rf ~/gtk/source
  10. Build/Install Gimp dependencies
    jhbuild build suitesparse lcms libunistring gmp libnettle libtasn1 gnutls libjpeg readline python glib-networking openjpeg gtk-mac-integration poppler poppler-data
    jhbuild build json-glib p2tc exiv2 gexiv2 ilmbase openexr libwebp libcroco librsvg-24 json-c
    jhbuild build libmypaint mypaint-brushes libde265 nasm x265 libheif aalib shared-mime-info iso-codes libwmf libmng ghostscript
    - ## TODO: error implicit declaration of function "pango_font_metrics_new" is invalid in C99.
    jhbuild build pycairo pygobject pygtk gtk-mac-integration-python
  11. FIXME: Never got further 😢

    Build/Install WebKit dependencies
    jhbuild build enchant libpsl sqlite vala gnutls
    jhbuild buildone libsoup
  12. Cleanup
    rm -rf ~/gtk/source
  13. Build/Install WebKit
    jhbuild buildone webkit
  14. Cleanup
    rm -rf ~/gtk/source
  15. Build/Install and test babl/gegl
    jhbuild build --check babl gegl

Compile

  1. Build/Install Gimp
    jhbuild build gimp
  2. Build/Install Gimp Help
    ALL_LINGUAS=en jhbuild build gimp-help-git
  3. Cleanup
    rm -rf ~/gtk/source
  4. Optionally, configure codesigning/certificates.
  5. Build DMG
    cd ${HOME}/gimp-macos-build/package
    jhbuild run ./build.sh
  6. Optionally, notarize package.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment