0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

buildrootでVerovioを使う

Last updated at Posted at 2025-04-16

目的

組み込みLinux環境で musicxml -> svg変換を行なう

手順

Verovioのリポジトリはここ

詳しくは調べてないがGPL-3.0使用モジュールがあるっぽいので
利用は注意が必要

LGPL選択すれば良いだけっぽい

以下のファイルが必要

└ package
  ├ Config.in  ## 既存ファイル
  ├ ...
  └ verovio
    ├ 0001-cmake.patch
    ├ package/verovio/Config.in
    └ package/verovio/verovio.mk

package/verovio/Config.in

もしかしたらdependency(cairoとか)が必要かもしれない

config BR2_PACKAGE_VEROVIO
    bool "Verovio"
    help
      A music notation engraving library

package/verovio/0001-cmake.patch

commit idは生成ツールがあるが、
gitからダウンロードしてきて
ビルドディレクトリに配置されたものはgit管理ではないので
そのまま動作させられない
バージョン固定でパッチ当てるのが楽と思う

cmakeはcmakeディレクトリに移動するより
ルートにCMakeLists.txt作った方が楽なのでは?との理由で

diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..7bd7bc8
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,4 @@
+cmake_minimum_required(VERSION 2.8...3.19)
+project(Verovio)
+
+add_subdirectory(cmake)
diff --git a/include/vrv/git_commit.h b/include/vrv/git_commit.h
new file mode 100644
index 0000000..3ff4bb2
--- /dev/null
+++ b/include/vrv/git_commit.h
@@ -0,0 +1,6 @@
+////////////////////////////////////////////////////////
+/// Git commit version file generated at compilation ///
+////////////////////////////////////////////////////////
+
+#define GIT_COMMIT "-8c3069d"
+

package/verovio/verovio.mk

事前にフォント生成しないといけない

VEROVIO_VERSION = version-5.1.0
VEROVIO_SITE = https://github.com/rism-digital/verovio.git
VEROVIO_SITE_METHOD = git
VEROVIO_SITE_VERSION = $(VEROVIO_VERSION)
VEROVIO_GIT_SUBMODULES = YES
VEROVIO_LICENSE = LGPL-3.0

VEROVIO_DEPENDENCIES = host-python3

VEROVIO_CMAKE_BACKEND = ninja

define VEROVIO_GENERATE_FONTS
	cd $(@D)/fonts && ./generate_all.sh
endef

VEROVIO_PRE_BUILD_HOOKS += VEROVIO_GENERATE_FONTS


$(eval $(cmake-package))

package/Config.in

適当な場所に追加する

diff --git a/package/Config.in b/package/Config.in
index a47fdad1..3154015c 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -312,6 +312,7 @@ menu "Graphic libraries and applications (graphic/text)"
 comment "Graphic applications"
        source "package/pdf-viewer/Config.in"
        source "package/pdf-viewer-lvgl/Config.in"
+       source "package/verovio/Config.in"
        source "package/cage/Config.in"
        source "package/cog/Config.in"
        source "package/dmenu-wayland/Config.in"

確認

qemuで表示するとこんな感じ

Peek 2025-04-16 14-43.gif

文字が表示されない原因は調査中

文字を表示する方法

fontをインストールする(Dejavuで動きました)

Target packages > Fonts, cursors, icons, sounds and themes

image.png

image.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?