app-emacs/magit: Backport magit-inhibit-libgit patch

Signed-off-by: Ulrich Müller <ulm@gentoo.org>
This commit is contained in:
Ulrich Müller
2023-07-16 08:09:03 +02:00
parent 1a6587d5e5
commit 80ff253cb2
2 changed files with 79 additions and 0 deletions
@@ -0,0 +1,22 @@
commit 451cbe5c24f2af7ed505f1422af6ad4e8f05205b
Author: Jonas Bernoulli <jonas@bernoul.li>
Date: Sun Feb 19 13:37:28 2023 +0100
Inhibit use of libgit by default
--- lisp/magit-git.el
+++ lisp/magit-git.el
@@ -66,8 +66,11 @@
;;; Git implementations
-(defvar magit-inhibit-libgit nil
- "Whether to inhibit the use of libgit.")
+(defvar magit-inhibit-libgit t
+ "Whether to inhibit the use of libgit.
+Use of libgit is inhibited by default because support for libgit
+in magit is only a stub for now. There is no benefit in using
+it.")
(defvar magit--libgit-available-p 'unknown
"Whether libgit is available.
+57
View File
@@ -0,0 +1,57 @@
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit elisp
DESCRIPTION="A Git porcelain inside Emacs"
HOMEPAGE="https://magit.vc/
https://github.com/magit/magit/"
if [[ ${PV} == *9999* ]] ; then
inherit git-r3
EGIT_REPO_URI="https://github.com/magit/magit.git"
else
SRC_URI="https://github.com/magit/magit/archive/v${PV}.tar.gz
-> ${P}.tar.gz"
KEYWORDS="~amd64 ~arm ~ppc64 ~riscv ~x86 ~amd64-linux ~x86-linux"
fi
S="${WORKDIR}/${P}/lisp"
LICENSE="GPL-3+"
SLOT="0"
IUSE="libgit"
PATCHES=( "${FILESDIR}"/${P}-inhibit-libgit.patch )
DOCS=( ../README.md ../Documentation/AUTHORS.md ../Documentation/RelNotes )
ELISP_TEXINFO="../Documentation/*.texi"
SITEFILE="50${PN}-gentoo.el"
RDEPEND="
>=app-emacs/dash-2.19.1
>=app-emacs/transient-0.3.6
>=app-emacs/with-editor-3.0.5
libgit? ( app-emacs/libegit2 )
"
BDEPEND="
${RDEPEND}
sys-apps/texinfo
"
RDEPEND+="
>=dev-vcs/git-2.0.0
"
src_prepare() {
default
use libgit || rm magit-libgit.el || die
echo "(setq magit-version \"${PV}\")" > magit-version.el || die
}
pkg_postinst() {
elisp_pkg_postinst
einfo "magit version 3.3.0 dropped necessity of the app-emacs/libegit2 package"
einfo "magit after 3.3.0 can now use the git executable directly,"
einfo "if you need the libegit backend, then please add app-emacs/libegit2 to @world"
}