Novelwriter: Write your novel on Haiku

Good day,

novelWriter is a markdown-like editor specifically targeted at writing novels. Well, it happens to work on Haiku too (well, it’s PyQt5 after all):




Again… I need to learn how to package these things. :melting_face:

Regards,
RR

11 Likes

You should pop in IRC a bit more often, maybe we can help out a bit :slight_smile:

Packaging apps to appear on the official depot is a bit involved. You need to know for a fact whether it will compile on both 32 and 64 bit, the icon has to comply with the icon guidelines etc etc.

But to make an HPKG for your own use, or just to post up on your own website is surprisingly simple. I’d suggest you start with that, just to learn the structure of HPKGs.

Besides HaikuDepot and the pkgman command, there is another application that can open HPKGs: good old Expander. So just “unzip” a few packages to temporary directories and have a look at the structure. Be sure that Tracker isn’t hiding dotfiles because you will want to read the .PackageInfo file. You will see how the HPKG contents faithfully recreates the directory structure it will eventually occupy in /boot/system. Meanwhile the .PackageInfo file supplies the metadata the HPKG will need.

You will need to figure out your apps’ dependencies for the requires section of .PackageInfo. We don’t have an ldd command but this works just as well:

objdump -x binary_file | grep NEEDED

Of course that is a bit clumsy, so just put it in a script called ldd

#!/bin/sh
if [ -z  $1 ];then
	echo "Usage: ldd filename"
else
	echo $1
	objdump -x $1 | grep NEEDED
fi

So you move your binaries and documents into their respective directories. If you use symlinks, for example from the binary to the Deskbar menu, make sure they are relative links (hold down Shift while dragging). A relative link reads "../../../somwehere/something rather than /boot/system/somewhere/something

After that it’s just 2 steps. CD to the directory with your .PackageInfo file

package create -b appname-version.version-revision-architecture.hpkg

will create a bare package

package add appname-version.version-revision-architecture.hpkg apps list_of_directories

will recursively add those directories and their contents into the package.

For example:

package create -b myapp-0.1-1-x86_64.hpkg
package add myapp-0.1-1-x86_64.hpkg apps bin data documentation

You can do it in one step but that is not recommended.

Just make a few hpkgs for yourself, nothing fancy, just a script, a favourite wallpaper and so on. Then install them and see if the file ends up where you expected it to. You’ll get the hang of it. It really is not difficult.

4 Likes

Wow! How did you get this running on Haiku?
And is it ok to work with? Stable, keyboard input working as expected, etc…

If your app is 32 bit or 64 bit only, you just mark that in the “ARCHITECTURES” entry in the recipe. There is no problem with that. The worst thing that can happen is someone will fix it for you.

If your icon looks out of place, well, your app will look out of place, but that’s your problem, and I don’t think it will prevent getting it in the repository. The worst thing that can happen is, someone gets annoyed by it and draws you a better fitting icon.

I don’t see why you would go through the trouble of building a package manually when haikuporter can do it for you in just a handful lines of shell scripts?

@roiredxsoto shouldn’t be too hard, check the recipe for asciinema, provides the basics to get you started. :slight_smile:

Good day,

@bighill, it’s just a first test. I did it at work in a VM (lots of issues with VBox). novelWriter only depends on PyQt5 and PyEnchant, so few dependencies, easier to deal with and more chances this kind of software would work “out of the box”. Devs have done a great job with Qt, so it looks in place.

novelWriter is simpler than Manuskript in many ways, also because it uses Markdown for the files, well not really, but some sort of Markdown with some extras. Files are plain text files, though I don´t like how novelWriter names them, because has nothing to do with the file content. You can open each file in any text editor and will work, you’ll see everything, but won’t know what the file is about until you open it.

I wasn´t able to run it inside a venv… but I presume this was because I did something wrong. To get the example ´book’ I had to open the project from its location on disk instead of directly from the start dialog.

@Begasus , yes I by IRC… then,… you know the difference among:

  • what I want to do
  • what I can do
  • what I have to do
  • what I’m enforced to do
    :wink:

I’ll take a look at the asciinema recipe. I set also a “dev” env in VM, but Haiku inside Virtualbox is not so stable… Quite buggy in my case. Purpose of this VM is to get haikuporter there to fiddle around, so I won´t mess the laptop. We’ll see… Thanks for the tip.

@michel , Thanks for the process detail. I had already seen your video on that topic, and also read the info on BeSly to make a local pkg so I’ll try to get that first. One step at a time. Have to get the icon too, but that won’t be hard. :slightly_smiling_face:

@PulkoMandy haikuporter scares the hell out of me :scream: :scream: :scream: … all those files “polluting” my system… so clean and tidy… :smiling_face: … anyway, it’s about time to get there.

Regards,
RR

1 Like

It’s not that hard :smiley:

PS, VMWare should do better then VirtualBox (atleast my experience on Windows).

Only if you use the --get-dependencies switch. And I think we should modify that, so it puts them in its own “ports” directory instead of installing them in the system. Then it would be entirely self-contained, and you can just delete haikuporter when you are done with it, and it leaves no trace.

2 Likes

Good day,

@Begasus , thanks for the tip. VMWare seems a lot more stable than VBox. Need to fix screen resolution to max display’s. Other than that, pretty fine.
@PulkoMandy , I would appreciate that… Haikuports " a la " virtualenv… that would indeed be nice.

Regards,
RR

1 Like