commit 9b14d885556e6a9b56c56a3444eca3ce2f407146
parent e1572a1e333d6044cee6ef4e1ba31713fdbf3bcd
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Sat, 14 Jun 2014 19:58:50 +0200
add cgit
Signed-off-by: Hiltjo Posthuma <hiltjo@codemadness.org>
Diffstat:
5 files changed, 55 insertions(+), 0 deletions(-)
diff --git a/cgit/cgit-dlsym.patch b/cgit/cgit-dlsym.patch
@@ -0,0 +1,19 @@
+--- filter.c.old 2014-06-14 15:57:03.908481247 +0200
++++ filter.c 2014-06-14 15:57:06.132481156 +0200
+@@ -49,16 +49,6 @@
+
+ void cgit_init_filters(void)
+ {
+- libc_write = dlsym(RTLD_NEXT, "write");
+- if (!libc_write)
+- die("Could not locate libc's write function");
+-}
+-
+-ssize_t write(int fd, const void *buf, size_t count)
+-{
+- if (fd != STDOUT_FILENO || !filter_write)
+- return libc_write(fd, buf, count);
+- return filter_write(current_write_filter, buf, count);
+ }
+
+ static inline void hook_write(struct cgit_filter *filter, ssize_t (*new_write)(struct cgit_filter *base, const void *buf, size_t count))
diff --git a/cgit/cgit.mk b/cgit/cgit.mk
@@ -0,0 +1,25 @@
+# TODO: add lua support? and fix filter_write() in filter.c
+# see: cgit-dlsym.patch
+# TODO: -DNO_LUA=1 ?
+TARG = cgit
+DEPS = git openssl lua zlib
+BIN = cgit
+OBJ = `{ ls *.c | sed 's/.$/o/'}
+
+INSTALL_BIN = cgit
+
+<../v.mk
+
+<$mkbuild/mk.default
+
+LOCAL_CFLAGS = \
+ -DSHA1_HEADER=\"${openssl_includedir}/openssl/sha.h\" \
+ -DCGIT_VERSION=\"$v\" \
+ -DCGIT_CACHE_ROOT=\"/var/cache/cgit\" \
+ -DCGIT_SCRIPT_NAME=\"cgit.cgi\" \
+ -DCGIT_SCRIPT_PATH=\"/var/www/htdocs/cgit\" \
+ -DCGIT_DATA_PATH=\"/var/www/htdocs/cgit\" \
+ -DCGIT_CONFIG=\"/etc/cgitrc\"
+
+LOCAL_LDFLAGS = \
+ ${git_libdir}/xdiff/lib.a -lgit -lssl -lcrypto -lz
diff --git a/cgit/checksums b/cgit/checksums
@@ -0,0 +1 @@
+3a6afe2eb47ed718b4c0661ffbd0905118b61f6f2f10723022a9fe7d2e4b2742fcc20fd2a5ecb68de6a22b55d1c9b679d4b7305f6d622d64fa4be66117a9ad02 cgit-0.10.1.tar.xz
diff --git a/cgit/mkfile b/cgit/mkfile
@@ -0,0 +1,9 @@
+<$mkbuild/mk.3rdparty
+
+<v.mk
+src = cgit-$v
+url = http://git.zx2c4.com/cgit/snapshot/cgit-$v.tar.xz
+mkfile = ../cgit.mk
+
+patches = \
+ "0" ../cgit-dlsym.patch
diff --git a/cgit/v.mk b/cgit/v.mk
@@ -0,0 +1 @@
+v = 0.10.1