Skip to content

Commit

Permalink
merged changes from sidecar-binary
Browse files Browse the repository at this point in the history
  • Loading branch information
matthme committed Oct 10, 2023
2 parents fcebf0a + 92de83b commit ad9467c
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release-codesigned.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
fail-fast: false
matrix:
platform: [macos-11, ubuntu-20.04]
platform: [macos-11, ubuntu-20.04, windows-2019]
# platform: [windows-2019]
env:
MACOSX_DEPLOYMENT_TARGET: 10.13
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ jobs:
$LkPath = Get-Command lair-keystore | Select-Object -ExpandProperty Definition
Copy-Item $LkPath -Destination src-tauri/bins/lair-keystore-v0.3.0-x86_64-pc-windows-msvc.exe
cargo install holochain --version holochain-v0.2.3-beta-rc.1 --locked --features sqlite-encrypted
cargo install holochain --version 0.2.3-beta-rc.1 --locked --features sqlite-encrypted
$HcPath = Get-Command holochain | Select-Object -ExpandProperty Definition
Copy-Item $HcPath -Destination src-tauri/bins/holochain-v0.2.3-beta-rc.1-x86_64-pc-windows-msvc.exe
Expand All @@ -58,7 +57,7 @@ jobs:
LAIR_PATH=$(which lair-keystore)
cp $LAIR_PATH src-tauri/bins/lair-keystore-v0.3.0-x86_64-apple-darwin
cargo install holochain --version holochain-v0.2.3-beta-rc.1 --locked --features sqlite-encrypted
cargo install holochain --version 0.2.3-beta-rc.1 --locked --features sqlite-encrypted
HOLOCHAIN_PATH=$(which holochain)
cp $HOLOCHAIN_PATH src-tauri/bins/holochain-v0.2.3-beta-rc.1-x86_64-apple-darwin
Expand All @@ -79,7 +78,7 @@ jobs:
cp $LAIR_PATH src-tauri/bins/lair-keystore-v0.3.0-x86_64-unknown-linux-gnu
cargo install holochain --version holochain-v0.2.3-beta-rc.1 --locked --features sqlite-encrypted
cargo install holochain --version 0.2.3-beta-rc.1 --locked --features sqlite-encrypted
HOLOCHAIN_PATH=$(which holochain)
cp $HOLOCHAIN_PATH src-tauri/bins/holochain-v0.2.3-beta-rc.1-x86_64-unknown-linux-gnu
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ This repository let's you easily convert your Holochain app into a standalone ta

# Instructions

1. Install [Rust](https://www.rust-lang.org/tools/install) and [Go](https://go.dev/doc/install) (Go is required for Holochain version 0.2.X). If you are on Linux, follow [these](https://tauri.app/v1/guides/getting-started/prerequisites#1-system-dependencies) instructions to also install the required system dependencies for tauri.
1. Install [Rust](https://www.rust-lang.org/tools/install) and [Go](https://go.dev/doc/install) (Go is required for Holochain version 0.2.X). Then follow the [Tauri Prerequisites](https://tauri.app/v1/guides/getting-started/prerequisites) instructions for your platform.

2. Either use this repository as a template (by clicking on the green "Use this template" button) or fork it.<br>
(Using it as a template allows you to start with a clean git history and the contributors of this repository won't show up as contributors to your new repository. **Forking has the advantage of being able to relatively easily pull in updates from this parent repository at a later stage.**)
Using it as a template allows you to start with a clean git history and the contributors of this repository won't show up as contributors to your new repository. **Forking has the advantage of being able to relatively easily pull in updates from this parent repository at a later stage.**

3. After cloning the newly created repository, run `npm install` to install the relevant tauri dependencies.

4. Compile the holochain and lair-keystore binaries if you intend to build the binary locally on your machine. Follow [this](compile-binaries.md) guide.
4. Compile the holochain and lair-keystore binaries if you intend to build your app locally. On macOS/Linux you can run `bash setup/install_binaries.sh` to do that automatically. On Windows, follow [this](compile-binaries.md) guide.

5. Add your `[your-project].happ` file and your `ui.zip` file to the `./pouch` folder

Expand Down
1 change: 0 additions & 1 deletion compile-binaries.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ cargo install --version 0.3.0 lair_keystore
LAIR_PATH=$(which lair-keystore)
cp $LAIR_PATH src-tauri/bins/lair-keystore-v0.3.0-[_ARCHITECTURE_]
cargo install holochain --version holochain-v0.2.3-beta-rc.1 --locked --features sqlite-encrypted
HOLOCHAIN_PATH=$(which holochain)
cp $HOLOCHAIN_PATH src-tauri/bins/holochain-v0.2.3-beta-rc.1-[_ARCHITECTURE_]
Expand Down
6 changes: 3 additions & 3 deletions setup/install_binaries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ if [ -f "src-tauri/bins/holochain-v${REQUIRED_HOLOCHAIN_VERSION}-$TARGET_TRIPLE"
cargo install holochain --version $REQUIRED_HOLOCHAIN_VERSION --locked --features sqlite-encrypted
echo "Copying holochain binary to src-tauri/bins folder."
HOLOCHAIN_PATH=$(which holochain)
cp $HOLOCHAIN_PATH src-tauri/bins/holochain-v${REQUIRED_HOLOCHAIN_VERSION}-$TARGET_TRIPLE
cp $HOLOCHAIN_PATH src-tauri/bins/holochain-v${REQUIRED_HOLOCHAIN_VERSION}-$TARGET_TRIPLE
fi

# check whether correct lair binary is already in the src-tauri/bins folder
Expand All @@ -47,7 +47,7 @@ if [ -f "src-tauri/bins/lair-keystore-v${REQUIRED_LAIR_VERSION}-${TARGET_TRIPLE}
cargo install lair_keystore --version $REQUIRED_LAIR_VERSION --locked
echo "Copying lair-keystore binary to src-tauri/bins folder."
LAIR_PATH=$(which lair-keystore)
cp $LAIR_PATH src-tauri/bins/lair-keystore-v${REQUIRED_LAIR_VERSION}-$TARGET_TRIPLE
cp $LAIR_PATH src-tauri/bins/lair-keystore-v${REQUIRED_LAIR_VERSION}-$TARGET_TRIPLE
fi

echo "done.\n"
echo "done."
9 changes: 9 additions & 0 deletions src-tauri/entitlements.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict>
<key>com.apple.security.cs.allow-jit</key>
<true/>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
<key>com.apple.security.cs.disable-library-validation</key>
<true/>
</dict>
</plist>
30 changes: 16 additions & 14 deletions src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,20 +65,6 @@ fn main() {
_ => {}
})

// optional (single-instance) -- Allows only a single instance of your app running. Useful in combination with the systray
.plugin(tauri_plugin_single_instance::init(|app, _argv, _cwd| {
let main_window = app.get_window("main");
if let Some(window) = main_window {
window.show().unwrap();
window.unminimize().unwrap();
window.set_focus().unwrap();
} else {
let fs = app.state::<AppFileSystem>().inner().to_owned();
let (app_port, admin_port) = app.state::<(u16, u16)>().inner().to_owned();
let _r = build_main_window(fs, app, app_port, admin_port);
}
}))

.invoke_handler(tauri::generate_handler![
sign_zome_call,
log,
Expand All @@ -100,6 +86,22 @@ fn main() {
let profile = match profile_from_cli {
Some(profile) => profile,
None => {
// ========================================
// optional (single-instance) -- Allows only a single instance of your app running. Useful in combination with the systray
handle.plugin(tauri_plugin_single_instance::init(move |app, _argv, _cwd| {
let main_window = app.get_window("main");
if let Some(window) = main_window {
window.show().unwrap();
window.unminimize().unwrap();
window.set_focus().unwrap();
} else {
let fs = app.state::<AppFileSystem>().inner().to_owned();
let (app_port, admin_port) = app.state::<(u16, u16)>().inner().to_owned();
let _r = build_main_window(fs, app, app_port, admin_port);
}
}))?;
// ========================================

let fs_tmp = AppFileSystem::new(&handle, &String::from("default"))?;
fs_tmp.get_active_profile()
},
Expand Down
9 changes: 8 additions & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,14 @@
"externalBin": [
"bins/holochain-v0.2.3-beta-rc.1",
"bins/lair-keystore-v0.3.0"
]
],
"macOS": {
"frameworks": [],
"minimumSystemVersion": "",
"exceptionDomain": "",
"signingIdentity": null,
"entitlements": "entitlements.plist"
}
},
"security": {
"csp": null
Expand Down

0 comments on commit ad9467c

Please sign in to comment.