diff --git a/native-comp.patch b/native-comp.patch index f3b4adf..ae91fa7 100644 --- a/native-comp.patch +++ b/native-comp.patch @@ -1,7 +1,7 @@ -diff --git a/usr/share/emacs/29.0.90/lisp/emacs-lisp/comp.el b/usr/share/emacs/29.0.90/lisp/emacs-lisp/comp.el +diff --git a/usr/share/emacs/@@VERSION@@/lisp/emacs-lisp/comp.el b/usr/share/emacs/@@VERSION@@/lisp/emacs-lisp/comp.el index e97832455b9..b04cfa00c33 100644 ---- a/usr/share/emacs/29.0.90/lisp/emacs-lisp/comp.el -+++ b/usr/share/emacs/29.0.90/lisp/emacs-lisp/comp.el +--- a/usr/share/emacs/@@VERSION@@/lisp/emacs-lisp/comp.el ++++ b/usr/share/emacs/@@VERSION@@/lisp/emacs-lisp/comp.el @@ -186,8 +186,7 @@ and above." :type '(repeat string) :version "28.1") diff --git a/snapcraft.yaml b/snapcraft.yaml index 482186a..572fa53 100644 --- a/snapcraft.yaml +++ b/snapcraft.yaml @@ -255,7 +255,9 @@ parts: # snap rm -f usr/share/emacs/*/lisp/emacs-lisp/comp.elc gunzip -f usr/share/emacs/*/lisp/emacs-lisp/comp.el.gz - patch -p1 < $SNAPCRAFT_PROJECT_DIR/native-comp.patch + # ensure we use the right path in the patch file + VERSION=$(echo usr/share/emacs/*/lisp/emacs-lisp/comp.el | cut -d / -f 4) + sed s/@@VERSION@@/$VERSION/g $SNAPCRAFT_PROJECT_DIR/native-comp.patch | patch -p1 ../parts/emacs/build/src/emacs -batch -f batch-byte-compile usr/share/emacs/*/lisp/emacs-lisp/comp.el gzip usr/share/emacs/*/lisp/emacs-lisp/comp.el site-lisp: