summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKévin Le Gouguec <kevin.legouguec@gmail.com>2022-11-10 18:32:11 +0100
committerKévin Le Gouguec <kevin.legouguec@gmail.com>2022-11-10 18:32:11 +0100
commitfd103d61f795de3dafa3501274ca3419d449deaa (patch)
tree39a40e06be21df74b72e0ea76ab59a7008fa64d1
parente2df3eb277bb0bb9acc0261bc7ad16c298740b53 (diff)
downloaddotfiles-fd103d61f795de3dafa3501274ca3419d449deaa.tar.xz
Cache configure results on stable distros
-rwxr-xr-x.local/bin/emacs-build23
1 files changed, 23 insertions, 0 deletions
diff --git a/.local/bin/emacs-build b/.local/bin/emacs-build
index 815b244..cbd39a6 100755
--- a/.local/bin/emacs-build
+++ b/.local/bin/emacs-build
@@ -10,6 +10,29 @@ configure_flags=(
--with-xinput2
)
+is-rolling-distro ()
+{
+ (
+ . /etc/os-release
+ case "${ID}"
+ in
+ opensuse-tumbleweed) return 0;;
+ esac
+ return 1
+ )
+}
+
+if ! is-rolling-distro
+then
+ cachedir=${XDG_CACHE_HOME:-~/.cache}/emacs
+ test -d "${cachedir}" || mkdir -p "${cachedir}"
+
+ thistree=${PWD#~}
+ cachefile=${cachedir}/config${thistree//\//,}
+
+ configure_flags=(--cache-file="${cachefile}" "${configure_flags[@]}")
+fi
+
if ! test -f Makefile
then
${make} configure