2022-04-30 04:17:20 +02:00
|
|
|
# Installing Magic on macOS (Tested on Big Sur)
|
|
|
|
|
## With Brew
|
|
|
|
|
Get [Homebrew](https://brew.sh).
|
|
|
|
|
|
|
|
|
|
```sh
|
2025-01-03 10:08:14 +01:00
|
|
|
# TCL9 should be supported soon (Q2 2025)
|
|
|
|
|
brew install cairo tcl-tk@8 python3
|
2022-04-30 04:17:20 +02:00
|
|
|
brew install --cask xquartz
|
|
|
|
|
./scripts/configure_mac
|
2025-01-03 10:08:14 +01:00
|
|
|
# If you have both TCL8 and TCL9 installed you may need to verify TCL8 was selected.
|
2022-04-30 04:17:20 +02:00
|
|
|
make database/database.h
|
|
|
|
|
make -j$(sysctl -n hw.ncpu)
|
|
|
|
|
make install # may need sudo depending on your setup
|
|
|
|
|
```
|
2021-10-02 11:29:43 +02:00
|
|
|
|
2022-04-30 04:17:20 +02:00
|
|
|
## Without Brew
|
|
|
|
|
Get [XQuartz](https://github.com/XQuartz/XQuartz)
|
2021-10-02 11:29:43 +02:00
|
|
|
|
2022-04-30 04:17:20 +02:00
|
|
|
### Build Tcl for X11
|
2021-10-02 11:29:43 +02:00
|
|
|
|
|
|
|
|
We are following the instructions from xschem (https://github.com/StefanSchippers/xschem/blob/master/README_MacOS.md).
|
|
|
|
|
|
|
|
|
|
* Download Tcl from https://prdownloads.sourceforge.net/tcl/tcl8.6.10-src.tar.gz
|
|
|
|
|
|
|
|
|
|
We are using not `opt` but `opt2` so that this Tcl does not interfere with `tcl-tk` from HomeBrew.
|
|
|
|
|
|
2023-11-02 13:38:03 +01:00
|
|
|
Extract the Tcl sources and then go to the unix folder and execute the following commands::
|
2021-10-02 11:29:43 +02:00
|
|
|
```
|
|
|
|
|
./configure --prefix=/usr/local/opt2/tcl-tk
|
|
|
|
|
make
|
|
|
|
|
make install
|
|
|
|
|
```
|
|
|
|
|
|
2022-04-30 04:17:20 +02:00
|
|
|
### Build Tk for X11
|
2021-10-02 11:29:43 +02:00
|
|
|
|
|
|
|
|
* Download Tk from https://prdownloads.sourceforge.net/tcl/tk8.6.10-src.tar.gz
|
|
|
|
|
|
2023-11-02 13:38:03 +01:00
|
|
|
Extract Tk source and then go to the unix folder:
|
|
|
|
|
|
|
|
|
|
NOTE: before running 'make' inspect the Makefile and ensure the LIB_RUNTIME_DIR is set as follows. Make the correction if not:
|
|
|
|
|
```
|
|
|
|
|
LIB_RUNTIME_DIR = $(libdir)
|
|
|
|
|
```
|
|
|
|
|
|
2021-10-02 11:29:43 +02:00
|
|
|
```
|
|
|
|
|
./configure --prefix=/usr/local/opt2/tcl-tk \
|
|
|
|
|
--with-tcl=/usr/local/opt2/tcl-tk/lib --with-x \
|
|
|
|
|
--x-includes=/opt/X11/include --x-libraries=/opt/X11/lib
|
|
|
|
|
make
|
|
|
|
|
make install
|
|
|
|
|
```
|
|
|
|
|
|
2022-04-30 04:17:20 +02:00
|
|
|
### Build magic
|
2021-10-02 11:29:43 +02:00
|
|
|
|
|
|
|
|
We need to provide this `tcl-tk` and suppress compilation errors.
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
./configure --with-tcl=/usr/local/opt2/tcl-tk/lib \
|
|
|
|
|
--with-tk=/usr/local/opt2/tcl-tk/lib \
|
|
|
|
|
--x-includes=/opt/X11/include \
|
|
|
|
|
--x-libraries=/opt/X11/lib \
|
|
|
|
|
CFLAGS=-Wno-error=implicit-function-declaration
|
|
|
|
|
make
|
|
|
|
|
make install
|
|
|
|
|
```
|
2023-11-02 13:38:03 +01:00
|
|
|
|
|
|
|
|
## If facing issue with layout window not opening / XQuartz:
|
|
|
|
|
Make sure that the output of the following command is ```:0```.
|
|
|
|
|
```
|
|
|
|
|
echo $DISPLAY
|
|
|
|
|
```
|
|
|
|
|
if the above command doesn't display ```:0``` then add the following line in ```.zshrc```.
|
|
|
|
|
```
|
|
|
|
|
export PATH="/opt/X11/bin:$PATH"
|
|
|
|
|
```
|
|
|
|
|
Close & reopen terminal to load the path. Then set display manually to ```0``` by using the following command.
|
|
|
|
|
```
|
|
|
|
|
export DISPLAY=:0
|
|
|
|
|
```
|
|
|
|
|
Now ```echo DISPLAY``` should give ```:0``` as output.
|