emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Process to build standalone Emacs + deps in Windows


From: Juan José García-Ripoll
Subject: Re: Process to build standalone Emacs + deps in Windows
Date: Wed, 25 Mar 2020 15:54:05 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (windows-nt)

Juan José García-Ripoll <address@hidden> writes:
> I attach a patch file that changes build-dep-zips.py with the following
> fixes

As usual, the missing attachment below.

-- 
Juan José García Ripoll
http://juanjose.garciaripoll.com
http://quinfog.hbar.es

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()

reply via email to

[Prev in Thread] Current Thread [Next in Thread]