User Tools

Site Tools


Action unknown: copypageplugin__copy
plato:pterm7:linux.part.2

MacOS/Linux - Building (Part 2)

Apple Code Signing

 Apple

Code Signing

Code signing is required for MacOS packages to ensure their authenticity and integrity, especially when distributing software. Unsigned packages may be rejected during installation on MacOS, leading to deployment issues.

For the number of current potential hobbyists, code signing isn't worth the cost, so building Pterm locally is required. The Retro1.org project will not purchase a code-signing certificate and building the project is beneficial both from a hobbyist and practical perspective.

This is a security feature from Apple. The single most important thing to know is that you can allow individual apps to be exempt from this feature. This allows the app to run while the rest of the system remains under protection.

For this reason, the build process for the MacOS package relies on a self-signed certificate which must be created prior to the final make stage. Generating a self-signed certificate a is relatively easy procedure.

  1. Start Spotlight Search:
     Spotlight Search
  2. Find “Keychain Access”:
     Search Keychain Access
  3. Open the Certificate Assistant
     Open Certificate Assistant
  4. Create the self-signed, code-signing Certificate for Retro1.Org1):
     Self-Signed, Code-Signing Certificate
  5. Accept the warnings and proceed.
  6. Certificate is complete:

Always leave system-wide protection enabled, and disable it only for specific apps as needed.

Selectively Bypassing Protection

If you’re sure you want to trust the app, you can disable protection for it by right-clicking its icon and choosing Open:

In the resulting dialog, click the Open button to have MacOS permanently allow the app to run on this Mac. Don’t do this unless you’re sure you trust the app.

Preparing the Code Headers

Environment Reminder

Set the environment variable in your USER or SYSTEM environment:

 export PYTHONUTF8=1

Failing to do so will result in warnings from the utility function.

It is highly recommended that this same line be added to the .bashrc (or its equivalent) environment file.

Once preparation of the environment is complete, the next (somewhat optional) steps leading to a successful build are:

  • PtermKeyTabs.h
  • PtermVersion.h
  • wxversion.h

This is done using the utility functions from the command line:

cd /d <MyRepositoryFolder>

Then issue the following Case Sensitive commands (This only needs to be done ONCE as long as the underlying libraries and version numbers have not been changed.):

 python3 -m PTDevUtils make.ptermversion.h -r src/pterm.rc --wxheaderfn src/wxversion.h --ptheaderfn src/PtermVersion.h
 python3 -m PTDevUtils make.ptermkeytabs.h --ptkeytabsfn src/PtermKeyTabs.h   
 python3 -m PTDevUtils make.wxversion.h -p pterm7.vcxproj --wxheaderfn src/wxversion.h

What's Happening

PTerm's headers are used the the application for various core functions and in assorted displays.

  • Header src/PtermKeyTabs.h
    is the key translation table for all data transformation in the PTerm system. Converting PLATO character encoding, CDC character encoding, UNICODE character transformation, Cut/Paste operations, and more, are all controlled by this file. This header is not very volatile so if this step is accidentally skipped, the existing file stored in the repository should be sufficient.
  • Headers src/PtermVersion.h and src/wxversion.h
    are used in various information displays including the “About” box to convey the current build information which may be needed for defect reports. These files are supplied based on the currently supported libraries. If this step is accidentally skipped, the existing files stored in the repository should be sufficient, but it may be difficult to identify the source of problems if the Repository identifier information is not kept current.

Build the Solution

Open a terminal window and change to the repository root:

 make info

The following results should indicate that you're ready to build:

Default Goal is 'all' Preparing to build PTerm Version: 7.0.2.0 SDL2 Configuration is Valid '/opt/homebrew' ----------------------------------------------- c compiler: cc c2flags: -O2 -I/opt/homebrew/include/SDL2 -D_THREAD_SAFE -arch arm64 -Wno-c++11-extensions -mmacosx-version-min=11.3 -DHOST_Darwin cxx: c++ cxxflags: -I/opt/homebrew/lib/wx/include/osx_cocoa-unicode-3.2 -I/opt/homebrew/include/wx-3.2 -D_FILE_OFFSET_BITS=64 -DwxDEBUG_LEVEL=0 -DWXUSINGDLL -D__WXMAC__ -D__WXOSX__ -D__WXOSX_COCOA__ -fno-strict-aliasing -I/opt/homebrew/include ----------------------------------------------- gccversion: version ----------------------------------------------- link: c++ ----------------------------------------------- ostype: Darwin osver: 24.4.0 osxapp: Pterm.app path: /opt/homebrew/bin:/opt/homebrew/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/Users/AppleUser/.nvm/versions/node/v22.14.0/bin:/Library/Frameworks/Python.framework/Versions/3.13/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/X11/bin:/Library/Apple/usr/bin ----------------------------------------------- ptermgitver: ptermversion: 7.0.2.0 pterm PP: -DszHFMOD -DszXFER ----------------------------------------------- py3version: 13 ----------------------------------------------- snddir: /opt/homebrew sndincl: -I/opt/homebrew/include sndlibs: -L/opt/homebrew/lib -lsndfile ----------------------------------------------- sdlconfig: /opt/homebrew/bin/sdl2-config sdlincl: -I/opt/homebrew/include/SDL2 -D_THREAD_SAFE sdllibs: -L/opt/homebrew/lib -lSDL2 sdlfw: /Library/Frameworks/SDL2.framework sdlver: SDL2 sdlversion: 2.32.4 ----------------------------------------------- wxconfig: /opt/homebrew/bin/wx-config wxpath: /opt/homebrew wxlibs: -L/opt/homebrew/lib -framework IOKit -framework Carbon -framework Cocoa -framework QuartzCore -framework AudioToolbox -framework System -framework OpenGL -lwx_osx_cocoau_core-3.2 -lwx_baseu-3.2 wxversion: 3.2.7

Then issue the make buildall command which will clean all files before rebuilding:

 make buildall

If no errors appeared - the build was successful!

Success

You are now ready to launch the application!

Launching <MyRepositoryPath>\bin\PTerm.app should prompt you to select the target system.

 PTerm7 Up and Running

You may now copy the finished application into your Applications folder of choice (usually /Applications on MacOS).

1)
Case-Sensitive!!
plato/pterm7/linux.part.2.txt · Last modified: 2025/04/19 10:30 by Site Administrator