Debian Codegraph @

docs/install_instructions_macos.md

raw
1 Installation Instructions (MacOS)
2 =================================
3
4 Install with Installer
5 ----------------------
6
7 We now have a proper [installer](https://www.github.com/eoyilmaz/displaycal-py3/releases)
8 for MacOS and this is the preferred way of running DisplayCAL under MacOS (unless you
9 want to test the latest code).
10
11 > [!NOTE]
12 > ArgyllCMS 3.5.0 adds native Apple Silicon binaries
13 > (`Argyll_V3.5.0_macOS11_arm64_bin.tgz`). Intel macOS still uses
14 > `Argyll_V3.5.0_osx10.6_x86_64_bin.tgz`. DisplayCAL download handling supports both.
15
16 > [!WARNING]
17 > In **MacOS**, after installing DisplayCAL you need to run the following in Terminal:
18 >
19 > ```shell
20 > xattr -dr com.apple.quarantine /Applications/DisplayCAL
21 > ```
22
23 Install through PyPI or Build From Source
24 -----------------------------------------
25
26 In macOS, you can install DisplayCAL into a virtual environment through PyPI or build
27 it from source. Currently we support Python 3.9 to Python 3.14.
28
29 Prerequisites
30 -------------
31
32 Install the dependencies through `brew`:
33
34 ```shell
35 brew install glib gtk+3 [email protected]
36 ```
37
38 > [!NOTE]
39 > Note, if your system's default python is outside the supported range you will need to
40 > install a supported version and its related devel package.
41
42 Install through PyPI
43 --------------------
44
45 Installing through PyPI is straight forward. We highly suggest using a virtual
46 environment and not installing it to the system python:
47
48 Create a virtual environment:
49
50 ```shell
51 cd ~
52 python -m venv venv-displaycal
53 source venv-displaycal/bin/activate
54 pip install displaycal
55 ```
56
57 and now you can basically run `displaycal`:
58
59 ```shell
60 displaycal
61 ```
62
63 If you close the current terminal and run a new one, you need to activate the virtual
64 environment before calling `displaycal`:
65
66 ```shell
67 source ~/venv-displaycal/bin/activate
68 displaycal
69 ```
70
71 Build From Source (Makefile Workflow)
72 -------------------------------------
73
74 To test the latest code you can build DisplayCAL from its source. To do that:
75
76 Pull the source:
77
78 ```shell
79 cd ~
80 git clone https://github.com/eoyilmaz/displaycal-py3
81 cd ./displaycal-py3/
82 ```
83
84 At this stage you may want to switch to the ``develop`` branch to test some new features
85 or possibly fixed issues over the ``main`` branch.
86
87 ```shell
88 git checkout develop
89 ```
90
91 > [!TIP]
92 > If you want to switch to some other branches to test the code you can replace
93 > `develop` in the previous command with the branch name:
94 > ```shell
95 > git checkout 502-ccss-creation-with-i1pro3-does-not-seem-to-work
96 > ```
97
98 Then you can build and install DisplayCAL using:
99
100 ```shell
101 make venv build install
102 ```
103
104 The build step assumes your system has a `python3` binary available that is
105 within the correct range. If your system `python3` is not supported and you
106 installed a new one, you can try passing it to the build command:
107
108 ```shell
109 SYSTEM_PYTHON=python3.11 make venv build install
110 ```
111
112 If this errors out for you, you can follow the
113 [Build From Source (Manual)](#build-from-source-manual) section below.
114
115 Otherwise, this should install DisplayCAL. To run the UI:
116
117 ```shell
118 make launch
119 ```
120
121 Build From Source (Manual)
122 --------------------------
123
124 If the `makefile` workflow doesn't work for you for some reason, you can setup the
125 virtual environment manually. Ensure the python binary you're using is supported:
126
127 ```shell
128 python3 -m venv .venv
129 source .venv/bin/activate
130 pip install -r requirements.txt -r requirements-dev.txt
131 python -m build
132 pip install dist/displaycal-*.whl
133 ```
134
135 This should install DisplayCAL. To run the UI:
136
137 ```shell
138 displaycal
139 ```
140
141 Building `DisplayCAL.app`
142 -------------------------
143
144 You can build a proper macOS app to make it easier to run the application.
145
146 Firstly install the requirements if you didn't already done it before:
147
148 ```shell
149 brew install glib gtk+3 [email protected]
150 ```
151
152 Clone the source of DisplayCAL, build and install it:
153
154 ```shell
155 cd ~
156 git clone https://www.github.com/eoyilmaz/displaycal-py3
157 cd displaycal-py3
158 make venv build install
159 source ./.venv/bin/activate
160 ```
161
162 Now you can generate the app:
163
164 ```shell
165 python setup.py py2app
166 ```
167
168 That should generate a folder under `dist` with a name similar to
169 `py2app.macosx-<macOS-version>-<arch>-py<python-version>`, containing a
170 `DisplayCAL-<version>` folder with the `DisplayCAL.app` package.
171
172 You can use this directly, by putting it under the `/Applications` of your system.
173
174 Creating a `dmg` Image
175 ----------------------
176
177 You can generate a `dmg` image so that it is more compact and inline with how the other
178 macOS applications are distributed.
179
180 First put a link to the `Applications` folder for people to easily drag & drop the app
181 in to their system `Applications` folder:
182
183 ```shell
184 cd ~/displaycal-py3/dist/py2app.macosx-*/DisplayCAL-*
185 ln -s /Applications
186 ```
187
188 Use `Disk Utility.app` to generate a `dmg` file, by using the
189 `File -> New Image -> Image From Folder...` menu and selecting the
190 `~/displaycal-py3/dist/py2app.macosx-*/DisplayCAL-*` folder.
191
192 Now you can rename the `dmg` file to `DisplayCAL-<version>-macOS-arm64.dmg` or
193 `DisplayCAL-<version>-macOS-x86_64.dmg` depending on your macOS architecture.