From 7170e35096f0afd084be1350d080695c70c65d40 Mon Sep 17 00:00:00 2001 From: Ebrahim Byagowi Date: Mon, 29 Oct 2018 13:11:01 +0330 Subject: [PATCH] Rename deprecated symbols list file name and clean it up (#1328) --- src/Makefile.am | 6 +++--- src/gen-def.py | 9 ++++----- test/api/Makefile.am | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index a51048b70..fbd8f6023 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -268,7 +268,7 @@ EXTRA_DIST += \ CLEANFILES += $(pkgconfig_DATA) -DEF_FILES = harfbuzz.def harfbuzz-subset.def harfbuzz-icu.def harfbuzz-deprecated.def +DEF_FILES = harfbuzz.def harfbuzz-subset.def harfbuzz-icu.def harfbuzz-deprecated-symbols.txt if HAVE_GOBJECT DEF_FILES += harfbuzz-gobject.def endif @@ -282,8 +282,8 @@ harfbuzz-icu.def: $(HB_ICU_headers) $(AM_V_GEN) $(srcdir)/gen-def.py "$@" $^ harfbuzz-gobject.def: $(HB_GOBJECT_headers) $(AM_V_GEN) $(srcdir)/gen-def.py "$@" $^ -harfbuzz-deprecated.def: $(srcdir)/hb-deprecated.h - $(AM_V_GEN) $(srcdir)/gen-def.py "$@" $^ +harfbuzz-deprecated-symbols.txt: $(srcdir)/hb-deprecated.h + $(AM_V_GEN) PLAIN_LIST=1 $(srcdir)/gen-def.py "$@" $^ GENERATORS = \ diff --git a/src/gen-def.py b/src/gen-def.py index ba39eaae5..9111c698c 100755 --- a/src/gen-def.py +++ b/src/gen-def.py @@ -15,11 +15,10 @@ for h in header_paths: if h.endswith (".h"): with io.open (h, encoding='utf-8') as f: headers_content.append (f.read ()) -result = """EXPORTS +symbols = "\n".join (sorted (re.findall (r"^hb_\w+(?= \()", "\n".join (headers_content), re.M))) + +result = symbols if os.environ.get('PLAIN_LIST', '') else """EXPORTS %s -LIBRARY lib%s-0.dll""" % ( - "\n".join (sorted (re.findall (r"^hb_\w+(?= \()", "\n".join (headers_content), re.M))), - output_file.replace ('.def', '') -) +LIBRARY lib%s-0.dll""" % (symbols, output_file.replace ('.def', '')) with open (output_file, "w") as f: f.write (result) diff --git a/test/api/Makefile.am b/test/api/Makefile.am index 45a34e64d..c233a90ed 100644 --- a/test/api/Makefile.am +++ b/test/api/Makefile.am @@ -167,7 +167,7 @@ symbols-tested.txt: $(TEST_PROGS) $(AM_V_GEN)$(top_builddir)/libtool --mode=execute nm $^ \ | grep ' U hb_' | sed 's/.* U hb_/hb_/' \ | sort | uniq > $@.tmp && mv $@.tmp $@ -symbols-tested-or-deprecated.txt: symbols-tested.txt $(top_builddir)/src/harfbuzz-deprecated.def +symbols-tested-or-deprecated.txt: symbols-tested.txt $(top_builddir)/src/harfbuzz-deprecated-symbols.txt $(AM_V_GEN)cat $^ | sort | uniq > $@.tmp; mv $@.tmp $@ symbols-exported.txt: $(top_builddir)/src/.libs/libharfbuzz.so $(AM_V_GEN)$(top_builddir)/libtool --mode=execute nm $^ \