From e6f3cacb165107ae26648af5e3a0b04104be5a71 Mon Sep 17 00:00:00 2001 From: Kien Nguyen Date: Mon, 22 Aug 2022 18:39:04 +0900 Subject: [PATCH] dont compress loaddefs file on Windows --- emacs-build.sh | 5 ++-- ...file.in-dont-compress-loaddefs-files.patch | 25 +++++++++++++++++++ scripts/tools.sh | 11 ++++++++ 3 files changed, 38 insertions(+), 3 deletions(-) create mode 100644 patches/0001-makefile.in-dont-compress-loaddefs-files.patch diff --git a/emacs-build.sh b/emacs-build.sh index a328064..7481a86 100644 --- a/emacs-build.sh +++ b/emacs-build.sh @@ -32,7 +32,6 @@ . scripts/pdf-tools.sh . scripts/aspell.sh . scripts/hunspell.sh -. scripts/gzip.sh . scripts/msys2_extra.sh . scripts/gnutls.sh @@ -212,8 +211,7 @@ function action2_install () # If we compress files we need to install gzip no matter what # (even in pack-emacs) (ensure_packages gzip \ - && cp /usr/bin/gzip.exe $emacs_install_dir/bin/gzip.exe \ - && cp /usr/bin/msys-2.0.dll $emacs_install_dir/bin/msys-2.0.dll ) \ + && cp_bindeps_to "$emacs_install_dir/bin" gzip.exe) \ || return -1 fi echo Installing Emacs into directory $emacs_install_dir @@ -469,6 +467,7 @@ while test -n "$*"; do --deps) add_actions action1_ensure_packages action3_package_deps;; --pack-emacs) add_actions action2_install action4_package_emacs;; --pack-all) add_actions action1_ensure_packages action3_package_deps action2_install action5_package_all;; + # --pack-all) add_actions action1_ensure_packages action2_install;; --pdf-tools) add_actions action2_install action3_pdf_tools;; --mu) add_actions action2_install action3_mu;; diff --git a/patches/0001-makefile.in-dont-compress-loaddefs-files.patch b/patches/0001-makefile.in-dont-compress-loaddefs-files.patch new file mode 100644 index 0000000..635609f --- /dev/null +++ b/patches/0001-makefile.in-dont-compress-loaddefs-files.patch @@ -0,0 +1,25 @@ +From 5b48a7426c9e427a14226ae76ac0ea7661d10371 Mon Sep 17 00:00:00 2001 +From: Kien Nguyen +Date: Mon, 22 Aug 2022 16:18:58 +0900 +Subject: [PATCH] makefile.in: dont compress loaddefs files + +--- + Makefile.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile.in b/Makefile.in +index 78103f897..f1ec3cf49 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -671,7 +671,7 @@ install-arch-indep: + [ -z "${GZIP_PROG}" ] || { \ + echo "Compressing *.el etc. ..." && \ + cd "$(DESTDIR)${lispdir}" && \ +- for f in `find . -name "*.elc" -print | sed 's/.elc$$/.el/'`; do \ ++ for f in `find . -name "*.elc" ! -name "*loaddefs.elc" -print | sed 's/.elc$$/.el/'`; do \ + ${GZIP_PROG} -9n "$$f"; \ + done; \ + ${GZIP_PROG} -9n "../etc/publicsuffix.txt"; \ +-- +2.37.0.windows.1 + diff --git a/scripts/tools.sh b/scripts/tools.sh index 3e83ac6..3ab6735 100644 --- a/scripts/tools.sh +++ b/scripts/tools.sh @@ -152,6 +152,17 @@ function ensure_packages () fi } +function cp_bindeps_to () +{ + local dest="$1" + local bins="${@:2}" + echo Copying $bins to $dest with dependencies + echo $bins | xargs -n1 | xargs which | xargs -I{} cp -pf {} $dest/ + echo $bins | xargs -n1 | xargs which | xargs ldd \ + | awk -F' ' '!/ \/c\//{print $3}' \ + | xargs -I{} cp -pf {} $dest/ +} + function package_dependencies () { local zipfile="$1"