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.
Merge branch 'main' into fsundvik/wgpu-winit-0.30
- Loading branch information
Showing
15 changed files
with
1,193 additions
and
370 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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
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
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
Oops, something went wrong.