From fab2dd3478fae0b0d54bf311e17975a75d4640ec Mon Sep 17 00:00:00 2001 From: Daiki Ueno Date: Thu, 24 Aug 2023 11:50:09 +0900 Subject: [PATCH] pkcs11-json: Make use of Meson subprojects feature This moves the pkcs11-json submodule under "subprojects", following the Meson subprojects convention. This allows the submodule to be automatically initialized when running meson setup. Signed-off-by: Daiki Ueno --- .gitmodules | 2 +- Makefile.am | 4 ++-- meson.build | 4 +++- p11-kit/Makefile.am | 16 ++++++++-------- pkcs11-json | 1 - subprojects/pkcs11-json | 1 + 6 files changed, 15 insertions(+), 13 deletions(-) delete mode 160000 pkcs11-json create mode 160000 subprojects/pkcs11-json diff --git a/.gitmodules b/.gitmodules index a858fe325..368bf8485 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "pkcs11-json"] - path = pkcs11-json + path = subprojects/pkcs11-json url = https://github.com/p11-glue/pkcs11-json.git diff --git a/Makefile.am b/Makefile.am index 00723c518..ea17862d1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -27,7 +27,7 @@ CLEANFILES = EXTRA_DIST = CONTRIBUTING.md meson.build meson_options.txt po/meson.build \ doc/manual/meson.build doc/manual/userdir.xml.in \ doc/manual/sysdir.xml.in doc/manual/version.xml.in \ - bash-completion pkcs11-json + bash-completion subprojects incdir = $(includedir)/p11-kit-1/p11-kit inc_HEADERS = @@ -57,7 +57,7 @@ endif PKCS11_JSON_INPUT = $(srcdir)/common/pkcs11.h -include pkcs11-json/Makefile.am +include subprojects/pkcs11-json/Makefile.am SUBDIRS = . doc po diff --git a/meson.build b/meson.build index e3e25492d..4887568ff 100644 --- a/meson.build +++ b/meson.build @@ -440,7 +440,9 @@ if not python_version.version_compare(python_version_req) error('Requires Python @0@, @1@ found.'.format(python_version_req, python_version)) endif -subdir('pkcs11-json') +pkcs11_json_project = subproject('pkcs11-json') +pkcs11_json = pkcs11_json_project.get_variable('pkcs11_json') + subdir('common') subdir('p11-kit') subdir('fuzz') diff --git a/p11-kit/Makefile.am b/p11-kit/Makefile.am index b4f1acfa2..14650a5e1 100644 --- a/p11-kit/Makefile.am +++ b/p11-kit/Makefile.am @@ -44,35 +44,35 @@ CLEANFILES += \ $(VIRTUAL_GENERATED) \ $(NULL) -p11-kit/virtual-ffi-generated.h: Makefile p11-kit/gen-wrappers.py pkcs11-json/pkcs11.json +p11-kit/virtual-ffi-generated.h: Makefile p11-kit/gen-wrappers.py subprojects/pkcs11-json/pkcs11.json $(AM_V_GEN)$(PYTHON) $(srcdir)/p11-kit/gen-wrappers.py \ --template $(srcdir)/p11-kit/templates/binding-wrappers.py \ --excludes $(srcdir)/p11-kit/templates/virtual-excludes.list \ - --infile $(srcdir)/pkcs11-json/pkcs11.json --outfile $@ + --infile $(srcdir)/subprojects/pkcs11-json/pkcs11.json --outfile $@ -p11-kit/virtual-fixed-wrappers.h: Makefile p11-kit/gen-wrappers.py pkcs11-json/pkcs11.json +p11-kit/virtual-fixed-wrappers.h: Makefile p11-kit/gen-wrappers.py subprojects/pkcs11-json/pkcs11.json $(AM_V_GEN)$(PYTHON) $(srcdir)/p11-kit/gen-wrappers.py \ --template $(srcdir)/p11-kit/templates/fixed-wrappers.py \ --excludes $(srcdir)/p11-kit/templates/virtual-excludes.list \ --renames C_GetFunctionStatus:short C_CancelFunction:short \ --concat-lines \ - --infile $(srcdir)/pkcs11-json/pkcs11.json --outfile $@ + --infile $(srcdir)/subprojects/pkcs11-json/pkcs11.json --outfile $@ p11-kit/virtual-fixed-closures.h: Makefile p11-kit/gen-fixed-closures.py $(AM_V_GEN)$(PYTHON) $(srcdir)/p11-kit/gen-fixed-closures.py \ --closures $(closures) --outfile $@ -p11-kit/virtual-stack-generated.h: Makefile p11-kit/gen-wrappers.py pkcs11-json/pkcs11.json +p11-kit/virtual-stack-generated.h: Makefile p11-kit/gen-wrappers.py subprojects/pkcs11-json/pkcs11.json $(AM_V_GEN)$(PYTHON) $(srcdir)/p11-kit/gen-wrappers.py \ --template $(srcdir)/p11-kit/templates/stack-wrappers.py \ --excludes $(srcdir)/p11-kit/templates/virtual-excludes.list \ - --infile $(srcdir)/pkcs11-json/pkcs11.json --outfile $@ + --infile $(srcdir)/subprojects/pkcs11-json/pkcs11.json --outfile $@ -p11-kit/virtual-base-generated.h: Makefile p11-kit/gen-wrappers.py pkcs11-json/pkcs11.json +p11-kit/virtual-base-generated.h: Makefile p11-kit/gen-wrappers.py subprojects/pkcs11-json/pkcs11.json $(AM_V_GEN)$(PYTHON) $(srcdir)/p11-kit/gen-wrappers.py \ --template $(srcdir)/p11-kit/templates/base-wrappers.py \ --excludes $(srcdir)/p11-kit/templates/virtual-excludes.list \ - --infile $(srcdir)/pkcs11-json/pkcs11.json --outfile $@ + --infile $(srcdir)/subprojects/pkcs11-json/pkcs11.json --outfile $@ lib_LTLIBRARIES += \ libp11-kit.la diff --git a/pkcs11-json b/pkcs11-json deleted file mode 160000 index 66327553e..000000000 --- a/pkcs11-json +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 66327553effe36348606fd09e218c7148a4631fb diff --git a/subprojects/pkcs11-json b/subprojects/pkcs11-json new file mode 160000 index 000000000..2cc151a46 --- /dev/null +++ b/subprojects/pkcs11-json @@ -0,0 +1 @@ +Subproject commit 2cc151a46dbf475b492eaaa843d52907eafab3c1