NifSkope port

My first day try compiling NifSkope with QtCreator.
Need some manual fixes but so far part of the program is running : )

nifskope

5 Likes

If like me, you are wondering what it is about, you can have a look at the GitHub page.
And, for a more info, you can visit NifTools project page.

1 Like

I’m using this thread back again to complete the port.

My current process is to apply some patches relative to the Haiku version of Nikskope.

Nifskope uses 2 XML files during its launching. I’ve put them in the app directory to make it work (ie /boot/system/apps) but I’m not happy with this solution.

What is the default and correct directory for application setup files ?

My current best finding is /boot/system/settings/nifskope , am I correct ?

The rule for 3rd party apps is one file, or one folder in /home/config/settings. The setting dir in system is for … system settings, think of networking, low level libs etc.

3 Likes

The path shouldn’t be hardcoded. Instead it’s recommended to use
finddir B_USER_SETTINGS_DIRECTORY.

1 Like

Ok I’m trying to adapt my current recipe which is working fine but which is using the /boot/system/settings/nifskope directory to copy the two required XML :

How can I adapt the below recipe in order to use the “/home/config/settings/nifskope” directory ?

I’ve searched in the current haikuports packages but didn’t succeed to find something interesting.


GLOBAL_WRITABLE_FILES="
	settings/nifskope/kfm.xml keep-old
	settings/nifskope/nif.xml keep-old	
	"
	
PROVIDES="
	nifskope$secondaryArchSuffix = $portVersion
	app:NifSkope$secondaryArchSuffix = $portVersion
	app:nif.xml$secondaryArchSuffix = $portVersion
	app:kfm.xml$secondaryArchSuffix = $portVersion
	"
...
INSTALL()
{
	make install

	mkdir -p $appsDir
	mkdir -p $appsDir/../settings/
	mkdir -p $appsDir/../settings/nifskope/

	cp $sourceDir/release/NifSkope $appsDir/
	cp $sourceDir/release/nif.xml $appsDir/../settings/nifskope/
	cp $sourceDir/release/kfm.xml $appsDir/../settings/nifskope/
	
	addAppDeskbarSymlink $appsDir/NifSkope
}

I continue to work on the port and another question is relative to the icon to be added to the app.

I’ve created an icon via Icon O Matic, and once the package is installed, it uses the default app icon (last icon in the bar below) : any idea how to make it works ? Below is my recipe code to add the icon to the app.

The other below method is working fine with my personal icon once the package is installed, so not sure what’s wrong with my recipe file :

cp /system/apps/NifSkope $HOME/Desktop/
addattr -t icon -f /boot/home/Desktop/nifskope.hvif “BEOS:ICON” /boot/home/Desktop/NifSkope

INSTALL()
{
	make install

	mkdir -p $appsDir
	mkdir -p $appsDir/../settings/
	mkdir -p $appsDir/../settings/nifskope/

	cp $sourceDir/release/NifSkope $appsDir/
	cp $sourceDir/release/nif.xml $appsDir/../settings/nifskope/
	cp $sourceDir/release/kfm.xml $appsDir/../settings/nifskope/
	
    addattr -t icon -f $portDir/additional-files/nifskope.hvif \
 	    "BEOS:ICON" $appsDir/NifSkope
	addAppDeskbarSymlink $appsDir/NifSkope
}

If it’s a regular binary you can convert the hvif to rdef (or export the icon to rdef in IOM) and check the next (plenty recipes use this to put the icon to the binary):

A bit below that is an example on how to do this if the “binary” is a "script:

Most of this can be found at haikuports, I just added them for my personal use, maybe it can be usefull. :slight_smile:

To offer a bit of an explanation: There are two ways you can store an Icon for an application in Haiku. One is the application ressources section, which is “pretty much” just a section appended to the ELF image of your binary.

In your recipe you’ve only used the other way, to append it as an extended attribute. I’m not sure why it would not work with this only aswell, but usually it is added to the binary.

Ok thanks!

The addResourcesToBinaries is working fine.