Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rewrite Dockerfile to include plugins #711

Merged
merged 1 commit into from
Sep 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/commit-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout last commit
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install clang-format
run: sudo apt install -y clang-format
- name: Lint
Expand All @@ -30,3 +30,7 @@ jobs:
windows:
needs: lint
uses: ./.github/workflows/windows-build.yml

docker:
needs: lint
uses: ./.github/workflows/docker-build.yml
14 changes: 14 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Docker build
on:
workflow_call:

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Checkout last commit
uses: actions/checkout@v4
- name: Build with plugins
run: docker build -t librime .
2 changes: 1 addition & 1 deletion .github/workflows/linux-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
compiler: [g++, clang]
steps:
- name: Checkout last commit
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: ${{ inputs.repository }}
submodules: recursive
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/macos-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
RIME_PLUGINS: ${{ inputs.rime_plugins }}
steps:
- name: Checkout last commit
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: ${{ inputs.repository }}
submodules: recursive
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/windows-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
RIME_PLUGINS: ${{ inputs.rime_plugins }}
steps:
- name: Checkout last commit
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: ${{ inputs.repository }}
submodules: recursive
Expand Down Expand Up @@ -124,7 +124,7 @@ jobs:
uses: msys2/setup-msys2@v2

- name: Checkout last commit
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: ${{ inputs.repository }}

Expand Down
64 changes: 33 additions & 31 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,35 +1,37 @@
FROM ubuntu:18.04
FROM debian:12.1

RUN apt update
RUN apt install -y \
cmake \
libboost-dev \
libboost-filesystem-dev libboost-regex-dev libboost-system-dev libboost-locale-dev \
libgoogle-glog-dev \
libgtest-dev \
libyaml-cpp-dev \
libleveldb-dev \
libmarisa-dev
RUN apt update && apt install -y \
git \
build-essential \
cmake \
ninja-build \
libboost-dev \
libboost-filesystem-dev \
libboost-regex-dev \
libboost-system-dev \
libboost-locale-dev \
libgoogle-glog-dev \
libgtest-dev \
libyaml-cpp-dev \
libleveldb-dev \
libmarisa-dev \
libopencc-dev \
liblua5.4-dev

RUN apt install -y git
COPY / /librime
WORKDIR /librime/plugins
RUN git clone https://github.com/rime/librime-charcode charcode && \
git clone https://github.com/hchunhui/librime-lua lua && \
git clone https://github.com/lotem/librime-octagram octagram

# Manually install libopencc
RUN git clone https://github.com/BYVoid/OpenCC.git
WORKDIR OpenCC/
RUN apt install -y doxygen
RUN make
RUN make install
WORKDIR /librime
RUN cmake -B build -G Ninja \
-DCMAKE_BUILD_TYPE:STRING=Release \
-DENABLE_LOGGING:BOOL=ON \
-DBUILD_TEST:BOOL=ON \
-DBUILD_STATIC:BOOL=OFF \
-DBUILD_SHARED_LIBS:BOOL=ON
RUN cmake --build build

# Fix libgtest problem during compiling
WORKDIR /usr/src/gtest
RUN cmake CMakeLists.txt
RUN make
#copy or symlink libgtest.a and libgtest_main.a to your /usr/lib folder
RUN cp *.a /usr/lib

# Build librime
WORKDIR /
RUN git clone https://github.com/rime/librime.git
WORKDIR librime/
RUN make
RUN make install
WORKDIR /librime/build
RUN ctest