Can't get Scribus 1.5.2 to work

Great tutorial!
As you antecipated, there was an error. Here’s the final part:
(it’s funny because I made sure harfbuzz is installed, version 1.4.6 from haikuports.)

– Checking for modules ‘harfbuzz>=0.9.42;harfbuzz-icu’

– No package ‘harfbuzz-icu’ found
CMake Error at /boot/system/data/cmake/Modules/FindPkgConfig.cmake:415 (message):
A required package was not found
Call Stack (most recent call first):
/boot/system/data/cmake/Modules/FindPkgConfig.cmake:588 (_pkg_check_modules_internal)
CMakeLists.txt:915 (pkg_check_modules)

– Configuring incomplete, errors occurred!
See also “/sources/scribus-1.5.3/CMakeFiles/CMakeOutput.log”.
[Errno -2147459069] No such file or directory: '/boot/home/haikuports/app-office/scribus/work-1.5.3’
Error: Build has failed - stopping.

You should submit this as an article to the haiku website :slight_smile:

5 Likes

Sorry, i had a really long day yesterday, i’ll continue today afternoon (gmt1)

Nice job, mate!
Yeah, that was the error what about i talked earlier. Let’s solve it for once and all!

But first let me analyze your answer a bit:

it’s funny because I made sure harfbuzz is installed, version 1.4.6 from haikuports

You surly meant that the required package installed. Please, makse sure that the _devel package installed too.
But it seems to me, you don’t rreally understand the concept of haikuporter. As i told you earlier, there is apart in the recipe, what defines, what kind of packages (libraries and programs) required to build something and to run something. It is absolutely required o make sure, that we have reproducible and accurate packages with controlled requiments.

The autoconf based configure scripts, the cmake based programs using a script what check for the installed and available programs and libraries during the configure phase. HaikuPorter doesn’t directly use the installed packages, because there were no control, maybe i have more and different packages installed than you, so the configure scripts would find different stuffs. So: no go.

Instead using directly the installed packages haikuporter creates a temporary virtual environment to build the source code here. haikuporter then would analyze the build requiments in the recipe, and activate the packages in the virtual environment, what defined in the recipe.
So you not just need to have the required packages installed on your system, but you have to define it in the recipe. Without it, the required packages would missing from the virtual environment, and the configure script wouldn’t find them.

So, let’s see, what missing:

No package ‘harfbuzz-icu’ found

harfbuzz-icu… let’s see, if we got it…

Go to the haikuports official github site and search at the top for harfbuzz. The search will come up with the following result:

Current harfbuzz recipe

Oh, look, it defines, that it can provide
lib:libharfbuzz_icu$secondaryArchSuffix
runtime and
devel:libharfbuzz_icu$secondaryArchSuffix
developer package.

Check your current scribus recipe, and if they are missing, just add the

lib:libharfbuzz_icu$secondaryArchSuffix
to the REQUIRED section
and the
devel:libharfbuzz_icu$secondaryArchSuffix
into the BUILD_REQUIRES section.

If we are already here, we could add some more requiments too to have more features, yeee:

so add the followingto the REQUMENTS:

cmd:hunspell$secondaryArchSuffix
lib:libcrypto$secondaryArchSuffix
lib:libfreehand_0.1$secondaryArchSuffix
lib:libharfbuzz_icu$secondaryArchSuffix
lib:libhyphen$secondaryArchSuffix
lib:libpoppler$secondaryArchSuffix
lib:libssl$secondaryArchSuffix
lib:libmspub_0.1$secondaryArchSuffix

and theese to the BUILD_REQUIRES:

hunspell${secondaryArchSuffix}_devel
devel:libcrypto$secondaryArchSuffix
devel:libfreehand_0.1$secondaryArchSuffix
devel:libharfbuzz_icu$secondaryArchSuffix
devel:libhyphen$secondaryArchSuffix
devel:libpoppler$secondaryArchSuffix
devel:libmspub_0.1$secondaryArchSuffix
devel:libssl$secondaryArchSuffix

But make sure they are already installed on your system. I suppose they must be in the HaikuDepot. If you doesn’t find some, comment them out with a # character at the beginning of the line like:

# devel:somemissinglib$secondaryArchSuffix

Keep your requiments nicely organized in abc order! It is easier to find something later, if it is orgnaized.

Do not forget to update the copyright year to 2017 at the beginning of your recipe.

Now everything set up!
But if you starts the haikuporter, cmake will complain, that it cannot find OPENSSL. It is a bug in the source code, because it searchs for OPENSSL, hovewer it needs to be written as OpenSSL, so let us invent a short patch for this:

Add theese lines before the BUILD section:

PATCH()
{
# Fix openssl search
sed -i ‘s/find_package(OPENSSL)/find_package(OpenSSL)/g’
cmake/modules/FindLIBPODOFO.cmake
}

The lines between { and } should be idented with one TAB.

Now we are really ready, so just go and build it like:

haikuporter scribus

It will build everything, if you get any error, let us know about it.

Have fun!

1 Like

Man, you did it! It’s building, it’s building now!

Let’s see if the application works better now than the previous version.
I’ll report back when it’s done.

You should definitely make this step by step into an article in Haiku-os.org. It made things much clearer for a newbie like me.

Thank you.

As a side note, my Pe editor stopped working. Tried reinstalling it but nothing. Message: Could not open Pe (Missing symbol: _ZNK9BCollator7CompareEPKcS1_a)

May be related to Hrev51192 x86_gcc2 ошибка запуска редактора Ре.

Sure. Thanks

miqlas,
I just bumped into an error after building 59%.
It seems to be complaining of an absent directory. I’ve checked this and in fact there is a directory called work-1.5.3.

Nice job, mate!
It was expected :slight_smile:

Let’s see, how can we solve this problem:
As you can see, prefsDir not declared. Maybe it is a bug with the source code, i’m not really sure, but we have to fix it.

Open the app-office/scribus fodler, where your recipe resides right now. There will be one or more work folder too. We have to open the one with the current version number in the folder name, so 1.5.3.

There you can see, where all the magic happens, you can explore later, now navigate further into the sources fodler, it must have a scribus folder inside it, and inside the scribus folder you can actually find all the sources. Now go further into the scribus folder and search for scpaths.cpp file.
This is the file, about what the compiler complains. Open it with a text editor, and search for the following line:

#include “scribusapp.h”

after that line you have to insert the following lines:

#ifndef prefsDir
QString prefsDir;
#endif

If you are ready, save the file.
Keep your Tracker window open what shows the folder, where scpaths.cpp located. Now open a terminal, and copy the path from the Tracker window and jump there with your terminal like:

cd /this/is/the/path/what/jou/just/copied

After pressing enter the Terminal will jump into that folder. Now you have to know, that haikuporter creates a git repository for the extracted sources automatically, so we can use the following command to commit the change what you just done:

git commit -a

It will open a terminal based text editor and it will show some text. You just need to add a commit message at the beginning the file, like:

Scribus: build fix

Then press and keep down the Ctrl key on your keyboard and press the O key.
Nano (the text editor) will ask you if you want to save the file. Press Enter.
Then to exit you have to press and keep down Ctrl key and press the X.

Nano will disapear, and you will get back your terminal. You can close this terminal now.

Go back to the other terminal where you tried to build scribus, and let the haikuporter extract your change from the sources like:

haikuporter -e scribus

In some seconds haikuporter wil lcreate a new file in the patches folder with the follwing name:

scribus-1.5.3.patchset

Super!

Now open your recipe, and add the following line after the CHECKSUM section

PATCHES=“scribus-$portVersion.patchset”

(maybe you just commented it out earlier, then remove the # symbol at the beginning of the line.)

Now your recipe is really ready to rock.
Try to build your sources again with:

haikuporter scribus

During the build processyou could open a new terminal or tab, navigate to the folder where your haikuports tree located and use the following commands:

git add (pull your recipe from the Tracker window here)

and

git add (pull your patchset file from Tracker here)

With thoose 2 last command you just added your new recipe to your local git haikuports repository.

You have to commit your changes like:

git commit -a

It will open again the text editor, what you have seen before. Type your commit message like:

Scribus : bump version

Press Ctrl and O, then Ctrl and X to save and exit.
Now you just committed your changes into your local git repository, into the scribus_update branch.

But hey, it is your local git repo, so only you have access to it. Why don’t share your work with the whole world?

We can push your commit to your remote repository like:

git push origin

I assume you already set git up for the following stuff, if not, then use the following commands:

git config --global user.name “Your Name”

and

git config --global user.email your@email.com

It is possible, that git will complain about not knowing, what the remote branch should be and prints you a command, in this case just copy that and paste it into your terminal, and press enter. Then you can try your push again.

git will ask your github username and password, type it and press enter, if everything goes ok, then git will publish your change on your remote github repo.

Then, wait the build to finish, to make sure your recipe works ok, and then you can create a pull-request on the official haikuports github page.
For that open your web-browser, navigate to github,log in, open the official haikuports github repo, and you will see a new notification at the top in yellow box, that you can create your pull-request.

A pull request is required to send your changes to the haikuports mainline repository, to make your changes available for everybody.
It is really straightforward to do it.

Then you have still stuff to do:
your local github repository linked to your github remote repository, but maybe you want to get the updated recipes from the official haikuports repository. For that we have to change the settings of your github repo like the following:

open a terminal
navigate into the folder where all the recipes located, like:

cd /boot/home/haikuports

and add the official repository to your local repository like:

git remote add haikuports GitHub - haikuports/haikuports: Software ports for the Haiku operating system.

Now your local repository have 2 different remote repository too, and you can get the latest recipes easily:

If your build finished, just switch back to the master branch like:

git checkout master

(I know, i told you should not change your master, but it is an exception. You should pull the latest recipes always into your master branch! Be careful to switch to the master before you use the following command.

Everytime if you want to have the latest recipes, use the following command to pull them into your master branch:

git pull haikuports

That’s all mate, i wat to see your pull-request at the haikuports github site.

Have fun!

3 Likes

Miqlas, this has been a great crash course on haikuporter and git. Thank you.
I managed to build the Scribus package at last. It installs and runs. However, I’m getting the same error when I try to use any tool like the text frame tool. The application crashes.
Running it from the terminal I get the following message:


Apparently there’s a bug in Scribus’ source code or the Qt haiku port. Any chance that we can track it now?

Until this is fixed I don’t think I should create that pull-request on the official haikuports you mention, should I?

great @extrowerk… your post very usefull…

Miqlas, in this meantime, I’ve made contact with Scribus developers on their forum. They asked me for debug information which I tried to give them using Haiku debugger.
However, they said I need a debug build of Scribus to generate a full report. So I’m stuck here.
They also pointed at the possibility of it being a bug in the Haiku Qt port and not in the Scribus code at their end. Please see their comments here:
https://bugs.scribus.net/view.php?id=14843

Nice report, thanks for the info!

To be able to give a more detailed backtrace, it would be required to build Scribus with enabled Debug mode. If you got some time, add the “-DWANT_DEBUG=1” to your cmake command in your recipe.

Currently it looks like this:

BUILD()
{
	cmake . -DCMAKE_INSTALL_PREFIX=$prefix \
		-DEXECUTABLE_OUTPUT_PATH=$appsDir \
		-DCMAKE_INSTALL_DATAROOTDIR=$dataDir \
		-DSHAREDIR=$dataDir \
		-DAPPLICATION_DATA_DIR=$dataDir \
		-DWANT_DISTROBUILD=1 \
		-DWANT_CPP11=1 \
		-DLIB_SUFFIX="$secondaryArchSuffix"

and you should add “-DWANT_DEBUG=1” like:

BUILD()
{
	cmake . -DCMAKE_INSTALL_PREFIX=$prefix \
		-DEXECUTABLE_OUTPUT_PATH=$appsDir \
		-DCMAKE_INSTALL_DATAROOTDIR=$dataDir \
		-DSHAREDIR=$dataDir \
		-DAPPLICATION_DATA_DIR=$dataDir \
		-DWANT_DISTROBUILD=1 \
		-DWANT_CPP11=1 \
		-DLIB_SUFFIX="$secondaryArchSuffix" \ <= We need a backslash here
		-DWANT_DEBUG=1 <= Add this line.

DO NOT FORGET THE BACKSLASH!

And build again like:

#haikuporter scribus

Sorry, i can’t test it right now, but i think it should work.
Install the generated package, and try to run the program from Terminal.

Have fun!

Best Regards,
miqlas

1 Like

Alright. I’ll try it tomorrow. Let’s get this thing to work. :wink:

Miqlas,

I sent the new debug report to the Scribus issue tracker. It was checked out by jgalhi, one of the main developers. He said the problem is on the Qt 5.8 haiku port side. You can see his comment here: https://bugs.scribus.net/view.php?id=14843

Well if this is true, no Scribus 1.5.3 in Haiku for now. Could you forward this to the Qt maintainer?
or maybe I should wait until things become a more mature. If that is the case thank you so much.

You can open bug reports at GitHub - haikuports/haikuports: Software ports for the Haiku operating system. (with links to the relevant info: this discussion and the scribus bug report).

Hi folks,

After I read the news on the recent Qt 5.9 port success, I decided to take another try on compiling Scribus 1.5.3.
I erased my local haikuports tree and downloaded it again with the newest recipes of Scribus (updated by Miqlas) and Qt 5.9.
The building process went fine after I reinstalled all the dependencies. The app was built. It runs but shows the same bug I reported some weeks ago. It creates and opens documents but trying to use any tool to make or grab objects crashes the app without any dialog.
As it was said by one of Scribus’ developers in their forum above, the bug is in the Qt port code and should be fixed there.
So unfortunately no progress so far to bring this useful app to Haiku OS. :disappointed:

Maybe you missed the comment above asking to open a bug report?

I just did that (link here).
Thank you for pointing it out.

2 Likes

Great attempt trying to compile Scribus 1.5.3…
While this is a development release, wouldn’t it be better to try compiling the Currently stable branch the 1.4.x series recommended for production!?

Would be great to have it work in Haiku…