Skip to content

Commit

Permalink
pkcs11-json: Make use of Meson subprojects feature
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
ueno committed Aug 24, 2023
1 parent 3c2575c commit fab2dd3
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "pkcs11-json"]
path = pkcs11-json
path = subprojects/pkcs11-json
url = https://github.com/p11-glue/pkcs11-json.git
4 changes: 2 additions & 2 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down Expand Up @@ -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

Expand Down
4 changes: 3 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
16 changes: 8 additions & 8 deletions p11-kit/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion pkcs11-json
Submodule pkcs11-json deleted from 663275
1 change: 1 addition & 0 deletions subprojects/pkcs11-json
Submodule pkcs11-json added at 2cc151

0 comments on commit fab2dd3

Please sign in to comment.