Skip to content

Commit

Permalink
Feat: Install watchdog as dependency
Browse files Browse the repository at this point in the history
Install `watchdog` as a dependency into a virtual environment.
This allows to use different versions of Python
without relying on a particular commit of a submodule (the latest
version of `watchdog` (4.0) requires Python 3.8). Run

    make PYTHON=python3.7 USER=1 native-install

to set particular Python version.
  • Loading branch information
phdru committed Feb 24, 2024
1 parent dab83c0 commit fe84b6c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ else
endif

LIBEXEC ?= $(PREFIX)/libexec
PYTHON ?= python3

.PHONY: all
all:
Expand All @@ -29,7 +30,11 @@ native-install: native/textern.json
mkdir -p $(DESTDIR)$(MOZILLA_NATIVE)
cp -f native/textern.json $(DESTDIR)$(MOZILLA_NATIVE)
mkdir -p $(DESTDIR)$(LIBEXEC)/textern
cp -rf native/textern.py $(DESTDIR)$(LIBEXEC)/textern
$(PYTHON) -m venv $(DESTDIR)$(LIBEXEC)/textern/venv
$(DESTDIR)$(LIBEXEC)/textern/venv/bin/python -m pip install watchdog
sed "s@#!/usr/bin/env python3@#!$(DESTDIR)$(LIBEXEC)/textern/venv/bin/python@" \
< native/textern.py > $(DESTDIR)$(LIBEXEC)/textern/textern.py
chmod a+x $(DESTDIR)$(LIBEXEC)/textern/textern.py

.PHONY: native-uninstall
native-uninstall:
Expand Down

0 comments on commit fe84b6c

Please sign in to comment.