Linux あれこれ

Linux 関連の備忘録です。

「Haiku」にて「gtksourceview-4.8.2」をビルドしてみた〈H145-10〉

登録日: 2022-03-01 更新日: 2022-03-03

Haiku にて、Linux アプリをHaiku に移植するときに使われる環境 「Haikuports」を構築 しました。

Haiku に「mousepad」を移植するには依存として「gtksourceview-3.0」以上が必要でした。 ということで、「gtksourceview-4.8.2」の移植にトライしてみました。

-

その備忘録です。

-

-

VirtualBox に「nightly ビルド」の「Haiku R1/beta3」をインストール しました。システムとしては最新です。そこで作業しました。

-

-

使用したPC は「ASUS Chromebox CN60」で、 プロセッサは第4世代の「Intel Celeron 2955U 」です。

-

(注)リンクを戻るときはブラウザの左上の「←」をクリック

-

-


目次

-

Haiku での移植の関連情報 :

「レシピファイルについて」

「パッチファイルについて」

「ローカルで差分を作成」

「git で差分を作成」

「.patchset を手動で作成」

「.patchset を自動で作成」  ←(事前準備が必要)

-

今回の作業 :

  1. 移植環境を作り直し

  2. 「gtksourceview」フォルダを追加:

  3. 「gtksourceview-4.8.2.recipe」を作成(未完):

  4. 「パッケージ化」を実行:

「まとめ へ」

-

「目次詳細 へ」

-

-


--- - --- - --- - --- - --- - --- - --- - --- - --- - --- - --- - -

Haiku R1/beta3」のデスクトップ

-

「nightly ビルド」のデスクトップ画面:

→「nightly ビルド」は開発版ですが、更新の回数が多いので不具合が解消されている可能性があります。

-

「nightly ビルド」のアイコン:

→立ち上げデバイス(ボリューム)には「てんとう虫」マークが付きます。

-

-


--- - --- - --- - --- - --- - --- - --- - --- - --- - --- - --- - --

現在のシステムのバージョン:

-

2022-03-01 現在:

~> uname -v
hrev55916 Feb  28 2022 07:47:48

→「nightly ビルド」は、頻繁に更新されています。

-

デスクトップが表示しきれないことがあったら、

もし、立ち上げで背景色のまま、デスクトップが表示されないときは「ココ 」を参照

-

-


--- - --- - --- - --- - --- - --- - --- - --- - --- - --- - --- - ---

1. Ubuntu 22.04 にて、「gtksourceview-4.8.2」をダウンロード:

-

Ubuntu 22.04 にて、事前確認しました。

-

「GtkSourceView」公式サイト:

公式サイト:

-

gitlab gtksourceview

-

ダウンロード:

GtkSourceView Downloads Tarballs

-

gtksourceview-4.8.2.tar.xz 1.1 MiB 2021-Sep-03 19:15

-

チェックサムの確認:
$ sha256sum gtksourceview-4.8.2.tar.xz
842de7e5cb52000fd810e4be39cd9fe29ffa87477f15da85c18f7b82d45637cc  gtksourceview-4.8.2.tar.xz

-

-


--- - --- - --- - --- - --- - --- - --- - --- - --- - --- - --- - ----

2. 「gtksourceview-4.8.2」のインストール関連の情報:

-

「GtkSourceView」公式サイト:

公式サイト:

-

開発サイト:

gitlab gtksourceview

-

ライセンス: GNU LGPL v2.1

-

現在リリースされているのは「5.3.2」なので、サイトに置かれた情報はその「5.3.2」の情報です。 なので、「4.8.2」の情報はダウンロードして展開後のソースファイルで確認しました。

-


1). README.md を確認:

-

(1). ビルドの手順:
$ mkdir build
$ meson build
$ cd build
  [ Become root if necessary ]  必要に応じてルートになります
$ ninja install

→「mkdir build」は要らないし、「cd build」の後に「ninja」の行がありませんが、無くてもいいのかな。

-

(2). 依存するパッケージ
  • GLib >= 2.48
  • GTK+ >= 3.24
  • libxml2 >= 2.6
  • freebidi >= 0.19.7

-


2). Ubuntu 22.04 でのパッケージ名:

libglib2.0-dev-bin/focal-updates 2.64.6-1~ubuntu20.04.4 amd64
  Development utilities for the GLib library

libgtk-3-dev/focal-updates 3.24.20-0ubuntu1 amd64
  development files for the GTK library

libxml2-dev/focal-updates,focal-security 2.9.10+dfsg-5ubuntu0.20.04.1 amd64
  Development files for the GNOME XML library

libfribidi-dev/focal 1.0.8-2 amd64
  Development files for FreeBidi library

libgtksourceview-4-dev/focal 4.6.0-1 amd64
  development files for the GTK+ syntax highlighting widget

-


3). ソースに含まれている「meson.build」 から抜粋:

glib_req_version = '2.48'
gtk_req_version = '3.24'

libm_dep = cc.find_library('m', required: false)

glib_req = '>= @0@'.format(glib_req_version)
gtk_req = '>= @0@'.format(gtk_req_version)
libxml_req = '>= 2.6'
gladeui_req = '>= 3.9'
introspection_req  = '>= 1.42.0'
gtk_doc_req = '>= 1.25'
fribidi_req = '>= 0.19.7'

glib_dep = dependency('glib-2.0', version: glib_req)
gobject_dep = dependency('gobject-2.0', version: glib_req)
gio_dep = dependency('gio-2.0', version: glib_req)
gtk_dep = dependency('gtk+-3.0', version: gtk_req)
libxml_dep = dependency('libxml-2.0', version: libxml_req, required: cc.get_id() != 'msvc')
fribidi_dep = dependency('fribidi', version: fribidi_req)

-


4). Ubuntu 22.04 でビルドした「gtksourceview-4」の .pc の内容:

$ cat /usr/lib/x86_64-linux-gnu/pkgconfig/gtksourceview-4.pc
prefix=/usr
libdir=${prefix}/lib/x86_64-linux-gnu
includedir=${prefix}/include

Name: gtksourceview-4
Description: Source code editing Gtk+ widget.
Version: 4.8.2
Requires: glib-2.0 >=  2.48, gobject-2.0 >=  2.48, gio-2.0 >=  2.48, gtk+-3.0 >=  3.24
Requires.private: libxml-2.0 >=  2.6, fribidi >=  0.19.7
Libs: -L${libdir} -lgtksourceview-4
Cflags: -I${includedir}/gtksourceview-4

↓ 抜粋:

glib-2.0 >=  2.48
gobject-2.0 >=  2.48
gio-2.0 >=  2.48
gtk+-3.0 >=  3.24
libxml-2.0 >=  2.6
fribidi >=  0.19.7

-


5). Ubuntu 22.04 で確認:

$ apt show libgtksourceview-4-dev
:
Package: libgtksourceview-4-dev
Version: 4.6.0-1
Priority: optional
Section: libdevel
Source: gtksourceview4  ←(ソースが同じことに注目)
Origin: Ubuntu
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Debian GNOME Maintainers <pkg-gnome-maintainers@lists.alioth.debian.org>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 1,210 kB
Depends: libgtksourceview-4-0 (= 4.6.0-1), gir1.2-gtksource-4 (= 4.6.0-1), libgtk-3-dev (>= 3.19.6), libxml2-dev (>= 2.6.0)
Suggests: libgtksourceview-4-doc
Breaks: libgtksourceview-3.0-dev (<< 3.24.7-2~)
Replaces: libgtksourceview-3.0-dev (<< 3.24.7-2~)
Homepage: https://wiki.gnome.org/Projects/GtkSourceView
Download-Size: 83.1 kB
APT-Sources: http://archive.ubuntu.com/ubuntu focal/main amd64 Packages
Description: development files for the GTK+ syntax highlighting widget
 GtkSourceView is a text widget that extends the standard GTK+ 3.x text widget
 GtkTextView. It improves GtkTextView by implementing syntax highlighting and
 other features typical of a source editor.
 .
 This package contains the header files required if you wish to develop
 software that uses the GtkSourceView widget.

→「Replaces: libgtksourceview-3.0-dev」は置き換わるということでわかるけど、 「Breaks: libgtksourceview-3.0-dev」は壊れるということ、これはどういう意味?

- →依存?に「gir1.2-gtksource-4」がありました:

$ apt search gir1.2-gtksource-4
:
gir1.2-gtksource-4/focal 4.6.0-1 amd64
  gir files for the GTK+ syntax highlighting widget
$ apt show gir1.2-gtksource-4
:
Package: gir1.2-gtksource-4
Version: 4.6.0-1
Priority: optional
Section: introspection
Source: gtksourceview4  ←(ソースが同じことに注目)
Origin: Ubuntu
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Debian GNOME Maintainers <pkg-gnome-maintainers@lists.alioth.debian.org>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 93.2 kB
Depends: gir1.2-gtk-3.0 (>= 3.22), libgtksourceview-4-0 (>= 3.99.7)
Homepage: https://wiki.gnome.org/Projects/GtkSourceView
Task: ubuntu-desktop-minimal, ubuntu-desktop, ubuntu-budgie-desktop
Download-Size: 17.7 kB
APT-Sources: http://archive.ubuntu.com/ubuntu focal/main amd64 Packages
Description: gir files for the GTK+ syntax highlighting widget
 GtkSourceView is a text widget that extends the standard GTK+ 3.x text widget
 GtkTextView. It improves GtkTextView by implementing syntax highlighting and
 other features typical of a source editor.
 .
 This package contains GObject introspection information.

→1つのソースからいくつかのパッケージが生成されるようです。

→依存に「libgtksourceview-4-0」(ベース)と 「gir1.2-gtksource-4」がありました:

-


5). ports ツリーのカテゴリをどこにすべきか確認:

(1). Haiku で新しいports を追加するときは、「https://packages.gentoo.org/」の階層に従います:

→「gtksourceview」で検索

-

x11-libs/gtksourceview :

→カテゴリは「x11-libs」です。Gentoo Linux のカテゴリ分けに習います。

-

SUMMARY: (概要)
A text widget implementing syntax highlighting and other features

-

Homepage:: (ホームページ)
https://wiki.gnome.org/Projects/GtkSourceView

-

ヒントの記述:
バージョン5.2.0 はアップストリームで利用できます。更新を検討してください!
バージョン5.2.0 はアップストリームで利用できるようですが、
Gentoo ツリーの最新バージョンは4.8.2 です。

Gentoo Linux に移植されているのは「4.8.2」です。

-

(2). Gentoo Linux で使われているレシピファイル (.ebuild) を確認:

-

Available Versions: (利用可能なバージョン)

4.8.2  をクリック

path: root/x11-libs/gtksourceview/gtksourceview-4.8.2.ebuild

# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

inherit gnome.org meson vala virtualx xdg

DESCRIPTION="A text widget implementing syntax highlighting and other features"
HOMEPAGE="https://wiki.gnome.org/Projects/GtkSourceView"

LICENSE="LGPL-2.1+"
SLOT="4"

IUSE="glade gtk-doc +introspection +vala"
REQUIRED_USE="vala? ( introspection )"

KEYWORDS="~alpha amd64 arm arm64 ~ia64 ~mips ppc ppc64 ~riscv sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-solaris"

RDEPEND="
    >=dev-libs/glib-2.48:2
    >=x11-libs/gtk+-3.24:3[introspection?]
    >=dev-libs/libxml2-2.6:2
    glade? ( >=dev-util/glade-3.9:3.10 )
    introspection? ( >=dev-libs/gobject-introspection-1.42.0:= )
    >=dev-libs/fribidi-0.19.7
"
DEPEND="${RDEPEND}"
BDEPEND="
    dev-util/glib-utils
    gtk-doc? (
        >=dev-util/gtk-doc-1.25
        app-text/docbook-xml-dtd:4.3
    )
    >=sys-devel/gettext-0.19.8
    virtual/pkgconfig
    vala? ( $(vala_depend) )
"

src_prepare() {
    use vala && vala_src_prepare
    xdg_src_prepare
}

src_configure() {
    local emesonargs=(
        $(meson_use glade glade_catalog)
        -Dinstall_tests=false
        $(meson_use introspection gir)
        $(meson_use vala vapi)
        $(meson_use gtk-doc gtk_doc)
    )
    meson_src_configure
}

src_test() {
    virtx meson_src_test
}

src_install() {
    meson_src_install

    insinto /usr/share/${PN}-4/language-specs
    newins "${FILESDIR}"/4.6-gentoo.lang gentoo.lang

    # Avoid conflict with gtksourceview:3.0 glade-catalog
    # TODO: glade doesn't actually show multiple GtkSourceView widget collections, so with both installed, can't really be sure which ones are used
    if use glade; then
        mv "${ED}"/usr/share/glade/catalogs/gtksourceview.xml "${ED}"/usr/share/glade/catalogs/gtksourceview-${SLOT}.xml || die
    fi
}

→レシピの記述は似ているけど違う形式なので、一部と依存関連ぐらいしか参考になりません。 依存が実際のパッケージ名なので明確です。これは利点にも欠点にもなります。

-

(3). 「dependencies」タブ をクリックすると、「依存」が表示:

→こちらも重要な情報です。

-

gtksourceview 4.8.2
Version RDEPEND DEPEND BDEPEND PDEPEND
app-arch/xz-utils   -   -   ✅   -
app-text/docbook-xml-dtd   -   -   ✅   -
dev-lang/vala   -   -   ✅   -
dev-libs/fribidi   ✅   ✅   -   -
dev-libs/glib   ✅   ✅   -   -
dev-libs/gobject-introspection   ✅   ✅   -   -
dev-libs/libxml2   ✅   ✅   -   -
dev-util/desktop-file-utils   -   ✅   -   -
dev-util/glade   ✅   ✅   -   -
dev-util/glib-utils   -   -   ✅   -
dev-util/gtk-doc   -   -   ✅   -
dev-util/meson   -   -   ✅   -
dev-util/meson-format-array   -   -   ✅   -
dev-util/ninja   -   -   ✅   -
sys-devel/gettext   -   -   ✅   -
virtual/pkgconfig   -   -   ✅   -
x11-apps/xhost   -   -   ✅   -
x11-base/xorg-server   -   -   ✅   -
x11-libs/gtk+   ✅   ✅   -   -
x11-misc/shared-mime-info   -   ✅   -   -
  • RDEPEND: 実行時に必要な依存
  • DEPEND: RDEPEND にはあるが、DEPEND にはないアイテムは、後でマージできます
  • BDEPEND: ビルド時に必要な依存
  • PDEPEND: すぐに満たされる必要のない実行時の依存。通常は代わりにRDEPENDを使用

-

(4). 記述されていた HOMEPAGE からの情報:

-

Download: (ダウンロード)
https://download.gnome.org/sources/gtksourceview/4.8/gtksourceview-4.8.2.tar.xz

sha256:
842de7e5cb52000fd810e4be39cd9fe29ffa87477f15da85c18f7b82d45637cc  gtksourceview-4.8.2.tar.xz

-

(5). GtkSourceView on GitLab のREADME.md より、

-

DESCRIPTION: (説明)
GtkSourceView is a GNOME library that extends GtkTextView, 
the standard GTK widget for multiline text editing. 
GtkSourceView adds support for syntax highlighting, undo/redo, 
file loading and saving, search and replace, a completion system, 
printing, displaying line numbers, and other features typical of a source code editor.

-

Dependencies: (依存するパッケージ)
    GLib >= 2.62
    GTK >= 3.99
    libxml2 >= 2.6
    freebidi >= 0.19.7
    libpcre2-8 >= 10.21

-

Installation: (インストール)
$ mkdir build
$ meson build
$ cd build
  [ 必要に応じてルートになります ]
$ ninja install

-

-


--- - --- - --- - --- - --- - --- - --- - --- - --- - --- - --- - -----

3. haikuports をインストールし直し:

-

「移植環境を作り直し」

→haikuports の初期化処理にて、警告がいっぱい表示します。

haikuporter コマンドのバージョンが上がりましたが、それに対応していないパッケージが多数あるようです。 以前はビルドできたパッケージでも、新しくビルドするとエラーするかもしれません。レシピファイルの修正が必要です。(例: Otter Browser)

-

-


--- - --- - --- - --- - --- - --- - --- - --- - --- - --- - --- - ----- -

4. 「haikuporter」コマンドがどこでも使えるようにリンクを貼りました:

-

1). リンク:

> ln -s /boot/home/Git/haikuporter/haikuporter /boot/home/config/non-packaged/bin/
> ls -l /boot/home/config/non-packaged/bin/
:
lrwxrwxrwx 1 user root 38  2月  7 09:04 haikuporter -> /boot/home/Git/haikuporter/haikuporter

-

2). 確認:

~/Desktop> haikuporter -v
Checking if any dependency-infos need to be updated ...
Looking for stale dependency-infos ...

Error: You need to specify a search string.
Error: Invoke '/boot/home/config/non-packaged/bin/haikuporter -h' for usage information.

→haikuporter コマンドはどこでも使えました

和訳:

依存関係情報を更新する必要があるかどうかを確認しています...
古い依存関係を探しています..
:
エラー: 検索文字列を指定する必要があります
エラー: 使用法については、「/boot/home/config/non-packaged/bin/haikuporter -h」を呼び出してください

→git clone した最初に、ヘルプを除く何かしらのhaikuporter コマンドを実行すると、全てのポートを対象にした ファイルの確認処理が実行され、作業フォルダがなければ作成されます。

今回のエラーは、コマンドにてポート指定していないから表示されました。

-

3). 既存のポートの場所を検索してみる:

~/Desktop> haikuporter -o featherpad
/boot/home/Git/haikuports/app-editors/featherpad

→表示されました。

-

-


--- - --- - --- - --- - --- - --- - --- - --- - --- - --- - --- - ----- --

5. 「gtksourceview」フォルダを追加:

-

Gentoo Linux に習って、「haikuports/x11-libs/」配下に作成します。

-

> cd /boot/home/Git/haikuports/x11-libs/
> mkdir -p gtksourceview

-

-


--- - --- - --- - --- - --- - --- - --- - --- - --- - --- - --- - ----- ---

6. 仮の「gtksourceview-4.8.2」を作成して登録:

-

ライブラリの移植は初めてなので、他のports を参考に、色々と試行錯誤:

> lpe /boot/home/Git/haikuports/x11-libs/gtksourceview/gtksourceview-4.8.2.recipe
SUMMARY="A GNOME library that extends GtkTextView"
DESCRIPTION="GtkSourceView is a GNOME library that extends \
GtkTextView, the standard GTK+ widget for multiline text editing. \
GtkSourceView adds support for syntax highlighting, undo/redo, \
file loading and saving, search and replace, a completion system, \
printing, displaying line numbers, and other features typical of \
a source code editor. "
HOMEPAGE="https://wiki.gnome.org/Projects/GtkSourceView"
COPYRIGHT="2005 - 2022 The GNOME Project."
LICENSE="GNU LGPL v2"
REVISION="1"
SOURCE_URI="https://download.gnome.org/sources/gtksourceview/4.8/gtksourceview-$portVersion.tar.xz"
CHECKSUM_SHA256="842de7e5cb52000fd810e4be39cd9fe29ffa87477f15da85c18f7b82d45637cc"
SOURCE_DIR="gtksourceview-$portVersion"
#PATCHES="gtksourceview-$portVersion.patchset"

ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"

libVersion="4.8.2"
libVersionCompat="$libVersion compat >= ${libVersion%%.*}"

PROVIDES="
    gtksourceview$secondaryArchSuffix = $portVersion
    lib:libgtksourceview_4$secondaryArchSuffix = $libVersionCompat
    "
REQUIRES="
    haiku$secondaryArchSuffix
    gobject_introspection$secondaryArchSuffix
    lib:libfribidi$secondaryArchSuffix
    lib:libgio_2.0$secondaryArchSuffix
    lib:libglib_2.0$secondaryArchSuffix
    lib:libgmodule_2.0$secondaryArchSuffix
    lib:libgobject_2.0$secondaryArchSuffix
    lib:libgtk_3$secondaryArchSuffix
    lib:libintl$secondaryArchSuffix
    lib:libxml2$secondaryArchSuffix
    "

PROVIDES_devel="
    libgtksourceview${secondaryArchSuffix}_devel = $portVersion
    devel:libgtksourceview_4$secondaryArchSuffix = $libVersionCompat
    "
REQUIRES_devel="
    libgtksourceview$secondaryArchSuffix == $portVersion base
    devel:libglib_2.0$secondaryArchSuffix
    devel:libpcre$secondaryArchSuffix
    "

BUILD_REQUIRES="
    haiku${secondaryArchSuffix}_devel
    gobject_introspection${secondaryArchSuffix}_devel
    devel:libfribidi$secondaryArchSuffix
    devel:libgio_2.0$secondaryArchSuffix
    devel:libglib_2.0$secondaryArchSuffix
    devel:libgmodule_2.0$secondaryArchSuffix
    devel:libgobject_2.0$secondaryArchSuffix
    devel:libgtk_3$secondaryArchSuffix
    devel:libxml2$secondaryArchSuffix
    "
BUILD_PREREQUIRES="
    cmd:cmake
    cmd:gcc$secondaryArchSuffix
    cmd:ld$secondaryArchSuffix
    cmd:libtoolize$secondaryArchSuffix
    cmd:make
    cmd:meson
    cmd:ninja
    cmd:perl
    cmd:pkg_config$secondaryArchSuffix
    cmd:python3 >= 3.7
    cmd:valac
    cmd:vapigen
    cmd:which
    "

# PATCH()     (必要であれば修正が必要)
# {
#   # the patch wont break the build
#   # only applies when you enable gobject-introspection
#   sed -i \
#       -e 's|@INTROSPECTION_GIRDIR@|@datadir@/gir-1.0|g' \
#       -e 's|@INTROSPECTION_TYPELIBDIR@|@libdir@/girepository-1.0|g' \
#       gtksourceview/meson.build
# }

BUILD()
{
    meson builddir --buildtype=release \
        --prefix=$prefix \
        --includedir=$includeDir \
        --datadir=$dataDir \
        --libdir=$libDir \
        --mandir=$manDir
        #--enable-vala

    ninja -C builddir $jobArgs
}

INSTALL()
{
    ninja -C builddir install

    prepareInstalledDevelLib libgtksourceview_4
    fixPkgconfig

    # devel package
    packageEntries devel "$developDir"
}

TEST()
{
    ninja -C build test
}

→ちなみに、「${libVersion%%.*}」のbash の文字列操作は「4」になります。

-

ビルドに成功すれば、INSTALL() の後半にて、Devel パッケージが作成されるはず?です。

-

-


--- - --- - --- - --- - --- - --- - --- - --- - --- - --- - --- - ----- ----

7. 新規作成したポートの「gtksourceview」が使えるかを確認

-

こちらの記述は修正済みなので、作業は要りません。

-

1). 今回作成した「gtksourceview」の場所を検索:

> haikuporter -o gtksourceview
>

→表示されません。

-

2). 他のports の場所を確認:

> haikuporter -o featherpad
/boot/home/Git/haikuports/app-editors/featherpad

> haikuporter -o mousepad
/boot/home/Git/haikuports/app-editors/mousepad

> haikuporter -o gtksourceview
> 

→「gtksourceview」のみ表示されません。

-

3). 「--lint」で問題点を確認:

> haikuporter --lint mousepad
Checking ports of: mousepad
mousepad-0.5.8  [app-editors]

> haikuporter --lint gtksourceview
Checking ports of: gtksourceview
Error: gtksourceview is not a known port!

→「gtksourceview」はports として有効になっていません。

-

4). 「ls」でファイルを確認:

> cd ~/Git/haikuports/x11-libs/gtksourceview/
> ls
gtksourceview-4.8.2

→ファイル名に「.recipe」を付け忘れていました。

-

5). ファイル名を修正:

> mv gtksourceview-4.8.2 gtksourceview-4.8.2.recipe
> ls
gtksourceview-4.8.2.recipe

→ファイル名に「.recipe」を付けました。

-

6). 場所を再確認:

> haikuporter -o gtksourceview
/boot/home/Git/haikuports/x11-libs/gtksourceview

→フォルダ配下にレシピファイル(gtksourceview-4.8.2.recipe) を作成しておかないと表示(認識)されません。

-

> ls -1 /boot/home/Git/haikuports/x11-libs/gtksourceview/
gtksourceview-4.8.2.recipe
work-4.8.2

→認識されて、作業フォルダが作成されました。

-

→カテゴリやパッケージのフォルダを追加時に、ファイル名に「.recipe」を付け忘れると、ポートとして認識されません

-

-


--- - --- - --- - --- - --- - --- - --- - --- - --- - --- - --- - ----- -----

8.「gtksourceview」をビルドしてみる:

-

「項番 7).」までは、実施済みなので作業は要りません。記述をご覧ください。

項番 8). 」から、実施して現状を確認できます。

-

1). レシピを作成、作業フォルダを削除してからパッケージ化を実行:

> cd  /boot/home/Git/haikuports/x11-libs/gtksourceview/
> rm -r work-4.8.2
> hp gtksourceview
:

-

最初の「BUILD()」の記述
BUILD()
{
    meson setup builddir
:
}

→シンプルに指定してみました。

-


2). パッケージ化を実行 1回目:

> hp gtksourceview
:
ERROR: Neither directory contains a build file meson.build.

→パラメータを詳細に設定しないと、「meson.build」を見つけられないとのことで、修正: また、 「--buildtype=」の指定も必要です。

「haikuports/dev-libs/glib/glib2-2.68.4.recipe」 を参考に修正しました:

BUILD()
{
    CFLAGS="-D_BSD_SOURCE" LDFLAGS="-lbsd -lgnu -lnetwork" \
        meson setup builddir --buildtype=debugoptimized \
        -D glib_debug=disabled --buildtype=debugoptimized \
:

→ちょっと複雑。余計な部分がありそう。

-


3). パッケージ化を実行 2回目:

「meson setup」にしたら、-D でエラーして、下記のヘルプが表示:

> hp --force gtksourceview
:
Building ...
usage: meson setup [-h] [--prefix PREFIX] [--bindir BINDIR] [--datadir DATADIR] [--includedir INCLUDEDIR]
                   [--infodir INFODIR] [--libdir LIBDIR] [--libexecdir LIBEXECDIR] [--localedir LOCALEDIR]
                   [--localstatedir LOCALSTATEDIR] [--mandir MANDIR] [--sbindir SBINDIR] [--sharedstatedir SHAREDSTATEDIR]
                   [--sysconfdir SYSCONFDIR] [--auto-features {enabled,disabled,auto}]
                   [--backend {ninja,vs,vs2010,vs2012,vs2013,vs2015,vs2017,vs2019,xcode}]
                   [--buildtype {plain,debug,debugoptimized,release,minsize,custom}] [--debug]
                   [--default-library {shared,static,both}] [--errorlogs] [--install-umask INSTALL_UMASK]
                   [--layout {mirror,flat}] [--optimization {0,g,1,2,3,s}] [--stdsplit] [--strip]
                   [--unity {on,off,subprojects}] [--unity-size UNITY_SIZE] [--warnlevel {0,1,2,3}] [--werror]
                   [--wrap-mode {default,nofallback,nodownload,forcefallback,nopromote}]
                   [--force-fallback-for FORCE_FALLBACK_FOR] [--python.platlibdir PYTHON.PLATLIBDIR]
                   [--python.purelibdir PYTHON.PURELIBDIR] [--pkg-config-path PKG_CONFIG_PATH]
                   [--build.pkg-config-path BUILD.PKG_CONFIG_PATH] [--cmake-prefix-path CMAKE_PREFIX_PATH]
                   [--build.cmake-prefix-path BUILD.CMAKE_PREFIX_PATH] [-D option] [--native-file NATIVE_FILE]
                   [--cross-file CROSS_FILE] [--vsenv] [-v] [--fatal-meson-warnings] [--reconfigure] [--wipe]
                   [builddir] [sourcedir]
meson setup: error: argument -D: expected one argument

↓ meson setup を meson に修正:

BUILD()
{
    CFLAGS="-D_BSD_SOURCE" LDFLAGS="-lbsd -lgnu -lnetwork" \
        meson builddir --buildtype=debugoptimized \
        -D glib_debug=disabled --buildtype=debugoptimized \
        #-Diconv=external --prefix=$prefix --includedir=$includeDir \
        --prefix=$prefix --includedir=$includeDir \
        --libdir=$libDir --datadir=$dataDir --bindir=$binDir \
        --localedir=$dataDir/locale
:

-


4). パッケージ化を実行 3回目:

> hp --force gtksourceview
:
meson.build:1:0: ERROR: Unknown options: "glib_debug, iconv"

↓ 「-D option」には、「glib_debug=disabled」のパラメータはないみたい

BUILD()
{
    CFLAGS="-D_BSD_SOURCE" LDFLAGS="-lbsd -lgnu -lnetwork" \
        meson builddir --buildtype=debugoptimized \
        #-D glib_debug=disabled --buildtype=debugoptimized \
        #-Diconv=external --prefix=$prefix --includedir=$includeDir \
        --prefix=$prefix --includedir=$includeDir \
        --libdir=$libDir --datadir=$dataDir --bindir=$binDir \
        --localedir=$dataDir/locale

-


5). パッケージ化を実行 4回目:

上記の指定が正しいかは別にして、「pkg-config」で依存パッケージのチェックが走りました:

> hp --force gtksourceview
:
Fetching package for devel:libgobject_introspection_1.0 ...
*** Failed to find a match for "devel:libgobject_introspection_1.0": Name not found
Error: unable to resolve required packages for build for gtksourceview-4.8.2
Error:  dependency-infos:
Error:          /boot/home/Git/haikuports/repository/gtksourceview-4.8.2.DependencyInfo
Error:  repositories:
Error:          ['/boot/home/Git/haikuports/packages', '/boot/system/packages']
Error: 

→依存の「gobject_introspection_devel」の記述のしかたが良くないみたい。

-

パッケージの確認:
> pkgman search introspection
Status  Name                             Description                                              
--------------------------------------------------------------------------------------------------
        gobject_introspection            Introspection system for GObject-based libraries         
        gobject_introspection_debuginfo  Introspection system for GObject-based libraries (debug i
        gobject_introspection_devel      Introspection system for GObject-based libraries (develop
        gobject_introspection_source     Introspection system for GObject-based libraries (source 

-

「gobject_introspection」の記述を修正:

ports によって記述のしかたが違います。 色々と「/boot/home/Git/haikuports/repository/???.DependencyInfo」を見て参考にしました:

REQUIRES="
    lib:libgobject_introspection_1.0$secondaryArchSuffix
:
BUILD_REQUIRES="
    devel:libgobject_introspection_1.0$secondaryArchSuffix

↓ 修正

REQUIRES="
    gobject_introspection$secondaryArchSuffix
:
BUILD_REQUIRES="
    gobject_introspection${secondaryArchSuffix}_devel

→ライブラリというよりも、OS のシステムと同じ記述のしかたです。

-

ついでに、「BUILD()」をシンプルな形式に修正:

「haikuports/dev-libs/gobject-introspection/gobject_introspection-1.68.0.recipe」 を参考にしました。

BUILD()
{
    meson builddir --buildtype=release \
        --prefix=$prefix \
        --includedir=$includeDir \
        --datadir=$dataDir \
        --libdir=$libDir \
        --mandir=$manDir

    ninja -C builddir $jobArgs
}

-


6). パッケージ化を実行 5回目:

> hp --force gtksourceview
:
Checking if any dependency-infos need to be updated ...
        updating dependency infos of gtksourceview-4.8.2
Looking for stale dependency-infos ...
----------------------------------------------------------------------
x11-libs::gtksourceview-4.8.2
        /boot/home/Git/haikuports/x11-libs/gtksourceview/gtksourceview-4.8.2.recipe
----------------------------------------------------------------------
Skipping download of source for gtksourceview-4.8.2.tar.xz
Validating checksum of gtksourceview-4.8.2.tar.xz
Unpacking source of gtksourceview-4.8.2.tar.xz
Initialized empty Git repository in /boot/home/Git/haikuports/x11-libs/gtksourceview/work-4.8.2/sources/gtksourceview-4.8.2/.git/
chroot has these packages active:
        /boot/system/packages/atk-2.32.0-1-x86_64.hpkg
        /boot/system/packages/atk_devel-2.32.0-1-x86_64.hpkg
        /boot/system/packages/automake-1.16.5-1-x86_64.hpkg
        : 省略
        /boot/system/packages/zlib-1.2.11-4-x86_64.hpkg
        /boot/system/packages/zlib_devel-1.2.11-4-x86_64.hpkg
        /boot/system/packages/zstd-1.5.2-1-x86_64.hpkg
----- Package Info ----------------
header size:                     80
heap size:                     1019
TOC size:                        41
package attributes size:       1284
total size:                    1099
-----------------------------------
waiting for build package gtksourceview-4.8.2-1 to be activated
Building ...
The Meson build system
Version: 0.61.2  ←(バージョンが上がりました。構文チェックが厳しくなります)
Source dir: /sources/gtksourceview-4.8.2
Build dir: /sources/gtksourceview-4.8.2/builddir
Build type: native build
Project name: gtksourceview
Project version: 4.8.2
C compiler for the host machine: cc (gcc 11.2.0 "cc (2021_07_28) 11.2.0")
C linker for the host machine: cc ld.bfd 2.31.1
Host machine cpu family: x86_64
Host machine cpu: x86_64
Library m found: YES
Found pkg-config: /bin/pkg-config (0.29.2)
Run-time dependency glib-2.0 found: YES 2.68.4
Run-time dependency gobject-2.0 found: YES 2.68.4
Run-time dependency gio-2.0 found: YES 2.68.4
Run-time dependency gtk+-3.0 found: YES 3.24.30
Run-time dependency libxml-2.0 found: YES 2.9.13
Run-time dependency fribidi found: YES 1.0.11
Found CMake: /bin/cmake (3.22.2)
Run-time dependency gtk+-quartz-3.0 found: NO (tried pkgconfig and cmake)   ←(不足)
Run-time dependency gobject-introspection-1.0 found: YES 1.68.0   ←(OK になりました)
Run-time dependency vapigen found: NO (tried pkgconfig and cmake)   ←(不足)

meson.build:105:2: ERROR: Dependency "vapigen" not found, tried pkgconfig and cmake

A full log can be found at /sources/gtksourceview-4.8.2/builddir/meson-logs/meson-log.txt
Warning: Command '['bash', '-c', '. /wrapper-script']' returned non-zero exit status 1.
Error: Build has failed - stopping.

-

gtk-quartz」を検索すると、

Where is the gtk+-quartz-3.0 package located? (Trying to compile webkitgtk) がヒット

→「libsoup2.4-dev」をインストールすると解決するみたい。

> pkgman search libsoup
Status  Name            Description                                             
--------------------------------------------------------------------------------
S       libsoup         HTTP client/server library for GNOME                    
        libsoup_devel   HTTP client/server library for GNOME (development files)
        libsoup_source  HTTP client/server library for GNOME (source files)    

-

参考になりそうな、依存の記述を確認:
> infodepe libsoup
:
/boot/home/Git/haikuports/repository/appstream_glib-0.7.18.DependencyInfo:30:        "devel:libsoup_2.4",
/boot/home/Git/haikuports/repository/appstream_glib-0.7.18.DependencyInfo:62:        "lib:libsoup_2.4",

→「便利なツール 」を設定することで「infodepe」は使えます。これは他のコマンドを参考に個人的に作成しました。使用頻度は高いです。

-

「vapigen」の確認
> pkgman search vapigen
:
        vala            An object-oriented programming language that uses the GObject system             
        vala_debuginfo  An object-oriented programming language that uses the GObject system (debug info)
> pkgman install vala
:
The following changes will be made:
  in system:
    install package gd-2.3.3-1 from repository HaikuPorts
    install package graphviz-2.49.1-1 from repository HaikuPorts
    install package vala-0.54.3-1 from repository HaikuPorts
Continue? [yes/no] (yes) : no

→中断して、バージョン番号を確認

> pkgman search vala
:
        vala            An object-oriented programming language that uses the GObject system             
        vala_debuginfo  An object-oriented programming language that uses the GObject system (debug info)

-


7). パッケージ化を実行 6回目:

> hp --force gtksourceview
:
        /boot/system/packages/zstd-1.5.2-1-x86_64.hpkg
----- Package Info ----------------
header size:                     80
heap size:                     1070
TOC size:                        41
package attributes size:       1355
total size:                    1150
-----------------------------------
waiting for build package gtksourceview-4.8.2-1 to be activated
waiting for build package gtksourceview-4.8.2-1 to be activated
waiting for build package gtksourceview-4.8.2-1 to be activated
: 繰り返し

→依存パッケージ「vala」を追加したら、上記の「繰り返し」で終了しません。Ctrl+C で終了。

-

作業フォルダ「work-4.8.2」を削除してパッケージ化すると解消:
> lpe /boot/home/Git/haikuports/x11-libs/gtksourceview/gtksourceview-4.8.2.recipe
> rm -r /boot/home/Git/haikuports/x11-libs/gtksourceview/work-4.8.2

> hp gtksourceview
→「hp --force gtksourceview」が使えるのは、pkg-confg が失敗している時点までみたい

pkg-confg (依存の確認)がほぼ成功して、「ビルド」に入ったら、作業フォルダ「work-4.8.2」を削除してから、パッケージ化を実行しないと、作成するパッケージのアクティブ化でループしました。

→「--force」指定では作業フォルダの上書きなので、クリア処理が不十分みたい。

-

開発パッケージ(gtksourceview_devel-4.8.2) の生成も追加:

参考:

haikuports/dev-libs/libgee/libgee-0.20.4.recipe

-

追加するには、レシピファイルに定義を追加する必要がありました:

PROVIDES_devel="
    libgtksourceview${secondaryArchSuffix}_devel = $portVersion
    devel:libgtksourceview_4$secondaryArchSuffix = $libVersionCompat
    "
REQUIRES_devel="
    libgtksourceview$secondaryArchSuffix == $portVersion base
    devel:libglib_2.0$secondaryArchSuffix
    devel:libpcre$secondaryArchSuffix
    "

-

参考: もし、defineDebugInfo パッケージの生成も追加する場合:
defineDebugInfoPackage libgtksourceview$secondaryArchSuffix \
    "$libDir"/libgtksourceview_4.so.$libVersion

BUILD()
{
:

-


8). パッケージ化を実行 7回目:

> hp -c gtksourceview
Checking if any dependency-infos need to be updated ...
Looking for stale dependency-infos ...
Cleaning work directory of gtksourceview-4.8.2 ...

または、

> rm -r /boot/home/Git/haikuports/x11-libs/gtksourceview/work-4.8.2

-

実行:

> hp gtksourceview

-

表示:

Checking if any dependency-infos need to be updated ...
Looking for stale dependency-infos ...
----------------------------------------------------------------------
x11-libs::gtksourceview-4.8.2
        /boot/home/Git/haikuports/x11-libs/gtksourceview/gtksourceview-4.8.2.recipe
----------------------------------------------------------------------
Skipping download of source for gtksourceview-4.8.2.tar.xz
Validating checksum of gtksourceview-4.8.2.tar.xz
Unpacking source of gtksourceview-4.8.2.tar.xz
Initialized empty Git repository in /boot/home/Git/haikuports/x11-libs/gtksourceview/work-4.8.2/sources/gtksourceview-4.8.2/.git/
chroot has these packages active:
        /boot/system/packages/atk-2.32.0-1-x86_64.hpkg
        /boot/system/packages/atk_devel-2.32.0-1-x86_64.hpkg
        /boot/system/packages/automake-1.16.5-1-x86_64.hpkg
        /boot/system/packages/bash-5.1.016-1-x86_64.hpkg
        /boot/system/packages/binutils-2.31.1-2-x86_64.hpkg
        /boot/system/packages/brotli-1.0.9-2-x86_64.hpkg
        /boot/system/packages/bzip2-1.0.8-1-x86_64.hpkg
        /boot/system/packages/bzip2_devel-1.0.8-1-x86_64.hpkg
        /boot/system/packages/ca_root_certificates-2021_07_05-1-any.hpkg
        /boot/system/packages/cmake-3.22.2-1-x86_64.hpkg
        /boot/system/packages/coreutils-9.0-6-x86_64.hpkg
        /boot/system/packages/curl-7.81.0-1-x86_64.hpkg
        /boot/system/packages/dav1d-0.9.2-1-x86_64.hpkg
        /boot/system/packages/diffutils-3.8-1-x86_64.hpkg
        /boot/system/packages/enca-1.19-2-x86_64.hpkg
        /boot/system/packages/expat-2.4.6-1-x86_64.hpkg
        /boot/system/packages/fdk_aac-2.0.2-2-x86_64.hpkg
        /boot/system/packages/ffmpeg-4.2.2-9-x86_64.hpkg
        /boot/system/packages/file-5.41-1-x86_64.hpkg
        /boot/system/packages/file_data-5.41-1-any.hpkg
        /boot/system/packages/findutils-4.8.0-1-x86_64.hpkg
        /boot/system/packages/fontconfig-2.13.92-1-x86_64.hpkg
        /boot/system/packages/fontconfig_devel-2.13.92-1-x86_64.hpkg
        /boot/system/packages/freetype-2.11.1-1-x86_64.hpkg
        /boot/system/packages/freetype_bootstrap-2.11.1-1-x86_64.hpkg
        /boot/system/packages/fribidi-1.0.11-1-x86_64.hpkg
        /boot/system/packages/fribidi_devel-1.0.11-1-x86_64.hpkg
        /boot/system/packages/game_music_emu-0.6.3-1-x86_64.hpkg
        /boot/system/packages/gawk-5.1.1-1-x86_64.hpkg
        /boot/system/packages/gcc-11.2.0_2021_07_28-5-x86_64.hpkg
        /boot/system/packages/gcc_syslibs-11.2.0_2021_07_28-5-x86_64.hpkg
        /boot/system/packages/gd-2.3.3-2-x86_64.hpkg
        /boot/system/packages/gdk_pixbuf-2.42.2-8-x86_64.hpkg
        /boot/system/packages/gdk_pixbuf_devel-2.42.2-8-x86_64.hpkg
        /boot/system/packages/gettext-0.19.8.1-7-x86_64.hpkg
        /boot/system/packages/gettext_libintl-0.19.8.1-7-x86_64.hpkg
        /boot/system/packages/giflib-5.2.1-1-x86_64.hpkg
        /boot/system/packages/glib2-2.68.4-2-x86_64.hpkg
        /boot/system/packages/glib2_devel-2.68.4-2-x86_64.hpkg
        /boot/system/packages/gmp-6.2.1-2-x86_64.hpkg
        /boot/system/packages/gobject_introspection-1.68.0-1-x86_64.hpkg
        /boot/system/packages/gobject_introspection_devel-1.68.0-1-x86_64.hpkg
        /boot/system/packages/graphite2-1.3.14-1-x86_64.hpkg
        /boot/system/packages/graphite2_devel-1.3.14-1-x86_64.hpkg
        /boot/system/packages/graphviz-2.49.1-1-x86_64.hpkg
        /boot/system/packages/grep-3.7-1-x86_64.hpkg
        /boot/system/packages/gtk3-3.24.30-6-x86_64.hpkg
        /boot/system/packages/gtk3_devel-3.24.30-6-x86_64.hpkg
        /boot/system/packages/gutenprint8-5.3.1-2-x86_64.hpkg
        /boot/system/packages/gzip-1.11-1-x86_64.hpkg
        /boot/system/packages/haiku-r1~beta3_hrev55916_1-1-x86_64.hpkg
        /boot/system/packages/haiku_datatranslators-r1~beta3_hrev55916_1-1-x86_64.hpkg
        /boot/system/packages/haiku_devel-r1~beta3_hrev55916_1-1-x86_64.hpkg
        /boot/system/packages/haiku_svg_icon_theme-5.15.2.22-1-any.hpkg
        /boot/system/packages/harfbuzz-3.4.0-1-x86_64.hpkg
        /boot/system/packages/harfbuzz_devel-3.4.0-1-x86_64.hpkg
        /boot/system/packages/icu66-66.1-2-x86_64.hpkg
        /boot/system/packages/icu66_devel-66.1-2-x86_64.hpkg
        /boot/system/packages/intel_wifi_firmwares-2019_11_02-1-any.hpkg
        /boot/system/packages/jasper-2.0.16-4-x86_64.hpkg
        /boot/system/packages/lame-3.100-3-x86_64.hpkg
        /boot/system/packages/lcms-2.12-1-x86_64.hpkg
        /boot/system/packages/libass-0.15.2-1-x86_64.hpkg
        /boot/system/packages/libavif9-0.8.4-1-x86_64.hpkg
        /boot/system/packages/libedit-20210419_3.1-1-x86_64.hpkg
        /boot/system/packages/libepoxy-1.5.8-2-x86_64.hpkg
        /boot/system/packages/libepoxy_devel-1.5.8-2-x86_64.hpkg
        /boot/system/packages/libffi-3.4.2-1-x86_64.hpkg
        /boot/system/packages/libffi_devel-3.4.2-1-x86_64.hpkg
        /boot/system/packages/libicns-0.8.1-8-x86_64.hpkg
        /boot/system/packages/libiconv-1.16-1-x86_64.hpkg
        /boot/system/packages/libiconv_devel-1.16-1-x86_64.hpkg
        /boot/system/packages/libjpeg_turbo-2.1.2-1-x86_64.hpkg
        /boot/system/packages/libogg-1.3.5-1-x86_64.hpkg
        /boot/system/packages/libopenmpt-0.6.1-1-x86_64.hpkg
        /boot/system/packages/libpcre-8.45-1-x86_64.hpkg
        /boot/system/packages/libpcre_devel-8.45-1-x86_64.hpkg
        /boot/system/packages/libpng16-1.6.37-1-x86_64.hpkg
        /boot/system/packages/libpng16_devel-1.6.37-1-x86_64.hpkg
        /boot/system/packages/libraw19-0.19.5-1-x86_64.hpkg
        /boot/system/packages/libsolv-0.3.0_haiku_2014_12_22-3-x86_64.hpkg
        /boot/system/packages/libssh2-1.9.0-2-x86_64.hpkg
        /boot/system/packages/libtheora-1.1.1-7-x86_64.hpkg
        /boot/system/packages/libtool-2.4.6-2-x86_64.hpkg
        /boot/system/packages/libtool_libltdl-2.4.6-2-x86_64.hpkg
        /boot/system/packages/libuv-1.42.0-1-x86_64.hpkg
        /boot/system/packages/libvorbis-1.3.7-1-x86_64.hpkg
        /boot/system/packages/libvpx-1.11.0-1-x86_64.hpkg
        /boot/system/packages/libvpx6-1.10.0-1-x86_64.hpkg
        /boot/system/packages/libwebp-1.2.2-1-x86_64.hpkg
        /boot/system/packages/libxml2-2.9.13-1-x86_64.hpkg
        /boot/system/packages/libxml2_devel-2.9.13-1-x86_64.hpkg
        /boot/system/packages/llvm9_libs-9.0.1-2-x86_64.hpkg
        /boot/system/packages/m4-1.4.19-1-x86_64.hpkg
        /boot/system/packages/make-4.1-5-x86_64.hpkg
        /boot/system/packages/mesa-21.3.6-1-x86_64.hpkg
        /boot/system/packages/mesa_devel-21.3.6-1-x86_64.hpkg
        /boot/system/packages/meson-0.61.2-2-any.hpkg
        /boot/system/packages/mpc-1.2.1-1-x86_64.hpkg
        /boot/system/packages/mpfr-4.1.0-1-x86_64.hpkg
        /boot/system/packages/ncurses6-6.3-1-x86_64.hpkg
        /boot/system/packages/nghttp2-1.43.0-1-x86_64.hpkg
        /boot/system/packages/ninja-1.10.2-5-x86_64.hpkg
        /boot/system/packages/noto-20200106-1-any.hpkg
        /boot/system/packages/noto_sans_cjk_jp-1.004-2-any.hpkg
        /boot/system/packages/openexr-2.4.1-1-x86_64.hpkg
        /boot/system/packages/openjpeg-2.4.0-1-x86_64.hpkg
        /boot/system/packages/openssl-1.1.1m-1-x86_64.hpkg
        /boot/system/packages/opus-1.3.1-1-x86_64.hpkg
        /boot/system/packages/pango-1.50.3-1-x86_64.hpkg
        /boot/system/packages/pango_devel-1.50.3-1-x86_64.hpkg
        /boot/system/packages/perl-5.32.1-1-x86_64.hpkg
        /boot/system/packages/pixman-0.38.4-1-x86_64.hpkg
        /boot/system/packages/pixman_devel-0.38.4-1-x86_64.hpkg
        /boot/system/packages/pkgconfig-0.29.2-4-x86_64.hpkg
        /boot/system/packages/python3-3.7.12-1-x86_64.hpkg
        /boot/system/packages/ralink_wifi_firmwares-2015_02_11-1-any.hpkg
        /boot/system/packages/readline-8.1.002-1-x86_64.hpkg
        /boot/system/packages/realtek_wifi_firmwares-2019_01_02-1-any.hpkg
        /boot/system/packages/rhash-1.4.2-1-x86_64.hpkg
        /boot/system/packages/sed-4.8-1-x86_64.hpkg
        /boot/system/packages/setuptools_python3-57.5.0-1-any.hpkg
        /boot/system/packages/shared_mime_info-1.15-2-x86_64.hpkg
        /boot/system/packages/snappy-1.1.9-1-x86_64.hpkg
        /boot/system/packages/soxr-0.1.3-1-x86_64.hpkg
        /boot/system/packages/speex-1.2.0-4-x86_64.hpkg
        /boot/system/packages/sqlite-3.36.0.0-1-x86_64.hpkg
        /boot/system/packages/tar-1.34-1-x86_64.hpkg
        /boot/system/packages/tiff4-4.2.0-1-x86_64.hpkg
        /boot/system/packages/unzip-6.10c23-4-x86_64.hpkg
        /boot/system/packages/vala-0.54.3-1-x86_64.hpkg
        /boot/system/packages/wavpack-5.4.0-1-x86_64.hpkg
        /boot/system/packages/which-2.21-6-x86_64.hpkg
        /boot/system/packages/xcairo-1.16.0-4-x86_64.hpkg
        /boot/system/packages/xcairo_devel-1.16.0-4-x86_64.hpkg
        /boot/system/packages/xlibe-0.1.3-2-x86_64.hpkg
        /boot/system/packages/xlibe_devel-0.1.3-2-x86_64.hpkg
        /boot/system/packages/xorgproto-2021.5-1-any.hpkg
        /boot/system/packages/xz_utils-5.2.5-1-x86_64.hpkg
        /boot/system/packages/zlib-1.2.11-4-x86_64.hpkg
        /boot/system/packages/zlib_devel-1.2.11-4-x86_64.hpkg
        /boot/system/packages/zstd-1.5.2-1-x86_64.hpkg
----- Package Info ----------------
header size:                     80    ←( gtksourceview-4.8.2-1)
heap size:                     1015
TOC size:                        41
package attributes size:       1325
total size:                    1095
-----------------------------------
----- Package Info ----------------
header size:                     80    ←(gtksourceview_devel-4.8.2-1)
heap size:                      991
TOC size:                        41
package attributes size:       1264
total size:                    1071
-----------------------------------
waiting for build package gtksourceview-4.8.2-1 to be activated ←(アクティブ化待ち)
waiting for build package gtksourceview_devel-4.8.2-1 to be activated ←(アクティブ化待ち)
Building ...
The Meson build system ←(ビルドシステムはMeson でninja の前準備を実施)
Version: 0.61.2
Source dir: /sources/gtksourceview-4.8.2
Build dir: /sources/gtksourceview-4.8.2/builddir ←(ビルド先のフォルダ)
Build type: native build
Project name: gtksourceview          ↓(pkg-config でのチェック開始)
Project version: 4.8.2
C compiler for the host machine: cc (gcc 11.2.0 "cc (2021_07_28) 11.2.0")
C linker for the host machine: cc ld.bfd 2.31.1
Host machine cpu family: x86_64
Host machine cpu: x86_64
Library m found: YES
Found pkg-config: /bin/pkg-config (0.29.2)
Run-time dependency glib-2.0 found: YES 2.68.4
Run-time dependency gobject-2.0 found: YES 2.68.4
Run-time dependency gio-2.0 found: YES 2.68.4
Run-time dependency gtk+-3.0 found: YES 3.24.30
Run-time dependency libxml-2.0 found: YES 2.9.13
Run-time dependency fribidi found: YES 1.0.11
Found CMake: /bin/cmake (3.22.2)
Run-time dependency gtk+-quartz-3.0 found: NO (tried pkgconfig and cmake)  ←(注目)
Run-time dependency gobject-introspection-1.0 found: YES 1.68.0
Run-time dependency vapigen found: YES 0.54.3
Program xmllint found: YES (/bin/xmllint)
Has header "unistd.h" : YES 
Compiler for C supports arguments -Wcast-align: YES 
Compiler for C supports arguments -Wdeclaration-after-statement: YES 
Compiler for C supports arguments -Werror=address: YES 
Compiler for C supports arguments -Werror=array-bounds: YES 
Compiler for C supports arguments -Werror=empty-body: YES 
Compiler for C supports arguments -Werror=implicit: YES 
Compiler for C supports arguments -Werror=implicit-function-declaration: YES 
Compiler for C supports arguments -Werror=init-self: YES 
Compiler for C supports arguments -Werror=int-conversion: YES 
Compiler for C supports arguments -Werror=int-to-pointer-cast: YES 
Compiler for C supports arguments -Werror=main: YES 
Compiler for C supports arguments -Werror=misleading-indentation: YES 
Compiler for C supports arguments -Werror=missing-braces: YES 
Compiler for C supports arguments -Werror=missing-include-dirs: YES 
Compiler for C supports arguments -Werror=nonnull: YES 
Compiler for C supports arguments -Werror=overflow: YES 
Compiler for C supports arguments -Werror=parenthesis: NO     ←(注目)
Compiler for C supports arguments -Werror=pointer-arith: YES 
Compiler for C supports arguments -Werror=pointer-to-int-cast: YES 
Compiler for C supports arguments -Werror=return-type: YES 
Compiler for C supports arguments -Werror=sequence-point: YES 
Compiler for C supports arguments -Werror=shadow: YES 
Compiler for C supports arguments -Werror=strict-prototypes: YES 
Compiler for C supports arguments -Werror=trigraphs: YES 
Compiler for C supports arguments -Werror=undef: YES 
Compiler for C supports arguments -Werror=write-strings: YES 
Compiler for C supports arguments -Wformat-nonliteral: YES 
Compiler for C supports arguments -Werror=format-security -Werror=format=2: YES 
Compiler for C supports arguments -Wignored-qualifiers: YES 
Compiler for C supports arguments -Wimplicit-function-declaration: YES 
Compiler for C supports arguments -Wlogical-op: YES 
Compiler for C supports arguments -Wmissing-format-attribute: YES 
Compiler for C supports arguments -Wmissing-include-dirs: YES 
Compiler for C supports arguments -Wmissing-noreturn: YES 
Compiler for C supports arguments -Wnested-externs: YES 
Compiler for C supports arguments -Wno-cast-function-type: YES 
Compiler for C supports arguments -Wno-missing-field-initializers: YES 
Compiler for C supports arguments -Wno-sign-compare: YES 
Compiler for C supports arguments -Wno-unused-parameter: YES 
Compiler for C supports arguments -Wold-style-definition: YES 
Compiler for C supports arguments -Wpointer-arith: YES 
Compiler for C supports arguments -Wstrict-prototypes: YES 
Compiler for C supports arguments -Wswitch-default: YES 
Compiler for C supports arguments -Wswitch-enum: YES     ←(注目)
Compiler for C supports arguments -Wundef: YES 
Compiler for C supports arguments -Wuninitialized: YES 
Compiler for C supports arguments -Wunused: YES 
Compiler for C supports arguments -fno-strict-aliasing: YES 
Compiler for C supports arguments -fstack-protector-strong: YES 
Compiler for C supports arguments -Wmissing-declarations: YES 
Compiler for C supports arguments -fvisibility=hidden: YES 
Compiler for C supports link arguments -Wl,-z,defs: YES 
Compiler for C supports link arguments -Wl,-z,now: YES 
Compiler for C supports link arguments -Wl,-z,relro: YES 
Compiler for C supports link arguments -Wl,-Bsymbolic: YES 
Compiler for C supports link arguments -fno-plt: YES 
Configuring config.h using configuration
Found pkg-config: /bin/pkg-config (0.29.2)
Program glib-genmarshal found: YES (/bin/glib-genmarshal)
Program glib-mkenums found: YES (/bin/glib-mkenums)
Program glib-mkenums found: YES (/bin/glib-mkenums)
Configuring gtksourceversion.h using configuration
Program glib-compile-resources found: YES (/bin/glib-compile-resources)
WARNING: extract_all_objects called without setting recursive
keyword argument. Meson currently defaults to
non-recursive to maintain backward compatibility but
the default will be changed in the future.

WARNING: extract_all_objects called without setting recursive
keyword argument. Meson currently defaults to
non-recursive to maintain backward compatibility but
the default will be changed in the future.

Dependency gobject-introspection-1.0 found: YES 1.68.0 (cached)
Dependency gobject-introspection-1.0 found: YES 1.68.0 (cached)
Program g-ir-scanner found: YES (/packages/gobject_introspection-1.68.0-1/.self/bin/g-ir-scanner)
Dependency gobject-introspection-1.0 found: YES 1.68.0 (cached)
Program g-ir-compiler found: YES (/packages/gobject_introspection-1.68.0-1/.self/bin/g-ir-compiler)
Program vapigen found: YES (/bin/vapigen)
WARNING: Unknown keyword arguments in target gtksourceview-4.vapi: packages
Program glib-compile-resources found: YES (/bin/glib-compile-resources)
Program glib-compile-resources found: YES (/bin/glib-compile-resources)
Program glib-compile-resources found: YES (/bin/glib-compile-resources)
Message: 
------
GtkSourceView 4.8.2 (4)

  Documentation: false
  Glade catalog: false
  Install tests: false
  Introspection: true     ←(注目)
      Vala vapi: true     ←(注目)

Directories:
         prefix: /packages/gtksourceview-4.8.2-1/.self
     includedir: /packages/gtksourceview-4.8.2-1/.self/develop/headers
         libdir: /packages/gtksourceview-4.8.2-1/.self/lib
        datadir: /packages/gtksourceview-4.8.2-1/.self/data
------
Build targets in project: 132
NOTICE: Future-deprecated features used:
 * 0.56.0: {'meson.source_root', 'meson.build_root'}

gtksourceview 4.8.2

  User defined options
    buildtype : release
    datadir   : /packages/gtksourceview-4.8.2-1/.self/data
    includedir: /packages/gtksourceview-4.8.2-1/.self/develop/headers
    libdir    : /packages/gtksourceview-4.8.2-1/.self/lib
    mandir    : /packages/gtksourceview-4.8.2-1/.self/documentation/man
    prefix    : /packages/gtksourceview-4.8.2-1/.self
    wrap_mode : nodownload

Found ninja-1.10.2 at /bin/ninja     ↓(ninja で実際のビルドが行われます)
ninja: Entering directory `builddir'
[5/244] Generating gtksourceview/gtksource-marshal_h with a custom command
INFO: Reading ../gtksourceview/gtksourcemarshalers.list...
[6/244] Generating gtksourceview/gtksource-marshal_c with a custom command
INFO: Reading ../gtksourceview/gtksourcemarshalers.list...

[61/244] Compiling C object gtksourceview/libgtksourceview-4core.a.p/gtksourceutils.c.o
../gtksourceview/gtksourceutils.c: In function '_gtk_source_utils_pango_font_description_to_css':
../gtksourceview/gtksourceutils.c:387:17: warning: enumeration value 'PANGO_VARIANT_ALL_SMALL_CAPS' not handled in switch [-Wswitch-enum]
  387 |                 switch (variant)
      |                 ^~~~~~
../gtksourceview/gtksourceutils.c:387:17: warning: enumeration value 'PANGO_VARIANT_PETITE_CAPS' not handled in switch [-Wswitch-enum]
../gtksourceview/gtksourceutils.c:387:17: warning: enumeration value 'PANGO_VARIANT_ALL_PETITE_CAPS' not handled in switch [-Wswitch-enum]
../gtksourceview/gtksourceutils.c:387:17: warning: enumeration value 'PANGO_VARIANT_UNICASE' not handled in switch [-Wswitch-enum]
../gtksourceview/gtksourceutils.c:387:17: warning: enumeration value 'PANGO_VARIANT_TITLE_CAPS' not handled in switch [-Wswitch-enum]

[111/244] Generating gtksourceview/GtkSource-4.gir with a custom command
FAILED: gtksourceview/GtkSource-4.gir 
/packages/gobject_introspection-1.68.0-1/.self/bin/g-ir-scanner --no-libtool --namespace=GtkSource --nsversion=4 --warn-all --output gtksourceview/GtkSource-4.gir --c-include=gtksourceview/gtksource.h --warn-all -I/sources/gtksourceview-4.8.2/gtksourceview -I/sources/gtksourceview-4.8.2/builddir/gtksourceview -I/sources/gtksourceview-4.8.2/. -I/sources/gtksourceview-4.8.2/builddir/. -I/sources/gtksourceview-4.8.2/. -I/sources/gtksourceview-4.8.2/builddir/. -I/sources/gtksourceview-4.8.2/. -I/sources/gtksourceview-4.8.2/builddir/. --filelist=/sources/gtksourceview-4.8.2/builddir/gtksourceview/libgtksourceview-4.so.0.0.0.p/GtkSource_4_gir_filelist -L/sources/gtksourceview-4.8.2/builddir/gtksourceview -L/packages/fribidi-1.0.11-1/.self/develop/lib -L/packages/glib2-2.68.4-2/.self/develop/lib -L/packages/gtk3-3.24.30-6/.self/develop/lib -L/packages/libxml2-2.9.13-1/.self/develop/lib --extra-library=gtksourceview-4 --include=Gdk-3.0 --include=Gtk-3.0 --symbol-prefix=gtk_source --identifier-prefix=GtkSource --pkg-export=gtksourceview-4 --cflags-begin -DG_DISABLE_ASSERT -DG_DISABLE_CAST_CHECKS -DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGDK_VERSION_MIN_REQUIRED=GDK_VERSION_3_24 -DGDK_VERSION_MAX_ALLOWED=GDK_VERSION_3_24 -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_48 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_48 -I/sources/gtksourceview-4.8.2/. -I/sources/gtksourceview-4.8.2/builddir/. -I/packages/fribidi-1.0.11-1/.self/develop/headers/fribidi -I/packages/glib2-2.68.4-2/.self/develop/headers/glib-2.0 -I/packages/glib2-2.68.4-2/.self/develop/lib/glib-2.0/include -I/packages/libpcre-8.45-1/.self/develop/headers -I/packages/glib2-2.68.4-2/.self/develop/headers -I/packages/libffi-3.4.2-1/.self/develop/headers -I/packages/zlib-1.2.11-4/.self/develop/headers -DEGL_NO_X11 -I/packages/gtk3-3.24.30-6/.self/develop/headers/gtk-3.0 -I/packages/glib2-2.68.4-2/.self/develop/headers/gio-unix-2.0 -I/packages/xcairo-1.16.0-4/.self/develop/headers/cairo -I/packages/libepoxy-1.5.8-2/.self/develop/headers -I/packages/mesa-21.3.6-1/.self/develop/headers -I/packages/pango-1.50.3-1/.self/develop/headers/pango-1.0 -I/packages/harfbuzz-3.4.0-1/.self/develop/headers/harfbuzz -I/packages/graphite2-1.3.14-1/.self/develop/headers -I/packages/atk-2.32.0-1/.self/develop/headers/atk-1.0 -I/packages/pixman-0.38.4-1/.self/develop/headers/pixman-1 -I/packages/fontconfig-2.13.92-1/.self/develop/headers -I/packages/libxml2-2.9.13-1/.self/develop/headers/libxml2 -I/packages/freetype_bootstrap-2.11.1-1/.self/develop/headers/freetype2 -I/packages/libpng16-1.6.37-1/.self/develop/headers -I/packages/gdk_pixbuf-2.42.2-8/.self/develop/headers/gdk-pixbuf-2.0 -I/packages/xorgproto-2021.5-1/.self/develop/headers -I/packages/gobject_introspection-1.68.0-1/.self/develop/headers/gobject-introspection-1.0 --cflags-end --add-include-path=/packages/gobject_introspection-1.68.0-1/.self/data/gir-1.0 -L/sources/gtksourceview-4.8.2/builddir/gtksourceview --library gtksourceview-4 -L/packages/fribidi-1.0.11-1/.self/develop/lib -L/packages/glib2-2.68.4-2/.self/develop/lib -L/packages/gtk3-3.24.30-6/.self/develop/lib -L/packages/libxml2-2.9.13-1/.self/develop/lib --extra-library=m -L/packages/fribidi-1.0.11-1/.self/develop/lib --extra-library=fribidi -L/packages/glib2-2.68.4-2/.self/develop/lib --extra-library=glib-2.0 --extra-library=intl --extra-library=gobject-2.0 --extra-library=gio-2.0 -L/packages/gtk3-3.24.30-6/.self/develop/lib -L/packages/pango-1.50.3-1/.self/develop/lib -L/packages/harfbuzz-3.4.0-1/.self/develop/lib -L/packages/atk-2.32.0-1/.self/develop/lib -L/packages/xcairo-1.16.0-4/.self/develop/lib -L/packages/gdk_pixbuf-2.42.2-8/.self/develop/lib --extra-library=gtk-3 --extra-library=gdk-3 --extra-library=pangocairo-1.0 --extra-library=pango-1.0 --extra-library=harfbuzz --extra-library=atk-1.0 --extra-library=cairo-gobject --extra-library=cairo --extra-library=gdk_pixbuf-2.0 -L/packages/libxml2-2.9.13-1/.self/develop/lib --extra-library=xml2 -L/packages/gobject_introspection-1.68.0-1/.self/develop/lib --extra-library=girepository-1.0 --sources-top-dirs /sources/gtksourceview-4.8.2/subprojects/ --sources-top-dirs /sources/gtksourceview-4.8.2/builddir/subprojects/
Couldn't find include 'Gdk-3.0.gir' (search path: '['/packages/gobject_introspection-1.68.0-1/.self/data/gir-1.0', '/packages/gobject_introspection-1.68.0-1/.self/data', 'gir-1.0', '/usr/local/share/gir-1.0', '/usr/share/gir-1.0', '/packages/gobject_introspection-1.68.0-1/.self/data/gir-1.0', '/usr/share/gir-1.0']')

[112/244] Generating symbol file gtksourceview/libgtksourceview-4.so.0.0.0.p/libgtksourceview-4.so.0.0.0.symbols
WARNING: Symbol extracting has not been implemented for this platform. Relinking will always happen on source changes.
ninja: build stopped: subcommand failed.
Warning: Command '['bash', '-c', '. /wrapper-script']' returned non-zero exit status 1.
Error: Build has failed - stopping.

→ビルドまで進みました。まだ下記のエラーがあります:

これ以降はスキルがないときびしいみたい。

-

(1). 「FAILED: gtksourceview/GtkSource-4.gir →Couldn't find include 'Gdk-3.0.gir' 」
[111/244] Generating gtksourceview/GtkSource-4.gir with a custom command
FAILED: gtksourceview/GtkSource-4.gir 
:
Couldn't find include 'Gdk-3.0.gir' (search path: '['/packages/gobject_introspection-1.68.0-1/.self/data/gir-1.0', '/packages/gobject_introspection-1.68.0-1/.self/data', 'gir-1.0', '/usr/local/share/gir-1.0', '/usr/share/gir-1.0', '/packages/gobject_introspection-1.68.0-1/.self/data/gir-1.0', '/usr/share/gir-1.0']')

→「GtkSource-4.gir」の生成で、インクルードする「Gdk-3.0.gir」が見つかりませんでした

-

パッケージ名は違いますが、似たような事象がヒットしました:

[Buildroot] [PATCH 1/1] package/libgtk3: disable introspection

Couldn't find include 'GdkPixbuf-2.0.gir' (search path:...... '/usr/share/gir-1.0']')

→gobject-introspection がlibgtk3 の前にビルドされると、ビルドは失敗します。 なので、ホストとターゲットのバリアントのintrospection を無効にします

-

/package/libgtk3/libgtk3.mk:

 LIBGTK3_CONF_OPTS = \
    --disable-glibtest \
+   --disable-introspection \
    --enable-explicit-deps=no
+HOST_LIBGTK3_CONF_OPTS = --disable-introspection

→「libgtk3」の修正を行っています。この事象が同じなのかは不明。

-

(2). 「WARNING: Symbol extracting has not been implemented for this platform.」
[112/244] Generating symbol file gtksourceview/libgtksourceview-4.so.0.0.0.p/libgtksourceview-4.so.0.0.0.symbols
WARNING: Symbol extracting has not been implemented for this platform. Relinking will always happen on source changes.
ninja: build stopped: subcommand failed.

→警告: このプラットフォームでは、シンボル抽出は実装されていません。

-

(3). 「gtk+-quartz-3.0」が見つからない
Run-time dependency gtk+-quartz-3.0 found: NO (tried pkgconfig and cmake)

→このエラーはなかなか解決しません。

-

gtk-quartz」を検索すると、

Where is the gtk+-quartz-3.0 package located? (Trying to compile webkitgtk) がヒット

→「libsoup2.4-dev」をインストールすると解決するみたい。

-

        lib:libsoup_2.4$secondaryArchSuffix  
        devel:libsoup_2.4$secondaryArchSuffix

→インストール指定した(つもりだ)けど、エラーは変わらず。コメントとして残しました。

-

「meson.build」を確認すると、下記の行がありました:
gtk_quartz_dep = dependency('gtk+-quartz-3.0', version: gtk_doc_req, required: false)
if build_machine.system() == 'darwin' and gtk_quartz_dep.found()
  cocoa_dep = dependency('appleframeworks', modules: 'Cocoa', required: false)
  assert(cocoa_dep.found(), 'Dependency appleframeworks not found')
  config_h.set_quoted('OS_OSX', 'yes')
endif
gtk_quartz は「Mac OSX」のときに使われるようなので、「no」のままで良さそう:

-

-


--- - --- - --- - --- - --- - --- - --- - --- - --- - --- - --- - ----- ----- -

9. 参考: 「gtksourceview」の meson.build の内容:

-

> cd /boot/home/Git/haikuports/x11-libs/gtksourceview/work-4.8.2/sources/gtksourceview-4.8.2/
> ls -a
.     AUTHORS   data           gtksourceview.doap   meson_options.txt  NEWS       README.win32  testsuite
..    builddir  docs           gtksourceview.pc.in  meson.build        po         scripts
.git  COPYING   gtksourceview  HACKING              msvc               README.md  tests

-

> cat meson.build

project('gtksourceview', 'c',
          version: '4.8.2',
          license: 'LGPL-2.1-or-later',
    meson_version: '>= 0.50.0',
  default_options: [ 'c_std=gnu99',
                     'buildtype=debugoptimized',
                     'warning_level=2' ],
)

buildtype = get_option('buildtype')

i18n = import('i18n')
gnome = import('gnome')
pkg = import('pkgconfig')

# Versioning
version = meson.project_version()
version_arr = version.split('.')
version_major = version_arr[0].to_int()
version_minor = version_arr[1].to_int()
version_micro = version_arr[2].to_int()

api_version = '4'

lib_version = '0.0.0'
lib_version_arr = lib_version.split('.')
lib_version_major = lib_version_arr[0].to_int()
lib_version_minor = lib_version_arr[1].to_int()
lib_version_micro = lib_version_arr[2].to_int()

osx_current = lib_version_major + 1
lib_osx_version = [osx_current, '@0@.@1@'.format(osx_current, lib_version_minor)]


package_name = meson.project_name()
package_string = '@0@-@1@'.format(package_name, api_version)

# Paths
rootdir = include_directories('.')
srcdir = meson.source_root()
builddir = meson.build_root()

prefix = get_option('prefix')

includedir = join_paths(prefix, get_option('includedir'))
libdir = join_paths(prefix, get_option('libdir'))
libexecdir = join_paths(prefix, get_option('libexecdir'))
typelibdir = join_paths(libdir, 'girepository-1.0')
datadir = join_paths(prefix, get_option('datadir'))
localedir = join_paths(prefix, get_option('localedir'))
pkgincludedir = join_paths(includedir, package_string)
pkgconfigdir = join_paths(libdir, 'pkgconfig')
pkgdatadir = join_paths(datadir, package_string)
girdir = join_paths(datadir, 'gir-1.0')
vapidir = join_paths(datadir, 'vala', 'vapi')
mandir = join_paths(prefix, get_option('mandir'))
testexecdir = join_paths(libexecdir, 'installed-tests', package_string)
testdatadir = join_paths(datadir, 'installed-tests', package_string)
docpath = join_paths(datadir, 'gtk-doc', 'html', package_string)

# Options
install_glade_catalog = get_option('glade_catalog')
generate_gir = get_option('gir')
generate_vapi = generate_gir and get_option('vapi')
build_gtk_doc = get_option('gtk_doc')

# Dependencies
cc = meson.get_compiler('c')

glib_req_version = '2.48'
gtk_req_version = '3.24'

libm_dep = cc.find_library('m', required: false)

glib_req = '>= @0@'.format(glib_req_version)
gtk_req = '>= @0@'.format(gtk_req_version)
libxml_req = '>= 2.6'
gladeui_req = '>= 3.9'
introspection_req  = '>= 1.42.0'
gtk_doc_req = '>= 1.25'
fribidi_req = '>= 0.19.7'

glib_dep = dependency('glib-2.0', version: glib_req)
gobject_dep = dependency('gobject-2.0', version: glib_req)
gio_dep = dependency('gio-2.0', version: glib_req)
gtk_dep = dependency('gtk+-3.0', version: gtk_req)
libxml_dep = dependency('libxml-2.0', version: libxml_req, required: cc.get_id() != 'msvc')
fribidi_dep = dependency('fribidi', version: fribidi_req)

gtk_quartz_dep = dependency('gtk+-quartz-3.0', version: gtk_doc_req, required: false)   ←(注目)

if install_glade_catalog
  gladeui_dep = dependency('gladeui-2.0', version: gladeui_req)
else
  gladeui_dep = []
endif

if generate_gir
  introspection_dep = dependency('gobject-introspection-1.0', version: introspection_req)
else
  introspection_dep = []
endif

if generate_vapi
  vapigen_dep = dependency('vapigen')
else
  vapigen_dep = []
endif

if build_gtk_doc
  gtk_doc_dep = dependency('gtk-doc', version: gtk_doc_req)
else
  gtk_doc_dep = []
endif

# Look for the libxml2 library manually on Visual Studio if
# its pkg-config file could not be found, as the NMake
# Makefiles of libxml2 do not generate the pkg-config files
# for us.  Remove once Meson gains the ability to declare
# deps in a declarative way
if cc.get_id() == 'msvc' and not libxml_dep.found()
  libxml_dep = cc.find_library('libxml2', has_headers: ['libxml/xmlreader.h', 'libxml/parser.h'])
endif

xmllint_prg = find_program('xmllint', required: false)

glib_version_arr = glib_req_version.split('.')
glib_major_version = glib_version_arr[0]
glib_minor_version = glib_version_arr[1]

gtk_version_arr = gtk_req_version.split('.')
gtk_major_version = gtk_version_arr[0]
gtk_minor_version = gtk_version_arr[1]

# Configurations
add_project_arguments([
  '-DG_DISABLE_DEPRECATED',
  '-DGDK_DISABLE_DEPRECATED',
  '-DGTK_DISABLE_DEPRECATED',
  '-DGDK_PIXBUF_DISABLE_DEPRECATED',
  '-DGDK_VERSION_MIN_REQUIRED=GDK_VERSION_@0@_@1@'.format(gtk_major_version, gtk_minor_version),
  '-DGDK_VERSION_MAX_ALLOWED=GDK_VERSION_@0@_@1@'.format(gtk_major_version, gtk_minor_version),
  '-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_@0@_@1@'.format(glib_major_version, glib_minor_version),
  '-DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_@0@_@1@'.format(glib_major_version, glib_minor_version),
], language: 'c')

config_h = configuration_data()
config_h.set('GSV_API_VERSION', api_version)
config_h.set_quoted('GSV_API_VERSION_S', api_version)
config_h.set_quoted('GETTEXT_PACKAGE', package_string)
config_h.set_quoted('DATADIR', datadir)

check_headers = [
  ['unistd.h', 'HAVE_UNISTD_H'],
]

foreach header: check_headers
  if cc.has_header(header.get(0))
    config_h.set(header.get(1), 1)
  endif
endforeach

if build_machine.system() == 'darwin' and gtk_quartz_dep.found()     ←(注目)
  cocoa_dep = dependency('appleframeworks', modules: 'Cocoa', required: false)
  assert(cocoa_dep.found(), 'Dependency appleframeworks not found')
  config_h.set_quoted('OS_OSX', 'yes')
endif

# Compiler flags and warnings
global_c_args = []
if cc.get_id() == 'msvc'
  test_c_args = [
    '/FImsvc_recommended_pragmas.h',
  ]
else
  test_c_args = [
    '-Wcast-align',
    '-Wdeclaration-after-statement',
    '-Werror=address',
    '-Werror=array-bounds',
    '-Werror=empty-body',
    '-Werror=implicit',
    '-Werror=implicit-function-declaration',
    # Disabled due to volatile changes in GLib
    # '-Werror=incompatible-pointer-types',
    '-Werror=init-self',
    '-Werror=int-conversion',
    '-Werror=int-to-pointer-cast',
    '-Werror=main',
    '-Werror=misleading-indentation',
    '-Werror=missing-braces',
    '-Werror=missing-include-dirs',
    '-Werror=nonnull',
    '-Werror=overflow',
    '-Werror=parenthesis',
    '-Werror=pointer-arith',
    '-Werror=pointer-to-int-cast',
    '-Werror=return-type',
    '-Werror=sequence-point',
    '-Werror=shadow',
    '-Werror=strict-prototypes',
    '-Werror=trigraphs',
    '-Werror=undef',
    '-Werror=write-strings',
    '-Wformat-nonliteral',
    ['-Werror=format-security', '-Werror=format=2' ],
    '-Wignored-qualifiers',
    '-Wimplicit-function-declaration',
    '-Wlogical-op',
    '-Wmissing-format-attribute',
    '-Wmissing-include-dirs',
    '-Wmissing-noreturn',
    '-Wnested-externs',
    '-Wno-cast-function-type',
    '-Wno-missing-field-initializers',
    '-Wno-sign-compare',
    '-Wno-unused-parameter',
    '-Wold-style-definition',
    '-Wpointer-arith',
    '-Wstrict-prototypes',
    '-Wswitch-default',
    '-Wswitch-enum',
    '-Wundef',
    '-Wuninitialized',
    '-Wunused',
    '-fno-strict-aliasing',
  ]
  if buildtype != 'plain'
    test_c_args += '-fstack-protector-strong'
  endif
endif

foreach arg: test_c_args
  if cc.has_multi_arguments(arg)
    global_c_args += arg
  endif
endforeach

if cc.get_id() != 'msvc' and cc.has_multi_arguments('-Wmissing-declarations')
  global_c_args += '-Wmissing-declarations'
endif

# Detect and set symbol visibility
if get_option('default_library') != 'static'
  if host_machine.system() == 'windows'
    config_h.set('DLL_EXPORT', true)
    if cc.get_id() == 'msvc'
      config_h.set('_GTK_SOURCE_EXTERN', '__declspec(dllexport) extern')
    elif cc.has_argument('-fvisibility=hidden')
      config_h.set('_GTK_SOURCE_EXTERN', '__attribute__((visibility("default"))) __declspec(dllexport) extern')
    endif
  elif cc.has_argument('-fvisibility=hidden')
    config_h.set('_GTK_SOURCE_EXTERN', '__attribute__((visibility("default"))) extern')
  endif
endif

add_project_arguments(global_c_args, language: 'c')

# Various optimizations for non-debug builds including disabling of
# cast checks, asserts, and additional link options.
release_link_args = []
test_link_args = [
  '-Wl,-z,defs',   # Detect and reject underlinking
  '-Wl,-z,now',    # Disable lazy binding
  '-Wl,-z,relro',  # Read-only segments after relocation
]
if not buildtype.startswith('debug')
  add_global_arguments([
    '-DG_DISABLE_ASSERT',
    '-DG_DISABLE_CAST_CHECKS',
  ], language: 'c')
  test_link_args += ['-Wl,-Bsymbolic', '-fno-plt']
endif
foreach link_arg: test_link_args
  if cc.has_link_argument(link_arg)
    release_link_args += link_arg
  endif
endforeach

configure_file(
         output: 'config.h',
  configuration: config_h
)

subdir('gtksourceview')
subdir('data')
subdir('docs')
subdir('po')
subdir('tests')
subdir('testsuite')

summary = [
  '',
  '------',
  'GtkSourceView @0@ (@1@)'.format(version, api_version),
  '',
  '  Documentation: @0@'.format(build_gtk_doc),
  '  Glade catalog: @0@'.format(install_glade_catalog),
  '  Install tests: @0@'.format(get_option('install_tests')),
  '  Introspection: @0@'.format(generate_gir),
  '      Vala vapi: @0@'.format(generate_vapi),
  '',
  'Directories:',
  '         prefix: @0@'.format(prefix),
  '     includedir: @0@'.format(includedir),
  '         libdir: @0@'.format(libdir),
  '        datadir: @0@'.format(datadir),
  '------',
]

message('\n'.join(summary))

-

-

→今回はここまで。

ビルドできるようになるのは、まだまだ先ですね。

-

-


まとめ

前回行った「mousepad」のビルドに「gtksourceview-3.0」以降が必要なので、今回その移植にトライしました。

アプリの移植は行ったことがありましたが、ライブラリの移植は初めてです。このやり方でいいのかわからないのがつらいところ。

-

サイトを見ると「mousepad」のビルドでは「gtksourceview-4.0」でも良さそう(GtkSourceView >= 3.24.0 or >= 4.0.0)ですが、もしかしたら「gtksourceview-3.0」が必要になるかも。それだと、依存関連も違ってくるのでイチからです。

-

-


-

-

    目次

-

「投稿の先頭 へ」

-

-


-

「この目次 の先頭へ」

「本編の目次 に戻る」

-