Skip to content

Commit

Permalink
Merge pull request #199 from gaphor/pyinstaller
Browse files Browse the repository at this point in the history
Convert Windows Install to PyInstaller
  • Loading branch information
danyeaw committed Oct 22, 2019
2 parents 6bba575 + 0da03bf commit ef1ef87
Show file tree
Hide file tree
Showing 16 changed files with 260 additions and 1,479 deletions.
24 changes: 1 addition & 23 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,19 +75,7 @@ def run(self):
"Topic :: Software Development :: Documentation",
],
keywords="model modeling modelling uml diagram python tool",
packages=find_packages(
exclude=[
"utils*",
"docs",
"tests",
"windows",
"macOS",
"linux",
"iOS",
"android",
"django",
]
),
packages=find_packages(exclude=["utils*", "docs", "tests"]),
include_package_data=True,
install_requires=[
"pycairo >= 1.17.0",
Expand Down Expand Up @@ -137,16 +125,6 @@ def run(self):
},
tests_require=["pytest"],
options={
"app": {"formal_name": "Gaphor", "bundle": "org.gaphor"},
# Desktop/laptop deployments
"macos": {"app_requires": [], "icon": "package/gaphor"},
"linux": {"app_requires": []},
"windows": {"app_requires": []},
# Mobile deployments
"ios": {"app_requires": []},
"android": {"app_requires": []},
# Web deployments
"django": {"app_requires": []},
# Translations
"build_pot": {"all_linguas": ",".join(LINGUAS)},
"build_mo": {"all_linguas": ",".join(LINGUAS)},
Expand Down
35 changes: 7 additions & 28 deletions win-installer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,7 @@
We use msys2 for creating the Windows installer and development on Windows
because that is what PyGObject currently supports.

## Development
For developing on Windows you have two choices.

#### 1. Use an Existing Gaphor Installation Plus a Git Checkout:
- Clone the git repo with some git client
- Download and install the latest [installer
build](https://github.com/gaphor/gaphor/releases/download/latest/gaphor-latest-installer.exe)
- Go to setup.py in the git checkout and run C:\Program
Files\Gaphor\bin\python.exe setup.py run.

#### 2. Use a Full MSYS2 Environment
### Use a Full MSYS2 Environment
- Download msys2 64-bit from https://msys2.org
- Follow instructions on https://msys2.org
- Execute C:\msys64\mingw64.exe
Expand All @@ -22,24 +12,13 @@ Files\Gaphor\bin\python.exe setup.py run.
- Run cd gaphor/win_installer to end up where this README exists.
- Execute `./bootstrap.sh` to install all the needed dependencies.
- Now go to the source code `cd ../`
- To run Gaphor execute `python3 setup.py run`
- Execute `python -m venv .venv` to create a virtualenv
- Activate the virtualenv with `source .venv/bin/activate`
- Install poetry with `pip install poetry`
- Install the dependencies with `poetry install`
- Run gaphor by typing `gaphor

## Creating an Installer
Simply run `./build.sh` and both the installer and the portable
Simply run `./build-installer.sh` and both the installer and the portable
installer should appear in this directory.

You can also run the build using a specific git version:
1. Pass a git tag with: `./build.sh release-1.0.0`
1. Pass a git commit hash with: `./build.sh a5d3e53406fadd1fe089aa995b650949256d4981`
1. Pass nothing to build master

Note: `build.sh` clones from the local repository and not from GitHub so any
commits present locally will be cloned as well.

## Updating an Existing Installer
We directly follow msys2 upstream so building the installer two weeks later
might result in newer versions of dependencies being used. To reduce the risk of
stable release breakage you can use an existing installer and just install a
newer Gaphor version into it and then repack it:

`./rebuild.sh gaphor-1.0.0-installer.exe [git tag / commit]`

0 comments on commit ef1ef87

Please sign in to comment.