Closed rnpnr closed 9 months ago
Thanks for the PR!
Update to 2.42 looks great, nice job. git is one of the more involved packages to update, too. I pushed with two tiny changes:
pkg/git/ver
to 2.42.0. This is needed so that the oasis build system will know to update the submodule before trying to build the sources.pkg/git/.gitignore
to git-manpages-2.42.0.tar.gz
. This is just so git status
shows outdated distfiles correctly.Regarding config.prefix
, I think there may be a simpler approach. It looks like all of those paths (GIT_*_PATH
, DEFAULT_GIT_TEMPLATE_DIR
) are used with the system_path()
function, which prefixes them with system_prefix()
.
system_prefix()
works in one of two ways, depending on whether RUNTIME_PREFIX
is defined. If it is, it looks of the executable path using /proc/self/exe
, finding the prefix dynamically similar to a relocatable gcc toolchain, otherwise it uses FALLBACK_RUNTIME_PREFIX
. So I think we could do the following:
diff --git a/pkg/git/gen.lua b/pkg/git/gen.lua
index ff45e4333..89239fa90 100644
--- a/pkg/git/gen.lua
+++ b/pkg/git/gen.lua
@@ -31,7 +31,7 @@ build('hooklist', '$outdir/hook-list.h', {
'|', '$srcdir/generate-hooklist.sh', '$srcdir/Documentation/githooks.txt'
})
-cc('exec-cmd.c', nil, {cflags=[[$cflags '-DFALLBACK_RUNTIME_PREFIX=""']]})
+cc('exec-cmd.c', nil, {cflags=string.format([[$cflags '-DFALLBACK_RUNTIME_PREFIX="%s"']], config.prefix)})
cc('common-main.c')
cc('http.c')
cc('compat/regex/regex.c', nil, {cflags='$cflags -DGAWK -DNO_MBSUPPORT'})
Perhaps you could test this and see if it works for you? Alternatively, we could enable runtime prefix detection by defining RUNTIME_PREFIX
and PROCFS_EXECUTABLE_PATH
. What do you think?
pkg/git/.gitignore
&pkg/git/ver
Sorry I definitely thought I included those.
As for config.prefix
I can confirm your approach works. I rebased and pushed this branch with only that fix. Feel free to use it or write your own commit if you prefer.
I think FALLBACK_RUNTIME_PREFIX
is fine. Since you can't just copy the git
binary to another location and expect it to work I think that runtime detection of the prefix is unnecessary. If you didn't need all the files in libexec/git-core
to have fully functional git it might be a different story.
Thanks, pushed.
First commit simply updates git to 2.42.0.
Second commit makes
config.prefix
apply to some of compiled in paths. It makes git built here usable if its installed toconfig.prefix
rather than/
.I omitted the
ETC_*
paths for now but they could also be modified.Note:
GIT_LOCALE_PATH
isn't actually used anywhere so it was dropped.See #15.