diff --git a/.azure/msys2-install.sh b/.azure/msys2-install.sh index 904c1b2f00..670b83d549 100755 --- a/.azure/msys2-install.sh +++ b/.azure/msys2-install.sh @@ -15,13 +15,8 @@ pacman --noconfirm -S --needed \ mingw-w64-$MSYS2_ARCH-gobject-introspection \ mingw-w64-$MSYS2_ARCH-python3 \ mingw-w64-$MSYS2_ARCH-python3-lxml \ - mingw-w64-$MSYS2_ARCH-python3-importlib-metadata \ mingw-w64-$MSYS2_ARCH-python3-gobject \ mingw-w64-$MSYS2_ARCH-python3-cairo \ - mingw-w64-$MSYS2_ARCH-python3-pip \ - mingw-w64-$MSYS2_ARCH-python3-setuptools \ - mingw-w64-$MSYS2_ARCH-python3-zope.interface \ - mingw-w64-$MSYS2_ARCH-python3-coverage \ - mingw-w64-$MSYS2_ARCH-python3-pytest + mingw-w64-$MSYS2_ARCH-python3-pip -source venv +./venv -S diff --git a/README.md b/README.md index 2ca9b6d22b..ddb64f9fa5 100644 --- a/README.md +++ b/README.md @@ -105,14 +105,19 @@ To setup a development environment in Windows: ```bash $ pacman -Suy $ pacman -S mingw-w64-x86_64-gtk3 mingw-w64-x86_64-python3-gobject mingw-w64-x86_64-python3-cairo -$ pacman -S mingw-w64-x86_64-python3-pip mingw-w64-x86_64-python3-setuptools +$ pacman -S mingw-w64-x86_64-python3-pip mingw-w64-x86_64-python3-lxml ``` Install git if it isn't already installed in msys2 with `pacman -S git` +Ensure `/mingw64/bin` is added to your `PATH`: +```bash +$ export PATH=/mingw64/bin:$PATH +``` + [Clone the repository](https://help.github.com/en/articles/cloning-a-repository). ```bash $ cd gaphor -$ source ./venv +$ source ./venv -S $ poetry run gaphor ``` diff --git a/venv b/venv index c7f73b62ec..bce3a97e4c 100755 --- a/venv +++ b/venv @@ -18,6 +18,12 @@ brew --version >/dev/null 2>&1 && { export PKG_CONFIG_PATH="${libffi_path}:${PKG_CONFIG_PATH:-}" } +echo "Are we on MSys (Windows)?" +uname -a | grep -q MSYS_NT && { + export PKG_CONFIG_PATH="/mingw64/lib/pkgconfig:${PKG_CONFIG_PATH:-}" + export PATH="/mingw64/bin:${PATH}" +} + ( # Do the whole installation process in a sub-shell, so we can safely fail when # this file is sourced in the parent shell. @@ -30,12 +36,17 @@ brew --version >/dev/null 2>&1 && { NO_FORCE_INSTALL=true - while getopts 'fh' OPTION + while getopts 'fSh' OPTION do case "$OPTION" in f) NO_FORCE_INSTALL=false ;; + S) + VENV_OPTS="--system-site-packages" + ;; + h) echo "Usage: $0 [-f] [-S] [-h] # -f = force install, -S = Use system site packages, -h = this message" + exit 0 esac done @@ -53,7 +64,7 @@ brew --version >/dev/null 2>&1 && { test -d .venv || { echo "Setting up a virtual env for Gaphor..." - python3 -m venv --prompt Gaphor .venv + python3 -m venv --prompt Gaphor ${VENV_OPTS:-} .venv } source .venv/bin/activate