diff options
Diffstat (limited to 'admin')
| -rwxr-xr-x | admin/nt/dist-build/build-dep-zips.py | 278 | ||||
| -rw-r--r-- | admin/nt/dist-build/emacs.nsi | 95 | ||||
| -rw-r--r-- | admin/release-process | 22 |
3 files changed, 310 insertions, 85 deletions
diff --git a/admin/nt/dist-build/build-dep-zips.py b/admin/nt/dist-build/build-dep-zips.py index 0b1cc4d8695..9df5d6703a8 100755 --- a/admin/nt/dist-build/build-dep-zips.py +++ b/admin/nt/dist-build/build-dep-zips.py | |||
| @@ -20,41 +20,56 @@ import argparse | |||
| 20 | import os | 20 | import os |
| 21 | import shutil | 21 | import shutil |
| 22 | import re | 22 | import re |
| 23 | import functools | 23 | import subprocess |
| 24 | import operator | ||
| 25 | 24 | ||
| 26 | from subprocess import check_output | 25 | from subprocess import check_output |
| 27 | 26 | ||
| 28 | ## Constants | 27 | ## Constants |
| 29 | EMACS_MAJOR_VERSION="28" | 28 | EMACS_MAJOR_VERSION= os.getenv('EMACS_MAJOR_VERSION') or "30" |
| 30 | 29 | ||
| 31 | # This list derives from the features we want Emacs to compile with. | 30 | # Base URI for the package sources mapped in PKG_REQ |
| 31 | SRC_REPO="https://repo.msys2.org/mingw/sources" | ||
| 32 | |||
| 33 | # Map items in `dynamic-library-alist' to source pakages | ||
| 32 | PKG_REQ='''mingw-w64-x86_64-giflib | 34 | PKG_REQ='''mingw-w64-x86_64-giflib |
| 33 | mingw-w64-x86_64-gnutls | 35 | mingw-w64-x86_64-gnutls |
| 34 | mingw-w64-x86_64-harfbuzz | 36 | mingw-w64-x86_64-harfbuzz |
| 37 | mingw-w64-x86_64-jansson | ||
| 35 | mingw-w64-x86_64-lcms2 | 38 | mingw-w64-x86_64-lcms2 |
| 36 | mingw-w64-x86_64-libjpeg-turbo | 39 | mingw-w64-x86_64-libjpeg-turbo |
| 37 | mingw-w64-x86_64-libpng | 40 | mingw-w64-x86_64-libpng |
| 38 | mingw-w64-x86_64-librsvg | 41 | mingw-w64-x86_64-librsvg |
| 42 | mingw-w64-x86_64-libwebp | ||
| 39 | mingw-w64-x86_64-libtiff | 43 | mingw-w64-x86_64-libtiff |
| 40 | mingw-w64-x86_64-libxml2 | 44 | mingw-w64-x86_64-libxml2 |
| 41 | mingw-w64-x86_64-xpm-nox'''.split() | 45 | mingw-w64-x86_64-gmp |
| 42 | 46 | mingw-w64-x86_64-xpm-nox | |
| 43 | DLL_REQ='''libgif | 47 | mingw-w64-x86_64-tree-sitter |
| 44 | libgnutls | 48 | mingw-w64-x86_64-sqlite3'''.split() |
| 45 | libharfbuzz | 49 | |
| 46 | liblcms2 | 50 | # Emacs style path to dependancy DLLs on build system |
| 47 | libturbojpeg | 51 | DLL_SRC="c:/msys64/mingw64/bin" |
| 48 | libpng | 52 | |
| 49 | librsvg | 53 | # libraries we never include |
| 50 | libtiff | 54 | DLL_SKIP=["libgccjit-0.dll"] |
| 51 | libxml | 55 | |
| 52 | libXpm'''.split() | 56 | # Report first existing file for entries in dynamic-library-alist |
| 53 | 57 | # ELISP_PROG=""" | |
| 58 | # (message "%s" (mapconcat 'identity (remove nil | ||
| 59 | # (mapcar (lambda(lib) | ||
| 60 | # (seq-find | ||
| 61 | # (lambda(file) | ||
| 62 | # (file-exists-p | ||
| 63 | # (file-name-concat "{}" | ||
| 64 | # file))) | ||
| 65 | # (cdr lib))) | ||
| 66 | # dynamic-library-alist) | ||
| 67 | # ) "\\n")) | ||
| 68 | # """.format(DLL_SRC) | ||
| 54 | 69 | ||
| 55 | ## Options | 70 | ## Options |
| 56 | DRY_RUN=False | 71 | DRY_RUN=False |
| 57 | 72 | # NEW_EMACS="bin/emacs.exe" | |
| 58 | 73 | ||
| 59 | def check_output_maybe(*args,**kwargs): | 74 | def check_output_maybe(*args,**kwargs): |
| 60 | if(DRY_RUN): | 75 | if(DRY_RUN): |
| @@ -62,31 +77,76 @@ def check_output_maybe(*args,**kwargs): | |||
| 62 | else: | 77 | else: |
| 63 | return check_output(*args,**kwargs) | 78 | return check_output(*args,**kwargs) |
| 64 | 79 | ||
| 80 | #################### | ||
| 65 | ## DLL Capture | 81 | ## DLL Capture |
| 82 | |||
| 83 | # entry point | ||
| 66 | def gather_deps(): | 84 | def gather_deps(): |
| 67 | 85 | ||
| 68 | os.mkdir("x86_64") | 86 | os.mkdir("x86_64") |
| 69 | os.chdir("x86_64") | 87 | os.chdir("x86_64") |
| 70 | 88 | ||
| 71 | for dep in full_dll_dependency(): | 89 | #full=full_dll_dependency(init_deps()) |
| 72 | check_output_maybe(["cp /mingw64/bin/{}*.dll .".format(dep)], | 90 | #filtered=filter(lambda x: x not in DLL_SKIP, full) |
| 73 | shell=True) | 91 | #print("full:",full.len(), " filtered:",filtered.len()) |
| 74 | 92 | #exit | |
| 75 | print("Zipping") | 93 | |
| 76 | check_output_maybe("zip -9r ../emacs-{}-{}deps.zip *" | 94 | for dep in full_dll_dependency(init_deps()): |
| 77 | .format(EMACS_MAJOR_VERSION, DATE), | 95 | if dep not in DLL_SKIP: |
| 78 | shell=True) | 96 | if args.l != True: |
| 97 | print("Adding dep", dep) | ||
| 98 | check_output_maybe(["cp /mingw64/bin/{} .".format(dep)], shell=True) | ||
| 99 | else: | ||
| 100 | if args.l != True: | ||
| 101 | print("Skipping dep", dep) | ||
| 102 | |||
| 103 | zipfile="../emacs-{}-{}deps.zip".format(EMACS_MAJOR_VERSION, DATE) | ||
| 104 | tmpfile="{}.tmp".format(zipfile) | ||
| 105 | print("Zipping deps in", os.getcwd(), "as", tmpfile) | ||
| 106 | check_output_maybe("zip -9vr {} *.dll".format(tmpfile), shell=True) | ||
| 107 | if os.path.isfile(zipfile): | ||
| 108 | os.remove(zipfile) | ||
| 109 | os.rename(tmpfile, zipfile) | ||
| 110 | print("Deps updated in", os.getcwd(), "as", zipfile) | ||
| 79 | os.chdir("../") | 111 | os.chdir("../") |
| 80 | 112 | ||
| 81 | ## Return all Emacs dependencies | 113 | # Return dependancies listed in Emacs |
| 82 | def full_dll_dependency(): | 114 | def init_deps(): |
| 83 | deps = [dll_dependency(dep) for dep in DLL_REQ] | 115 | return '''libXpm-nox4.dll |
| 84 | return set(sum(deps, []) + DLL_REQ) | 116 | libpng16-16.dll |
| 85 | 117 | libjpeg-8.dll | |
| 86 | ## Dependencies for a given DLL | 118 | libgif-7.dll |
| 119 | librsvg-2-2.dll | ||
| 120 | libwebp-7.dll | ||
| 121 | libwebpdemux-2.dll | ||
| 122 | libsqlite3-0.dll | ||
| 123 | libgdk_pixbuf-2.0-0.dll | ||
| 124 | libglib-2.0-0.dll | ||
| 125 | libgio-2.0-0.dll | ||
| 126 | libgobject-2.0-0.dll | ||
| 127 | libgnutls-30.dll | ||
| 128 | libxml2-2.dll | ||
| 129 | zlib1.dll | ||
| 130 | liblcms2-2.dll | ||
| 131 | libgccjit-0.dll | ||
| 132 | libtree-sitter.dll'''.split() | ||
| 133 | # job_args=[NEW_EMACS, "--batch", "--eval", ELISP_PROG] | ||
| 134 | # #print("args: ", job_args) | ||
| 135 | # return subprocess.check_output(job_args, stderr=subprocess.STDOUT | ||
| 136 | # ).decode('utf-8').splitlines() | ||
| 137 | |||
| 138 | # Return all second order dependencies | ||
| 139 | def full_dll_dependency(dlls): | ||
| 140 | deps = [dll_dependency(dep) for dep in dlls] | ||
| 141 | return set(sum(deps, []) + dlls) | ||
| 142 | |||
| 143 | #xs = filter(lambda x: x.attribute == value, xs) | ||
| 144 | |||
| 145 | # Dependencies for a given DLL | ||
| 87 | def dll_dependency(dll): | 146 | def dll_dependency(dll): |
| 88 | output = check_output(["/mingw64/bin/ntldd", "--recursive", | 147 | output = check_output(["/mingw64/bin/ntldd", "--recursive", |
| 89 | "/mingw64/bin/{}*.dll".format(dll)]).decode("utf-8") | 148 | "/mingw64/bin/{}".format(dll)] |
| 149 | ).decode("utf-8") | ||
| 90 | ## munge output | 150 | ## munge output |
| 91 | return ntldd_munge(output) | 151 | return ntldd_munge(output) |
| 92 | 152 | ||
| @@ -101,9 +161,8 @@ def ntldd_munge(out): | |||
| 101 | 161 | ||
| 102 | ## if it's the former, we want it, if its the later we don't | 162 | ## if it's the former, we want it, if its the later we don't |
| 103 | splt = dep.split() | 163 | splt = dep.split() |
| 104 | if len(splt) > 2 and "msys64" in splt[2]: | 164 | if len(splt) > 2 and "mingw64" in splt[2]: |
| 105 | print("Adding dep", splt[0]) | 165 | rtn.append(splt[0]) |
| 106 | rtn.append(splt[0].split(".")[0]) | ||
| 107 | 166 | ||
| 108 | return rtn | 167 | return rtn |
| 109 | 168 | ||
| @@ -112,26 +171,92 @@ def ntldd_munge(out): | |||
| 112 | ## Packages to fiddle with | 171 | ## Packages to fiddle with |
| 113 | ## Source for gcc-libs is part of gcc | 172 | ## Source for gcc-libs is part of gcc |
| 114 | SKIP_SRC_PKGS=["mingw-w64-gcc-libs"] | 173 | SKIP_SRC_PKGS=["mingw-w64-gcc-libs"] |
| 115 | SKIP_DEP_PKGS=frozenset(["mingw-w64-x86_64-glib2"]) | 174 | SKIP_DEP_PKGS=["mingw-w64-glib2", "mingw-w64-ca-certificates-20211016-3"] |
| 116 | MUNGE_SRC_PKGS={"mingw-w64-libwinpthread-git":"mingw-w64-winpthreads-git"} | 175 | MUNGE_SRC_PKGS={ |
| 176 | "mingw-w64-libwinpthread-git":"mingw-w64-winpthreads-git", | ||
| 177 | "mingw-w64-gettext-runtime":"mingw-w64-gettext" | ||
| 178 | } | ||
| 117 | MUNGE_DEP_PKGS={ | 179 | MUNGE_DEP_PKGS={ |
| 118 | "mingw-w64-x86_64-libwinpthread":"mingw-w64-x86_64-libwinpthread-git", | 180 | "mingw-w64-x86_64-libwinpthread":"mingw-w64-x86_64-libwinpthread-git", |
| 119 | "mingw-w64-x86_64-libtre": "mingw-w64-x86_64-libtre-git", | 181 | "mingw-w64-x86_64-libtre": "mingw-w64-x86_64-libtre-git", |
| 120 | } | 182 | } |
| 183 | SRC_EXT={ | ||
| 184 | "mingw-w64-freetype": ".src.tar.zst", | ||
| 185 | "mingw-w64-fribidi": ".src.tar.zst", | ||
| 186 | "mingw-w64-glib2": ".src.tar.zst", | ||
| 187 | "mingw-w64-harfbuzz": ".src.tar.zst", | ||
| 188 | "mingw-w64-libunistring": ".src.tar.zst", | ||
| 189 | "mingw-w64-winpthreads-git": ".src.tar.zst", | ||
| 190 | "mingw-w64-ca-certificates": ".src.tar.zst", | ||
| 191 | "mingw-w64-libxml2": ".src.tar.zst", | ||
| 192 | "mingw-w64-ncurses": ".src.tar.zst", | ||
| 193 | "mingw-w64-openssl": ".src.tar.zst", | ||
| 194 | "mingw-w64-pango": ".src.tar.zst", | ||
| 195 | "mingw-w64-python": ".src.tar.zst", | ||
| 196 | "mingw-w64-sqlite3": ".src.tar.zst", | ||
| 197 | "mingw-w64-xpm-nox": ".src.tar.zst", | ||
| 198 | "mingw-w64-xz": ".src.tar.zst", | ||
| 199 | "mingw-w64-bzip2": ".src.tar.zst", | ||
| 200 | "mingw-w64-cairo": ".src.tar.zst", | ||
| 201 | "mingw-w64-expat": ".src.tar.zst", | ||
| 202 | "mingw-w64-fontconfig": ".src.tar.zst", | ||
| 203 | "mingw-w64-gdk-pixbuf2": ".src.tar.zst", | ||
| 204 | "mingw-w64-giflib": ".src.tar.zst", | ||
| 205 | "mingw-w64-gmp": ".src.tar.zst", | ||
| 206 | "mingw-w64-gnutls": ".src.tar.zst", | ||
| 207 | "mingw-w64-graphite2": ".src.tar.zst", | ||
| 208 | "mingw-w64-jbigkit": ".src.tar.zst", | ||
| 209 | "mingw-w64-lcms2": ".src.tar.zst", | ||
| 210 | "mingw-w64-lerc": ".src.tar.zst", | ||
| 211 | "mingw-w64-libdatrie": ".src.tar.zst", | ||
| 212 | "mingw-w64-libffi": ".src.tar.zst", | ||
| 213 | "mingw-w64-libiconv": ".src.tar.zst", | ||
| 214 | "mingw-w64-libiconv": ".src.tar.zst", | ||
| 215 | "mingw-w64-libpng": ".src.tar.zst", | ||
| 216 | "mingw-w64-librsvg": ".src.tar.zst", | ||
| 217 | "mingw-w64-libsystre": ".src.tar.zst", | ||
| 218 | "mingw-w64-libtasn": ".src.tar.zst", | ||
| 219 | "mingw-w64-libthai": ".src.tar.zst", | ||
| 220 | "mingw-w64-libtiff": ".src.tar.zst", | ||
| 221 | "mingw-w64-libtre-git": ".src.tar.zst", | ||
| 222 | "mingw-w64-libwebp": ".src.tar.zst", | ||
| 223 | "mingw-w64-mpdecimal": ".src.tar.zst", | ||
| 224 | "mingw-w64-nettle": ".src.tar.zst", | ||
| 225 | "mingw-w64-p11-kit": ".src.tar.zst", | ||
| 226 | "mingw-w64-pcre": ".src.tar.zst", | ||
| 227 | "mingw-w64-pixman": ".src.tar.zst", | ||
| 228 | "mingw-w64-python-packaging": ".src.tar.zst", | ||
| 229 | "mingw-w64-readline": ".src.tar.zst", | ||
| 230 | "mingw-w64-tcl": ".src.tar.zst", | ||
| 231 | "mingw-w64-termcap": ".src.tar.zst", | ||
| 232 | "mingw-w64-tk": ".src.tar.zst", | ||
| 233 | "mingw-w64-tree-sitter": ".src.tar.zst", | ||
| 234 | "mingw-w64-tzdata": ".src.tar.zst", | ||
| 235 | "mingw-w64-wineditline": ".src.tar.zst", | ||
| 236 | "mingw-w64-zlib": ".src.tar.zst", | ||
| 237 | "mingw-w64-zstd": ".src.tar.zst", | ||
| 238 | "mingw-w64-brotli": ".src.tar.zst", | ||
| 239 | "mingw-w64-gettext": ".src.tar.zst", | ||
| 240 | "mingw-w64-libdeflate": ".src.tar.zst", | ||
| 241 | "mingw-w64-libidn2": ".src.tar.zst", | ||
| 242 | "mingw-w64-libjpeg-turbo": ".src.tar.zst", | ||
| 243 | "mingw-w64-libtasn1": ".src.tar.zst", | ||
| 244 | "mingw-w64-pcre2": ".src.tar.zst", | ||
| 245 | } | ||
| 121 | 246 | ||
| 122 | ## Currently no packages seem to require this! | 247 | ## Currently no packages seem to require this! |
| 123 | ARCH_PKGS=[] | 248 | ARCH_PKGS=[] |
| 124 | SRC_REPO="https://repo.msys2.org/mingw/sources" | ||
| 125 | 249 | ||
| 250 | def immediate_deps(pkg): | ||
| 251 | package_info = check_output(["pacman", "-Si", pkg]).decode("utf-8").split("\n") | ||
| 126 | 252 | ||
| 127 | def immediate_deps(pkgs): | 253 | ## Extract the "Depends On" line |
| 128 | package_info = check_output(["pacman", "-Si"] + pkgs).decode("utf-8").splitlines() | 254 | depends_on = [x for x in package_info if x.startswith("Depends On")][0] |
| 255 | ## Remove "Depends On" prefix | ||
| 256 | dependencies = depends_on.split(":")[1] | ||
| 129 | 257 | ||
| 130 | ## Extract the packages listed for "Depends On:" lines. | 258 | ## Split into dependencies |
| 131 | dependencies = [line.split(":")[1].split() for line in package_info | 259 | dependencies = dependencies.strip().split(" ") |
| 132 | if line.startswith("Depends On")] | ||
| 133 | ## Flatten dependency lists from multiple packages into one list. | ||
| 134 | dependencies = functools.reduce(operator.iconcat, dependencies, []) | ||
| 135 | 260 | ||
| 136 | ## Remove > signs TODO can we get any other punctuation here? | 261 | ## Remove > signs TODO can we get any other punctuation here? |
| 137 | dependencies = [d.split(">")[0] for d in dependencies if d] | 262 | dependencies = [d.split(">")[0] for d in dependencies if d] |
| @@ -147,18 +272,16 @@ def extract_deps(): | |||
| 147 | print( "Extracting deps" ) | 272 | print( "Extracting deps" ) |
| 148 | 273 | ||
| 149 | # Get a list of all dependencies needed for packages mentioned above. | 274 | # Get a list of all dependencies needed for packages mentioned above. |
| 150 | pkgs = set(PKG_REQ) | 275 | pkgs = PKG_REQ[:] |
| 151 | newdeps = pkgs | 276 | n = 0 |
| 152 | print("adding...") | 277 | while n < len(pkgs): |
| 153 | while True: | 278 | subdeps = immediate_deps(pkgs[n]) |
| 154 | subdeps = frozenset(immediate_deps(list(newdeps))) | 279 | for p in subdeps: |
| 155 | newdeps = subdeps - SKIP_DEP_PKGS - pkgs | 280 | if not (p in pkgs or p in SKIP_DEP_PKGS): |
| 156 | if not newdeps: | 281 | pkgs.append(p) |
| 157 | break | 282 | n = n + 1 |
| 158 | print('\n'.join(newdeps)) | ||
| 159 | pkgs |= newdeps | ||
| 160 | 283 | ||
| 161 | return list(pkgs) | 284 | return sorted(pkgs) |
| 162 | 285 | ||
| 163 | 286 | ||
| 164 | def download_source(tarball): | 287 | def download_source(tarball): |
| @@ -206,14 +329,24 @@ def gather_source(deps): | |||
| 206 | ## Switch names if necessary | 329 | ## Switch names if necessary |
| 207 | pkg_name = MUNGE_SRC_PKGS.get(pkg_name,pkg_name) | 330 | pkg_name = MUNGE_SRC_PKGS.get(pkg_name,pkg_name) |
| 208 | 331 | ||
| 209 | tarball = "{}-{}.src.tar.gz".format(pkg_name,pkg_version) | 332 | ## src archive is usually a .tar.gz |
| 333 | if pkg_name in SRC_EXT.keys(): | ||
| 334 | src_ext = SRC_EXT[pkg_name] | ||
| 335 | else: | ||
| 336 | src_ext = ".src.tar.gz" | ||
| 337 | |||
| 338 | tarball = "{}-{}{}".format(pkg_name,pkg_version,src_ext) | ||
| 210 | 339 | ||
| 211 | download_source(tarball) | 340 | download_source(tarball) |
| 212 | 341 | ||
| 213 | print("Zipping") | 342 | srczip="../emacs-{}-{}deps-mingw-w64-src.zip".format(EMACS_MAJOR_VERSION,DATE) |
| 214 | check_output_maybe("zip -9 ../emacs-{}-{}deps-mingw-w64-src.zip *" | 343 | tmpzip="{}.tmp".format(srczip) |
| 215 | .format(EMACS_MAJOR_VERSION,DATE), | 344 | print("Zipping Dsrc in", os.getcwd(), "as", tmpzip) |
| 216 | shell=True) | 345 | check_output_maybe("zip -9 {} *".format(tmpzip), shell=True) |
| 346 | if os.path.isfile(srczip): | ||
| 347 | os.remove(srczip) | ||
| 348 | os.rename(tmpzip, srczip) | ||
| 349 | print("Dsrc updated in", os.getcwd(), "as", srczip) | ||
| 217 | 350 | ||
| 218 | os.chdir("..") | 351 | os.chdir("..") |
| 219 | 352 | ||
| @@ -231,6 +364,9 @@ if(os.environ["MSYSTEM"] != "MSYS"): | |||
| 231 | 364 | ||
| 232 | 365 | ||
| 233 | parser = argparse.ArgumentParser() | 366 | parser = argparse.ArgumentParser() |
| 367 | |||
| 368 | #parser.add_argument("emacs", help="emacs executable") | ||
| 369 | |||
| 234 | parser.add_argument("-s", help="snapshot build", | 370 | parser.add_argument("-s", help="snapshot build", |
| 235 | action="store_true") | 371 | action="store_true") |
| 236 | 372 | ||
| @@ -243,19 +379,29 @@ parser.add_argument("-c", help="clean only", | |||
| 243 | parser.add_argument("-d", help="dry run", | 379 | parser.add_argument("-d", help="dry run", |
| 244 | action="store_true") | 380 | action="store_true") |
| 245 | 381 | ||
| 246 | parser.add_argument("-l", help="list dependencies only", | 382 | parser.add_argument("-l", help="list dependencies", |
| 383 | action="store_true") | ||
| 384 | |||
| 385 | parser.add_argument("-e", help="extract direct dependancies", | ||
| 247 | action="store_true") | 386 | action="store_true") |
| 248 | 387 | ||
| 249 | args = parser.parse_args() | 388 | args = parser.parse_args() |
| 250 | do_all=not (args.c or args.r) | 389 | do_all=not (args.c or args.r) |
| 251 | 390 | ||
| 252 | 391 | #NEW_EMACS=args.emacs | |
| 253 | 392 | ||
| 254 | DRY_RUN=args.d | 393 | DRY_RUN=args.d |
| 255 | 394 | ||
| 395 | if( args.e ): | ||
| 396 | print("\n".join(init_deps())) | ||
| 397 | |||
| 256 | if( args.l ): | 398 | if( args.l ): |
| 257 | print("List of dependencies") | 399 | print("List of dependencies:") |
| 258 | print( deps ) | 400 | print(full_dll_dependency(init_deps())) |
| 401 | print("List of source packages:") | ||
| 402 | print( extract_deps() ) | ||
| 403 | |||
| 404 | if( args.e or args.l ): | ||
| 259 | exit(0) | 405 | exit(0) |
| 260 | 406 | ||
| 261 | if args.s: | 407 | if args.s: |
diff --git a/admin/nt/dist-build/emacs.nsi b/admin/nt/dist-build/emacs.nsi index 557bb106dde..b8226d69423 100644 --- a/admin/nt/dist-build/emacs.nsi +++ b/admin/nt/dist-build/emacs.nsi | |||
| @@ -8,7 +8,10 @@ Outfile "emacs-${OUT_VERSION}-installer.exe" | |||
| 8 | SetCompressor /solid lzma | 8 | SetCompressor /solid lzma |
| 9 | 9 | ||
| 10 | Var StartMenuFolder | 10 | Var StartMenuFolder |
| 11 | Var UninstallerPath | ||
| 11 | 12 | ||
| 13 | !define UNINST_KEY \ | ||
| 14 | "Software\Microsoft\Windows\CurrentVersion\Uninstall\emacs-${VERSION_BRANCH}" | ||
| 12 | 15 | ||
| 13 | !define MUI_WELCOMEPAGE_TITLE "Emacs" | 16 | !define MUI_WELCOMEPAGE_TITLE "Emacs" |
| 14 | !define MUI_WELCOMEPAGE_TITLE_3LINES | 17 | !define MUI_WELCOMEPAGE_TITLE_3LINES |
| @@ -20,16 +23,27 @@ Var StartMenuFolder | |||
| 20 | 23 | ||
| 21 | !insertmacro MUI_PAGE_WELCOME | 24 | !insertmacro MUI_PAGE_WELCOME |
| 22 | 25 | ||
| 23 | 26 | # licensing/about click-though page | |
| 24 | !define MUI_LICENSEPAGE_TEXT_TOP "The GNU General Public License" | 27 | !define MUI_PAGE_HEADER_TEXT "Emacs is Free Software" |
| 28 | !define MUI_PAGE_HEADER_SUBTEXT "A component of the GNU operating system." | ||
| 29 | !define MUI_LICENSEPAGE_TEXT_TOP "This program is free software." | ||
| 30 | !define MUI_LICENSEPAGE_TEXT_BOTTOM "You can redistribute this program and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License (as above), or (at your option) any later version." | ||
| 31 | !define MUI_LICENSEPAGE_BUTTON "OK" | ||
| 25 | !insertmacro MUI_PAGE_LICENSE "emacs-${VERSION_BRANCH}\share\emacs\${EMACS_VERSION}\lisp\COPYING" | 32 | !insertmacro MUI_PAGE_LICENSE "emacs-${VERSION_BRANCH}\share\emacs\${EMACS_VERSION}\lisp\COPYING" |
| 26 | 33 | ||
| 34 | # user option page: installation path | ||
| 27 | !insertmacro MUI_PAGE_DIRECTORY | 35 | !insertmacro MUI_PAGE_DIRECTORY |
| 28 | !insertmacro MUI_PAGE_INSTFILES | ||
| 29 | 36 | ||
| 37 | # user option page: start menu shortcut | ||
| 30 | !insertmacro MUI_PAGE_STARTMENU Application $StartMenuFolder | 38 | !insertmacro MUI_PAGE_STARTMENU Application $StartMenuFolder |
| 31 | 39 | ||
| 40 | # user option confirm/begin install | ||
| 41 | !insertmacro MUI_PAGE_INSTFILES | ||
| 42 | |||
| 43 | # uninstaller confirmation/options (no options) | ||
| 32 | !insertmacro MUI_UNPAGE_CONFIRM | 44 | !insertmacro MUI_UNPAGE_CONFIRM |
| 45 | |||
| 46 | # uninstaller begin | ||
| 33 | !insertmacro MUI_UNPAGE_INSTFILES | 47 | !insertmacro MUI_UNPAGE_INSTFILES |
| 34 | 48 | ||
| 35 | !insertmacro MUI_LANGUAGE "English" | 49 | !insertmacro MUI_LANGUAGE "English" |
| @@ -39,23 +53,35 @@ function .onInit | |||
| 39 | StrCpy $INSTDIR "$PROGRAMFILES64\Emacs" | 53 | StrCpy $INSTDIR "$PROGRAMFILES64\Emacs" |
| 40 | functionend | 54 | functionend |
| 41 | 55 | ||
| 42 | 56 | # main section logic, run after confirming installation | |
| 43 | Section | 57 | Section |
| 44 | 58 | ||
| 45 | SetOutPath $INSTDIR | 59 | # insisting on installing shortcuts for "all users" |
| 60 | # might ensure uninstall can remove shortcuts we created | ||
| 61 | # SetShellVarContext all | ||
| 46 | 62 | ||
| 63 | # extract program files | ||
| 64 | SetOutPath $INSTDIR | ||
| 47 | File /r emacs-${VERSION_BRANCH} | 65 | File /r emacs-${VERSION_BRANCH} |
| 48 | 66 | ||
| 49 | # define uninstaller name | 67 | # define uninstaller name |
| 50 | WriteUninstaller $INSTDIR\Uninstall.exe | 68 | StrCpy $UninstallerPath "$INSTDIR\Uninstall-${VERSION_BRANCH}.exe" |
| 69 | |||
| 70 | # create uninstaller | ||
| 71 | WriteUninstaller "$UninstallerPath" | ||
| 72 | |||
| 73 | # add registry key to enable uninstall from control panel | ||
| 74 | WriteRegStr HKLM "${UNINST_KEY}" "DisplayName" "GNU Emacs ${VERSION_BRANCH}" | ||
| 75 | WriteRegStr HKLM "${UNINST_KEY}" "UninstallString" "$\"$UninstallerPath$\"" | ||
| 51 | 76 | ||
| 52 | !insertmacro MUI_STARTMENU_WRITE_BEGIN Application | ||
| 53 | ;Create shortcuts | 77 | ;Create shortcuts |
| 78 | !insertmacro MUI_STARTMENU_WRITE_BEGIN Application | ||
| 54 | CreateDirectory "$SMPROGRAMS\$StartMenuFolder" | 79 | CreateDirectory "$SMPROGRAMS\$StartMenuFolder" |
| 55 | CreateShortcut "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk" "$INSTDIR\Uninstall.exe" | 80 | CreateShortcut "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk" \ |
| 56 | 81 | "$UninstallerPath" | |
| 82 | CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Emacs.lnk" \ | ||
| 83 | "$INSTDIR\emacs-${VERSION_BRANCH}\bin\runemacs.exe" | ||
| 57 | !insertmacro MUI_STARTMENU_WRITE_END | 84 | !insertmacro MUI_STARTMENU_WRITE_END |
| 58 | CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Emacs.lnk" "$INSTDIR\emacs-${VERSION_BRANCH}\bin\runemacs.exe" | ||
| 59 | SectionEnd | 85 | SectionEnd |
| 60 | 86 | ||
| 61 | 87 | ||
| @@ -63,15 +89,50 @@ SectionEnd | |||
| 63 | # the section will always be named "Uninstall" | 89 | # the section will always be named "Uninstall" |
| 64 | Section "Uninstall" | 90 | Section "Uninstall" |
| 65 | 91 | ||
| 66 | # Always delete uninstaller first | 92 | # remove All Users shortcuts only |
| 67 | Delete "$INSTDIR\Uninstall.exe" | 93 | # SetShellVarContext all |
| 94 | |||
| 95 | # retreive/recalculate uninstaller location | ||
| 96 | StrCpy $UninstallerPath "$INSTDIR\Uninstall-${VERSION_BRANCH}.exe" | ||
| 97 | |||
| 98 | # remove registry key | ||
| 99 | DeleteRegKey HKLM "${UNINST_KEY}" | ||
| 68 | 100 | ||
| 69 | # now delete installed directory | 101 | # delete uninstaller |
| 70 | RMDir /r "$INSTDIR" | 102 | Delete "$INSTDIR\Uninstall-${VERSION_BRANCH}.exe" |
| 71 | RMDir "$INSTDIR" | ||
| 72 | 103 | ||
| 104 | # retreive/reclculate startmenu shortcuts location | ||
| 73 | !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder | 105 | !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder |
| 106 | StrCpy $StartMenuFolder "$SMPROGRAMS\$StartMenuFolder" | ||
| 107 | |||
| 108 | # remove Start Menu Program shortcuts | ||
| 109 | Delete "$StartMenuFolder\Emacs.lnk" | ||
| 110 | Delete "$StartMenuFolder\Uninstall.lnk" | ||
| 111 | |||
| 112 | # remove empty startmenu parents up to $SMPROGRAMS | ||
| 113 | startMenuDeleteLoop: | ||
| 114 | ClearErrors | ||
| 115 | RMDir $StartMenuFolder | ||
| 116 | GetFullPathName $StartMenuFolder "$StartMenuFolder\.." | ||
| 117 | IfErrors startMenuDeleteLoopDone | ||
| 118 | StrCmp $StartMenuFolder $SMPROGRAMS startMenuDeleteLoopDone startMenuDeleteLoop | ||
| 119 | |||
| 120 | # we're basically using GOTO, above, so we should get here.. | ||
| 121 | startMenuDeleteLoopDone: | ||
| 122 | |||
| 123 | # next we remove stuff from program-files/instalation path | ||
| 124 | # start with recursive delete of the Emacs we installed | ||
| 125 | RMDir /r "$INSTDIR\emacs-${VERSION_BRANCH}" | ||
| 126 | |||
| 127 | # now walk parents of installation directory, deleting if empty | ||
| 128 | instDirDeleteLoop: | ||
| 129 | ClearErrors | ||
| 130 | RMDir $INSTDIR | ||
| 131 | GetFullPathName $INSTDIR "$INSTDIR\.." | ||
| 132 | IfErrors instDirDeleteLoopDone | ||
| 133 | StrCmp $INSTDIR $PROGRAMFILES64 instDirDeleteLoopDone instDirDeleteLoop | ||
| 134 | |||
| 135 | # final clean-up (after removing from startmenu and progfiles) | ||
| 136 | instDirDeleteLoopDone: | ||
| 74 | 137 | ||
| 75 | Delete "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk" | ||
| 76 | RMDir "$SMPROGRAMS\$StartMenuFolder" | ||
| 77 | SectionEnd | 138 | SectionEnd |
diff --git a/admin/release-process b/admin/release-process index ef698f51666..d66bc48f70d 100644 --- a/admin/release-process +++ b/admin/release-process | |||
| @@ -93,7 +93,19 @@ documentation (or decide no updates are necessary) for those that aren't. | |||
| 93 | ** For a major release, add a "New in Emacs XX" section to faq.texi. | 93 | ** For a major release, add a "New in Emacs XX" section to faq.texi. |
| 94 | 94 | ||
| 95 | ** cusver-check from admin.el can help find new defcustoms missing | 95 | ** cusver-check from admin.el can help find new defcustoms missing |
| 96 | :version tags. | 96 | :version tags. This asks for new and old Lisp directories; use the one |
| 97 | in the current release branch as New and the one from the last released | ||
| 98 | Emacs version as Old. | ||
| 99 | |||
| 100 | Note that this doesn't (yet) know about :package-version and | ||
| 101 | 'customize-package-emacs-version-alist', so it could produce false | ||
| 102 | positives for packages that use :package-version. Make sure the files | ||
| 103 | with defcustoms that use :package-version have the appropriate | ||
| 104 | add-to-list that determines the correspondence between package versions | ||
| 105 | and Emacs versions. Any changes you make in :version etc. should be | ||
| 106 | tested by running "M-x customize-changed" after regenerating cus-load.el | ||
| 107 | (run "make custom-deps" in the lisp/ directory) and loaddefs.el (run | ||
| 108 | "make autoloads-force"). | ||
| 97 | 109 | ||
| 98 | ** Manuals | 110 | ** Manuals |
| 99 | Check for node names using problematic characters: | 111 | Check for node names using problematic characters: |
| @@ -102,7 +114,13 @@ Sadly makeinfo does not warn about such characters. | |||
| 102 | 114 | ||
| 103 | Check for major new features added since the last release (e.g. new | 115 | Check for major new features added since the last release (e.g. new |
| 104 | lisp files), and add the relevant authors to the Acknowledgments in | 116 | lisp files), and add the relevant authors to the Acknowledgments in |
| 105 | doc/emacs/ack.texi and emacs.texi. | 117 | doc/emacs/ack.texi and emacs.texi. To find new files, you could run a |
| 118 | command such as this: | ||
| 119 | |||
| 120 | $ diff -rq emacs-NN.MM emacs-XX.YY | grep "^Only in emacs-XX" | ||
| 121 | |||
| 122 | where NN.MM is the previous Emacs version, and XX.YY is the new version. | ||
| 123 | This assumes you have the source trees of both versions available. | ||
| 106 | 124 | ||
| 107 | For major releases, rewrite the "Antinews" appendix of the User Manual | 125 | For major releases, rewrite the "Antinews" appendix of the User Manual |
| 108 | (doc/emacs/anti.texi) to describe features lost by downgrading to the | 126 | (doc/emacs/anti.texi) to describe features lost by downgrading to the |