Skip to content

Commit 4fdd249

Browse files
committed
Makefile: generate and install requirements.txt files for Python plugins.
Doesn't automate the install, but at least provides some tools for users to install the requirements on their systems Changelog-Added: Install: we now supply requirements.txt file for Python plugin (i.e. wss-proxy). See-also: ElementsProject#7665 Signed-off-by: Rusty Russell <[email protected]>
1 parent 75c487a commit 4fdd249

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

Makefile

+6-2
Original file line numberDiff line numberDiff line change
@@ -812,10 +812,10 @@ installdirs:
812812

813813
# $(PLUGINS) is defined in plugins/Makefile.
814814

815-
install-program: installdirs $(BIN_PROGRAMS) $(PKGLIBEXEC_PROGRAMS) $(PLUGINS) $(PY_PLUGINS)
815+
install-program: installdirs $(BIN_PROGRAMS) $(PKGLIBEXEC_PROGRAMS) $(PLUGINS) $(PY_PLUGINS) $(PLUGIN_REQUIREMENTS_TXT)
816816
@$(NORMAL_INSTALL)
817817
$(INSTALL_PROGRAM) $(BIN_PROGRAMS) $(DESTDIR)$(bindir)
818-
$(INSTALL_PROGRAM) $(PKGLIBEXEC_PROGRAMS) $(DESTDIR)$(pkglibexecdir)
818+
$(INSTALL_PROGRAM) $(PKGLIBEXEC_PROGRAMS) $(PLUGIN_REQUIREMENTS_TXT) $(DESTDIR)$(pkglibexecdir)
819819
[ -z "$(PLUGINS)" ] || $(INSTALL_PROGRAM) $(PLUGINS) $(DESTDIR)$(plugindir)
820820
for PY in $(PY_PLUGINS); do DIR=`dirname $$PY`; DST=$(DESTDIR)$(plugindir)/`basename $$DIR`; if [ -d $$DST ]; then rm -rf $$DST; fi; $(INSTALL_PROGRAM) -d $$DIR; cp -a $$DIR $$DST ; done
821821

@@ -894,6 +894,10 @@ uninstall:
894894
$(ECHO) rm -f $(DESTDIR)$(docdir)/`basename $$f`; \
895895
rm -f $(DESTDIR)$(docdir)/`basename $$f`; \
896896
done
897+
@for f in $(PLUGIN_REQUIREMENTS_TXT); do \
898+
$(ECHO) rm -f $(DESTDIR)$(pkglibexecdir)/`basename $$f`; \
899+
rm -f $(DESTDIR)$(pkglibexecdir)/`basename $$f`; \
900+
done
897901

898902
installcheck: all-programs
899903
@rm -rf testinstall || true

plugins/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@ cln-askrene
2020
recklessrpc
2121
exposesecret
2222
cln-xpay
23+
wss-proxy-requirements.txt

plugins/Makefile

+9
Original file line numberDiff line numberDiff line change
@@ -311,8 +311,17 @@ include plugins/rest-plugin/Makefile
311311
DEFAULT_TARGETS += $(CLN_PLUGIN_EXAMPLES) plugins/cln-grpc plugins/clnrest
312312
endif
313313

314+
ifneq ($(NO_PYTHON), 1)
315+
PLUGIN_REQUIREMENTS_TXT := plugins/wss-proxy-requirements.txt
316+
plugins/wss-proxy-requirements.txt: plugins/wss-proxy/pyproject.toml plugins/wss-proxy/poetry.lock
317+
cd plugins/wss-proxy && poetry export --without-hashes > ../../$@
318+
319+
all-programs: $(PLUGIN_REQUIREMENTS_TXT)
320+
endif
321+
314322
clean: plugins-clean
315323
plugins-clean:
324+
$(RM) $(PLUGIN_REQUIREMENTS_TXT)
316325
$(RM) $(PLUGINS) $(CLN_PLUGIN_EXAMPLES)
317326
$(RM) plugins/sql-schema_gen.h
318327

0 commit comments

Comments
 (0)