---
# System prepended metadata

title: QGIS macOS build

---

# QGIS macOS build

I try [rebuild QGIS-Mac-Packager](https://github.com/qgis/QGIS-Mac-Packager).

- [WIP PR](https://github.com/qgis/QGIS-Mac-Packager/pull/168)
- Related issue
    - [QGIS-Mac-Packager #153](https://github.com/qgis/QGIS-Mac-Packager/issues/153)
- My motivation
    - I want to use GDAL 3.6.x with QGIS on Mac

## prepare

```diff=
diff --git a/config/dev.conf b/config/dev.conf
index ddf0e99..cdb653d 100644
--- a/config/dev.conf
+++ b/config/dev.conf
@@ -4,7 +4,7 @@ CONFIGDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
 
 export VERSION_major_python=3.9
 export VERSION_qt=5.15.2
-export RELEASE_VERSION=0.9
+export RELEASE_VERSION=0.10.0
 export RELEASE_VERSION_PATCH=0
 export RELEASE=dev
```

```bash=
brew install gsed
brew install llvm
```

## build deps

### Qt

```bash=
cd /opt
sudo mkdir Qt
sudo chown ${USER}:admin Qt
cd Qt
wget https://download.qgis.org/downloads/macos/deps/qt-5.15.2.tar.gz
mkdir -p 5.15.2/clang_64
cd 5.15.2/clang_64
tar zxf ../../qt-5.15.2.tar.gz
```

### QGIS-deps

```bash=
cd /opt
sudo mkdir QGIS
sudo chown ${USER}:admin QGIS
cd QGIS
wget https://download.qgis.org/downloads/macos/deps/qgis-deps-0.9.0.tar.gz
mkdir qgis-deps-0.9.0
cd qgis-deps-0.9.0
tar zxf ../qgis-deps-0.9.0.tar.gz
```

### generate new deps

```bash=
cd /opt
sudo mkdir QGIS
sudo chown ${USER}:admin QGIS
cd QGIS
mkdir qgis-deps-0.10.0
```

```bash=
sh QGIS-Mac-Packager/scripts/install_brew_dev_packages.bash
```

```bash=
cd QGIS-Mac-Packager/qgis_deps
./qgis_deps.bash ../config/dev.conf
```

## Qt build (5.15.14 and x86_64)

https://gist.github.com/smellman/1716e2bc5e4b3a6ac158bf2fd75c42eb

```bash=
git clone https://gist.github.com/1716e2bc5e4b3a6ac158bf2fd75c42eb.git
cd 1716e2bc5e4b3a6ac158bf2fd75c42eb
cp ~/Downloads/qt-everywhere-src-5.15.14.tar.xz .
chmod +x qt5-build-for-qgis-macos.sh
./qt5-build-for-qgis-macos.sh
```

## Qt build (6.7.2)

```bash=
tar jxf ~/Downloads/qt-everywhere-src-6.7.2.tar.xz
cd qt-everywhere-src-6.7.2
python3.12 -m venv venv
source venv/bin/activate
pip install html5lib
pip install webencodings
export PYTHONPATH=venv/lib/python3.12/site-packages/
./configure -release -prefix /opt/Qt/6.7.2 -- -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64"
cmake --build . --parallel
cmake --install .
```

Build OK!

## Xcodes

Xcode version 15 dropped supporting Qt 5.15.2 because Xcode didn't create some directories depend on Qt 5.15.2.

[XcodesOrg/Xcodes](https://github.com/XcodesOrg/xcodes?tab=readme-ov-file) enables to install old Xcode and specify version.

## TBD

