mirror of
https://github.com/ciromattia/kcc
synced 2026-09-29 22:22:36 +00:00
Destroyed How to build M1 (markdown)
@@ -1,89 +0,0 @@
|
|||||||
Based on @celogeek's instructions: https://github.com/darodi/kcc/issues/4#issuecomment-1364553511
|
|
||||||
|
|
||||||
# Requirements
|
|
||||||
- [Homebrew](https://brew.sh) installed
|
|
||||||
- Python 3.9-3.11. In this tutorial, we will use Python 3.9. If you use other versions, remember to change it in the commands.
|
|
||||||
|
|
||||||
# Steps
|
|
||||||
1. Create a new Python environment.
|
|
||||||
|
|
||||||
```
|
|
||||||
python3.9 -m venv kindle
|
|
||||||
```
|
|
||||||
|
|
||||||
3. Activate new environment.
|
|
||||||
|
|
||||||
```
|
|
||||||
source kindle/bin/activate
|
|
||||||
```
|
|
||||||
4. Install dependencies from Homebrew. Remember the `pyqt@5` version installed. At the time of writing, the latest version is `5.15.7_2`.
|
|
||||||
|
|
||||||
```
|
|
||||||
brew install pyqt@5 boost-python3 cmake node
|
|
||||||
```
|
|
||||||
|
|
||||||
5. Install `appdmg` for packaging.
|
|
||||||
|
|
||||||
```
|
|
||||||
npm install -g appdmg
|
|
||||||
```
|
|
||||||
|
|
||||||
6. Bind `pyqt@5` to Python. Change the version number of `pyqt@5` if necessary.
|
|
||||||
|
|
||||||
```
|
|
||||||
export PYTHONPATH=/opt/homebrew/Cellar/pyqt@5/5.15.7_2/lib/python3.9/site-packages
|
|
||||||
```
|
|
||||||
|
|
||||||
To check if `PyQt5` is correctly binded, run `pip freeze | grep PyQt5` and see if `PyQt5` shows up.
|
|
||||||
|
|
||||||
7. In repo folder, install Python dependencies and `pyinstaller`.
|
|
||||||
|
|
||||||
```
|
|
||||||
pip install -r requirements.txt
|
|
||||||
pip install pyinstaller
|
|
||||||
```
|
|
||||||
|
|
||||||
8. Compile 7z.
|
|
||||||
|
|
||||||
```
|
|
||||||
git clone https://github.com/p7zip-project/p7zip.git
|
|
||||||
cd p7zip
|
|
||||||
git checkout v17.04
|
|
||||||
make -j4 7z
|
|
||||||
```
|
|
||||||
|
|
||||||
9. Replace repo's 7z binaries and libraries with the one you compiled. In the `bin` directory of `p7zip`, you should have
|
|
||||||
|
|
||||||
```
|
|
||||||
bin
|
|
||||||
├── 7z
|
|
||||||
├── 7z.so
|
|
||||||
└── Codecs
|
|
||||||
└── Rar.so
|
|
||||||
```
|
|
||||||
|
|
||||||
Copy and replace those files into `kcc`'s `other/osx`. Running `git status` should give the following output.
|
|
||||||
```
|
|
||||||
git status
|
|
||||||
modified: other/osx/7z
|
|
||||||
modified: other/osx/7z.so
|
|
||||||
modified: other/osx/Rar.so
|
|
||||||
```
|
|
||||||
|
|
||||||
10. Build the app. The DMG file will show up in `dist` folder.
|
|
||||||
|
|
||||||
```
|
|
||||||
python setup.py build_binary
|
|
||||||
```
|
|
||||||
|
|
||||||
# Updating KCC
|
|
||||||
|
|
||||||
In order to update KCC, run:
|
|
||||||
|
|
||||||
```
|
|
||||||
git stash
|
|
||||||
git pull
|
|
||||||
git stash pop
|
|
||||||
rm -rf dist
|
|
||||||
python setup.py build_binary
|
|
||||||
```
|
|
||||||
Reference in New Issue
Block a user