Add Building from Source documentation

This commit is contained in:
Mykola Grymalyuk
2021-11-14 19:50:45 -07:00
parent b27007d55c
commit 90cc87702d
4 changed files with 102 additions and 7 deletions

View File

@@ -88,5 +88,5 @@ class OpenCoreLegacyPatcher:
if getattr(sys, "frozen", False) and self.constants.recovery_status is False:
subprocess.run("""osascript -e 'tell application "Terminal" to close first window' & exit""", shell=True)
OpenCoreLegacyPatcher()
if __name__ == '__main__':
OpenCoreLegacyPatcher()

View File

@@ -18,16 +18,19 @@ Note: Only clean-installs and upgrades are supported, macOS Big Sur installs alr
* You can however reinstall macOS with this patcher and retain your original data
Note 2: Currently OpenCore Legacy Patcher officially supports patching to run macOS 11, Big Sur installs. For older OSes, OpenCore may function however support is currently not provided from Dortania.
Note 2: Currently OpenCore Legacy Patcher officially supports patching to run macOS Big Sur and Monterey installs. For older OSes, OpenCore may function however support is currently not provided from Dortania.
* For macOS Mojave and Catalina support, we recommend the use of [dosdude1's patchers](http://dosdude1.com)
* macOS Monterey usage is provided however support is limited, currently recommended for users to run Big Sur for best compatibility
## Running from source
To run the project from source, see here: [Build and run from source](./SOURCE.md)
## Support
To get aid with the patcher, we recommend joining the [OpenCore Patcher Paradise Discord Server](https://discord.gg/rqdPgH8xSN). We're actively there and is the quickest way to receive help. For bigger issues such as patcher crashing on build and such, we recommend opening an issue right here on GitHub(Please review [How to debug with OpenCore](https://dortania.github.io/OpenCore-Legacy-Patcher/DEBUG.html) before opening issues):
* [OpenCore Legacy Patcher's Issue's tab](https://github.com/dortania/OpenCore-Legacy-Patcher/issues)
To get aid with the patcher, we recommend joining the [OpenCore Patcher Paradise Discord Server](https://discord.gg/rqdPgH8xSN). We're actively there and is the quickest way to receive help. For bigger issues such as patcher crashing on build and such, we recommend opening an issue right here on GitHub
* Please review [How to debug with OpenCore](https://dortania.github.io/OpenCore-Legacy-Patcher/DEBUG.html) before opening issues
## Credits

92
SOURCE.md Normal file
View File

@@ -0,0 +1,92 @@
# Build and run from source
OpenCore Legacy Patcher at its core is a python-based TUI/CLI based application. This means that to run the project from source, you simply need to invoke the OpenCore-Patcher.command file via Python.
For developers wishing to validate mainline changes, you may use these nightly links:
* [GUI (Graphical Based App)](https://nightly.link/dortania/OpenCore-Legacy-Patcher/workflows/build-gui/main/OpenCore-Patcher-GUI.app.zip)
* [TUI (Text Based App)](https://nightly.link/dortania/OpenCore-Legacy-Patcher/workflows/build-app/main/OpenCore-Patcher-TUI.app.zip)
* [TUI (Text Based App) - Offline Variant](https://nightly.link/dortania/OpenCore-Legacy-Patcher/workflows/build-app/main/OpenCore-Patcher-TUI-Offline.app.zip)
**Warning**: These binaries should not be used without first consulting the [CHANGELOG](./CHANGELOG.md). Do not distribute these links in forums, instead direct to this file.
* Users running new builds of the project without understanding what has changed are at higher of bricking their installation as they do not read any warnings provided in the CHANGELOG. We wish to minimize these situations as much as possible.
## Getting Started
To start, ensure you have python 3.6 or newer installed. Additionally ensure that they were downloaded from the offical source, [python.org](https://www.python.org/downloads/macos/).
* Python installations either preinstalled or provided with Xcode/Xcode Tools are unsupported due to reliablility issues
Once Python is installed, open Terminal and run the following:
```sh
# Move into a directory to store the project
cd ~/Developer
# Clone project
git clone https://github.com/dortania/OpenCore-Legacy-Patcher
# Install Python dependacies used by the project
pip3 install -r requirements.txt
```
## Running OpenCore Legacy Patcher
To run the project from source, simply invoke via python3:
```sh
python3 OpenCore-Patcher.command
```
Note that the OpenCore-Patcher.command file can be run as both a TUI and a CLI utility for other programs to call. If no core arguments are passed, the TUI is initialized. Otherwise the CLI will start:
```sh
python3 OpenCore-Patcher.command --build --model iMac12,2 --verbose
```
See `-h`/`--help` for more information on supported CLI arguments.
## Generating prebuilt binaries
The main goal of generating prebuilt binaries is to strip the requirement of a local python installation for users. For developers, there's very little benefit besides for usage with the project's GUI ([Generating the GUI](#generating-the-gui)). For development, simply use the OpenCore-Patcher.command file with a python3 installation.
* Note that due to PyInstaller's linking mechanism, binaries generated on Catalina and newer are not compatible with High Sierra and older
* To ensure the largest compatibility, generate binaries on macOS Mojave. These binaries will be compatible with macOS 10.9 to macOS 12.
* Currently our build system is a [Macmini8,1 provided by MacStadium](https://www.macstadium.com/opensource) running macOS Mojave (10.14.6).
```sh
# Install PyInstaller
pip3 install pyinstaller
# Move into project directory
cd ~/Developer/OpenCore-Legacy-Patcher/
# Create the pyinstaller based Application
pyinstaller OpenCore-Patcher.spec
# Post PyInstaller clean up
./after_pyinstaller.sh
# Open build folder
open ./dist/
```
Once done, you'll find the application generated at `./dist/OpenCore-Patcher.app`:
![](./images/build-dist.png)
## Generating the GUI
To generate a GUI, you will have need a core `OpenCore-Patcher` binary generated during the above stage([Generating prebuilt binaries](#generating-prebuilt-binaries)).
Once conditions are met, you'll be able to work with the GUI portion. The source of which is found at [dortania/OCLP-GUI](https://github.com/dortania/OCLP-GUI).
```sh
# Move into a directory to store the project
cd ~/Developer
# Clone project
git clone https://github.com/dortania/OCLP-GUI
# Update the OpenCore-Patcher binary from the core project
cp ./OpenCore-Legacy-Patcher/dist/OpenCore-Patcher ./OCLP-GUI/OpenCore\ Patcher/OpenCore\ Patcher/
# Rename binary to OCLP-CLI
mv ./OCLP-GUI/OpenCore\ Patcher/OpenCore\ Patcher/OCLP-GUI/OpenCore-Patcher ./OCLP-GUI/OpenCore\ Patcher/OpenCore\ Patcher/OCLP-GUI/OCLP-CLI
# Build project
cd ./OCLP-GUI/OpenCore\ Patcher; xcodebuild; cd ../../
# Move application to project root
open ./OCLP-GUI/OpenCore\ Patcher/build/Release/OpenCore\ Patcher.app
```

BIN
images/build-dist.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 240 KiB