First up, my mk.conf. I have this in /usr/bsd/etc/, and a symlink pointing here in /etc.

These settings configure pkgsrc to exist in /usr/bsd/src, owned by netbsd:netbsd. Running pkgsrc as a non-root user is a great idea when used as a secondary package manager, to ensure that no OS files can be overwritten - although pkgsrc is actually very good at ensuring that this doesn't happen.

(I also changed the permissions on /usr/bsd to netbsd:sys, so that the necessary top-level directories can be created)

Next up, create a "netbsd" user and group. I set the user's home to /usr/bsd/src (e.g. the pkgsrc root directory) with bash (3.1, compiled from source manually with GCC to ensure that it's not broken) as the defautl shell.

In their home directory, this user then has the following .bashrc (and a corresponding .bash_profile entry to source it):

Some problems still remain which I've not been able to fix yet... there's a cosmetic issue where builds will output something along the lines of "work/.buildlink/wrapper/bin/cc[50]: Not found" a number of times, but this to be caused by a malformed logging statement in one of the pkgsrc .mk files, and doesn't look like anything serious.

More problematic is that meta-packages (which only pull in other real packages) don't work - they will always mis-detect that the first package they depend on is not present (even if it is), and will then rebuild it - but complain when it gets to the installation stage that the package is already present. This happens even if the dependant package is first uninstalled. This can also be worked around by simple installing the constituent packages and ignoring the meta-package, but this is messy.

Last edited by stuart on Thu Aug 31, 2006 7:48 am, edited 1 time in total.

The are many packages which don't compile by default with MIPSpro on IRIX, many of which require only changes to the pkgsrc Makefile. This is especially true when building with the "-apo" Auto-parallelisation option, which causes binaries to addiitonally require being linked to libmp.so. This is often solved by adding:

A final note on APO - there are some things it just can't handle. If the build process faults with a segfault followed by an internal compiler error, then running the most recent invocation of $CC/$CXX again without APO, and it will succeed and the build can continue from where it left off - ghostscript-gnu is a good example of this. gtk2, on the other hand, will generate these faults for every object in the gdk subdirectory... in this case, removing all instances of "-apo" from the Makefile is much easier.

So far, I've found the following packages which won't build on IRIX/MIPSpro without source code changes:

... and note that any version of bash3 built on MIPSpro will not work correctly - there's something in there which only likes GCC (the build will complete and bash will run, but some syntax will not be parsed correctly. For example, "echo $(( 3 + 4 ))" should output "7", not "4: command not found".

devel/gettext and devel/gettext-tools include a horrible macro which is GNU-specific, and then even more fragile tests to try to determine if you're using a compiler which doesn't like this (which seems, frankly, to be most of them - including Apple's GCC!)

I've tried to get this fixed, but the MIPSpro fix applied in-tree doesn't actually solve the problem (although possibly due to miscommunication on my part...)

The necessary patch to be applied after invoking "bmake patch" in the devel/gettext and devel/gettext-tools directories are:

/* Contains information about the definition of one translation. */ struct msgstr_def

devel/gettext-asprintf also fails to build: The configure script strips "-LANG:exceptions=OFF:libc_in_namespace_std=OFF" from the supplied CXXFLAGS, the lack of which in turn prevents C++ code from seeing stdarg.h's va_list definition.

During the build process, a file named "fcaliastail.h" is generated... which by default contains one "#if" directive and 181 "#endif"s. For obvious reasons, the MIPSpro preprocessor barfs at this. All except the last of these "#endif"s need removing - it's probably best to use sed or awk.