Browse Source

Add the possibility to compress files and install gunzip. Install a site-wide site-start.el

tmp/comercial-emacs
Juan Jose Garcia-Ripoll 4 years ago
parent
commit
297d70d64c
  1. 23
      emacs-build.sh
  2. 15
      scripts/gzip.sh
  3. 6
      scripts/site-start.el

23
emacs-build.sh

@ -31,6 +31,7 @@
. scripts/tools.sh
. scripts/pdf-tools.sh
. scripts/hunspell.sh
. scripts/gzip.sh
. scripts/msys2_extra.sh
function write_help () {
@ -156,7 +157,10 @@ function emacs_dependencies ()
function emacs_configure_build_dir ()
{
cd "$emacs_build_dir"
options="--disable-build-details --disable-silent-rules --without-compress-install --without-dbus"
options="--disable-build-details --disable-silent-rules --without-dbus"
if test "$emacs_compress_files" = "no"; then
$options="$options --without-compress-install"
fi
for f in $all_features; do
if echo $features | grep $f > /dev/null; then
options="--with-$f $options"
@ -217,6 +221,11 @@ function action2_install ()
else
rm -rf "$emacs_install_dir"
mkdir -p "$emacs_install_dir"
if test "$emacs_compress_files" = "yes"; then
# If we compress files we need to install gzip no matter what
# (even in pack-emacs)
(action3_gzip && cd "$emacs_install_dir" && unzip "$gzip_zip_file") || return -1
fi
echo Installing Emacs into directory $emacs_install_dir
# HACK!!! Somehow libgmp is not installed as part of the
# standalone Emacs build process. This is weird, but means
@ -224,7 +233,11 @@ function action2_install ()
make -j 4 -C $emacs_build_dir install \
&& cp "${mingw_dir}bin/libgmp"*.dll "$emacs_install_dir/bin/" \
&& rm -f "$emacs_install_dir/bin/emacs-*.exe" \
&& find "$emacs_install_dir" -name '*.exe' -exec strip '{}' '+'
&& find "$emacs_install_dir" -name '*.exe' -exec strip '{}' '+' \
&& cp "$emacs_build_root/scripts/site-start.el" "$emacs_install_dir/share/emacs/site-lisp" \
&& mkdir -p "$emacs_install_dir/usr/share/emacs/site-lisp/" \
&& cp "$emacs_install_dir/share/emacs/site-lisp/subdirs.el" \
"$emacs_install_dir/usr/share/emacs/site-lisp/subdirs.el"
fi
}
@ -386,6 +399,7 @@ branches=""
actions=""
do_clean=""
debug_dependency_list="false"
emacs_compress_files=no
emacs_build_version=0.2
while test -n "$*"; do
case $1 in
@ -397,6 +411,7 @@ while test -n "$*"; do
delete_feature rsvg
delete_feature tiff
dependency_exclusions="$slim_exclusions"
emacs_compress_files=yes
;;
--clean) add_actions action0_clean;;
--clean-all) add_actions action0_clean action0_clean_rest;;
@ -409,6 +424,7 @@ while test -n "$*"; do
--pack-all) add_actions action1_ensure_packages action3_package_deps action2_install action5_package_all;;
--version) write_version_number;;
--pdf-tools) add_actions action2_install action3_pdf_tools;;
--compress) emacs_compress_files=yes;;
--mu) add_actions action2_install action3_mu;;
--isync) add_actions action3_isync;;
--debug-dependencies) debug_dependency_list="true";;
@ -421,6 +437,9 @@ done
if test -z "$branches"; then
branches="emacs-27"
fi
if test "$emacs_compress_files" = yes; then
add_actions action3_gzip
fi
actions=`echo $actions | sed 's,[ ],\n,g' | sort | uniq`
if test -z "$actions"; then
actions="action0_clone action1_ensure_packages action2_build action3_package_deps action5_package_all"

15
scripts/gzip.sh

@ -0,0 +1,15 @@
function action3_gzip () {
gzip_build_dir="$emacs_build_build_dir/gzip"
gzip_zip_file="$emacs_build_zip_dir/gzip-${architecture}.zip"
if test ! -f "${gzip_zip_file}"; then
(mkdir -p "$gzip_build_dir/usr/bin" \
&& echo '%~dp0\gzip.exe -d %*' > "${gzip_build_dir}/usr/bin/gunzip.cmd" \
&& cp /usr/bin/gzip.exe "${gzip_build_dir}/usr/bin/gzip.exe" \
&& ensure_packages gzip \
&& msys2_extra_package "msys2-runtime" "/" "" "$gzip_zip_file" \
&& cd "${gzip_build_dir}" \
&& zip -9vr "$gzip_zip_file" "usr") || return -1
fi
emacs_extensions="$gzip_zip_file $emacs_extensions"
}

6
scripts/site-start.el

@ -0,0 +1,6 @@
(let* ((emacs-libexec-path (car (last exec-path)))
(emacs-libexec-ndx (string-match "libexec" emacs-libexec-path))
(emacs-root (substring emacs-libexec-path 0 emacs-libexec-ndx)))
(add-to-list 'exec-path (expand-file-name "bin/" emacs-root))
(add-to-list 'exec-path (expand-file-name "usr/bin/" emacs-root))
(add-to-list 'load-path (expand-file-name "usr/share/emacs/site-lisp/" emacs-root)))
Loading…
Cancel
Save