summaryrefslogtreecommitdiff
path: root/dev-vcs/git
diff options
context:
space:
mode:
authorLiguros - Gitlab CI/CD [develop] <gitlab@liguros.net>2026-05-08 07:13:11 +0000
committerLiguros - Gitlab CI/CD [develop] <gitlab@liguros.net>2026-05-08 07:13:11 +0000
commite79618d2286e15df4892b907b8f5fe63ebf4e62b (patch)
tree6ec94fcc8ec3fa3f8a1d14d30a867a9ad0a5e59f /dev-vcs/git
parent299816f0c09b4fa9b0ed7e30ea69cbd6942edbf7 (diff)
downloadbaldeagleos-repo-e79618d2286e15df4892b907b8f5fe63ebf4e62b.tar.gz
baldeagleos-repo-e79618d2286e15df4892b907b8f5fe63ebf4e62b.tar.xz
baldeagleos-repo-e79618d2286e15df4892b907b8f5fe63ebf4e62b.zip
Adding metadata
Diffstat (limited to 'dev-vcs/git')
-rw-r--r--dev-vcs/git/files/git-2.48.1-macos-no-fsmonitor.patch39
-rw-r--r--dev-vcs/git/files/git-2.50.0-diff-implement-config.diff.renames-copies-harder.patch163
-rw-r--r--dev-vcs/git/files/git-2.54.0-0001-rust-don-t-pass-quiet-to-cargo.patch30
-rw-r--r--dev-vcs/git/files/git-2.54.0-0002-rust-respect-CARGO-environment-variable.patch32
-rw-r--r--dev-vcs/git/git-2.54.0.ebuild463
5 files changed, 399 insertions, 328 deletions
diff --git a/dev-vcs/git/files/git-2.48.1-macos-no-fsmonitor.patch b/dev-vcs/git/files/git-2.48.1-macos-no-fsmonitor.patch
new file mode 100644
index 000000000000..f1b89e736f46
--- /dev/null
+++ b/dev-vcs/git/files/git-2.48.1-macos-no-fsmonitor.patch
@@ -0,0 +1,39 @@
+meson.build: allow to disable fsmonitor backend for macOS
+
+Gentoo Prefix toolchain and setup does not enable CoreServices Framework
+by default, so simply allow to disable the fsmonitor backend
+
+Signed-off-by: Fabian Groffen <grobian@gentoo.org>
+
+--- a/meson.build
++++ b/meson.build
+@@ -1117,11 +1117,13 @@
+ endif
+
+ fsmonitor_backend = ''
+-if host_machine.system() == 'windows'
+- fsmonitor_backend = 'win32'
+-elif host_machine.system() == 'darwin'
+- fsmonitor_backend = 'darwin'
+- libgit_dependencies += dependency('CoreServices')
++if get_option('fsmonitor')
++ if host_machine.system() == 'windows'
++ fsmonitor_backend = 'win32'
++ elif host_machine.system() == 'darwin'
++ fsmonitor_backend = 'darwin'
++ libgit_dependencies += dependency('CoreServices')
++ endif
+ endif
+ if fsmonitor_backend != ''
+ libgit_c_args += '-DHAVE_FSMONITOR_DAEMON_BACKEND'
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -57,6 +57,8 @@
+ # Build tweaks.
+ option('macos_use_homebrew_gettext', type: 'boolean', value: true,
+ description: 'Use gettext from Homebrew instead of the slightly-broken system-provided one.')
++option('fsmonitor', type: 'boolean', value: true,
++ description: 'Build fsmonitor backend on supported platforms.')
+
+ # gitweb configuration.
+ option('gitweb_config', type: 'string', value: 'gitweb_config.perl')
diff --git a/dev-vcs/git/files/git-2.50.0-diff-implement-config.diff.renames-copies-harder.patch b/dev-vcs/git/files/git-2.50.0-diff-implement-config.diff.renames-copies-harder.patch
new file mode 100644
index 000000000000..f815ff7bedc5
--- /dev/null
+++ b/dev-vcs/git/files/git-2.50.0-diff-implement-config.diff.renames-copies-harder.patch
@@ -0,0 +1,163 @@
+https://lore.kernel.org/git/20240311213928.1872437-1-sam@gentoo.org/
+
+From afe0cc87d790d7dbf33b83cf3e1ae23d5646e8e9 Mon Sep 17 00:00:00 2001
+Message-ID: <afe0cc87d790d7dbf33b83cf3e1ae23d5646e8e9.1749343442.git.sam@gentoo.org>
+From: Sam James <sam@gentoo.org>
+Date: Fri, 16 Feb 2024 22:07:54 +0000
+Subject: [PATCH] diff: implement config.diff.renames=copies-harder
+
+This patch adds a config value for 'diff.renames' called 'copies-harder'
+which make it so '-C -C' is in effect always passed for 'git log -p',
+'git diff', etc.
+
+This allows specifying that 'git log -p', 'git diff', etc should always act
+as if '-C --find-copies-harder' was passed.
+
+It has proven this especially useful for certain types of repository (like
+Gentoo's ebuild repositories) because files are often copies of a previous
+version:
+
+Suppose a directory 'sys-devel/gcc' contains recipes for building
+GCC, with one file for each supported upstream branch:
+ gcc-13.x.build.recipe
+ gcc-12.x.build.recipe
+ gcc-11.x.build.recipe
+ gcc-10.x.build.recipe
+
+gcc-13.x.build.recipe was started as a copy of gcc-12.x.build.recipe
+(which was started as a copy of gcc-11.x.build.recipe, etc.). Previous versions
+are kept around to support parallel installation of multiple versions.
+
+Being able to easily observe the diff relative to other recipes within the
+directory has been a quality of life improvement for such repo layouts.
+
+Signed-off-by: Sam James <sam@gentoo.org>
+---
+ Documentation/config/diff.adoc | 6 +++---
+ Documentation/config/status.adoc | 4 +++-
+ diff.c | 11 +++++++++--
+ diff.h | 1 +
+ diffcore-rename.c | 6 ++++--
+ merge-ort.c | 2 +-
+ 6 files changed, 21 insertions(+), 9 deletions(-)
+
+diff --git a/Documentation/config/diff.adoc b/Documentation/config/diff.adoc
+index 1135a62a0a..5362d8091e 100644
+--- a/Documentation/config/diff.adoc
++++ b/Documentation/config/diff.adoc
+@@ -158,9 +158,9 @@ endif::git-diff[]
+ Whether and how Git detects renames. If set to `false`,
+ rename detection is disabled. If set to `true`, basic rename
+ detection is enabled. If set to `copies` or `copy`, Git will
+- detect copies, as well. Defaults to `true`. Note that this
+- affects only `git diff` Porcelain like linkgit:git-diff[1] and
+- linkgit:git-log[1], and not lower level commands such as
++ detect copies, as well. Defaults to `true`.
++ Note that this affects only 'git diff' Porcelain like linkgit:git-diff[1]
++ and linkgit:git-log[1], and not lower level commands such as
+ linkgit:git-diff-files[1].
+
+ `diff.suppressBlankEmpty`::
+diff --git a/Documentation/config/status.adoc b/Documentation/config/status.adoc
+index 8caf90f51c..e15add32a3 100644
+--- a/Documentation/config/status.adoc
++++ b/Documentation/config/status.adoc
+@@ -33,7 +33,9 @@ status.renames::
+ Whether and how Git detects renames in linkgit:git-status[1] and
+ linkgit:git-commit[1] . If set to "false", rename detection is
+ disabled. If set to "true", basic rename detection is enabled.
+- If set to "copies" or "copy", Git will detect copies, as well.
++ If set to "copies" or "copy", Git will detect copies, as well. If set
++ to "copies-harder", Git will spend extra cycles to find more copies even
++ in unmodified paths, see '--find-copies-harder' in linkgit:git-diff[1].
+ Defaults to the value of diff.renames.
+
+ status.showStash::
+diff --git a/diff.c b/diff.c
+index 90e8003dd1..f0ca884280 100644
+--- a/diff.c
++++ b/diff.c
+@@ -212,6 +212,8 @@ int git_config_rename(const char *var, const char *value)
+ {
+ if (!value)
+ return DIFF_DETECT_RENAME;
++ if (!strcasecmp(value, "copies-harder"))
++ return DIFF_DETECT_COPY_HARDER;
+ if (!strcasecmp(value, "copies") || !strcasecmp(value, "copy"))
+ return DIFF_DETECT_COPY;
+ return git_config_bool(var,value) ? DIFF_DETECT_RENAME : 0;
+@@ -4902,8 +4904,12 @@ void diff_setup_done(struct diff_options *options)
+ else
+ options->flags.diff_from_contents = 0;
+
+- if (options->flags.find_copies_harder)
++ /* Just fold this in as it makes the patch-to-git smaller */
++ if (options->flags.find_copies_harder ||
++ options->detect_rename == DIFF_DETECT_COPY_HARDER) {
++ options->flags.find_copies_harder = 1;
+ options->detect_rename = DIFF_DETECT_COPY;
++ }
+
+ if (!options->flags.relative_name)
+ options->prefix = NULL;
+@@ -5342,7 +5348,8 @@ static int diff_opt_find_copies(const struct option *opt,
+ if (*arg != 0)
+ return error(_("invalid argument to %s"), opt->long_name);
+
+- if (options->detect_rename == DIFF_DETECT_COPY)
++ if (options->detect_rename == DIFF_DETECT_COPY ||
++ options->detect_rename == DIFF_DETECT_COPY_HARDER)
+ options->flags.find_copies_harder = 1;
+ else
+ options->detect_rename = DIFF_DETECT_COPY;
+diff --git a/diff.h b/diff.h
+index 62e5768a9a..8c8aa6cbb6 100644
+--- a/diff.h
++++ b/diff.h
+@@ -594,6 +594,7 @@ int git_config_rename(const char *var, const char *value);
+
+ #define DIFF_DETECT_RENAME 1
+ #define DIFF_DETECT_COPY 2
++#define DIFF_DETECT_COPY_HARDER 3
+
+ #define DIFF_PICKAXE_ALL 1
+ #define DIFF_PICKAXE_REGEX 2
+diff --git a/diffcore-rename.c b/diffcore-rename.c
+index 7723bc3334..34a883a55d 100644
+--- a/diffcore-rename.c
++++ b/diffcore-rename.c
+@@ -302,7 +302,8 @@ static int find_identical_files(struct hashmap *srcs,
+ }
+ /* Give higher scores to sources that haven't been used already */
+ score = !source->rename_used;
+- if (source->rename_used && options->detect_rename != DIFF_DETECT_COPY)
++ if (source->rename_used && options->detect_rename != DIFF_DETECT_COPY &&
++ options->detect_rename != DIFF_DETECT_COPY_HARDER)
+ continue;
+ score += basename_same(source, target);
+ if (score > best_score) {
+@@ -1407,7 +1408,8 @@ void diffcore_rename_extended(struct diff_options *options,
+ trace2_region_enter("diff", "setup", options->repo);
+ info.setup = 0;
+ ASSERT(!dir_rename_count || strmap_empty(dir_rename_count));
+- want_copies = (detect_rename == DIFF_DETECT_COPY);
++ want_copies = (detect_rename == DIFF_DETECT_COPY ||
++ detect_rename == DIFF_DETECT_COPY_HARDER);
+ if (dirs_removed && (break_idx || want_copies))
+ BUG("dirs_removed incompatible with break/copy detection");
+ if (break_idx && relevant_sources)
+diff --git a/merge-ort.c b/merge-ort.c
+index 47b3d1730e..cb090c7af5 100644
+--- a/merge-ort.c
++++ b/merge-ort.c
+@@ -4957,7 +4957,7 @@ static void merge_start(struct merge_options *opt, struct merge_result *result)
+ * sanity check them anyway.
+ */
+ assert(opt->detect_renames >= -1 &&
+- opt->detect_renames <= DIFF_DETECT_COPY);
++ opt->detect_renames <= DIFF_DETECT_COPY_HARDER);
+ assert(opt->verbosity >= 0 && opt->verbosity <= 5);
+ assert(opt->buffer_output <= 2);
+ assert(opt->obuf.len == 0);
+--
+2.49.0
diff --git a/dev-vcs/git/files/git-2.54.0-0001-rust-don-t-pass-quiet-to-cargo.patch b/dev-vcs/git/files/git-2.54.0-0001-rust-don-t-pass-quiet-to-cargo.patch
new file mode 100644
index 000000000000..795e33e5e711
--- /dev/null
+++ b/dev-vcs/git/files/git-2.54.0-0001-rust-don-t-pass-quiet-to-cargo.patch
@@ -0,0 +1,30 @@
+From 0f7b6cf83c868a009c9843522429ba6810990ae6 Mon Sep 17 00:00:00 2001
+Message-ID: <0f7b6cf83c868a009c9843522429ba6810990ae6.1776707419.git.sam@gentoo.org>
+From: Sam James <sam@gentoo.org>
+Date: Tue, 18 Nov 2025 18:10:03 +0000
+Subject: [PATCH 1/2] rust: don't pass --quiet to cargo
+
+This obscures that cargo is being invoked at all and it means even
+ninja --verbose has no mention of it other than invoking the target.
+
+Signed-off-by: Sam James <sam@gentoo.org>
+---
+ src/cargo-meson.sh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/cargo-meson.sh b/src/cargo-meson.sh
+index 75f3cd1265..26a6d3bb16 100755
+--- a/src/cargo-meson.sh
++++ b/src/cargo-meson.sh
+@@ -31,7 +31,7 @@ case "$(cargo -vV | sed -n 's/^host: \(.*\)$/\1/p')" in
+ LIBNAME=libgitcore.a;;
+ esac
+
+-cargo build --lib --quiet --manifest-path="$SOURCE_DIR/Cargo.toml" --target-dir="$BUILD_DIR" "$@"
++cargo build --lib --manifest-path="$SOURCE_DIR/Cargo.toml" --target-dir="$BUILD_DIR" "$@"
+ RET=$?
+ if test $RET -ne 0
+ then
+--
+2.53.0
+
diff --git a/dev-vcs/git/files/git-2.54.0-0002-rust-respect-CARGO-environment-variable.patch b/dev-vcs/git/files/git-2.54.0-0002-rust-respect-CARGO-environment-variable.patch
new file mode 100644
index 000000000000..da7148e34e36
--- /dev/null
+++ b/dev-vcs/git/files/git-2.54.0-0002-rust-respect-CARGO-environment-variable.patch
@@ -0,0 +1,32 @@
+From 1fe93707dbb6d9c5214250f576151cb5cec3762f Mon Sep 17 00:00:00 2001
+Message-ID: <1fe93707dbb6d9c5214250f576151cb5cec3762f.1776707419.git.sam@gentoo.org>
+In-Reply-To: <0f7b6cf83c868a009c9843522429ba6810990ae6.1776707419.git.sam@gentoo.org>
+References: <0f7b6cf83c868a009c9843522429ba6810990ae6.1776707419.git.sam@gentoo.org>
+From: Sam James <sam@gentoo.org>
+Date: Tue, 18 Nov 2025 18:10:47 +0000
+Subject: [PATCH 2/2] rust: respect $CARGO environment variable
+
+Respect the CARGO environment variable if set. Gentoo uses this to
+control the version of rust/cargo for a build.
+
+Signed-off-by: Sam James <sam@gentoo.org>
+---
+ src/cargo-meson.sh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/cargo-meson.sh b/src/cargo-meson.sh
+index 26a6d3bb16..b7b9578861 100755
+--- a/src/cargo-meson.sh
++++ b/src/cargo-meson.sh
+@@ -31,7 +31,7 @@ case "$(cargo -vV | sed -n 's/^host: \(.*\)$/\1/p')" in
+ LIBNAME=libgitcore.a;;
+ esac
+
+-cargo build --lib --manifest-path="$SOURCE_DIR/Cargo.toml" --target-dir="$BUILD_DIR" "$@"
++${CARGO:-cargo} build --lib --manifest-path="$SOURCE_DIR/Cargo.toml" --target-dir="$BUILD_DIR" "$@"
+ RET=$?
+ if test $RET -ne 0
+ then
+--
+2.53.0
+
diff --git a/dev-vcs/git/git-2.54.0.ebuild b/dev-vcs/git/git-2.54.0.ebuild
index b7721e348ccb..2de96d041e9f 100644
--- a/dev-vcs/git/git-2.54.0.ebuild
+++ b/dev-vcs/git/git-2.54.0.ebuild
@@ -3,11 +3,15 @@
EAPI=8
GENTOO_DEPEND_ON_PERL=no
-PYTHON_COMPAT=( python3_{10..14} )
-inherit bash-completion-r1 optfeature perl-module plocale python-single-r1 systemd toolchain-funcs
+# bug #329479: git-remote-testgit is not multiple-version aware
+PYTHON_COMPAT=( python3_{10..14} )
+RUST_OPTIONAL=1
+inherit flag-o-matic toolchain-funcs perl-module shell-completion optfeature
+inherit plocale python-single-r1 rust systemd meson
PLOCALES="bg ca de es fr is it ko pt_PT ru sv vi zh_CN"
+
MY_PV="${PV/_rc/.rc}"
MY_P="${PN}-${MY_PV}"
@@ -15,28 +19,31 @@ DOC_VER="${MY_PV}"
DESCRIPTION="Stupid content tracker: distributed VCS designed for speed and efficiency"
HOMEPAGE="https://www.git-scm.com/"
+
SRC_URI_SUFFIX="xz"
SRC_URI_KORG="https://www.kernel.org/pub/software/scm/git"
-[[ "${PV/rc}" != "${PV}" ]] && SRC_URI_KORG+='/testing'
-SRC_URI="
- ${SRC_URI_KORG}/${MY_P}.tar.${SRC_URI_SUFFIX}
- ${SRC_URI_KORG}/${PN}-manpages-${DOC_VER}.tar.${SRC_URI_SUFFIX}
- doc? (
- ${SRC_URI_KORG}/${PN}-htmldocs-${DOC_VER}.tar.${SRC_URI_SUFFIX}
- )
-"
-[[ "${PV}" == *_rc* ]] || \
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
+
+[[ ${PV/rc} != ${PV} ]] && SRC_URI_KORG+='/testing'
+
+SRC_URI="${SRC_URI_KORG}/${MY_P}.tar.${SRC_URI_SUFFIX}"
+SRC_URI+=" ${SRC_URI_KORG}/${PN}-manpages-${DOC_VER}.tar.${SRC_URI_SUFFIX}"
+SRC_URI+=" doc? ( ${SRC_URI_KORG}/${PN}-htmldocs-${DOC_VER}.tar.${SRC_URI_SUFFIX} )"
+
+if [[ ${PV} != *_rc* ]] ; then
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~arm64-macos ~x64-macos ~x64-solaris"
+fi
+
+S="${WORKDIR}"/${MY_P}
LICENSE="GPL-2"
SLOT="0"
-IUSE="+blksha1 +curl cgi doc keyring +gpg highlight +iconv libressl mediawiki +nls +pcre perforce +perl +safe-directory selinux subversion tk +webdav xinetd cvs test"
+IUSE="+curl cgi cvs doc keyring +gpg highlight +iconv libressl +nls +pcre perforce +perl rust +safe-directory selinux subversion test tk +webdav xinetd"
# Common to both DEPEND and RDEPEND
DEPEND="
!libressl? ( dev-libs/openssl:= )
libressl? ( dev-libs/libressl:= )
- sys-libs/zlib
+ virtual/zlib:=
curl? (
net-misc/curl
webdav? ( dev-libs/expat )
@@ -52,7 +59,7 @@ DEPEND="
"
RDEPEND="
${DEPEND}
- gpg? ( app-crypt/gnupg )
+ gpg? ( app-alternatives/gpg )
perl? (
dev-perl/Error
dev-perl/MailTools
@@ -67,11 +74,6 @@ RDEPEND="
dev-perl/DBI
dev-perl/DBD-SQLite
)
- mediawiki? (
- dev-perl/DateTime-Format-ISO8601
- dev-perl/HTML-Tree
- dev-perl/MediaWiki-API
- )
subversion? (
dev-vcs/subversion[-dso(-),perl]
dev-perl/libwww-perl
@@ -95,21 +97,19 @@ BDEPEND="
)
keyring? ( virtual/pkgconfig )
nls? ( sys-devel/gettext )
- test? ( app-crypt/gnupg )
+ rust? ( ${RUST_DEPEND} )
+ test? (
+ app-arch/unzip
+ app-crypt/gnupg
+ dev-lang/perl
+ )
"
-# Live ebuild builds man pages and HTML docs, additionally
-if [[ ${PV} == *9999 ]]; then
- BDEPEND+=" app-text/asciidoc"
-fi
-
SITEFILE="50${PN}-gentoo.el"
-S="${WORKDIR}/${MY_P}"
REQUIRED_USE="
cgi? ( perl )
cvs? ( perl )
- mediawiki? ( perl )
perforce? ( ${PYTHON_REQUIRED_USE} )
subversion? ( perl )
webdav? ( curl )
@@ -118,8 +118,15 @@ REQUIRED_USE="
RESTRICT="!test? ( test )"
PATCHES=(
- # Make submodule output quiet
- "${FILESDIR}"/git-2.21.0-quiet-submodules-testcase.patch
+ "${FILESDIR}"/${PN}-2.48.1-macos-no-fsmonitor.patch
+
+ # This patch isn't merged upstream but is kept in the ebuild by
+ # demand from developers. It's opt-in (needs a config option)
+ # and the documentation mentions that it is a Gentoo addition.
+ "${FILESDIR}"/${PN}-2.50.0-diff-implement-config.diff.renames-copies-harder.patch
+
+ "${FILESDIR}"/${PN}-2.54.0-0001-rust-don-t-pass-quiet-to-cargo.patch
+ "${FILESDIR}"/${PN}-2.54.0-0002-rust-respect-CARGO-environment-variable.patch
)
pkg_setup() {
@@ -132,90 +139,23 @@ pkg_setup() {
if use perforce ; then
python-single-r1_pkg_setup
fi
-}
-
-# This is needed because for some obscure reasons future calls to make don't
-# pick up these exports if we export them in src_unpack()
-exportmakeopts() {
- local extlibs myopts
-
- myopts=(
- ASCIIDOC_NO_ROFF=YesPlease
-
- $(usex perl 'INSTALLDIRS=vendor NO_PERL_CPAN_FALLBACKS=YesPlease' NO_PERL=YesPlease)
- $(usev elibc_musl NO_REGEX=NeedsStartEnd)
- $(usev !cvs NO_CVS=YesPlease)
- $(usev !iconv NO_ICONV=YesPlease)
- $(usev !nls NO_GETTEXT=YesPlease)
- $(usev !perforce NO_PYTHON=YesPlease)
- $(usev !subversion NO_SVN_TESTS=YesPlease)
- $(usev !tk NO_TCLTK=YesPlease)
- )
-
- if use blksha1 ; then
- myopts+=( BLK_SHA1=YesPlease )
+ if use rust ; then
+ rust_pkg_setup
fi
-
- if use curl ; then
- use webdav || myopts+=( NO_EXPAT=YesPlease )
- else
- myopts+=( NO_CURL=YesPlease )
- fi
-
- # Broken assumptions because of static build system
- myopts+=(
- NO_FINK=YesPlease
- NO_DARWIN_PORTS=YesPlease
- INSTALL=install
- TAR=tar
- SHELL_PATH="${EPREFIX}/bin/sh"
- SANE_TOOL_PATH=
- OLD_ICONV=
- NO_EXTERNAL_GREP=
- )
-
- # Can't define this to null, since the entire makefile depends on it
- sed -i -e '/\/usr\/local/s/BASIC_/#BASIC_/' Makefile || die
-
- if use pcre; then
- myopts+=( USE_LIBPCRE2=YesPlease )
- extlibs+=( -lpcre2-8 )
- fi
-
- if [[ ${CHOST} == *-solaris* ]]; then
- myopts+=(
- NEEDS_LIBICONV=YesPlease
- HAVE_CLOCK_MONOTONIC=1
- )
-
- if grep -Fq getdelim "${ESYSROOT}"/usr/include/stdio.h ; then
- myopts+=( HAVE_GETDELIM=1 )
- fi
- fi
-
- myopts+=( ASCIIDOC8=YesPlease )
-
- export MY_MAKEOPTS="${myopts[@]}"
- export EXTLIBS="${extlibs[@]}"
}
src_unpack() {
- if [[ ${PV} != *9999 ]] ; then
- unpack ${MY_P}.tar.${SRC_URI_SUFFIX}
+ unpack ${MY_P}.tar.${SRC_URI_SUFFIX}
- cd "${S}" || die
- unpack ${PN}-manpages-${DOC_VER}.tar.${SRC_URI_SUFFIX}
+ cd "${S}" || die
+ unpack ${PN}-manpages-${DOC_VER}.tar.${SRC_URI_SUFFIX}
- if use doc ; then
- pushd "${S}"/Documentation &>/dev/null || die
- unpack ${PN}-htmldocs-${DOC_VER}.tar.${SRC_URI_SUFFIX}
- popd &>/dev/null || die
- fi
- else
- git-r3_src_unpack
+ if use doc ; then
+ pushd "${S}"/Documentation &>/dev/null || die
+ unpack ${PN}-htmldocs-${DOC_VER}.tar.${SRC_URI_SUFFIX}
+ popd &>/dev/null || die
fi
-
}
src_prepare() {
@@ -228,274 +168,147 @@ src_prepare() {
fi
default
+}
+
+src_configure() {
+ local contrib=(
+ completion
+ subtree
+
+ $(usev perl 'contacts')
+ )
+ local credential_helpers=(
+ $(usev keyring 'libsecret')
+ $(usev perl 'netrc')
+ )
- if use prefix ; then
- # bug #757309
- sed -i \
- -e 's:/usr/local/opt/gettext/:/do/not/look/elsewhere/:g' \
- -e 's:/opt/homebrew/:/do/not/look/elsewhere/:g' \
- config.mak.uname || die
+ # Needs macOS Frameworks that can't currently be built with GCC.
+ if [[ ${CHOST} == *-darwin* ]] && tc-is-clang ; then
+ credential_helpers+=( osxkeychain )
fi
- sed -i \
- -e 's:^\(CFLAGS[[:space:]]*=\).*$:\1 $(OPTCFLAGS) -Wall:' \
- -e 's:^\(LDFLAGS[[:space:]]*=\).*$:\1 $(OPTLDFLAGS):' \
- -e 's:^\(CC[[:space:]]* =\).*$:\1$(OPTCC):' \
- -e 's:^\(AR[[:space:]]* =\).*$:\1$(OPTAR):' \
- -e "s:\(PYTHON_PATH[[:space:]]\+=[[:space:]]\+\)\(.*\)$:\1${EPREFIX}\2:" \
- -e "s:\(PERL_PATH[[:space:]]\+=[[:space:]]\+\)\(.*\)$:\1${EPREFIX}\2:" \
- Makefile || die
+ local native_file="${T}"/meson.ini.local
+ cat >> ${native_file} <<-EOF || die
+ [binaries]
+ # We don't want to bake /usr/bin/sh from usrmerged systems into
+ # binaries. /bin/sh is required by POSIX.
+ sh='/bin/sh'
+ EOF
+
+ local emesonargs=(
+ --native-file "${native_file}"
- # Fix docbook2texi command
- sed -r -i 's/DOCBOOK2X_TEXI[[:space:]]*=[[:space:]]*docbook2x-texi/DOCBOOK2X_TEXI = docbook2texi.pl/' \
- Documentation/Makefile || die
+ $(meson_feature curl)
+ $(meson_feature cgi gitweb)
+ $(meson_feature webdav expat)
+ $(meson_feature tk gitk)
+ $(meson_feature tk git_gui)
+ $(meson_feature iconv)
+ $(meson_feature nls gettext)
+ $(meson_feature pcre pcre2)
+ $(meson_feature perl)
+ $(meson_feature perforce python)
+ $(meson_feature rust)
+ $(meson_use test tests)
+
+ -Dcontrib=$(IFS=, ; echo "${contrib[*]}" )
+ -Dcredential_helpers=$(IFS=, ; echo "${credential_helpers[*]}" )
+
+ -Dmacos_use_homebrew_gettext=false
+ -Dperl_cpan_fallback=false
+ # TODO: allow zlib-ng
+ -Dzlib_backend=zlib
+ )
+
+ [[ ${CHOST} == *-darwin* ]] && emesonargs+=( -Dfsmonitor=false )
+ [[ ${CHOST} == *-solaris* ]] && append-flags -D__EXTENSIONS__
+
+ # For non-live, we use a downloaded docs tarball instead.
+ # Non-live ebuilds download the sources from a tarball which does not
+ # include a .git directory. Coccinelle assumes it exists and fails
+ # otherwise.
+ #
+ # Fixes https://bugs.gentoo.org/952004
+ emesonargs+=(
+ -Dcoccinelle=disabled
+ )
+
+ meson_src_configure
}
git_emake() {
- # bug #320647: PYTHON_PATH
- local PYTHON_PATH=""
- use perforce && PYTHON_PATH="${PYTHON}"
-
local mymakeargs=(
- ${MY_MAKEOPTS}
-
prefix="${EPREFIX}"/usr
htmldir="${EPREFIX}"/usr/share/doc/${PF}/html
- perllibdir="$(use perl && perl_get_raw_vendorlib)"
sysconfdir="${EPREFIX}"/etc
+ perllibdir="$(use perl && perl_get_raw_vendorlib)"
CC="$(tc-getCC)"
CFLAGS="${CFLAGS}"
+ LDFLAGS="${LDFLAGS}"
PKG_CONFIG="$(tc-getPKG_CONFIG)"
-
- # TODO: --verbose?
- GIT_TEST_OPTS="--no-color"
-
OPTAR="$(tc-getAR)"
OPTCC="$(tc-getCC)"
OPTCFLAGS="${CFLAGS}"
OPTLDFLAGS="${LDFLAGS}"
- CURL_CONFIG="${ESYSROOT}/usr/bin/curl-config"
- CURL_CFLAGS="$($(tc-getPKG_CONFIG) --cflags libcurl)"
- CURL_LDFLAGS="$($(tc-getPKG_CONFIG) --libs libcurl)"
-
PERL_PATH="${EPREFIX}/usr/bin/perl"
PERL_MM_OPT=""
- PYTHON_PATH="${PYTHON_PATH}"
-
V=1
+
"$@"
)
emake "${mymakeargs[@]}"
}
-src_configure() {
- exportmakeopts
-}
-
src_compile() {
- git_emake
-
- if use perl && use cgi ; then
- git_emake gitweb
- fi
+ meson_src_compile
- if use perl ; then
- git_emake -C contrib/credential/netrc
- fi
-
- if [[ ${CHOST} == *-darwin* ]] && tc-is-clang ; then
- git_emake -C contrib/credential/osxkeychain
- fi
-
- pushd Documentation &>/dev/null || die
- if [[ ${PV} == *9999 ]] ; then
- git_emake man
- if use doc ; then
- git_emake info html
- fi
- else
- if use doc ; then
- git_emake info
- fi
- fi
- popd &>/dev/null || die
-
- if use keyring ; then
- git_emake -C contrib/credential/libsecret
+ if use doc ; then
+ # Workaround fragments that still use the Makefile and can't
+ # find the bits from Meson's out-of-source build
+ ln -s "${BUILD_DIR}"/Documentation/asciidoc.conf "${S}"/Documentation/asciidoc.conf || die
fi
git_emake -C contrib/diff-highlight
-
- if use mediawiki ; then
- git_emake -C contrib/mw-to-git
- fi
}
src_test() {
- local disabled=(
- # We make safe-directory optional
- t0033-safe-directory.sh
- )
-
- local tests_cvs=(
- t9200-git-cvsexportcommit.sh
- t9400-git-cvsserver-server.sh
- t9401-git-cvsserver-crlf.sh
- t9402-git-cvsserver-refs.sh
- t9600-cvsimport.sh
- t9601-cvsimport-vendor-branch.sh
- t9602-cvsimport-branches-tags.sh
- t9603-cvsimport-patchsets.sh
- t9604-cvsimport-timestamps.sh
- )
-
- local tests_perl=(
- t3701-add-interactive.sh
- t5502-quickfetch.sh
- t5512-ls-remote.sh
- t5520-pull.sh
- t7106-reset-unborn-branch.sh
- t7501-commit.sh
- )
- # Bug #225601 - t0004 is not suitable for root perm
- # Bug #219839 - t1004 is not suitable for root perm
- # t0001-init.sh - check for init notices EPERM* fails
- local tests_nonroot=(
- t0001-init.sh
- t0004-unwritable.sh
- t0070-fundamental.sh
- t1004-read-tree-m-u-wf.sh
- t3700-add.sh
- t7300-clean.sh
- )
- # t9100 still fails with symlinks in SVN 1.7
- local test_svn=( t9100-git-svn-basic.sh )
-
- # Unzip is used only for the testcase code, not by any normal parts of Git.
- if ! has_version app-arch/unzip ; then
- einfo "Disabling tar-tree tests"
- disabled+=( t5000-tar-tree.sh )
- fi
-
- local cvs=0
- use cvs && let cvs=${cvs}+1
- if [[ ${EUID} -eq 0 ]] ; then
- if [[ ${cvs} -eq 1 ]] ; then
- ewarn "Skipping CVS tests because CVS does not work as root!"
- ewarn "You should retest with FEATURES=userpriv!"
- disabled+=( ${tests_cvs[@]} )
- fi
- einfo "Skipping other tests that require being non-root"
- disabled+=( ${tests_nonroot[@]} )
- else
- if [[ ${cvs} -gt 0 ]] && has_version dev-vcs/cvs ; then
- let cvs=${cvs}+1
- fi
-
- if [[ ${cvs} -gt 1 ]] && has_version "dev-vcs/cvs[server]" ; then
- let cvs=${cvs}+1
- fi
-
- if [[ ${cvs} -lt 3 ]] ; then
- einfo "Disabling CVS tests (needs dev-vcs/cvs[USE=server])"
- disabled+=( ${tests_cvs[@]} )
- fi
- fi
-
- if ! use perl ; then
- einfo "Disabling tests that need Perl"
- disabled+=( ${tests_perl[@]} )
- fi
-
- einfo "Disabling tests that fail with SVN 1.7"
- disabled+=( ${test_svn[@]} )
-
- # Reset all previously disabled tests
- pushd t &>/dev/null || die
- local i
- for i in *.sh.DISABLED ; do
- [[ -f "${i}" ]] && mv -f "${i}" "${i%.DISABLED}"
- done
- einfo "Disabled tests:"
- for i in ${disabled[@]} ; do
- if [[ -f "${i}" ]] ; then
- mv -f "${i}" "${i}.DISABLED" && einfo "Disabled ${i}"
- fi
- done
-
- # Avoid the test system removing the results because we want them ourselves
- sed -e '/^[[:space:]]*$(MAKE) clean/s,^,#,g' -i Makefile || die
-
- # Clean old results first, must always run
- nonfatal git_emake clean
- popd &>/dev/null || die
-
- # Now run the tests, keep going if we hit an error, and don't terminate on
- # failure
- local rc
# t0610-reftable-basics.sh uses $A
local -x A=
- einfo "Start test run"
- #MAKEOPTS=-j1
- nonfatal git_emake --keep-going test
- rc=$?
- # Display nice results, now print the results
- pushd t &>/dev/null || die
- nonfatal git_emake aggregate-results
-
- # And bail if there was a problem
- [[ ${rc} -eq 0 ]] || die "Tests failed. Please file a bug!"
-
- popd &>/dev/null || die
- if use perl ; then
- emake -C contrib/credential/netrc testverbose
- fi
+ meson_src_test
}
src_install() {
- git_emake DESTDIR="${D}" install
-
- if [[ ${CHOST} == *-darwin* ]] && tc-is-clang ; then
- dobin contrib/credential/osxkeychain/git-credential-osxkeychain
- fi
+ meson_src_install
# Depending on the tarball and manual rebuild of the documentation, the
# manpages may exist in either OR both of these directories.
find man?/*.[157] >/dev/null 2>&1 && doman man?/*.[157]
find Documentation/*.[157] >/dev/null 2>&1 && doman Documentation/*.[157]
dodoc README* Documentation/{SubmittingPatches,CodingGuidelines}
- use doc && dodir /usr/share/doc/${PF}/html
+
local d
for d in / /howto/ /technical/ ; do
docinto ${d}
dodoc Documentation${d}*.adoc
- if use doc ; then
- docinto ${d}/html
- dodoc Documentation${d}*.html
- fi
done
docinto /
- # Upstream does not ship this pre-built :-(
- use doc && doinfo Documentation/{git,gitman}.info
newbashcomp contrib/completion/git-completion.bash ${PN}
bashcomp_alias git gitk
+ newzshcomp contrib/completion/git-completion.zsh _${PN}
# Not really a bash-completion file (bug #477920)
# but still needed uncompressed (bug #507480)
insinto /usr/share/${PN}
doins contrib/completion/git-prompt.sh
+ #dobin contrib/fast-import/git-p4 # Moved upstream
+ #dodoc contrib/fast-import/git-p4.txt # Moved upstream
newbin contrib/fast-import/import-tars.perl import-tars
- exeinto /usr/libexec/git-core/
-
- if use mediawiki ; then
- git_emake -C contrib/mw-to-git DESTDIR="${D}" install
- fi
# diff-highlight
dobin contrib/diff-highlight/diff-highlight
@@ -506,29 +319,15 @@ src_install() {
doexe contrib/git-jump/git-jump
newdoc contrib/git-jump/README git-jump.txt
- # git-contacts
- exeinto /usr/libexec/git-core/
- doexe contrib/contacts/git-contacts
- dodoc contrib/contacts/git-contacts.adoc
-
- if use keyring ; then
- pushd contrib/credential/libsecret &>/dev/null || die
- dobin git-credential-libsecret
- popd &>/dev/null || die
- fi
-
dodir /usr/share/${PN}/contrib
# The following are excluded:
# completion - installed above
# diff-highlight - done above
- # emacs - removed upstream
- # examples - these are stuff that is not used in Git anymore actually
# git-jump - done above
# gitview - installed above
# p4import - excluded because fast-import has a better one
# patches - stuff the Git guys made to go upstream to other places
- # persistent-https - TODO
- # mw-to-git - TODO
+ # subtree - built seperately
# svnimport - use git-svn
# thunderbird-patch-inline - fixes thunderbird
local contrib_objects=(
@@ -542,7 +341,7 @@ src_install() {
cp -rf "${S}"/contrib/${i} "${ED}"/usr/share/${PN}/contrib || die "Failed contrib ${i}"
done
- if use perl && use cgi ; then
+ if use cgi ; then
# We used to install in /usr/share/${PN}/gitweb
# but upstream installs in /usr/share/gitweb
# so we will install a symlink and use their location for compat with other
@@ -564,9 +363,9 @@ src_install() {
fi
if use perl ; then
- pushd contrib/credential/netrc &>/dev/null || die
- dobin git-credential-netrc
- popd &>/dev/null || die
+ dodir "$(perl_get_vendorlib)"
+ mv "${ED}"/usr/share/perl5/Git.pm "${ED}/$(perl_get_vendorlib)" || die
+ mv "${ED}"/usr/share/perl5/Git "${ED}/$(perl_get_vendorlib)" || die
fi
if ! use subversion ; then
@@ -607,6 +406,14 @@ pkg_postinst() {
elog "Note that the prompt bash code is now in that separate script"
fi
+ if has_version app-shells/zsh ; then
+ elog 'There are two competing zsh completions available for Git.'
+ elog 'One is from app-shells/zsh, the other from dev-vcs/git.'
+ elog 'To choose between them, order the entries of $fpath so that your'
+ elog 'desired completion is earlier in the list or symlink the relevant'
+ elog 'script into a personal override directory early on fpath.'
+ fi
+
optfeature_header "Some scripts require additional dependencies:"
optfeature git-quiltimport dev-util/quilt
optfeature git-instaweb www-servers/lighttpd www-servers/apache www-servers/nginx