Commit 7dd7978a authored by Yuanle Song's avatar Yuanle Song
Browse files

move c_std=c11 to project(); add build from source documents

parent 326178bc
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -8,7 +8,8 @@ project('zero-pinyin-service', ['c', 'cpp'],
    'werror=true',
    'buildtype=release',
    'strip=true',
    'b_ndebug=if-release'])
    'b_ndebug=if-release',
    'c_std=c11'])
# to create a debug build
# meson setup --buildtype debugoptimized build/

@@ -17,10 +18,6 @@ add_project_arguments(
  '-Wno-missing-field-initializers',
  language: ['c', 'cpp'])
add_project_arguments(
  '-std=c11',
  language: 'c')
add_project_arguments(
  '-std=c++11',
  '-DHAVE_LIBUUID',
  language: 'cpp')

+63 −1
Original line number Diff line number Diff line
* COMMENT -*- mode: org -*-
#+Date: 2019-04-05
Time-stamp: <2020-02-16>
Time-stamp: <2023-08-15>
#+STARTUP: content
* notes                                                               :entry:
** 2020-02-02 documents
@@ -58,6 +58,49 @@ shared between zero-pinyin and ibus-pinyin.
** 2019-08-31 how to format C code? do it before git commit.
see ~/c/gtk-im-module/, it uses myastyle-pre-commit-check in git pre-commit
~/bin/myastyle-pre-commit-check
** 2023-08-15 how to build from source                                  :doc:
- dependencies

  - RHEL

    sudo dnf install -y gcc-c++ libuuid-devel sqlite-devel glib2-devel gtk3-devel python3-pip

- meson build tool
  python3 -m pip install --user meson ninja

- do a debug/release build

  get source code. This project requires libpyzy.
  mkdir ~/fromsource/
  git clone git@gitlab.emacsos.com:sylecn/libpyzy.git
  cd libpyzy/src/
  git clone git@gitlab.emacsos.com:sylecn/zero-pinyin-service.git
  cd zero-pinyin-service/
  This is project root dir.

  in project root dir,
  # for debug build, do not include "--buildtype release" param
  meson setup --buildtype release build/
  cd build && ninja

- to run the built binary

  get phrases db, they are available in libpyzy in debian.
  you can download the deb and unpack it
  https://packages.debian.org/bookworm/libpyzy-1.0-0v5

  put your main phrase database at any of these position:
  /usr/share/pyzy/db/open-phrase.db
  ~/.cache/ibus/pinyin/main.db

  put your user phrase database at:
  ~/.cache/ibus/pinyin/user-1.0.db

  now it's ready to run zero-pinyin-service.

  in project root dir,
  ./build/zero-pinyin-service

** 2020-02-16 how to create deb for distribution on apt repo?
- on dev node, test deb, make sure it works.
  git push
@@ -86,6 +129,25 @@ see ~/c/gtk-im-module/, it uses myastyle-pre-commit-check in git pre-commit
* later                                                               :entry:
* current                                                             :entry:
** 
** 2023-08-15 try build zero-pinyin-service for RHEL9
- problems
  - maindb is empty. I need libpyzy's db.

    on rh901,
    mkdir -p ~/.cache/ibus/pinyin/

    on lat21,
    scp ~/.cache/ibus/pinyin/main.db rh901:.cache/ibus/pinyin/

    also copy my user db. now that I am here.
    scp ~/.cache/ibus/pinyin/user-1.0.db rh901:.cache/ibus/pinyin/

    yes. it only needs the phrases db.
    libpyzy lib is not needed at runtime.

  - I should really get an alternative panel using emacs facility.
    it's easier to test when I don't have access to GUI env.

** 2019-08-31 honor XDG cache dir.
~/.cache/ibus
** 2019-04-17 make flags configurable at runtime.