Could not compile cgit-pink in alpine

Could not compile cgit-pink in alpine

From: Leni V.
Hi,

I tried to build cgit-pink in Alpine linux but it could not build, giving the error message
~/cgit-pink-1.4.1 # make
SUBDIR git
CC ../cgit.o
In file included from ../cgit.h:5,
from ../cgit.c:9:
./git-compat-util.h:1218:2: error: #error "Git requires REG_STARTEND support. Compile with NO_REGEX=NeedsStartEnd"
1218 | #error "Git requires REG_STARTEND support. Compile with NO_REGEX=NeedsStartEnd"
| ^~~~~
./git-compat-util.h: In function 'regexec_buf':
./git-compat-util.h:1227:60: error: 'REG_STARTEND' undeclared (first use in this function); did you mean 'REG_EPAREN'?
1227 | return regexec(preg, buf, nmatch, pmatch, eflags | REG_STARTEND);
| ^~~~~~~~~~~~
| REG_EPAREN
./git-compat-util.h:1227:60: note: each undeclared identifier is reported only once for each function it appears in
make[1]: *** [../cgit.mk:104: ../cgit.o] Error 1
make: *** [Makefile:76: cgit] Error 2

This is executed in an environment specified by (the 1.4.1 tarball has to be in the same folder)

FROM alpine:latest

ARG CGIT_PINK_VERSION=1.4.1

RUN apk add --no-cache --purge -uU \
make curl gcc \
libc-dev openssl-dev zlib-dev gettext-dev

WORKDIR /root/
ADD cgit-pink-$CGIT_PINK_VERSION.tar.gz .

How can I fix this issue?

Thanks,
Leni V.

Re: Could not compile cgit-pink in alpine

From: Leah Neukirchen
To: v
I just randomly found this question, if it's still relevant:

> How can I fix this issue?

Append "NO_REGEX = NeedsStartEnd" to cgit.conf, this is required on musl.

cu,
-- 
Leah Neukirchen  <leah@vuxu.org>  https://leahneukirchen.org/