Linux あれこれ

Linux 関連(一部 Windows11 )の備忘録です。

「Haiku」にて「Notepadqq」をバージョンアップ〈H136-3〉

登録日: 2021-10-22 更新日: 2022-01-13

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

すでに移植されているテキストエディタの「Notepadqq-1.4.8」は日本語環境では不具合のあるバージョンです。「Notepadqq-1.4.8-3」で日本語入力できるようになりましたが、まだヘルプのボタンの誤表示が残っています。翻訳ファイルのせいではないみたい。

最新バージョンである「Notepadqq-2.0.0-beta」へのバージョンアップにトライしてみました。その備忘録です。

-

-

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

-

-

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

-

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

-

-


目次

-

「前回の作業」

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

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

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

「git で差分を作成」

「.patchset の正式な形式」

-

今回の最終的な設定ファイルを表示:

1).「Notepadqq-2.0.0-beta」の レシピファイル:

2).「Notepadqq-2.0.0-beta」の パッチファイル:

「まとめ へ」

-

「目次詳細 へ」

-

-


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

-

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

-

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

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

壁紙は個人的に変更しています。

-

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

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

-

日本語環境では不具合がある「Notepadqq-1.4.8」

→ヘルプ表示のボタンが誤表示しています。日本語入力ができませんでしたが、しばらくして日本語入力できるようになりました。

-

-


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

-

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

-

2021-11-11 現在:

~> uname -v
hrev55632 Nov 10 2021 08:36:21

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

-

時々、デスクトップが表示しきれないことがあるので、

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

-

-


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

-

1. 前回までの作業:

-

Linux アプリをHaiku に移植するときに使われる環境を準備:

「Haiku」にてアプリを日本語化する準備〈H136-1〉

-

参考となるアプリの移植例:

「Haiku」にてアプリを日本語化 「Koder」編〈H136-2〉

-

今回はその続きです。

-

-


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

-

2.「haikuports」ツリーにて、アプリを確認:

-


テキストエディタ「notepadqq」:

-

在り処の表示:
> cd ~/Git/haikuporter/

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



> cd ~/Git/haikuports/app-editors/notepadqq/

> ls -1
additional-files
notepadqq-1.4.8.recipe     ←(レシピファイル: 必須)
patches              ←(パッチファイルを置いておくフォルダ)
work-1.4.8            ←(作業フォルダ)更新チェックの時に自動作成

> ls additional-files
notepadqq.rdef.in        ←(アプリのアイコンなどのリソースが定義されてます)

> ls patches
notepadqq-1.4.8.patchset    ←(パッチファイル: ソースを修正するときに使用)

→「.rdef.in 」が置かれている場所はアプリによってはソースの方にある場合もあります。 今回の場合は、パッケージ化のときに作業フォルダに自動でコピーされます。

-

-


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

-

3. 「notepadqq」のインストール関連の情報を収集:

-

公式サイト:

GitHub notepadqq/notepadqq

「Notepadqq」:

  • Windows 版のnotepad++ のLinux 版です。タブ(開いていたファイル)履歴で開けるので、ひと手間減らせます。標準で使えるテーマも多いです。Qt アプリ。

  • 最新は「2.0.0-beta」ですが、最近の更新は少ないみたい。惜しいのは途中のバージョンがないこと。

-

ビルドに必要な依存 (Build dependencies:)

Qt 5.6 or higher
qtwebengine5-dev    ←(注目)
libqt5websockets5-dev
libqt5svg5-dev
qttools5-dev-tools
libuchardet-dev
pkg-config

-

実行に必要な依存 (Dependencies:)

Qt 5.6 or higher
qtwebengine5    ←(注目)
libqt5websockets5
libqt5svg5
coreutils
libuchardet

-

ソースの入手:
> git clone --recursive https://github.com/notepadqq/notepadqq.git
> cd notepadqq

-

ビルド:
notepadqq> ./configure --prefix /usr
notepadqq> make

-

インストール:
notepadqq> sudo make install

-

tags:
v2.0.0-beta
v1.4.8

-

新しいバージョン「v2.0.0-beta」かを見分けるには、

src/ui/include/notepadqq.h

37行目:

#define POINTVERSION "2.0.0-beta" // major.minor.revision

-

-


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

-

4. Ubuntu 系にて「notepadqq」をインストールした例:

参考:

GaliumOS 3.1 にて、 「Notepadqq」をインストール:

→「GaliumOS 3.1」は、Ubuntu 18.04 ベースの軽量なXfce デスクトップ環境です。

-

1). ビルド手順の確認:

README.md

-

2). 使うツールの確認:

-

git:
$ apt list -a git

-

make:
$ apt list make

-

3). ビルドの依存関係をインストール:

-

Ubuntuの場合:
$ sudo apt install qt5-default qttools5-dev-tools qtwebengine5-dev libqt5websockets5-dev libqt5svg5 libqt5svg5-dev libuchardet-dev pkg-config

-

4). ソースを入手:

~/Git$ git clone --recursive https://github.com/notepadqq/notepadqq.git
~/Git$ cd ~/Git/notepadqq/

~/Git/notepadqq$ ls -a
.               .gitignore          Dockerfile   notepadqq.pro
..              .travis             README.md    snap
.clang-format   .travis.yml         build-tools  src
.git            CODE_OF_CONDUCT.md  configure    support_files
.gitattributes  CONTRIBUTING.md     doc
.github         COPYING             images

-

5). git の状態を確認:

~/Git/notepadqq$ git status
ブランチ master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean

→何も編集(修正)されていない最新の状態。

-

ブランチ一覧を表示:
~/Git/notepadqq$ git branch
* master

-

ローカルに登録されているタグの一覧を表示:
~/Git/notepadqq$ git tag
:
v1.3.6
v1.4.0
v1.4.2
v1.4.4
v1.4.6
:     ←「スペース」キーで続きを表示
v1.4.8
v2.0.0-beta  ←(最新は v2.0.0-beta)
(END)

「q」キーで表示を終了

-

タグの情報を確認:
$ git show v2.0.0-beta

tag v2.0.0-beta
Tagger: Daniele Di Sarli <danieleds0@gmail.com>
Date:   Sat Oct 12 10:49:41 2019 +0200     ←(2019年10月12日(土)10:49:41)

v2.0.0-beta

commit 5317c21678e71687aaab56862339354e1ea07306 (tag: v2.0.0-beta)
Author: Daniele Di Sarli <danieleds0@gmail.com>
Date:   Sat Oct 12 10:49:15 2019 +0200
: 

「q」キーで表示を終了

-

6). ビルド:

~/Git/notepadqq$ ./configure --prefix /usr

checking for QT5 qmake... /usr/bin/qtchooser -run-tool=qmake -qt=5
checking for lrelease... /usr/bin/qtchooser -run-tool=lrelease -qt=5
checking for c++... /usr/bin/c++
checking whether c++ compiler builds test program... ok
checking whether c++ compiler supports -std=c++0x... ok
checking whether compiled test program works... ok
checking for make... /usr/bin/make
checking for pkg-config... /usr/bin/pkg-config
checking for Qt5Core library... -lQt5Core
checking for Qt5Gui library... -lQt5Gui -lQt5Core
checking for Qt5Network library... -lQt5Network -lQt5Core
checking for Qt5WebEngine library... -lQt5WebEngine -lQt5WebEngineCore -lQt5Quick -lQt5Gui -lQt5WebChannel -lQt5Qml -lQt5Network -lQt5Positioning -lQt5Core
checking for Qt5Widgets library... -lQt5Widgets -lQt5Gui -lQt5Core
checking for Qt5WebEngineWidgets library... -lQt5WebEngineWidgets -lQt5WebEngineCore -lQt5WebChannel -lQt5Positioning -lQt5Quick -lQt5Qml -lQt5Network -lQt5PrintSupport -lQt5Widgets -lQt5Gui -lQt5Core
checking for Qt5PrintSupport library... -lQt5PrintSupport -lQt5Widgets -lQt5Gui -lQt5Core
checking for Qt5Svg library... -lQt5Svg -lQt5Widgets -lQt5Gui -lQt5Core
checking for Qt5WebSockets library... -lQt5WebSockets -lQt5Network -lQt5Core
checking for Qt5WebChannel library... -lQt5WebChannel -lQt5Qml -lQt5Network -lQt5Core
checking for uchardet library... -luchardet
generate Makefile... Info: creating stash file /home/ubn/Git/notepadqq/.qmake.stash
done

→最後のメッセージを確認。違うようなら問題あり。

-

確認:
~/Git$ ls -a
.               .github       CODE_OF_CONDUCT.md  README.md    notepadqq.pro
..              .gitignore    CONTRIBUTING.md     build-tools  snap
.clang-format   .qmake.stash  COPYING             configure    src
.git            .travis       Dockerfile          doc          support_files
.gitattributes  .travis.yml   Makefile            images

→「Makefile」と「.qmake.stash」が増えました。

-

7). make:

~/Git/notepadqq$ make
:
make[1]: ディレクトリ '/home/ubn/Git/notepadqq/src/ui-tests' から出ます

→最後のメッセージを確認。違うようなら問題あり。

-

8). インストール:

~/Git/notepadqq$ sudo make install
:
Updating '/home/ubn/Git/notepadqq/src/ui/../translations/notepadqq_ja.qm'...
     447 件のメッセージを翻訳しました(完了 447 件、未完了 0 件)
     5 件の未翻訳のソーステキストを無視しました
:
/usr/lib/qt5/bin/qmake -install qinstall /home/ubn/Git/notepadqq/support_files/icons/hicolor/48x48/apps/notepadqq.png /usr/share/icons/hicolor/48x48/apps/notepadqq.png
:
make[1]: ディレクトリ '/home/ubn/Git/notepadqq/src/ui-tests' から出ます

→最後のメッセージを確認。違うようなら問題あり。

-

確認:
$ whereis notepadqq
notepadqq: /usr/bin/notepadqq /usr/lib/notepadqq /usr/share/notepadqq

$ which notepadqq
/usr/bin/notepadqq

→アプリはインストールされています。

-

$ apt list notepadqq
$ 

→ビルドしてインストールだと、APT では認識されません。 つまり、アンインストールは手動です。

-

$ notepadqq --version
Notepadqq 2.0.0-beta+git

→「Wayland」が使われていないのでエラー が表示されていません。今のところは正常に使えそう。

-

9). 起動:

$ notepadqq

もしくは、

メニュー→開発→「Notepadqq」

-

-


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

-

5. Haiku に移植されている「Notepadqq-1.4.8」の情報:

-

1). 「.rdef.in」ファイル:

> cat ~/Git/haikuports/app-editors/notepadqq/additional-files/notepadqq.rdef.in
resource app_flags B_MULTIPLE_LAUNCH;

resource app_version {
    major  = @MAJOR@,
    middle = @MIDDLE@,
    minor  = @MINOR@,
    variety = B_APPV_FINAL,
    internal = 0,
    short_info = "Programmer editor",
    long_info = "Notepad++-like editor"
};

resource app_signature "application/x-vnd.notepadqq";

resource("QT:QPA_FLAGS") "Q_REF_TO_ARGV|Q_REF_TO_FORK";

resource file_types message {
    "types" = "text/plain",
    "types" = "text/x-source-code",
    "types" = "text",
    "types" = "text/x-makefile",
    "types" = "text/x-rez",
    "types" = "text/x-jamfile",
    "types" = "application/xhtml+xml"
};

resource vector_icon {
    $"6E6369660803010000020006023CC7EE389BC0BA16573E39B04977C842ADC700"
    $"EAB1B1FFDA7676020006023AF85036C922BA16573E39B048FE7441945C00DC65"
    $"65FFAC3C3C020016023CC7EE389BC0BA16573E39B04977C842ADC700FFFFF202"
    $"0016023C96323A4D3FBAFC013D5A974B57A549844D0057FFB502001602BC592F"
    $"BB29A73C0CE4BD0B7C4892C04B796600BEFFFF02001602BC592FBB29A73C0CE4"
    $"BD0B7C4892C04B79660057FFF4040180070607A62B223C49445B5A3E5838583B"
    $"58355A3139250A04223C293F412839250A04293F444B5A3141280606AE0B444B"
    $"4252424E4256445B5A3E5838583B58355A310605E602223C49445B4252425642"
    $"4E444B0A05445D495D603E5A3B5B3F08022540434E0A0A070105000A00010010"
    $"01178400040A010102000A020101000A040103000A050104000A030010011782"
    $"00040A0601061240212037DF1AB7E7B0401C723FA1FE443BFC01178200040A06"
    $"0106123F972B36F2F4B6E6F33F49DF4491BC46B70E01178200040A0601061001"
    $"17820004"
};

-

2). レシピファイル:

> cat ~/Git/haikuports/app-editors/notepadqq/notepadqq-1.4.8.recipe

-

3). パッチファイル:

> cat ~/Git/haikuports/app-editors/notepadqq/patches/notepadqq-1.4.8.patchset
From ad36c58d4ded001703a53e5cb32b1ffda333d9a8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= <zmizsei@extrowerk.com>
Date: Fri, 23 Aug 2019 13:46:42 +0200
Subject: Disable root check for haiku


diff --git a/src/ui/main.cpp b/src/ui/main.cpp
index da417af..9a358e6 100644
--- a/src/ui/main.cpp
+++ b/src/ui/main.cpp
@@ -87,6 +87,7 @@ int main(int argc, char *argv[])
     // Check for "run-and-exit" options like -h or -v
     const auto parser = Notepadqq::getCommandLineArgumentsParser(QApplication::arguments());
 
+#ifndef Q_OS_HAIKU
     // Check if we're running as root
     if( getuid() == 0 && !parser->isSet("allow-root") ) {
         qWarning() << QObject::tr(
@@ -95,6 +96,7 @@ int main(int argc, char *argv[])
 
         return EXIT_SUCCESS;
     }
+#endif
 
     if (a.attachToOtherInstance()) {
         return EXIT_SUCCESS;
-- 
2.23.0


From ea2dd9ad34997684e5a76abd4aacfce014762ba7 Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Sat, 24 Aug 2019 11:18:35 +1000
Subject: Fix resources path


diff --git a/src/ui/notepadqq.cpp b/src/ui/notepadqq.cpp
index ae84c27..c017024 100644
--- a/src/ui/notepadqq.cpp
+++ b/src/ui/notepadqq.cpp
@@ -22,6 +22,9 @@ QString Notepadqq::appDataPath(QString fileName)
 #ifdef Q_OS_MACX
     QString def = QString("%1/../Resources/").
             arg(qApp->applicationDirPath());
+#elif defined(Q_OS_HAIKU)
+    QString def = QString("%1/Resources/").
+            arg(qApp->applicationDirPath());
 #else
     QString def = QString("%1/../appdata/").
             arg(qApp->applicationDirPath());
-- 
2.23.0

-

-


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

-

6. レシピファイルの修正:

-


1). 最新バージョンの「v2.0.0-beta」をダウンロードする指定:

https://github.com/notepadqq/notepadqq/archive/refs/tags/v2.0.0-beta.zip

> sha256sum notepadqq-2.0.0-beta.tar.gz
7dba81115438f3f44dc29ef0a81d880f6ca98b888b057247308731a39dce234a  notepadqq-2.0.0-beta.tar.gz

-


2). レシピファイルの名前の変更:

> cd ~/Git/haikuports/app-editors/notepadqq/

> cp notepadqq-1.4.8.recipe notepadqq-1.4.8.recipe-ORG
> mv notepadqq-1.4.8.recipe notepadqq-2.0.0.recipe

> ls -1
additional-files
notepadqq-1.4.8.recipe-ORG
notepadqq-2.0.0.recipe
patches
work-1.4.8

→「notepadqq-2.0.0-beta.recipe」のファイル名にすると、パッケージ化がうまく動きません。

-


3). レシピファイルの修正:

> lpe ~/Git/haikuports/app-editors/notepadqq/notepadqq-2.0.0.recipe
SOURCE_URI="https://github.com/notepadqq/notepadqq/archive/v$portVersion.tar.gz"
CHECKSUM_SHA256="13fba9abd84c59de27fbe92f74e2763b57588fcf9c88af10ec67313b0abbc9d0"
PATCHES="notepadqq-$portVersion.patchset"
ADDITIONAL_FILES="notepadqq.rdef.in"

↓ 下記に置換:

SOURCE_URI="https://github.com/notepadqq/notepadqq/archive/refs/tags/v$portVersion-beta.tar.gz"
CHECKSUM_SHA256="7dba81115438f3f44dc29ef0a81d880f6ca98b888b057247308731a39dce234a"
SOURCE_DIR="notepadqq-$portVersion-beta"
PATCHES="notepadqq-$portVersion.patchset"
ADDITIONAL_FILES="notepadqq.rdef.in"
  • レシピファイル名を「notepadqq-2.0.0-beta.recipe」のように「-beta」を付けると、うまく認識できませんでした。「.tar.gz」の名前は変えられないので工夫が必要でした。

→重要: ダウンロードされたソースは、Haikuporter のデフォルト設定では、<Port Name>-<Port Version> という名前のディレクトリに解凍されます。それ以外のディレクトリにする場合は、「SOURCE_DIR=」行にてそのディレクトリ名を指定します。

-


4). パッチファイルの名前の変更:

> cd ~/Git/haikuports/app-editors/notepadqq/patches/
> cp notepadqq-1.4.8.patchset notepadqq-2.0.0.patchset

> ls
notepadqq-1.4.8.patchset
notepadqq-2.0.0.patchset

→こちらもレシピ名に合わせました。

-


5). 「work-2.0.0」フォルダと「download」フォルダを削除

> ls -1 ~/Git/haikuports/app-editors/notepadqq/
additional-files
notepadqq-1.4.8.recipe-ORG
notepadqq-2.0.0.recipe
patches

-


6). アプリのパッケージ化を実行:

> cd ~/Git/haikuporter/
> hp notepadqq
:
2021-10-19 21:51:45 (1.50 MB/s) - `/boot/home/Git/haikuports/app-editors/notepadqq/download/v2.0.0-beta.tar.gz' へ保存終了 [4516680]
Validating checksum of v2.0.0-beta.tar.gz
Unpacking source of v2.0.0-beta.tar.gz

Initialized empty Git repository in /boot/home/Git/haikuports/app-editors/notepadqq/work-2.0.0/sources/notepadqq-2.0.0-beta/.git/
Applying patchset "/boot/home/Git/haikuports/app-editors/notepadqq/patches/notepadqq-2.0.0.patchset" ...
:
error: sha1 information is lacking or useless (src/ui/main.cpp).
error: could not build fake ancestor
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Command '['git', 'am', '--ignore-whitespace', '-3', '--keep-cr', '/boot/home/Git/haikuports/app-editors/notepadqq/patches/notepadqq-2.0.0.patchset']' returned non-zero exit status 128.

→パッチファイルのエラーです。パッチの見直しが必要です。

-


7). 行番号がズレているので 2つのファイルともに修正しました:

> cd ~/Git/haikuports/app-editors/notepadqq/patches/
> lpe notepadqq-2.0.0.patchset
From ad36c58d4ded001703a53e5cb32b1ffda333d9a8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= <zmizsei@extrowerk.com>
Date: Fri, 23 Aug 2019 13:46:42 +0200
Subject: Disable root check for haiku


diff --git a/src/ui/main.cpp b/src/ui/main.cpp
--- a/src/ui/main.cpp   2019-10-12 17:49:15.000000000 +0900
+++ b/src/ui/main.cpp   2021-10-19 22:41:31.068943784 +0900
@@ -92,6 +92,7 @@
         return EXIT_SUCCESS;
     }
 
+#ifndef Q_OS_HAIKU
     // Check if we're running as root
     if( getuid() == 0 && !parser->isSet("allow-root") ) {
         qWarning() << QObject::tr(
@@ -100,6 +101,7 @@
 
         return EXIT_SUCCESS;
     }
+#endif
 
     if (a.attachToOtherInstance()) {
         return EXIT_SUCCESS;
-- 
2.23.0


From ea2dd9ad34997684e5a76abd4aacfce014762ba7 Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Sat, 24 Aug 2019 11:18:35 +1000
Subject: Fix resources path


diff --git a/src/ui/notepadqq.cpp b/src/ui/notepadqq.cpp
--- a/src/ui/notepadqq.cpp  2019-10-12 17:49:15.000000000 +0900
+++ b/src/ui/notepadqq.cpp  2021-10-19 22:46:52.152172438 +0900
@@ -23,6 +23,9 @@
 #ifdef Q_OS_MACX
     QString def = QString("%1/../Resources/").
             arg(qApp->applicationDirPath());
+#elif defined(Q_OS_HAIKU)
+    QString def = QString("%1/Resources/").
+            arg(qApp->applicationDirPath());
 #else
     QString def = QString("%1/../appdata/").
             arg(qApp->applicationDirPath());
-- 
2.23.0

→以前のヘッダー部を残しておくのがミソです。コミット番号とgit バージョン以外(つまり、開発者名)は引き継がれます。

-


8). レシピファイル「notepadqq-2.0.0.recipe」を「patches」にコピーして退避

-


9). レシピファイル「notepadqq-2.0.0.recipe」の「BUILD()」以降をごっそり削除

→パッケージ作成途中で、「パッチを適用」してから停止させ、その修正された差分を表示できるようにしました。 最後まで行くと、差分表示しづらくなります。

-


10). 「download」フォルダと「work-2.0.0」フォルダを削除

-


11). パッケージ化を実行

> cd ~/Git/haikuporter/
> hp notepadqq

-


12). Haiku のパッチファイルの形式でファイル出力:

  • コミットされていないと作成されません。

  • コミット数の指定が必要です。

-

> cd ~/Git/haikuports/app-editors/notepadqq/work-2.0.0/sources/notepadqq-2.0.0-beta/

> git format-patch -2
0001-Add-translation-file-Japanese-etc.patch
0002-Translation-correction-Japanese.patch

→コミットごとにパッチファイルが作成されます。

-

コミット番号は違いますが、コミットが以前のAuthor 名で残っています:

> cd ~/Git/haikuports/app-editors/notepadqq/work-2.0.0/sources/notepadqq-2.0.0-beta/
> git log
commit 0aabf29d20ce274506ffaed3f6039fc46b8a61f1 (HEAD -> haikuport)
Author: Gerasim Troeglazov <3dEyes@gmail.com>
Date:   Sat Aug 24 11:18:35 2019 +1000

    Fix resources path

commit f4234e9ab4d6728817a092edbde8f4b8984e902a
Author: Zoltán Mizsei <zmizsei@extrowerk.com>
Date:   Fri Aug 23 13:46:42 2019 +0200

    Disable root check for haiku

commit 49e953feebe7ef1c6bc22dd575321ae77e922d7d (tag: ORIGIN)
Author: FuRuYa7 <mymail@mydomain.org>
Date:   Tue Oct 19 23:31:15 2021 +0900

    import

-

コミット番号を合わせるため、パッチファイルを作成し直し:

> cd ~/Git/haikuports/app-editors/notepadqq/work-2.0.0/sources/notepadqq-2.0.0-beta/
> git format-patch -2
0001-Disable-root-check-for-haiku.patch
0002-Fix-resources-path.patch

→コミット番号は一種のチェックサムsha1)とも言えるので、改ざん防止にもなります。

-

2つを合わせて、パッチファイルを修正:

From f4234e9ab4d6728817a092edbde8f4b8984e902a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= <zmizsei@extrowerk.com>
Date: Fri, 23 Aug 2019 13:46:42 +0200
Subject: [PATCH 1/2] Disable root check for haiku

---
 src/ui/main.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/ui/main.cpp b/src/ui/main.cpp
index be427b2..a05fe74 100644
--- a/src/ui/main.cpp
+++ b/src/ui/main.cpp
@@ -92,6 +92,7 @@ int main(int argc, char *argv[])
         return EXIT_SUCCESS;
     }
 
+#ifndef Q_OS_HAIKU
     // Check if we're running as root
     if( getuid() == 0 && !parser->isSet("allow-root") ) {
         qWarning() << QObject::tr(
@@ -100,6 +101,7 @@ int main(int argc, char *argv[])
 
         return EXIT_SUCCESS;
     }
+#endif
 
     if (a.attachToOtherInstance()) {
         return EXIT_SUCCESS;
-- 
2.30.2


From 0aabf29d20ce274506ffaed3f6039fc46b8a61f1 Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Sat, 24 Aug 2019 11:18:35 +1000
Subject: [PATCH 2/2] Fix resources path

---
 src/ui/notepadqq.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/ui/notepadqq.cpp b/src/ui/notepadqq.cpp
index b93c0e4..9fd994c 100644
--- a/src/ui/notepadqq.cpp
+++ b/src/ui/notepadqq.cpp
@@ -23,6 +23,9 @@ QString Notepadqq::appDataPath(QString fileName)
 #ifdef Q_OS_MACX
     QString def = QString("%1/../Resources/").
             arg(qApp->applicationDirPath());
+#elif defined(Q_OS_HAIKU)
+    QString def = QString("%1/Resources/").
+            arg(qApp->applicationDirPath());
 #else
     QString def = QString("%1/../appdata/").
             arg(qApp->applicationDirPath());
-- 
2.30.2

→番号順そのままで、合わせるときに、2行開けるとちょうど良いです。

  • フッター(お尻)にある番号は、使っているgit のバージョン番号です。

-

git のバージョン:
> git --version
git version 2.30.2

-

Subject: にある [PATCH 1/2]、 [PATCH 2/2] の部分を除いた表題が、パッケージ化のパッチ適用のときに、メッセージとして表示されます:

Applying patchset "/boot/home/Git/haikuports/app-editors/notepadqq/patches/notepadqq-2.0.0.patchset" ...
Applying: Disable root check for haiku
Applying: Fix resources path

-

-


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

-

7. 依存パッケージの関連を確認:

-


1). レシピファイルの内容:

SUMMARY="Multiplatform Notepad++-like editor"
DESCRIPTION="Notepadqq is designed from developers, for developers. With its \
more than 100 supported languages, it is the ideal text editor for your daily \
tasks."
HOMEPAGE="http://notepadqq.altervista.org/"
COPYRIGHT="2012-2019 Notepadqq Project"
LICENSE="GNU LGPL v3"
REVISION="3"
SOURCE_URI="https://github.com/notepadqq/notepadqq/archive/refs/tags/v$portVersion-beta.tar.gz"
CHECKSUM_SHA256="7dba81115438f3f44dc29ef0a81d880f6ca98b888b057247308731a39dce234a"
SOURCE_DIR="notepadqq-$portVersion-beta"
PATCHES="notepadqq-$portVersion.patchset"
ADDITIONAL_FILES="notepadqq.rdef.in"

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

PROVIDES="
    notepadqq$secondaryArchSuffix = $portVersion
    app:Notepadqq$secondaryArchSuffix = $portVersion
    "
REQUIRES="
    haiku$secondaryArchSuffix
    lib:libGL$secondaryArchSuffix
    lib:libQt5Core$secondaryArchSuffix
    lib:libQt5Gui$secondaryArchSuffix
    lib:libQt5Network$secondaryArchSuffix
    lib:libQt5PrintSupport$secondaryArchSuffix
    lib:libQt5Svg$secondaryArchSuffix
    lib:libQt5WebKit$secondaryArchSuffix
    lib:libQt5WebKitWidgets$secondaryArchSuffix
    lib:libQt5Widgets$secondaryArchSuffix
    "

BUILD_REQUIRES="
    haiku${secondaryArchSuffix}_devel
    devel:libGL$secondaryArchSuffix
    devel:libQt5Core$secondaryArchSuffix
    devel:libQt5Gui$secondaryArchSuffix
    devel:libQt5Network$secondaryArchSuffix
    devel:libQt5PrintSupport$secondaryArchSuffix
    devel:libQt5Svg$secondaryArchSuffix
    devel:libQt5WebKit$secondaryArchSuffix
    devel:libQt5WebKitWidgets$secondaryArchSuffix
    devel:libQt5Widgets$secondaryArchSuffix
    "
BUILD_PREREQUIRES="
    cmd:find
    cmd:g++$secondaryArchSuffix
    cmd:gcc$secondaryArchSuffix
    cmd:ld$secondaryArchSuffix
    cmd:lrelease$secondaryArchSuffix >= 5
    cmd:make
    cmd:pkg_config$secondaryArchSuffix
    cmd:qmake$secondaryArchSuffix >= 5
    cmd:which
    "

BUILD()
{
    ./configure --prefix "$appsDir/Notepadqq"

    make $jobArgs
}

INSTALL()
{
    mkdir -p $appsDir/Notepadqq/Resources
    make install

    mv $appsDir/Notepadqq/lib/notepadqq/notepadqq-bin \
        $appsDir/Notepadqq/Notepadqq
    mv $appsDir/Notepadqq/share/notepadqq/* \
        $appsDir/Notepadqq/Resources

    # Cleanup
    rm -rf $appsDir/Notepadqq/{bin,share,lib}

    # Icon
    local MAJOR="`echo "$portVersion" | cut -d. -f1`"
    local MIDDLE="`echo "$portVersion" | cut -d. -f2`"
    local MINOR="`echo "$portVersion" | cut -d. -f3`"

    sed \
        -e "s|@MAJOR@|$MAJOR|" \
        -e "s|@MIDDLE@|$MIDDLE|" \
        -e "s|@MINOR@|$MINOR|" \
        $portDir/additional-files/notepadqq.rdef.in > notepadqq.rdef

    addResourcesToBinaries notepadqq.rdef \
        $appsDir/Notepadqq/Notepadqq

    addAppDeskbarSymlink $appsDir/Notepadqq/Notepadqq
}

-


2). notepadqq のパッケージ化のときのメッセージとエラー

~/Git/haikuporter> hp notepadqq

Checking if any dependency-infos need to be updated ...
Looking for stale dependency-infos ...
----------------------------------------------------------------------
app-editors::notepadqq-2.0.0
        /boot/home/Git/haikuports/app-editors/notepadqq/notepadqq-2.0.0.recipe
----------------------------------------------------------------------

Downloading: https://github.com/notepadqq/notepadqq/archive/refs/tags/v2.0.0-beta.tar.gz ...
--2021-10-20 08:34:36--  https://github.com/notepadqq/notepadqq/archive/refs/tags/v2.0.0-beta.tar.gz
github.com をDNSに問いあわせています... 52.69.186.44
github.com|52.69.186.44|:443 に接続しています... 接続しました。
HTTP による接続要求を送信しました、応答を待っています... 302 Found
場所: https://codeload.github.com/notepadqq/notepadqq/tar.gz/refs/tags/v2.0.0-beta [続く]
--2021-10-20 08:34:37--  https://codeload.github.com/notepadqq/notepadqq/tar.gz/refs/tags/v2.0.0-beta
codeload.github.com をDNSに問いあわせています... 13.112.159.149
codeload.github.com|13.112.159.149|:443 に接続しています... 接続しました。
HTTP による接続要求を送信しました、応答を待っています... 200 OK
長さ: 特定できません [application/x-gzip]
`/boot/home/Git/haikuports/app-editors/notepadqq/download/v2.0.0-beta.tar.gz' に保存中
     0K ........ ........ ........ ........ ........ ........ 1.71M
  3072K ........ ........ ....                                1.81M=2.5s
2021-10-20 08:34:39 (1.74 MB/s) - `/boot/home/Git/haikuports/app-editors/notepadqq/download/v2.0.0-beta.tar.gz' へ保存終了 [4516680]  ←(☆ダウンロード)
Validating checksum of v2.0.0-beta.tar.gz  ←(☆ダウンロードのチェックサム確認)
Unpacking source of v2.0.0-beta.tar.gz  ←(☆ダウンロードの展開)
Initialized empty Git repository in /boot/home/Git/haikuports/app-editors/notepadqq/work-2.0.0/sources/notepadqq-2.0.0-beta/.git/  ←(☆git 環境の構築: フォルダ名に注目)
Applying patchset "/boot/home/Git/haikuports/app-editors/notepadqq/patches/notepadqq-2.0.0.patchset" ...
Applying: Disable root check for haiku  ←(☆パッチの適用: コミット1)
Applying: Fix resources path      ←(☆パッチの適用: コミット2)

chroot has these packages active:  ←(☆ビルド処理中に使えるインストール済みのパッケージ)
        /boot/system/packages/aspell-0.60.8-1-x86_64.hpkg
        /boot/system/packages/assimp-5.0.1-2-x86_64.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/zstd-1.5.0-2-x86_64.hpkg
----- Package Info ----------------
header size:                     80
heap size:                      858
TOC size:                        41
package attributes size:       1066
total size:                     938
-----------------------------------
waiting for build package notepadqq-2.0.0-3 to be activated
Building ...              ←(☆ビルドに必要なパッケージの確認)
checking for QT5 qmake... /bin/qmake
checking for lrelease... /bin/lrelease
checking for c++... /bin/c++
checking whether c++ compiler builds test program... ok
checking whether c++ compiler supports -std=c++0x... ok
checking whether compiled test program works... ok
checking for make... /bin/make
checking for pkg-config... /bin/pkg-config
checking for Qt5Core library... -L/packages/qt5-5.15.2-6/.self/develop/lib -lQt5Core
checking for Qt5Gui library... -L/packages/qt5-5.15.2-6/.self/develop/lib -lQt5Gui -lQt5Core
checking for Qt5Network library... -L/packages/qt5-5.15.2-6/.self/develop/lib -lQt5Network -lQt5Core

checking for Qt5WebEngine library... not found!   ←(★依存なし1)
checking for Qt5Widgets library... -L/packages/qt5-5.15.2-6/.self/develop/lib -lQt5Widgets -lQt5Gui -lQt5Core

checking for Qt5WebEngineWidgets library... not found!  ←(★依存なし2)
checking for Qt5PrintSupport library... -L/packages/qt5-5.15.2-6/.self/develop/lib -lQt5PrintSupport -lQt5Widgets -lQt5Gui -lQt5Core
checking for Qt5Svg library... -L/packages/qt5-5.15.2-6/.self/develop/lib -lQt5Svg -lQt5Widgets -lQt5Gui -lQt5Core
checking for Qt5WebSockets library... -L/packages/qt5-5.15.2-6/.self/develop/lib -lQt5WebSockets -lQt5Network -lQt5Core
checking for Qt5WebChannel library... -L/packages/qt5-5.15.2-6/.self/develop/lib -lQt5WebChannel -lQt5Qml -lQt5Network -lQt5Core

checking for uchardet library... not found!  ←(★依存なし3)
generate Makefile... Info: creating stash file /sources/notepadqq-2.0.0-beta/.qmake.stash
done
cd src/ui-tests/ && ( test -e Makefile || /bin/qmake -o Makefile /sources/notepadqq-2.0.0-beta/src/ui-tests/ui-tests.pro PREFIX=/packages/notepadqq-2.0.0-3/.self/apps/Notepadqq QMAKE_CXX=c++ 'QMAKE_CXXFLAGS= ' QMAKE_LFLAGS= LRELEASE=/bin/lrelease CONFIG+= ) && make -f Makefile 
cd src/ui/ && ( test -e Makefile || /bin/qmake -o Makefile /sources/notepadqq-2.0.0-beta/src/ui/ui.pro PREFIX=/packages/notepadqq-2.0.0-3/.self/apps/Notepadqq QMAKE_CXX=c++ 'QMAKE_CXXFLAGS= ' QMAKE_LFLAGS= LRELEASE=/bin/lrelease CONFIG+= ) && make -f Makefile 
Project MESSAGE: Release build

Project ERROR: Unknown module(s) in QT: webenginewidgets  ←(★エラー2)
Makefile:72: recipe for target 'sub-src-ui-tests-make_first' failed
make: *** [sub-src-ui-tests-make_first] Error 3
make: *** Waiting for unfinished jobs....

WARNING: Project ERROR: Unknown module(s) in QT: webenginewidgets  ←(★エラー2)

Updating '/sources/notepadqq-2.0.0-beta/src/ui/../translations/notepadqq_de.qm'...
    Generated 453 translation(s) (453 finished and 0 unfinished)  ←(☆翻訳ファイルの変換)
:
    Generated 359 translation(s) (359 finished and 0 unfinished)
Updating '/sources/notepadqq-2.0.0-beta/src/ui/../translations/notepadqq_uk.qm'...
    Generated 453 translation(s) (453 finished and 0 unfinished)
Updating '/sources/notepadqq-2.0.0-beta/src/ui/../translations/notepadqq_zh.qm'...
    Generated 448 translation(s) (448 finished and 0 unfinished)

Project ERROR: uchardet development package not found  ←(★エラー3)一番目に付くエラー
Makefile:47: recipe for target 'sub-src-ui-make_first' failed
make: *** [sub-src-ui-make_first] Error 3
Warning: Command '['bash', '-c', '. /wrapper-script']' returned non-zero exit status 2.
Error: Build has failed - stopping.

→最終的なエラーしか目に付きませんが、 それよりも前の段階の「ビルドに必要なパッケージの確認」( ./configure --prefix /usr ) でエラーしています。

-


3). 3つの依存パッケージが不足:

1. checking for Qt5WebEngine library... not found! 
2. checking for Qt5WebEngineWidgets library... not found!
3. checking for uchardet library... not found!

→上2つは「Qt5WebEngine」のインストールで解決しそうですが、移植されてません。

-


4). 3番めの「uchardet」はインストールできました:

~> pkgman install uchardet_devel

~> pkgman search uchardet
Status  Name             Description                                                         
---------------------------------------------------------------------------------------------
S       uchardet         An encoding detector library ported from Mozilla                    
S       uchardet_devel   An encoding detector library ported from Mozilla (development files)
        uchardet_source  An encoding detector library ported from Mozilla (source files)     

→「uchardet」と「uchardet_devel」の2つがインストールされました。

-


5). 3番めは、レシピファイルに追加が必要でした:

> lpe ~/Git/haikuports/app-editors/notepadqq/notepadqq-2.0.0.recipe
REQUIRES="
    haiku$secondaryArchSuffix
    lib:libGL$secondaryArchSuffix
    lib:libQt5Core$secondaryArchSuffix
    lib:libQt5Gui$secondaryArchSuffix
    lib:libQt5Network$secondaryArchSuffix
    lib:libQt5PrintSupport$secondaryArchSuffix
    lib:libQt5Svg$secondaryArchSuffix
    lib:libQt5WebKit$secondaryArchSuffix
    lib:libQt5WebKitWidgets$secondaryArchSuffix
    lib:libQt5Widgets$secondaryArchSuffix
    lib:libuchardet$secondaryArchSuffix   ←(追加)
    "

BUILD_REQUIRES="
    haiku${secondaryArchSuffix}_devel
    devel:libGL$secondaryArchSuffix
    devel:libQt5Core$secondaryArchSuffix
    devel:libQt5Gui$secondaryArchSuffix
    devel:libQt5Network$secondaryArchSuffix
    devel:libQt5PrintSupport$secondaryArchSuffix
    devel:libQt5Svg$secondaryArchSuffix
    devel:libQt5WebKit$secondaryArchSuffix
    devel:libQt5WebKitWidgets$secondaryArchSuffix
    devel:libQt5Widgets$secondaryArchSuffix
    devel:libuchardet$secondaryArchSuffix  ←(追加)
    "

-


6). パッケージ化を実行したときに表示されるメッセージ:

:
checking for uchardet library... -L/packages/uchardet-0.0.7-1/.self/develop/lib -luchardet
→依存パッケージが認識されました

-


7). レシピファイルに登録した依存パッケージが、自動でインストールされるのかを確認:

→1回目で依存パッケージがインストールされますがエラーで停止します。そのまま再度バッケージ化を実行すればうまく行きます。1度で実行できないのは惜しいところ。 ただし、パッケージが存在しない(移植されていない)とエラーで停止します。

-

(1). アンインストール:
~> pkgman uninstall uchardet_devel uchardet

~> pkgman search uchardet
Status  Name             Description                                            
--------------------------------------------------------------------------------
        uchardet         An encoding detector library ported from Mozilla       
        uchardet_devel   An encoding detector library ported from Mozilla (devel
        uchardet_source  An encoding detector library ported from Mozilla (sourc

-

(2). 「download」フォルダと「work-2.0.0」フォルダを削除

-

(3). パッケージ化を実行
> cd ~/Git/haikuporter/
> hp notepadqq
:
Applying: Disable root check for haiku
Applying: Fix resources path
Fetching package for devel:libuchardet ...
'NoneType' object has no attribute 'packageInfo'

→パッチファイルの適用後に、「libuchardet」を読み込もうとしてエラーして、パッケージ化が停止しました。

たぶん、「libuchardet」がインストールされていないからだろうと思われます:

> ls /boot/home/Git/haikuports/repository/libuchardet*
ls: cannot access '/boot/home/Git/haikuports/repository/libuchardet*': No such file or directory

-

(4). エラーで停止したけど、「libuchardet」がインストールされたかの確認:
> pkgman search uchardet
Status  Name             Description                                                         
---------------------------------------------------------------------------------------------
S       uchardet         An encoding detector library ported from Mozilla                    
S       uchardet_devel   An encoding detector library ported from Mozilla (development files)
        uchardet_source  An encoding detector library ported from Mozilla (source files)     

→インストールされました。

-

(5). そのままパッケージ化を実行

作業フォルダを削除していないのがポイント:

> cd ~/Git/haikuporter/
> hp notepadqq
:
checking for uchardet library... -L/packages/uchardet-0.0.7-1/.self/develop/lib -luchardet
:

→目的の「uchardet」は認識されました。当然ながら、パッケージ化は完了しません。

-

ライブラリの確認:
> ls -1 /boot/system/develop/lib/libuchardet*
/boot/system/develop/lib/libuchardet.so
/boot/system/develop/lib/libuchardet.so.0
/boot/system/develop/lib/libuchardet.so.0.0.7

> ls -1 /boot/system/lib/libuchardet*
/boot/system/lib/libuchardet.so.0
/boot/system/lib/libuchardet.so.0.0.7

> ls -l /boot/system/lib/libuchardet*
lr-xr-xr-x 1 user root     20 1月  23  2021 /boot/system/lib/libuchardet.so.0 -> libuchardet.so.0.0.7
-r-xr-xr-x 1 user root 222840 1月  23  2021 /boot/system/lib/libuchardet.so.0.0.7

→レシピファイルにある定義行はこれを表しているのかも。

-


8). 残りの2つの依存は「Qt5WebEngine」がインストールできれば解決できそうですが、移植されてません

工数が大きすぎるので「Notepadqq-2.0.0-beta」へのバージョンアップは断念しました。

もし、「Qt5WebEngine」が移植されてインストールできるようになったときは、項番 5) と同じようにレシピファイルへの追加が必要です。

たぶん、

REQUIRES="
    haiku$secondaryArchSuffix
    lib:libGL$secondaryArchSuffix
    lib:libQt5Core$secondaryArchSuffix
    lib:libQt5Gui$secondaryArchSuffix
    lib:libQt5Network$secondaryArchSuffix
    lib:libQt5PrintSupport$secondaryArchSuffix
    lib:libQt5Svg$secondaryArchSuffix
    lib:libqt5webengine$secondaryArchSuffix      ←(置換)
    lib:libqt5webenginewidgets$secondaryArchSuffix   ←(置換)
    lib:libQt5Widgets$secondaryArchSuffix
    lib:libuchardet$secondaryArchSuffix   ←(追加済)
    "

BUILD_REQUIRES="
    haiku${secondaryArchSuffix}_devel
    devel:libGL$secondaryArchSuffix
    devel:libQt5Core$secondaryArchSuffix
    devel:libQt5Gui$secondaryArchSuffix
    devel:libQt5Network$secondaryArchSuffix
    devel:libQt5PrintSupport$secondaryArchSuffix
    devel:libQt5Svg$secondaryArchSuffix
    devel:libqt5webengine$secondaryArchSuffix     ←(置換)
    devel:libqt5webenginewidgets$secondaryArchSuffix  ←(置換)
    devel:libQt5Widgets$secondaryArchSuffix
    devel:libuchardet$secondaryArchSuffix  ←(追加済)
    "

-


9). 参考: もし、パッケージ化できて、インストールしたいときは、

-

(1). パッケージ化に成功すると、最後にパッケージ名が表示されます:
~/Git/haikuporter> hp koder
:
grabbing notepadqq-2.0.0-3-x86_64.hpkg and moving it to /boot/home/Git/haikuports/packages/notepadqq-2.0.0-3-x86_64.hpkg

-

(2). 確認:
> ls -1 ~/Git/haikuports/packages/
notepadqq-2.0.0-3-x86_64.hpkg  ←(追加)

-

(3). インストール:
> pkgman install ~/Git/haikuports/packages/notepadqq-2.0.0-3-x86_64.hpkg

→システム更新のタイミングで、メニューからの起動は、正規のアプリに上書きされるので注意。でも、右クリックで場所をホームに指定すれば起動は可能。

-

-


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

-

8. 最終的な「Notepadqq-2.0.0-beta」? の設定ファイル(試行中)を表示:

依存パッケージの「移植待ち」です。動きません。

-

1). レシピファイル:

> cat ~/Git/haikuports/app-editors/notepadqq/notepadqq-2.0.0.recipe
:
SOURCE_URI="https://github.com/notepadqq/notepadqq/archive/refs/tags/v$portVersion-beta.tar.gz"
CHECKSUM_SHA256="7dba81115438f3f44dc29ef0a81d880f6ca98b888b057247308731a39dce234a"
SOURCE_DIR="notepadqq-$portVersion-beta"
PATCHES="notepadqq-$portVersion.patchset"
ADDITIONAL_FILES="notepadqq.rdef.in"

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

PROVIDES="
        notepadqq$secondaryArchSuffix = $portVersion
        app:Notepadqq$secondaryArchSuffix = $portVersion
        "

REQUIRES="
    haiku$secondaryArchSuffix
    lib:libGL$secondaryArchSuffix
    lib:libQt5Core$secondaryArchSuffix
    lib:libQt5Gui$secondaryArchSuffix
    lib:libQt5Network$secondaryArchSuffix
    lib:libQt5PrintSupport$secondaryArchSuffix
    lib:libQt5Svg$secondaryArchSuffix
    lib:libqt5webengine$secondaryArchSuffix
    lib:libqt5webenginewidgets$secondaryArchSuffix
    lib:libQt5Widgets$secondaryArchSuffix
    lib:libuchardet$secondaryArchSuffix
    "

BUILD_REQUIRES="
    haiku${secondaryArchSuffix}_devel
    devel:libGL$secondaryArchSuffix
    devel:libQt5Core$secondaryArchSuffix
    devel:libQt5Gui$secondaryArchSuffix
    devel:libQt5Network$secondaryArchSuffix
    devel:libQt5PrintSupport$secondaryArchSuffix
    devel:libQt5Svg$secondaryArchSuffix
    devel:libqt5webengine$secondaryArchSuffix
    devel:libqt5webenginewidgets$secondaryArchSuffix
    devel:libQt5Widgets$secondaryArchSuffix
    devel:libuchardet$secondaryArchSuffix
    "

BUILD_PREREQUIRES="
        cmd:find
        cmd:g++$secondaryArchSuffix
        cmd:gcc$secondaryArchSuffix
        cmd:ld$secondaryArchSuffix
        cmd:lrelease$secondaryArchSuffix >= 5
        cmd:make
        cmd:pkg_config$secondaryArchSuffix
        cmd:qmake$secondaryArchSuffix >= 5
        cmd:which
        "

BUILD()
{
        ./configure --prefix "$appsDir/Notepadqq"

        make $jobArgs
}

INSTALL()
{
        mkdir -p $appsDir/Notepadqq/Resources
        make install

        mv $appsDir/Notepadqq/lib/notepadqq/notepadqq-bin \
                $appsDir/Notepadqq/Notepadqq
        mv $appsDir/Notepadqq/share/notepadqq/* \
                $appsDir/Notepadqq/Resources

        # Cleanup
        rm -rf $appsDir/Notepadqq/{bin,share,lib}

        # Icon
        local MAJOR="`echo "$portVersion" | cut -d. -f1`"
        local MIDDLE="`echo "$portVersion" | cut -d. -f2`"
        local MINOR="`echo "$portVersion" | cut -d. -f3`"
        sed \
                -e "s|@MAJOR@|$MAJOR|" \
                -e "s|@MIDDLE@|$MIDDLE|" \
                -e "s|@MINOR@|$MINOR|" \
                $portDir/additional-files/notepadqq.rdef.in > notepadqq.rdef

        addResourcesToBinaries notepadqq.rdef $appsDir/Notepadqq/Notepadqq
        addAppDeskbarSymlink $appsDir/Notepadqq/Notepadqq
}

→依存関連がまだ解決していません。

  • 「qt5webengine」パッケージが移植されて、インストールできたときの修正案です。

  • 「-beta.tar.gz」名が「.tar.gz」に変更になったら 2箇所の修正が必要です。

→「SOURCE_URI=」行は修正。「SOURCE_DIR=」行は削除。

-

2). パッチファイル:

~> cat ~/Git/haikuports/app-editors/notepadqq/patches/notepadqq-2.0.0.patchset
From f4234e9ab4d6728817a092edbde8f4b8984e902a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= <zmizsei@extrowerk.com>
Date: Fri, 23 Aug 2019 13:46:42 +0200
Subject: [PATCH 1/2] Disable root check for haiku

---
 src/ui/main.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/ui/main.cpp b/src/ui/main.cpp
index be427b2..a05fe74 100644
--- a/src/ui/main.cpp
+++ b/src/ui/main.cpp
@@ -92,6 +92,7 @@ int main(int argc, char *argv[])
         return EXIT_SUCCESS;
     }
 
+#ifndef Q_OS_HAIKU
     // Check if we're running as root
     if( getuid() == 0 && !parser->isSet("allow-root") ) {
         qWarning() << QObject::tr(
@@ -100,6 +101,7 @@ int main(int argc, char *argv[])
 
         return EXIT_SUCCESS;
     }
+#endif
 
     if (a.attachToOtherInstance()) {
         return EXIT_SUCCESS;
-- 
2.30.2


From 0aabf29d20ce274506ffaed3f6039fc46b8a61f1 Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Sat, 24 Aug 2019 11:18:35 +1000
Subject: [PATCH 2/2] Fix resources path

---
 src/ui/notepadqq.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/ui/notepadqq.cpp b/src/ui/notepadqq.cpp
index b93c0e4..9fd994c 100644
--- a/src/ui/notepadqq.cpp
+++ b/src/ui/notepadqq.cpp
@@ -23,6 +23,9 @@ QString Notepadqq::appDataPath(QString fileName)
 #ifdef Q_OS_MACX
     QString def = QString("%1/../Resources/").
             arg(qApp->applicationDirPath());
+#elif defined(Q_OS_HAIKU)
+    QString def = QString("%1/Resources/").
+            arg(qApp->applicationDirPath());
 #else
     QString def = QString("%1/../appdata/").
             arg(qApp->applicationDirPath());
-- 
2.30.2

→ソースが変更され、行がズレるようだと、再び修正が必要です。

-

-


まとめ

今回は、すでに移植されている「Notepadqq-1.4.8」を「Notepadqq-2.0.0-beta」にアップできるかトライしました。

まずは、アプリ名に「-beta」と付いているところが曲者でした。こういうアプリ名はありそうです。

-

順調でしたが、いくつかの依存パッケージの不足で、ビルド時にエラーします。 想定内でしたが、問題なのは足りないのが移植されていない「Qt5WebEngine 」だったこと。

-

Ubuntu 系の「GaliumOS 3.1」にて、「Notepadqq-2.0.0-beta」をインストールしたときは、依存のパッケージは apt コマンドで簡単にインストールできました。なので、このパッケージの依存は、あまり気にしていませんでした。

調べると「Qt5WebEngine」は依存が多く、ソースからビルドするだけでも大変そうです。

-

参考: QtWebEngine/How to Try

Haiku にこれまで移植されていなかった理由かも。残念ですが「断念」しました。 その他にも、これに依存しているQt アプリがあるかもしれませんね。(Falkon ブラウザがありました)

-

移植されているアプリで、バージョンが低いままのアプリが多いのは、レシピやパッチの修正が必要なこと以外に、 「依存するパッケージが移植されていない」ケースもありそうです。勉強になりました。

-

やってみないとわからないし、勉強になることも多いので、これからもトライするつもり。

-

-


-

-

    目次

-

「投稿の先頭 へ」

-

-


-

「この目次 の先頭へ」

「本編の目次 に戻る」

-