forked from neovide/neovide
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: consolidate macOS build instructions and scripts (neovide#2716)
* docs: consolidate macos build instructions and scripts - add a new file `macos-builder/readme.md` with instructions on building and packaging neovide for macos - update the `macos-builder/run` script to set the release directory based on the architecture target - modify the `dmg_name` variable in the `macos-builder/run` script to include the architecture target - update paths and filenames in the `notes` section for correctness and file presence - assume the script runs in a macos environment with the required tools installed * build: update macos build workflow configurations - update the target architecture variable assignments in the macos build workflow * ci: support multiple architectures in github actions - add support for building `x86_64-apple-darwin` in github action - add support for building `aarch64-apple-darwin` in github action - update the `run` script in the `macos-builder` directory to take an architecture parameter * chore: remove redundant code and improve efficiency - remove redundant echo statement from `macos-builder/run`
- Loading branch information
Showing
2 changed files
with
91 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
# Neovide Packaging for macOS | ||
|
||
This script is designed to build (if needed) and package the Neovide application packaging it into a macOS `.app` bundle, and then creating a `.dmg` disk image for distribution. | ||
|
||
## Prerequisites | ||
|
||
Before running the script, ensure you have the following dependencies installed: | ||
|
||
- [cargo](https://doc.rust-lang.org/cargo/getting-started/installation.html) | ||
- [create-dmg](https://github.com/create-dmg/create-dmg) | ||
- [codesign](https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution) | ||
|
||
**Run the Script**: | ||
|
||
```bash | ||
./macos-builder/run aarch64-apple-darwin | ||
``` | ||
|
||
### Steps | ||
|
||
**Set Up Release Directory**: | ||
The script sets the `RELEASE_DIR` based on the `TARGET_ARCHITECTURE` environment variable. If `TARGET_ARCHITECTURE` is not set, it defaults to `target/release`. | ||
|
||
```bash | ||
RELEASE_DIR=${TARGET_ARCHITECTURE:+target/${TARGET_ARCHITECTURE}/release} | ||
RELEASE_DIR=${RELEASE_DIR:-target/release} | ||
``` | ||
|
||
**Build the Project**: | ||
If the release directory does not exist, the script runs the `cargo build --release` command to build the project. | ||
|
||
_*This is for local development purposes since you would typically build the project beforehand.*_ | ||
|
||
```bash | ||
if [ ! -d "${RELEASE_DIR}" ]; then | ||
cargo build --release ${TARGET_ARCHITECTURE:+--target "${TARGET_ARCHITECTURE}"} | ||
fi | ||
``` | ||
|
||
**Prepare the Application Bundle**: | ||
|
||
- Sets up directories for the `.app` bundle. | ||
- Copies the built binary and other necessary resources into the bundle. | ||
- Signs the application using `codesign`. | ||
|
||
```bash | ||
mkdir -p "${APP_BINARY_DIR}" | ||
mkdir -p "${APP_EXTRAS_DIR}" | ||
cp -fRp "${APP_TEMPLATE}" "${APP_DIR}" | ||
cp -fp "${APP_BINARY}" "${APP_BINARY_DIR}" | ||
touch -r "${APP_BINARY}" "${APP_DIR}/${APP_NAME}" | ||
codesign --remove-signature "${APP_DIR}/${APP_NAME}" | ||
codesign --force --deep --sign - "${APP_DIR}/${APP_NAME}" | ||
``` | ||
|
||
**Create the Disk Image**: | ||
Uses `create-dmg` to create a `.dmg` file for the application. | ||
|
||
```bash | ||
create-dmg \ | ||
--filesystem "${DMG_FILESYSTEM}" \ | ||
--format "${DMG_FORMAT}" \ | ||
--volname "${DMG_VOLNAME}" \ | ||
--volicon "${DMG_ICNS}" \ | ||
--background "${DMG_BACKGROUND}" \ | ||
--window-size 650 470 \ | ||
--icon-size 80 \ | ||
--icon Neovide.app 240 320 \ | ||
--app-drop-link 410 320 \ | ||
"${APP_DIR}/${DMG_NAME}" \ | ||
"${APP_DIR}/${APP_NAME}" | ||
``` | ||
|
||
## Notes | ||
|
||
- Ensure all paths and filenames are correct and that the necessary files (like `Neovide.icns` and `neovide-dmg-background.tiff`) are present in their respective directories. | ||
- The script assumes a macOS environment with the necessary tools installed. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters