Skip to content

Commit

Permalink
land: Add git
Browse files Browse the repository at this point in the history
  • Loading branch information
lutoma committed Nov 15, 2023
1 parent 0421a39 commit 1bcca17
Show file tree
Hide file tree
Showing 2 changed files with 124 additions and 0 deletions.
44 changes: 44 additions & 0 deletions land/git/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
pkgname=git
pkgver=2.42.1
pkgrel=3
pkgdesc="Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency."
arch=('i786')
makedepend=('openssl' 'pcre2' 'curl' 'libexpat' 'zlib')
url="https://git-scm.com/"
source=(
'https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.42.1.tar.xz'
"$pkgname-$pkgver.patch"
)
sha256sums=(
'8e46fa96bf35a65625d85fde50391e39bc0620d1bb39afb70b96c4a237a1a4f7'
'SKIP'
)

prepare() {
cd $pkgname-$pkgver
patch -p0 < ../$pkgname-$pkgver.patch
}


build() {
cd $pkgname-$pkgver
ac_cv_fread_reads_directories=n \
ac_cv_snprintf_returns_bogus=n \
NO_MMAP=y \
./configure \
--host=i786-pc-xelix \
--prefix=/usr \
--sysconfdir=/etc \
--disable-pthreads \
--with-openssl \
--with-libpcre2 \
--with-curl \
--with-expat

make -j$(nproc)
}

package() {
cd $pkgname-$pkgver
make DESTDIR=$pkgdir install
}
80 changes: 80 additions & 0 deletions land/git/git-2.42.1.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
--- compat/disk.h
+++ compat/disk.h.new
@@ -35,6 +35,7 @@
strbuf_humanise_bytes(out, avail2caller.QuadPart);
strbuf_addch(out, '\n');
#else
+#ifndef __xelix__
struct statvfs stat;

strbuf_realpath(&buf, ".", 1);
@@ -48,6 +49,7 @@
strbuf_addf(out, "Available space on '%s': ", buf.buf);
strbuf_humanise_bytes(out, (off_t)stat.f_bsize * (off_t)stat.f_bavail);
strbuf_addf(out, " (mount flags 0x%lx)\n", stat.f_flag);
+#endif
#endif

cleanup:
--- git-compat-util.h
+++ git-compat-util.h.new
@@ -278,7 +278,9 @@
#include <sys/resource.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
+#ifndef __xelix__
#include <sys/statvfs.h>
+#endif
#include <termios.h>
#ifndef NO_SYS_SELECT_H
#include <sys/select.h>
@@ -400,7 +402,7 @@
#include <openssl/err.h>
#endif

-#ifdef HAVE_SYSINFO
+#ifndef __xelix__
# include <sys/sysinfo.h>
#endif

--- builtin/gc.c
+++ builtin/gc.c.new
@@ -262,7 +262,7 @@

static uint64_t total_ram(void)
{
-#if defined(HAVE_SYSINFO)
+#if 0
struct sysinfo si;

if (!sysinfo(&si))
--- Makefile
+++ Makefile.new
@@ -2078,9 +2078,9 @@
BASIC_CFLAGS += -DHAVE_SYNC_FILE_RANGE
endif

-ifdef NEEDS_LIBRT
- EXTLIBS += -lrt
-endif
+#ifdef NEEDS_LIBRT
+# EXTLIBS += -lrt
+#endif

ifdef HAVE_BSD_SYSCTL
BASIC_CFLAGS += -DHAVE_BSD_SYSCTL
--- progress.c
+++ progress.c.new
@@ -102,8 +102,12 @@

static int is_foreground_fd(int fd)
{
+#ifndef __xelix__
int tpgrp = tcgetpgrp(fd);
return tpgrp < 0 || tpgrp == getpgid(0);
+#else
+ return 1;
+#endif
}

static void display(struct progress *progress, uint64_t n, const char *done)

0 comments on commit 1bcca17

Please sign in to comment.