Porting QPrompt to Haiku, "Can't evaluate config file"

Hello,

I’m porting my project, QPrompt, to run on Haiku. QPrompt is written in C++ using Qt and KDE libraries. I’m having trouble getting the recipe to build. Running haikuporter in verbose mode returns:

$ haikuporter -v qprompt-1.0.0.recipe
Checking if any dependency-infos need to be updated …
/boot/home/haikuports/kde-apps/qprompt/work-1.0.0/port.recipe: line 11: $’\r’: command not found
recipe for qprompt-1.0.0 is still broken:
Error: Can’t evaluate config file: /boot/home/haikuports/kde-apps/qprompt/work-1.0.0/port.recipe

I don’t know what command it is failing to find…

Here’s a copy of my recipe. A big thanks to anyone who can point me in the right direction:

SUMMARY=“Personal Teleprompter App”
DESCRIPTION=“Teleprompter software for all video creators. Built with ease of use, productivity, control accuracy, and smooth performance in mind.”
HOMEPAGE=“https://qprompt.app
COPYRIGHT=“2022 Javier O. Cordero Perez”
LICENSE=“GNU GPL v3”
REVISION=“1”
SOURCE_URI=“https://github.com/Cuperino/QPrompt/archive/refs/tags/v$portVersion.tar.xz
CHECKSUM_SHA256=“dbafdebc84921ca3b69e86194efb3d728d7b8ac932b84ffc5e4a7682c671d199”
SOURCE_DIR=“qprompt-$portVersion”
ADDITIONAL_FILES=“qprompt.rdef.in”

ARCHITECTURES=“all !x86_gcc2”
SECONDARY_ARCHITECTURES=“x86”

PROVIDES="
qprompt$secondaryArchSuffix = $portVersion
app:QPrompt = $portVersion
"
REQUIRES="
haiku$secondaryArchSuffix
qqc2_desktop_style$secondaryArchSuffix
lib:libGL$secondaryArchSuffix
lib:libKF5CoreAddons$secondaryArchSuffix
lib:libKF5I18n$secondaryArchSuffix
lib:libKF5IconThemes$secondaryArchSuffix
lib:libKF5Kirigami2$secondaryArchSuffix
lib:libQt5Core$secondaryArchSuffix
lib:libQt5Gui$secondaryArchSuffix
lib:libQt5Network$secondaryArchSuffix
lib:libQt5Widgets$secondaryArchSuffix
lib:libQt5QuickControls2$secondaryArchSuffix
"

BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
qqc2_desktop_style${secondaryArchSuffix}_devel
extra_cmake_modules$secondaryArchSuffix >= 5.68
devel:libKF5CoreAddons$secondaryArchSuffix
devel:libKF5I18n$secondaryArchSuffix
devel:libKF5IconThemes$secondaryArchSuffix
devel:libKF5Kirigami2$secondaryArchSuffix
devel:libQCoro5Core$secondaryArchSuffix
devel:libQt5Core$secondaryArchSuffix
devel:libQt5QuickControls2$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:g++$secondaryArchSuffix
cmd:cmake
cmd:make
"

#PATCHES="
#"

BUILD()
{
sed -e ‘/ecm_find_qmlmodule/ s/^#*/#/’ -i CMakeLists.txt

mkdir -p build
cd build
cmake …
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_INSTALL_PREFIX=$appsDir
-DCMAKE_INSTALL_BINDIR=$appsDir
-DCMAKE_INSTALL_DATADIR=$dataDir
-DCMAKE_INSTALL_DATAROOTDIR=$dataDir
-DSHARE_INSTALL_PREFIX=$dataDir
-DECM_DIR=/system/data/cmake/Modules/ECM/cmake

make $jobArgs
}

INSTALL()
{
cd build
make install

mv $appsDir/qprompt $appsDir/QPrompt

local APP_SIGNATURE=“application/x-vnd.cuperino.qprompt”
local MAJOR="echo "$portVersion" | cut -d. -f1"
local MIDDLE="echo "$portVersion" | cut -d. -f2"
local MINOR="echo "$portVersion" | cut -d. -f3"
local LONG_INFO="$SUMMARY"
sed
-e “s|@APP_SIGNATURE@|$APP_SIGNATURE|”
-e “s|@MAJOR@|$MAJOR|”
-e “s|@MIDDLE@|$MIDDLE|”
-e “s|@MINOR@|$MINOR|”
-e “s|@LONG_INFO@|$LONG_INFO|”
$portDir/additional-files/qprompt.rdef.in > qprompt.rdef

addResourcesToBinaries qprompt.rdef $appsDir/QPrompt
addAppDeskbarSymlink $appsDir/QPrompt
}

2 Likes

Sounds like you need to save the recipe file with unix style line endings.

1 Like

Quotes look suspicious to me.

1 Like

Thanks! It seems like it was both incorrect double quotes and line DOS line endings causing that issue.

Now I’m getting recipe not found in tree, which I thought was a byproduct of the previous error but it seems like it wasn’t. I’ve tried placing my package’s folder inside of various haikuports’ subfolders, such as kde-apps, media-video, and app-misc. Do I need to register it somewhere?

No, you can place the your recipe in a directory anywhere you want in your haikuports directory. Obviously, if you want to submit it to haikuports it should be in a category folder that makes sense. Just to be sure that your haikuports setup is OK, can you build any other (existing) packages with your haikuporter setup?

You should start it like that:
haikuporter -S -j8 --no-source-packages --get-dependencies qprompt

To make it easier you can add an alias to bash profile ~/config/settings/profile.
alias hp="haikuporter -S -j8 --no-source-packages --get-dependencies"

2 Likes

I think (suggestions welcome) it would be OK in media-video/qprompt/qprompt-1.0.0.recipe ?

EDIT I’ve been able to build the package and launch it, however text doesn’t seem to display?

What I did so far:

SUMMARY="Personal Teleprompter App"
DESCRIPTION="Teleprompter software for all video creators.
Built with ease of use, productivity, control accuracy, and smooth performance in mind."
HOMEPAGE="https://qprompt.app"
COPYRIGHT="2022 Javier O. Cordero Perez"
LICENSE="GNU GPL v3"
REVISION="1"
SOURCE_URI="https://github.com/Cuperino/QPrompt/archive/refs/tags/v$portVersion.tar.gz"
CHECKSUM_SHA256="dbafdebc84921ca3b69e86194efb3d728d7b8ac932b84ffc5e4a7682c671d199"
SOURCE_DIR="QPrompt-$portVersion"
#ADDITIONAL_FILES="qprompt.rdef.in"

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

PROVIDES="
	qprompt$secondaryArchSuffix = $portVersion
	app:QPrompt = $portVersion
	"
REQUIRES="
	haiku$secondaryArchSuffix
	qqc2_desktop_style$secondaryArchSuffix
	lib:libGL$secondaryArchSuffix
	lib:libKF5CoreAddons$secondaryArchSuffix
	lib:libKF5I18n$secondaryArchSuffix
	lib:libKF5IconThemes$secondaryArchSuffix
	lib:libKF5Kirigami2$secondaryArchSuffix
	lib:libQt5Core$secondaryArchSuffix
	lib:libQt5Gui$secondaryArchSuffix
	lib:libQt5Network$secondaryArchSuffix
	lib:libQt5Widgets$secondaryArchSuffix
	lib:libQt5QuickControls2$secondaryArchSuffix
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	qqc2_desktop_style${secondaryArchSuffix}_devel
	extra_cmake_modules$secondaryArchSuffix >= 5.68
	devel:libKF5CoreAddons$secondaryArchSuffix
	devel:libKF5I18n$secondaryArchSuffix
	devel:libKF5IconThemes$secondaryArchSuffix
	devel:libKF5Kirigami2$secondaryArchSuffix
	devel:libQCoro5Core$secondaryArchSuffix
	devel:libQt5Core$secondaryArchSuffix
	devel:libQt5QuickControls2$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:g++$secondaryArchSuffix
	cmd:cmake
	cmd:make
	"

BUILD()
{
	sed -e '/ecm_find_qmlmodule/ s/^#*/#/' -i CMakeLists.txt

	cmake -B build -S . \
	-DCMAKE_BUILD_TYPE=Release \
	$cmakeDirArgs \
	-DCMAKE_INSTALL_BINDIR=$appsDir \
	-DECM_DIR=/system/data/cmake/Modules/ECM/cmake -L

	make -C build $jobArgs
}

INSTALL()
{
	make -C build install

	mv $appsDir/qprompt $appsDir/QPrompt

	mkdir -p $docDir
	mv $prefix/doc/qprompt/* $docDir
	rm -rf $prefix/doc

#	local APP_SIGNATURE="application/x-vnd.cuperino.qprompt"
#	local MAJOR="echo "$portVersion" | cut -d. -f1"
#	local MIDDLE="echo "$portVersion" | cut -d. -f2"
#	local MINOR="echo "$portVersion" | cut -d. -f3"
#	local LONG_INFO="$SUMMARY"
#	sed
#	-e "s|@APP_SIGNATURE@|$APP_SIGNATURE|"
#	-e "s|@MAJOR@|$MAJOR|"
#	-e "s|@MIDDLE@|$MIDDLE|"
#	-e "s|@MINOR@|$MINOR|"
#	-e "s|@LONG_INFO@|$LONG_INFO|"
#	$portDir/additional-files/qprompt.rdef.in > qprompt.rdef

#	addResourcesToBinaries qprompt.rdef $appsDir/QPrompt
	addAppDeskbarSymlink $appsDir/QPrompt
}
2 Likes

Oh wow! That’s fascinating. I’ve never seen the UI’s text fail to render. I suspect this might be related to QPrompt using Qt’s own Material Dark theme instead of the one provided by qqc2_desktop_style. The underlying cause may have to do with OpenGL rendering limitations.

And yes, I think media-video would be the ideal place for QPrompt. I’m also impressed system icons worked from the start! Usually icons don’t work from the start on non-Linux systems.

@Diver, Thanks, with your correction I got QPrompt to start building. Now I’m getting:

CMake Error: AUTORRC for target kcalc: Test run of "rcc" executable "/system/bin/rcc" failed.
/system/bin/rcc -h

Signal 21
CMake Generate step failed.  Build files cannot be regenerated correctly.

can you build any other (existing) packages with your haikuporter setup?

@BlueSky, Actually no… All Qt software I attempt to build fails with either AUTORRC or AUTOMOC failing. Maybe there’s something wrong my setup…

If I look into the recipe created by Arch-linux I don’t see Qt being used?

https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=qprompt

That works on Arch because kirigami2 itself sets Qt dependencies, and the dependency graph takes care of most dependencies automatically.

Out of all QPrompt builds that I’m aware to exist, the one from the AUR is the only one created and maintained by someone other than me. I usually specify most dependencies manually, just in case a dependency of QPrompt stops marking a mutual dependency as its own dependency, thus preventing it from being installed.

Build instructions with Arch dependencies listed can be found at:

Complete dependency lists for Ubuntu 21.04 Deb and Fedora 35 RPM packages are found at:

1 Like

It’s the only one mentioned at repology (Aur/Arch) :wink:

1 Like

First time hearing of Repology… Thanks for letting me know!

That makes sense because although Deb and RPM packages can be built (well, only the Deb works, the RPM fails to install due to unresolved path conflicts), they’re not available from any repositories. Anyone is free to include them in such, but I try to stick to universal packages when it comes to Linux. It makes things easier to maintain and avoids problems caused by bugs in dependencies.

More information about which packages are currently being supported, why, and for how long at QPrompt’s forum: http://forum.cuperino.com/t/appimage-vs-deb-installer/41/2?u=cuperino

Edit: In the case of Haiku, it would work similar to Arch and always use the latest libraries. That is better than being stuck with a bug from a dependency for years…

Why could AUTORRC be failing to run on my system?

No idea there, I don’t see it here when I’m building it, I presume you’re building on 64bit (as 32bit errors out during the build here with: out of memory)

That is correct. The only ways to make a 32 bit build is by cross-compiling or removing fonts from the program’s resources. You need around 3 GB of free, usable, memory to build QPrompt because of the fonts that it includes, which are there to enable combining most writing systems in a consistent way across all platforms, including mobile where system fonts can’t be picked.

Unless Chinese fonts are removed from QPrompt, one always runs out of memory building on 32 bit systems. For the build to succeed on 64 bit systems with 4 GB of RAM, one should compile with a single thread by passing -j=1 to make. This is unfortunately not enough to build on 32 bit systems.