Can't get Scribus 1.5.2 to work

Cool! Then lets see, how you can do this…

First, you have to fork the haikuports repository on github, so go to github, log in, navigate to the Haikuports Github Site site and fork it with the fork button on the top right corner.
You will get an very own haikuports copy with it. It will take some moments for github to do all the dirty things in the background, but we got time, right?

(Here is a part, where i’m not sure, afaik you already got a local haikuports checkout, maybe it is possible to reuse it, but to have a clean desk, lets delete it.)
Search for the folder called haikuports on your drives (this is where all the recipes lives) and delete it. You will get an another, do not panic.

Now open your terminal and navigate in the folder where you want to have your own haikuports tree. (So there, where it was earlier. If it was in /boot/home/haikuports then navigate in to /boot/home like

cd /boot/home

or

cd /Data/haiku

or anything else, you have to be creative :slight_smile:

Actually Terminal in default navigates automatically in your home folder at start, so if you want your repository there, you don’t need to do anything.

If you still have open in the webbrowser your really own haikuports github site, then search for the “Clone or dwonload” button in the right top corner. It is green. Click on it.

You will see a link like this:

https://github.com/yourname/haikuports.git

Copy it.

Then switch bac to your terminal and type the following:

git clone https://github.com/yourname/haikuports.git

Do not forget to use your really own repository address.

Now git will clone your remote repository (what right nov is a vanilla 1:1 copy of the original haikuports repository wit all the current recipes and stuff. It will take looong time, i would say connect your computer with wired connection to have easy ride. WiFi/WLAN can be an adventure sometimes.

So, if you got your shiny new repository, report back here and i will continue your guide.

Great.

This first part is done. I’ve forked haikuports into my own account.
No problem to delete the previous haikuports folder on my home folder. Better to clear everything.
Now as for the final part, cloning my own haikuports, I must delay it till tomorrow.
I’ll report back when it’s done. Thank you so much.

1 Like

You can reuse it, but it takes some git magic. I use the “hub” command for controlling github from the command line.

hub fork

Will take care of creating a fork, when run from inside your haikuports directory. Then you use

hub push yourname
hub pull-request

To push your changes to your fork and then create a pull request from it.

But your solution of re-downloading is simpler and works just fine.

It can work with a Qupzilla 2.x ?

Ofc, but i think it have some dependency, what not available on Haiku yet.
Edit: it depends on qtwebengine, what not ported yet to Haiku. Sorry, mate, you need to wait…

1 Like

Alright, I’ve cloned my repository. I’m ready to procede.

Congratulation!
Now you have your really own remote and local repository, we can start the real business!

Git is a version control system, so it can store your stuff with versions and stuff. Look for it on github or somewhere else, i won’t go too deep, only so far, what needed to your adventure.

A github repository, like your local can have a remote pair. In this case your remote repository is your own github haikuports repo. Everything was set up automatically as you cloned your repo.

Your local git repo have a default branch it called “master”. This is the most important branch, you can think about it like a holy cow. Do not mess with your “master”. Never ever.

Now, navigate into your repository in terminal like:

cd /boot/home/haikuports

If you wan’t make any changes in the repo, first check, which branch is active, and what the status like:

git status

It will print you, that you are on master and your repository is clean. Good.

As i told you, you do not want to mess with your master, but you have to base all your changes onto your master. It called branching. If you make a branch from master, it will be a separate sandbox where you can do everything, and everything will be based on top of your master,but you don’t actually change your master.

Let suppose, you want to work on the scribus ecipe, let’s do a branch for it:

git checkout -b scribus_update

Git will create a branch for you called “scribus_update”, and change to it automatically. You can check it wit the good ol’:

git status

It will report, that you are on the “scribus_update” branch, and your repository is clean.

Good work, mate!

So, let’s see, what we have done:

  • we made a fork about the official haikuports repo (this is your remote repo at github)
  • you just cloned your remote repo. (this is your local repo)
  • you just made a branch in your local repo, where you can do everything.

Now, as you told, you want to work on the scribus recipe, let’s navigate with Tracker into the scribus folder (it is in app-office/scribus).
Here you can see 2 recipe and some folders.

We have a 1.4.6 and a 1.5.2 recipe. You wan’t to update the scribus port to the latest one, so take the 1.5.2 recipe and duplicate it in Tracker. Then rename it to 1.5.3.
Do not forget to remove a “copy” postfix from the file-name.

Great! Nice job!

The point is, that haikuporter takes the version number from the file-name, and uses it in plenty different places, so a correct recipe defines its version only one times: in the file-name.
We took an old recipe, and renamed it, so haikuporter will know, it is a new version.

Let’s open the recipe with Pe. Do not change anything, just look at the different sections and try to analyze, how it built up, what kind of informations contains. Maybe there will be some unknown stuff, or some stuff, what you cannot decipher, but do not panic, first you need to look at it a bit, to get a bit intim connection with it.

The first some line is really straightforward to decipher, but at the SOURCE_URI you will see an web address (URL) what contains the following string:

$portVersion

Maybe you remember, haikuporter takes the version number from the file name, and reuses it plenty times. $portVersion is actually the version number. It will be replaced with the actual version number during the build, so you can think like a placeholder for “1.5.3”

The CHECKSUM_SHA256 is a CRC check stuff. Do not care about it right now. It is to check the integrity of the downloaded source code. We will talk about it later.

PATCHES is a really important stuff. Sometimes the source codes needs some changes to get it compiled on Haiku. If we need any patch, we will list it here.
As you can see, there is already a patch defined with $portVersion in it’s name. IT means, haikuporter needs to look in the “patches” folder for a file called “scribus-$portVersion.patchset” (the current recipe version.

ARCHITECTURES means: which processor architectures are supported. It isn’t actually a processor architecture, but the Haiku version. As you can see, there is more than one defined.
Let’s see them:

!x86_gcc2 means: it isn’t works on gcc2h PRIMARY arch.
?x86 means: it isn’t tested on x86 primary arch
?x86_64 : means it isn’t tested on x86_64 primary arch.

What is this primary arch stuff actually?
Haiku, historycally source and binary compatible with BeOS. BeOS had GCC2 compiler toolchain, so the traditional Haiku (gcc2h) comes with GCC2 what a bit old, and doesn’t support the shiny new features. The Haiku dev team solved this with the primary and secondary arch:

  • Haiku gcc2h comes with 2 different GCC compiler toolchain, the primary is gcc2 and the secondary is gcc5.
  • There is a Haiku version with opposite toolchains too: gcc5 as primary and gcc2 as secondary. This is the second in this line.
  • There is a x86_64 Haiku version too. It comes only with one GCC: gcc5, so the primary here is gcc5.

Now you understand the SECONDARY_ARCHITECTURES too.

Thencomes the PROVIDES section: here can we define, what does this package provides.

REQUIRES contains the runtime dependencies. Theese the packages what the end-user need, who do not want build it, just use it the resulting package.

PROVIDES_devel: is special stuff. Maybe you have noticed, some package have a _devel pair. This is the developer stuff, what not everybody needs. The libraries are mostly splitted up to “runtime” and “developer” stuff. The normal users needs the runtime stuff, the developers (like you) needs the developer packages TOO.
The PROVIDES_devel section means: scribus will be split up to runtime and developer package, and we defined here, what the developer package contains.

REQUIRES_devel: means what the scribus_devel package needs.

BUILD_REQUIRES: contains all the libraries, what haikuporter needs to build this package

BUILD_PREREQUIRES: contains all the programs, what required to build the package

BUILD() section will build the program

INSTALL() will install it

We already bumped the file name to 1.5.3, but our recipe contains a PATCHES section, where the portVersion variable used. We don’t have a patch like “scribus-1.5.3.patchset”. We got just 1.5.2 in the patches folder.
If i update a port, i always check if the old patchset still works or not. We can copy the old patchset and rename it to 1.5.3, but we have luck, @korli already sent theese patches to the scribus folks, and they are integrated into the current (1.5.3) version, so we don’t need the PATCHES section. LEt’s comment it out like:

#PATCHES="scribus-$portVersion.patchset"

Add a hashmark to the beginning. like in my example and save the file.

Now you got a preliminary recipe what we can try, so go to your Terminal, and let haikuporter bo the stuff:

haikuporter scribus

on x86_64, or

haikuporter scribus_x86

on haiku gcc2h.

If you start it, haikuporter will check the repository (i assume, your haikuporter already configured correctly, if not, check the haikuporter wiki) and finds your current scribus recipe. It will download the current sources and prints an error message, that the Checksum doesn’t match. Of course it isn’t, because it is a checksum of the 1.5.2 version, but we want 1.5.3. Haikuporter kind enough to show you the actual checksum, so copy it and paste it into your recipe. Replace the old checksum with the new one and try to build it again with the :

haikuporter scribus

command. Look! It went further!

It will complain later because something else, but i let you experience it alone.
Report back if you accomplished theese steps and i’ll guide you further.

Have fun!

2 Likes

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