=====<<< Pymod for MacPorts >>>=====================================================================
==
== The following lines capture the steps I followed to install
== 'pymod' to 'MacPorts' on macOS Monterey using 'pip3'.
==
== A "KLayout Python Module" is available under '/Applications/klayout.app/Contents/pymod-dist'
== as 'klayout-*.whl' for the 'pip3' tool.
==
== Ref: https://github.com/KLayout/klayout/issues/1040
==
== File: pymod-pip3-mp312.txt
== Author: kazzz-S
== Last modified: 2024-09-23 (as of KLayout version 0.29.6)
====================================================================================================

####################
### Installation ###
####################

MacBookPro2{kazzz-s}(1)$ pwd
/Applications/klayout.app/Contents/pymod-dist

MacBookPro2{kazzz-s}(2)$ ll
:
drwxr-xr-x 3 kazzz-s admin       96  9 22 10:34 .
drwxr-xr-x 9 kazzz-s admin      288  9 22 10:34 ..
-rwxr-xr-x 1 kazzz-s admin 20349976  9 22 10:33 klayout-0.29.6-cp312-cp312-macosx_14_0_x86_64.whl

MacBookPro2{kazzz-s}(3)$ which python3
/opt/local/bin/python3

MacBookPro2{kazzz-s}(4)$ python3 --version
Python 3.12.6

MacBookPro2{kazzz-s}(5)$ sudo -H pip3 install klayout-0.29.6-cp312-cp312-macosx_14_0_x86_64.whl
:
Processing ./klayout-0.29.6-cp312-cp312-macosx_14_0_x86_64.whl
Installing collected packages: klayout
Successfully installed klayout-0.29.6
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour
with the system package manager, possibly rendering your system unusable.It is recommended to use
a virtual environment instead: https://pip.pypa.io/warnings/venv.
Use the --root-user-action option if you know what you are doing and want to suppress this warning.

MacBookPro2{kazzz-s}(6)$ sudo -H pip3 list | grep klayout
klayout           0.29.6

MacBookPro2{kazzz-s}(7)$ pwd
/opt/local/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages

MacBookPro2{kazzz-s}(8)$ ll -rt
:
:
drwxr-xr-x  37 root wheel   1184  9 23 10:08 klayout
drwxr-xr-x   4 root wheel    128  9 23 10:08 pya
drwxr-xr-x  10 root wheel    320  9 23 10:08 klayout-0.29.6.dist-info

MacBookPro2{kazzz-s}(8)$ python3
Python 3.12.6 (main, Sep  7 2024, 05:15:33) [Clang 15.0.0 (clang-1500.1.0.2.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import klayout
>>> help(klayout)

Help on package klayout:

NAME
    klayout

PACKAGE CONTENTS
    db (package)
    dbcore
    lay (package)
    laycore
    lib (package)
    lib_ant
    lib_db
    lib_edt
    lib_gsi
    lib_img
    lib_laybasic
    lib_layview
    lib_lib
    lib_lym
    lib_pya
    lib_rba
    lib_rdb
    lib_tl
    libcore
    pya (package)
    pyacore
    rdb (package)
    rdbcore
    tl (package)
    tlcore

VERSION
    0.29.6

FILE
    /opt/local/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/klayout/__init__.py
================================================================================

####################
###   Testing    ###
####################
Visit "https://www.klayout.org/klayout-pypi/" and save the Code in the name of "sample.py".

MacBookPro2{kazzz-s}(1)$ ll
:
drwxr-xr-x    3 kazzz-s staff   96  9 23 11:18 .
drwxr-xr-x+ 124 kazzz-s staff 3968  9 23 11:18 ..
-rw-r--r--    1 kazzz-s staff 1081 10 24  2023 sample.py

MacBookPro2{kazzz-s}(2)$ python3 sample.py
MacBookPro2{kazzz-s}(3)$ ll
:
drwxr-xr-x    4 kazzz-s staff  128  9 23 11:18 .
drwxr-xr-x+ 124 kazzz-s staff 3968  9 23 11:18 ..
-rw-r--r--    1 kazzz-s staff 6316  9 23 11:18 basic.gds <=== generated
-rw-r--r--    1 kazzz-s staff 1081 10 24  2023 sample.py

[EOF]
