Nekoware Packaging Guide: Difference between revisions

From TechPubs Wiki

Created page with " This article provides a basic introduction to packaging software for distribution through the Nekoware software archive. Nekoware's standards are reflected in the way we wrote this article. ==Required Equipment== ===Compilers=== For C-based, normal everyday programs we highly recommend using MIPSPro for compilation. If using C++, the type of C++ and complexity of the program will determine if fixing it for MIPSPro outweighs the work necessary to compiler. W..."
 
No edit summary
 
Line 58: Line 58:


Any GCC applications will require installing GCC for proper building if they link against a dynamic libgcc.so. Be aware.  
Any GCC applications will require installing GCC for proper building if they link against a dynamic libgcc.so. Be aware.  
== Set up application for patching ==
Always prepare for patching.
% cp -rpf screen-4.2 screen-4.2-irix
Use the -irix directory for modifications, keeping the original pristine.
== Building with autotools ==
A general procedure to configure, build and install is as follows:
% ./configure --prefix=/usr/nekoware --libdir=/usr/nekoware/lib32 --mandir=/usr/nekoware/share/man
This command will allow configure to run. If there's errors, run:
% ./configure --help
And verify if it's looking for certain libraries. For instance, with building atk, Raion used this build command:
% ./configure --prefix=/usr/nekoware --libdir=/usr/nekoware/lib32 CPPFLAGS="$CPPFLAGS -DG_CONST_RETURN=const"
Due to use of an old macro. Or this command for moc:
% ./configure --prefix=/usr/nekoware --libdir=/usr/nekoware/lib32 --with-ncurses
  --with-libiconv-prefix=/usr/nekoware CURSES_CFLAGS=-I/usr/nekoware/include/ncursesw LDFLAGS="$LDFLAGS -lxg -liconv"
== Parallel make ==
Rather than running make, it's easier and faster to use parallel make:
% gmake -j3
This will run 3 workers for gmake, sufficient for a dual CPU system.
== Patching Applications ==
If the program requires patching, patch the code run gmake clean, then using neweoe diff:
% diff -urw screen-4.2 screen-4.2-irix > screen-irix.patch
Or GNU diff:
% diff -Naur screen-4.2 screen-4.2-irix > screen-irix.patch
Please clean the patch up before submission. Make sure that it only contains relevant patching files, and that other than the code patches the directories are identical.
== Packaging using genidb ==
This is a new method of packaging developed by Raion at IRIXNet using a [https://codeberg.org/IRIXNet-Development/genidb tool] developed by Easymode.
Install the application to /usr/neko_staging by running:
% gmake clean
% ./configure --prefix=/usr/neko_staging --libdir=/usr/neko_staging/lib32 --mandir=/usr/neko_staging/share/man [Other flags necessary]
% gmake -j[ncpu+1]
% gmake -n install
Before proceeding, make sure there's no hard coded paths for /usr or anything. Correct any path issues in the makefile, then install for real:
% gmake install
=== Building a spec file ===
A spec file maps out the subsystems used by inst to install the system. An example, using SDL 2, is below:
product neko_sdl2
    id "sdl2"
    image eoe
        id "sdl2 binaries"
        version 100
        order 9999
        subsys base default
            id "sdl2 binaries"
            replaces self
            exp neko_sdl2.eoe.base
        endsubsys
    endimage
    image lib
        id "sdl2 libs"
        version 100
        order 9999
        subsys base default
            id "sdl2 libs"
            replaces self
            exp neko_sdl2.lib.base
        endsubsys
    endimage
    image include
        id "sdl2 includes"
        version 100
        order 9999
        subsys base default
            id "sdl2 includes"
            replaces self
            exp neko_sdl2.include.base
        endsubsys
    endimage
    image man
        id "sdl2 manpages"
        version 100
        order 9999
        subsys manpages default
            id "sdl2 manpages"
            replaces self
            exp neko_sdl2.man.manpages
        endsubsys
    endimage
    image opt
        id "optional"
        version 1
        order 9999
        subsys patch
            id "software patch"
            replaces self
            exp neko_sdl2.opt.patch
        endsubsys
        subsys relnotes
            id "release notes"
            replaces self
            exp neko_sdl2.opt.relnotes
        endsubsys
        subsys dist
            id "distribution files"
            replaces self
            exp neko_sdl2.opt.dist
        endsubsys
    endimage
endproduct
Each image contains say, the binaries, the libraries, the headers (includes), release notes etc. Change the product, images and ids. Delete an image if lacked, paying attention to the indents and whitespaces. Do not use hyphens, for spacing for product names it must be underscores.
Use genidb as shown below to set it up:
% genidb -s /usr/neko_staging/dist/neko_yourspecfile.spec -p /usr/neko_staging
It should, assuming standard paths and file extensions, catch most things. Check the rejection file and add those to the neko_yourspecfile.idb manually.
Sort the idb file with <code>sort +4u -6 <</code><code>neko_yourspecfile.idb > idb</code>
=== Adding Dependencies ===
To properly manage dependencies, they must be listed in the specfile, like this:
    image eoe
        id "sdl2 binaries"
        version 100
        order 9999
        subsys base default
            id "sdl2 binaries"
            replaces self
            prereq (
            neko_fooware.lib.base 100 maxint
            neko_baz.include.base 100 maxint
            )
            exp neko_sdl2.eoe.base
        endsubsys
    endimage
The subsystem in full is enumerated, then the package (not software) version, by default 100 is used for nekoware currently, then maxint to ensure later versions are accepted.
If any of this is unclear, we also support simply submitting patches and having someone else do this.
== Release Notes ==
Currently there's no standard for release notes. Use existing packages release notes and formatting as a guideline.
== Further Information ==
At the moment, refer to the nekoware forums on IRIXNet.
[[Category:Tutorials]]
[[Category:Tutorials]]
[[Category:Nekoware]]
[[Category:Nekoware]]

Latest revision as of 17:13, 9 October 2025

This article provides a basic introduction to packaging software for distribution through the Nekoware software archive. Nekoware's standards are reflected in the way we wrote this article.

Required Equipment

Compilers

For C-based, normal everyday programs we highly recommend using MIPSPro for compilation. If using C++, the type of C++ and complexity of the program will determine if fixing it for MIPSPro outweighs the work necessary to compiler.

We support using GCC as well for building, with a few major caveats. C++ on GCC is incompatible with IRIX C++ libraries (libfam, libVk etc.). It also can cause issues with some C-based programs and libraries. In terms of performance, MIPSPro has been shown to consistently compile faster, and when micro-optimizations observed, it can build a program 15-20% faster. gdb is fundamentally broken on IRIX, unable to debug threads and having glitchy stack traces and other issues. GCC-built programs do not support the dbx debugger. In many cases, if a program is GCC-only and cannot be built with MIPSPro, a debugger won't work, and the porter will need to leverage debug macros and other alternative means.

Make, CMake etc.

Nekoware packages CMake 3.5 as of this writing, but CMake programs will require some hacks to work around and use MIPSPro. Try to use software with autotools.

For make, just use GNU Make. It's the best of the makes out there with the widest compatibility, the only time bmake may be necessary is on BSD-derived software.

Other tools

We mandate using pkgconf from nekoware instead of pkg-config. This is because pkg-config is a glib-dependent, obsolete piece of software.

We recommend either using neweoe diff (with command diff -urw) or GNU diff (diff -Naur) to build diffs.

Platform

IRIX 6.5.21 or higher is necessary due to certain C99 functions not being present on prior IRIX releases. It still may be possible to build and run IRIX software on a prior version, but bug reports will not be accepted.

Build Environment

This is the recommended build environment for MIPSPro:

CC=c99

CXX=CC

CFLAGS='-O2 -mips4 -TARG:proc=r10000'

CXXFLAGS='-O2 -mips4 -TARG:proc=r10000'

CPPFLAGS='-I/usr/nekoware/include -I/usr/include'

LDFLAGS='-L/usr/nekoware/lib32 -L/usr/lib32 -Wl,-rpath -Wl,/usr/nekoware/lib32'

PKG_CONFIG='/usr/nekoware/bin/pkgconf'

PKG_CONFIG_PATH='/usr/nekoware/lib32/pkgconfig'

ACLOCAL_PATH='/usr/nekoware/share/aclocal'

All Nekoware is installed relative to /usr/nekoware and should be built and linked against the libraries there.

For a bash or ksh shell, use export. Note for our purposes, we expect/use tcsh, as that's the primary IRIX interactive shell. For tcsh, setenv with a space instead of an equal sign works.

Library Directory: /usr/nekoware/lib32 (n32) or /usr/nekoware/lib64 (n64)

Man Directory: /usr/nekoware/share/man

Initscripts: /usr/nekoware/share/{progname]/init.d

Building with GCC

Do not use SGUG GCC 9 or didbs GCC versions for building. Use the GCC 6 located here: https://contrib.irixnet.org/raion/tardists/

The reason is that SGUG's GCC will link against libgcc.so in their directory. This is an unacceptable and will break the program on other installs.

Any GCC applications will require installing GCC for proper building if they link against a dynamic libgcc.so. Be aware.

Set up application for patching

Always prepare for patching.

% cp -rpf screen-4.2 screen-4.2-irix

Use the -irix directory for modifications, keeping the original pristine.

Building with autotools

A general procedure to configure, build and install is as follows:

% ./configure --prefix=/usr/nekoware --libdir=/usr/nekoware/lib32 --mandir=/usr/nekoware/share/man

This command will allow configure to run. If there's errors, run:

% ./configure --help

And verify if it's looking for certain libraries. For instance, with building atk, Raion used this build command:

% ./configure --prefix=/usr/nekoware --libdir=/usr/nekoware/lib32 CPPFLAGS="$CPPFLAGS -DG_CONST_RETURN=const"

Due to use of an old macro. Or this command for moc:

% ./configure --prefix=/usr/nekoware --libdir=/usr/nekoware/lib32 --with-ncurses
 --with-libiconv-prefix=/usr/nekoware CURSES_CFLAGS=-I/usr/nekoware/include/ncursesw LDFLAGS="$LDFLAGS -lxg -liconv"

Parallel make

Rather than running make, it's easier and faster to use parallel make:

% gmake -j3

This will run 3 workers for gmake, sufficient for a dual CPU system.

Patching Applications

If the program requires patching, patch the code run gmake clean, then using neweoe diff:

% diff -urw screen-4.2 screen-4.2-irix > screen-irix.patch

Or GNU diff:

% diff -Naur screen-4.2 screen-4.2-irix > screen-irix.patch

Please clean the patch up before submission. Make sure that it only contains relevant patching files, and that other than the code patches the directories are identical.

Packaging using genidb

This is a new method of packaging developed by Raion at IRIXNet using a tool developed by Easymode.

Install the application to /usr/neko_staging by running:

% gmake clean
% ./configure --prefix=/usr/neko_staging --libdir=/usr/neko_staging/lib32 --mandir=/usr/neko_staging/share/man [Other flags necessary]
% gmake -j[ncpu+1]
% gmake -n install

Before proceeding, make sure there's no hard coded paths for /usr or anything. Correct any path issues in the makefile, then install for real:

% gmake install

Building a spec file

A spec file maps out the subsystems used by inst to install the system. An example, using SDL 2, is below:

product neko_sdl2
    id "sdl2"
    image eoe
        id "sdl2 binaries"
        version 100
        order 9999
        subsys base default
            id "sdl2 binaries"
            replaces self
            exp neko_sdl2.eoe.base
        endsubsys
    endimage
    image lib
        id "sdl2 libs"
        version 100
        order 9999
        subsys base default
            id "sdl2 libs"
            replaces self
            exp neko_sdl2.lib.base
        endsubsys
    endimage
    image include
        id "sdl2 includes"
        version 100
        order 9999
        subsys base default
            id "sdl2 includes"
            replaces self
            exp neko_sdl2.include.base
        endsubsys
    endimage
    image man
        id "sdl2 manpages"
        version 100
        order 9999
        subsys manpages default
            id "sdl2 manpages"
            replaces self
            exp neko_sdl2.man.manpages
        endsubsys
    endimage
    image opt
        id "optional"
        version 1
        order 9999
        subsys patch
            id "software patch"
            replaces self
            exp neko_sdl2.opt.patch
        endsubsys
        subsys relnotes
            id "release notes"
            replaces self
            exp neko_sdl2.opt.relnotes
        endsubsys
        subsys dist
            id "distribution files"
            replaces self
            exp neko_sdl2.opt.dist
        endsubsys
    endimage
endproduct

Each image contains say, the binaries, the libraries, the headers (includes), release notes etc. Change the product, images and ids. Delete an image if lacked, paying attention to the indents and whitespaces. Do not use hyphens, for spacing for product names it must be underscores.

Use genidb as shown below to set it up:

% genidb -s /usr/neko_staging/dist/neko_yourspecfile.spec -p /usr/neko_staging

It should, assuming standard paths and file extensions, catch most things. Check the rejection file and add those to the neko_yourspecfile.idb manually.

Sort the idb file with sort +4u -6 <neko_yourspecfile.idb > idb

Adding Dependencies

To properly manage dependencies, they must be listed in the specfile, like this:

    image eoe
        id "sdl2 binaries"
        version 100
        order 9999
        subsys base default
            id "sdl2 binaries"
            replaces self
            prereq (
            neko_fooware.lib.base 100 maxint
            neko_baz.include.base 100 maxint
            )
            exp neko_sdl2.eoe.base
        endsubsys
    endimage

The subsystem in full is enumerated, then the package (not software) version, by default 100 is used for nekoware currently, then maxint to ensure later versions are accepted.

If any of this is unclear, we also support simply submitting patches and having someone else do this.

Release Notes

Currently there's no standard for release notes. Use existing packages release notes and formatting as a guideline.

Further Information

At the moment, refer to the nekoware forums on IRIXNet.