Skip to content

Commit

Permalink
alpine: build MeCab in Groonga build (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
otegami authored Jun 28, 2024
1 parent a8da0a3 commit 66fffeb
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 63 deletions.
4 changes: 1 addition & 3 deletions alpine/12-slim/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,16 @@ COPY alpine/build.sh /
RUN \
apk add --no-cache --virtual=.build-dependencies \
apache-arrow-dev \
autoconf \
automake \
build-base \
clang15-dev \
cmake \
gettext-dev \
libtool \
linux-headers \
llvm15 \
lz4-dev \
msgpack-c-dev \
rapidjson-dev \
ruby \
samurai \
xsimd-dev \
xxhash-dev \
Expand Down
4 changes: 1 addition & 3 deletions alpine/12/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,16 @@ COPY alpine/build.sh /
RUN \
apk add --no-cache --virtual=.build-dependencies \
apache-arrow-dev \
autoconf \
automake \
build-base \
clang15-dev \
cmake \
gettext-dev \
libtool \
linux-headers \
llvm15 \
lz4-dev \
msgpack-c-dev \
rapidjson-dev \
ruby \
samurai \
xsimd-dev \
xxhash-dev \
Expand Down
4 changes: 1 addition & 3 deletions alpine/13-slim/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,16 @@ COPY alpine/build.sh /
RUN \
apk add --no-cache --virtual=.build-dependencies \
apache-arrow-dev \
autoconf \
automake \
build-base \
clang15-dev \
cmake \
gettext-dev \
libtool \
linux-headers \
llvm15 \
lz4-dev \
msgpack-c-dev \
rapidjson-dev \
ruby \
samurai \
xsimd-dev \
xxhash-dev \
Expand Down
4 changes: 1 addition & 3 deletions alpine/13/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,16 @@ COPY alpine/build.sh /
RUN \
apk add --no-cache --virtual=.build-dependencies \
apache-arrow-dev \
autoconf \
automake \
build-base \
clang15-dev \
cmake \
gettext-dev \
libtool \
linux-headers \
llvm15 \
lz4-dev \
msgpack-c-dev \
rapidjson-dev \
ruby \
samurai \
xsimd-dev \
xxhash-dev \
Expand Down
4 changes: 1 addition & 3 deletions alpine/14-slim/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,16 @@ COPY alpine/build.sh /
RUN \
apk add --no-cache --virtual=.build-dependencies \
apache-arrow-dev \
autoconf \
automake \
build-base \
clang15-dev \
cmake \
gettext-dev \
libtool \
linux-headers \
llvm15 \
lz4-dev \
msgpack-c-dev \
rapidjson-dev \
ruby \
samurai \
xsimd-dev \
xxhash-dev \
Expand Down
4 changes: 1 addition & 3 deletions alpine/14/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,16 @@ COPY alpine/build.sh /
RUN \
apk add --no-cache --virtual=.build-dependencies \
apache-arrow-dev \
autoconf \
automake \
build-base \
clang15-dev \
cmake \
gettext-dev \
libtool \
linux-headers \
llvm15 \
lz4-dev \
msgpack-c-dev \
rapidjson-dev \
ruby \
samurai \
xsimd-dev \
xxhash-dev \
Expand Down
4 changes: 1 addition & 3 deletions alpine/15-slim/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,16 @@ COPY alpine/build.sh /
RUN \
apk add --no-cache --virtual=.build-dependencies \
apache-arrow-dev \
autoconf \
automake \
build-base \
clang15-dev \
cmake \
gettext-dev \
libtool \
linux-headers \
llvm15 \
lz4-dev \
msgpack-c-dev \
rapidjson-dev \
ruby \
samurai \
xsimd-dev \
xxhash-dev \
Expand Down
4 changes: 1 addition & 3 deletions alpine/15/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,16 @@ COPY alpine/build.sh /
RUN \
apk add --no-cache --virtual=.build-dependencies \
apache-arrow-dev \
autoconf \
automake \
build-base \
clang15-dev \
cmake \
gettext-dev \
libtool \
linux-headers \
llvm15 \
lz4-dev \
msgpack-c-dev \
rapidjson-dev \
ruby \
samurai \
xsimd-dev \
xxhash-dev \
Expand Down
4 changes: 1 addition & 3 deletions alpine/16-slim/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,16 @@ COPY alpine/build.sh /
RUN \
apk add --no-cache --virtual=.build-dependencies \
apache-arrow-dev \
autoconf \
automake \
build-base \
clang15-dev \
cmake \
gettext-dev \
libtool \
linux-headers \
llvm15 \
lz4-dev \
msgpack-c-dev \
rapidjson-dev \
ruby \
samurai \
xsimd-dev \
xxhash-dev \
Expand Down
4 changes: 1 addition & 3 deletions alpine/16/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,16 @@ COPY alpine/build.sh /
RUN \
apk add --no-cache --virtual=.build-dependencies \
apache-arrow-dev \
autoconf \
automake \
build-base \
clang15-dev \
cmake \
gettext-dev \
libtool \
linux-headers \
llvm15 \
lz4-dev \
msgpack-c-dev \
rapidjson-dev \
ruby \
samurai \
xsimd-dev \
xxhash-dev \
Expand Down
44 changes: 11 additions & 33 deletions alpine/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,53 +8,31 @@ GROONGA_VERSION=$2
MECAB_VERSION=0.996

mkdir build
cd build

wget \
-O mecab.tar.gz \
https://packages.groonga.org/source/mecab/mecab-${MECAB_VERSION}.tar.gz
tar xf mecab.tar.gz
cd mecab-*
sed -i.bak -e 's,ipadic,naist-jdic,g' mecabrc.in
wget https://github.com/taku910/mecab/pull/71.patch
patch -p2 < 71.patch
autoreconf --force --install
./configure --prefix=/usr/local
make -j$(nproc)
make install
cd -

wget \
-O mecab-naist-jdic.tar.gz \
https://packages.groonga.org/source/mecab-naist-jdic/mecab-naist-jdic-0.6.3b-20111013.tar.gz
tar xf mecab-naist-jdic.tar.gz
cd mecab-naist-jdic-*
autoreconf --force --install
./configure \
--prefix=/usr/local \
--with-charset=utf-8
make -j$(nproc)
make install
cd -
pushd build

wget https://packages.groonga.org/source/groonga/groonga-${GROONGA_VERSION}.tar.gz
tar xf groonga-${GROONGA_VERSION}.tar.gz
cd groonga-${GROONGA_VERSION}
pushd groonga-${GROONGA_VERSION}

pushd vendor
ruby download_mecab.rb
popd

cmake \
-S . \
-B ../groonga.build \
--preset=release-maximum \
-DCMAKE_INSTALL_PREFIX=/usr/local
cmake --build ../groonga.build
cmake --install ../groonga.build
cd -
popd

wget https://packages.groonga.org/source/pgroonga/pgroonga-${PGROONGA_VERSION}.tar.gz
tar xf pgroonga-${PGROONGA_VERSION}.tar.gz
cd pgroonga-${PGROONGA_VERSION}
pushd pgroonga-${PGROONGA_VERSION}
make PGRN_DEBUG=yes HAVE_MSGPACK=1 MSGPACK_PACKAGE_NAME=msgpack-c -j$(nproc)
make install
cd -
popd

cd ..
popd
rm -rf build

0 comments on commit 66fffeb

Please sign in to comment.