diff --git a/admin/nt/dist-build/build-dep-zips.py b/admin/nt/dist-build/build-dep-zips.py index 33ed4b6..6390eae 100755 --- a/admin/nt/dist-build/build-dep-zips.py +++ b/admin/nt/dist-build/build-dep-zips.py @@ -83,6 +83,11 @@ def immediate_deps(pkg): dependencies = [d.split(">")[0] for d in dependencies if d] dependencies = [d for d in dependencies if not d == "None"] + if dependencies: + print(f"Package {pkg} depends on:") + for d in dependencies: + print(f" -> {d}") + dependencies = [MUNGE_DEP_PKGS.get(d, d) for d in dependencies] return dependencies @@ -107,7 +112,8 @@ def extract_deps(): def gather_deps(deps, arch, directory): - os.mkdir(arch) + if not os.path.exists(arch): + os.mkdir(arch) os.chdir(arch) ## Replace the architecture with the correct one @@ -135,11 +141,56 @@ def gather_deps(deps, arch, directory): print("Copying dependencies: {}".format(arch)) check_output_maybe(["rsync", "-R"] + deps_files + ["."]) + ## exclude files + excludes=['lib/*.a', # No files to link against + 'lib/*/*.exe', # No hidden executables + 'libexec/*/*.exe', + 'include/*', # No development files + 'lib/cmake/*', + 'lib/pkgconfig/*', + 'lib/python*/*', + 'share/aclocal/*', + 'share/gettext/*', + 'share/doc/*', # No documentation from libraries + 'share/gtk-doc/*', + 'share/man/*', + 'share/info/*', + 'bin/*tiff*.exe', # No graphic manipulation tools + 'bin/img*.exe', + 'bin/*gif*.exe', + 'bin/*jpg*.exe', + 'bin/*jpeg*.exe', + 'bin/*png*.exe', + 'bin/*svg*.exe', + 'bin/*xpm*.exe', + 'bin/*icc.exe', + 'bin/fax2*.exe', + 'bin/pango-*.exe', + 'bin/gdk-*.exe', + 'bin/jasper.exe', + 'bin/fc-*.exe', # No font configuration tools + 'bin/gr2fonttest.exe', + 'bin/hb-*.exe', + 'bin/msg*.exe', # No tools to manipulate gettext catalogues + 'bin/*gettext.exe' + ] + ## Files that might have been excluded by those rules + includes=[] + ## Build command line argument for zip + if excludes: + excludes = '-x '+' '.join(excludes).replace('*','\\*') + else: + excludes = '' + if includes: + includes = '-i '+' '.join(includes).replace('*','\\*') + else: + includes='' + ## And package them up os.chdir(directory) print("Zipping: {}".format(arch)) - check_output_maybe("zip -9r ../../emacs-{}-{}{}-deps.zip *" - .format(EMACS_MAJOR_VERSION, DATE, arch), + check_output_maybe("zip -9r ../../emacs-{}-{}{}-deps.zip * {} {}" + .format(EMACS_MAJOR_VERSION, DATE, arch, excludes, includes), shell=True) os.chdir("../../") @@ -255,6 +306,17 @@ def clean(): args = parser.parse_args() do_all=not (args.c or args.r or args.f or args.t) +if( args.c ): + clean() + exit(0) + +# The dependency extraction relies on an English version of pacman +# We need to configure the locale to match the expectations +if 'LANG' in os.environ: + os_lang = os.environ['LANG'] + if (len(os_lang) > 2) and (os_lang[0:2] != 'en'): + os.environ['LANG']='en_US' + deps=extract_deps() DRY_RUN=args.d @@ -277,6 +339,3 @@ def clean(): if( do_all or args.r ): gather_source(deps) - -if( args.c ): - clean()