-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PR: Contrib Build instructions for Safari Extensions and added make's phny-pipeline for MacOS #43
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,5 @@ | |
/*.xpi | ||
dist | ||
web-ext-artifacts | ||
xcprj/ | ||
Shiori/ |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,85 @@ | ||||||
## Building Shiori for Safari | ||||||
|
||||||
Just a small quick write-up how to compile the extension without much changes to work in Safari as well. | ||||||
|
||||||
### Toolchain & General Requirements | ||||||
|
||||||
* Tested on XCode v14.3 running on MacOS Mojave (Macbook Pro M1) | ||||||
* Install `web-ext` requirements from Shiori's own toolchain | ||||||
- `npm install --global web-ext` | ||||||
* Open `Safari -> Settings` and enable "Develop" (development) Menu Bar | ||||||
* Again, in Safari, press the newly `Develop` menubar and enable `Allow Unsigned Extensions` | ||||||
* Quit Safari and head over to `shiori-web-ext` repository | ||||||
|
||||||
### Building Shiori | ||||||
|
||||||
Clone the repository as usual; | ||||||
|
||||||
```sh | ||||||
$ git clone https://github.com/go-shiori/shiori-web-ext.git | ||||||
$ cd shiori-web-ext | ||||||
``` | ||||||
|
||||||
The `Makefile` should, with this branch, contain a `run-safari` make handler. | ||||||
|
||||||
```sh | ||||||
$ cat Makefile | grep Safari -C 2 | ||||||
# ... | ||||||
# run-safari: | ||||||
# xcrun safari-web-extension-converter . --project-location xcprj/ --app-name Shiori --bundle-identifier com.durakiconsulting.shiori --macos-only --force | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
``` | ||||||
|
||||||
You need to set `ENV` variable `SHIORI_BUNDLE_IDENTIFIER` to your bundle identifier, using classical bundle identifier naming convention, such is `ext.yourcompanyname.shiori`. This identifier can be passed during make (defaults to `'com.durakiconsulting.shiori'`). | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
```sh | ||||||
$ make run-safari # bundles with default identifier | ||||||
|
||||||
# ... OR ... | ||||||
|
||||||
$ make run-safari SHIORI_BUNDLE_IDENTIFIER=com.yourcompanyname.shiori | ||||||
|
||||||
# ... | ||||||
# make all | ||||||
# ... | ||||||
|
||||||
# Xcode Project Location: $(PWD)/xcprj | ||||||
# App Name: Shiori | ||||||
# App Bundle Identifier: com.yourcompanyname.shiori | ||||||
# Platform: macOS | ||||||
# Language: Swift | ||||||
# | ||||||
# All Done. [safari-web-ext @ shiori built] 🙌 | ||||||
# | ||||||
# Execute manually to open XCode Project: | ||||||
# open xcprj/Shiori/Shiori.xcodeproj | ||||||
``` | ||||||
|
||||||
Upon successful Safari build pipeline, you will end up with `xcprj/` directory in the repository root directory. Enter the command seen in the Terminal output: | ||||||
|
||||||
```sh | ||||||
$ open xcprj/Shiori/Shiori.xcodeproj | ||||||
# ... XCode will open ... | ||||||
``` | ||||||
|
||||||
### Compiling via XCode | ||||||
|
||||||
Once in XCode, run `Shift + Cmd + R` (`Product => Build For => Running` via Menu) to build release version and generate application product. | ||||||
Once the above finished, click `Product => Show Build folder in Finder` and enter `Product/Debug/` directory from inside the Finder and you should see `Shiori.app`. | ||||||
|
||||||
![](/docs/safari-product-extbuild.png) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't this be?
Suggested change
|
||||||
|
||||||
### Running | ||||||
|
||||||
Open the built Shiori application and follow the screen instructions. | ||||||
|
||||||
![](/docs/safari-enable-shiori-ext.png) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't this be?
Suggested change
|
||||||
|
||||||
Once enabled, you can click `Settings` button for Shiori, or right-click on Shiori toolbar icon, and click `Manage Extension`. This will open Shiori Session settings where you will enter your server URL and username and password combo. | ||||||
|
||||||
![](/docs/safari-ext-usage-settings.png) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't this be?
Suggested change
|
||||||
|
||||||
**Note:** Be free to move the built Shiori extension to your `/Applications` directory to enjoy bugs free deployment on your Host OS. | ||||||
|
||||||
**Note:** You can use `make clean` to cleanup your build directory and XCode project as to not take space on your disk. | ||||||
|
||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.