Difference between revisions of "Pkgsrc on IRIX"

From WTFwiki
Jump to navigation Jump to search
(→‎lang/python24: How to make it build on n32)
m (86 revisions)
 
(56 intermediate revisions by one other user not shown)
Line 42: Line 42:
  
 
Add /usr/freeware/bin to your $PATH.
 
Add /usr/freeware/bin to your $PATH.
 +
 +
Configure /etc/compiler.defaults:
 +
  -DEFAULT:abi=n32:isa=mips4:proc=r12k
  
 
Patch your spec file if you want to default gcc to 64 bit mips4 mode [http://www.netbsd.org/~jschauma/ as noted here] or download a [http://eagle.bsd.st/~andrew/irix-64-mips4-gcc-specs pre-patched spec]. I had to patch on a freebsd box because IRIX' patch didn't like the diff.
 
Patch your spec file if you want to default gcc to 64 bit mips4 mode [http://www.netbsd.org/~jschauma/ as noted here] or download a [http://eagle.bsd.st/~andrew/irix-64-mips4-gcc-specs pre-patched spec]. I had to patch on a freebsd box because IRIX' patch didn't like the diff.
Line 52: Line 55:
  
 
== Build problems ==
 
== Build problems ==
=== Building gcc from pkgsrc ===
+
=== devel/libtool ===
 +
''' READ THIS'''
  
I currently don't know how to do this. The SGI freeware gcc binary seems to be working fine.
+
Libtool seems very prone to configuring itself incorrectly on IRIX. It has an issue with an incorrect global_symbol_pipe and it also has a problem with linking C++ shared libraries. Somehow, I've got it doing both correctly now, but I'm unsure of what is critical to change (I suspect removing the system sed from the $PATH is at least one of the 'fixes').
  
 
=== lang/perl5 ===
 
=== lang/perl5 ===
Line 60: Line 64:
 
Configure fails with invalid option -64 or some such nonsense, edit the pkgsrc Makefile and remove it.
 
Configure fails with invalid option -64 or some such nonsense, edit the pkgsrc Makefile and remove it.
  
In 32 bit mode, perl is a royal bitch. It's absolutely convinced that you want to build it in 64 bit mode on IRIX64. you have to edit the hints/irix_6 file to tell it not to do the -mabi=64 crap. Also, you need to add -lpthreads to libs in the toplevel Makefile. This was a major pain, might post detailed changes if I can ever be bothered to do it again...
+
In 32 bit mode, perl is a royal bitch. It's absolutely convinced that you want to build it in 64 bit mode on IRIX64. you have to edit the hints/irix_6 file to tell it not to do the -mabi=64 crap. Also, you need to add -lpthreads to `libs` in the toplevel Makefile. This was a major pain, might post detailed changes if I can ever be bothered to do it again...
 +
 
 +
'''Update''': ensure you remove -64 and replace -L/usr/lib64 with -L/usr/lib32 in the hints file. Also in the pkgsrc makefile, where it checks the IRIX ABI, set the compiler for 32 bit mode to be passed -mabi=n32 instead of -n32. You might also have to add :/usr/pkgsrc/lang/perl5/work/perl-5.8.X to the LD_LIBRARYN32_PATH.
  
 
=== fonts/fontconfig ===
 
=== fonts/fontconfig ===
Line 86: Line 92:
 
=== lang/ruby ===
 
=== lang/ruby ===
  
When you run ruby it complains about not being able to map the soname for libruby. The solution is:
+
For 32 bit mode, ensure that -n32 is in LDFLAGS and LDSHARED in the Makefile.
  
  export LD_LIBRARY64_PATH=/usr/pkg/lib
+
Additionally, you need to ensure that socket.c includes xti.h. This should be done by getting configure to set HAVE_XTI_H by adding xti.h to the 'for ac_header in ..' loop in configure and then checking for that ifdef in socket.c. If you don't do this not all of the socket parameters will be defined right.
  
A more general solution might be around, haven't done the research yet.
+
Also: install devel/byacc and set
  
For 32 bit mode, ensure that -n32 is in LDFLAGS and LDSHARED in the Makefile.
+
  TOOLS_PLATFORM.yacc?=      /usr/pkg/bin/yacc
  
=== graphics/tiff ===
+
in /usr/pkg/etc/mk.conf to avoid using the ancient IRIX yacc/bison.
  
This fails with "invalid preprocessor flag "-c"' or something. IRIX apparently comes with tiff of some sort, so make it a builtin:
+
See also my [http://rubyforge.org/tracker/index.php?func=detail&aid=14525&group_id=426&atid=1698 Bug report and patch for <xti.h>]
  
  BUILTIN_PKG.tiff=       tiff-3.8
+
=== graphics/tiff ===
  USE_BUILTIN.tiff=       YES
 
  
'''NOTE''' this only works for when you're using the 32 bit ABI, there's no 64 bit tiff library...
+
This actually builds fine after you have a working libtool.
  
 
=== textproc/groff ===
 
=== textproc/groff ===
Line 114: Line 119:
  
 
bmake clean and try to build it again.
 
bmake clean and try to build it again.
 +
 +
After this, groff doesn't even work right, eqn is missing /usr/pub/eqnchar (not sure why it's looking there) and groff is missing tmac.an. I sorta "fixed" this by stealing the eqnchar file from the netbsd install on my alpha and by doing the following symlinks:
 +
  ln -sf /usr/pkg/share/groff/1.19.2/tmac /usr/lib/tmac
 +
  ln -sf /usr/lib/tmac/an.tmac /usr/lib/tmac/tmac.an
 +
 +
No idea what the proper fix is, I assume there's some IRIX config file that's wrong or something...
  
 
=== devel/ncurses ===
 
=== devel/ncurses ===
  
This failed for me by complaining about a missing libncurses++.so when linking the demos. This apparently is a libtool issue, but it's way too complex for me to debug. I built it manually with --prefix=/usr/pkg and made it a builtin in mk.conf and things seemed to go well...
+
Builds fine with a valid libtool.
 
 
See also: [http://mail-index.netbsd.org/pkgsrc-users/2006/10/06/0015.html a netbsd-bugs report] and [http://mail-index.netbsd.org/pkgsrc-bugs/2006/12/15/0004.html a reported fix that doesn't work for me]
 
  
 
=== fonts/ttmkfdir2 ===
 
=== fonts/ttmkfdir2 ===
Line 131: Line 140:
 
=== devel/glib2 ===
 
=== devel/glib2 ===
  
Fails with "/usr/pkg/bin/libtool[4381]: syntax error at line 1 : `|' unexpected". I think this is caused by there being '| |' in the command line generated by libtool. Apparently some command is being omitted, but I don't know what or why...
+
Make sure you build this with -lpthread or GTK2 will fail its configure test.
  
Make sure you build this with -lpthread or GTK2 will fail its configure test.
+
  CONFIGURE_ARGS+=    LIBS="-lintl -lpthread"
 +
 
 +
For some reason, the pkgsrc maintainer disable thread support in the Makefile, this makes glib pretty much worthless, so disable the if ${OPSYS} == IRIX nonsense at the bottom of the file relating to threads.
 +
 
 +
If you have problems building the gobject subfolder, remove the libtool wrapper in the work/glib* directory and replace it with a symlink to the real pkgsrc libtool.
 +
 
 +
Also: http://mail-index.netbsd.org/pkgsrc-bugs/2007/11/01/0007.html
  
 
=== lang/python24 ===
 
=== lang/python24 ===
Line 145: Line 160:
 
=== lang/erlang ===
 
=== lang/erlang ===
  
The build will fail with an undeclared shiftleft in os_mon. Use the patch from [http://osdir.com/ml/lang.erlang.patches/2006-08/msg00002.html here] (you may have to remove the DOS style newlines...)
+
The build will fail with an undeclared shiftleft in os_mon. Use the patch from [http://osdir.com/ml/lang.erlang.patches/2006-08/msg00002.html here] (you may have to remove the DOS style newlines...) [this doesn't seem to be an issue as of erlang-11.5nb1]
  
 
The install will fail because IRIX' `chmod` doesn't support the -f parameter. Run `grep chmod **/Makefile*` to find the affected makefiles and remove the use of -f
 
The install will fail because IRIX' `chmod` doesn't support the -f parameter. Run `grep chmod **/Makefile*` to find the affected makefiles and remove the use of -f
 +
 +
OR
 +
 +
  find . -name Makefile -exec perl -pi -e 's/chmod -f/chmod/g' {} \;
  
 
=== wip/esdl ===
 
=== wip/esdl ===
Line 170: Line 189:
 
   CONFIGURE_ARGS+= --enable-ao
 
   CONFIGURE_ARGS+= --enable-ao
  
You MUST build as root, or the configure script will bitch about mapping sonames. sudo isn't good enough in this case for some reason...
+
You can find an init script [http://eagle.bsd.st/~andrew/IRIX/init-scripts/ Here].
  
 
=== audio/flac ===
 
=== audio/flac ===
  
Fails to build libFlac++.so.7.0 for some reason. I think this is related to the ncurses problem. I just edited the FLAC++ stuff out of the Makefile and did a bmake install clean. Very bad, but I needed it built.
+
  perl -pi -e 's/SIZE_T_MAX/UINT_MAX/g' **/*.[ch]
  
 
=== audio/libsndfile ===
 
=== audio/libsndfile ===
  
 
CFLAGS incorrectly include -pipe in the makefiles. Fix this somehow and it'll build.
 
CFLAGS incorrectly include -pipe in the makefiles. Fix this somehow and it'll build.
 
+
perl -pi -e 's/-pipe//' **/Makefile
  perl -pi -e 's/-pipe//' **/Makefile
+
If you get a nonsense error like:
 +
undefined macro: _m4_divert_diversion
 +
do a
 +
find . | xargs touch
 +
to reset timestamps on all the files in the work directory. If it complains about linux and soundcard.h, cd into the work directory and run bmake manually (you might then get the above m4 error).
  
 
=== graphics/glitz ===
 
=== graphics/glitz ===
Line 203: Line 226:
 
* Ensure /usr/pkg/bin/install-sh is being used for INSTALL
 
* Ensure /usr/pkg/bin/install-sh is being used for INSTALL
 
* Add -laudio -lpthread to DLL_LIBS
 
* Add -laudio -lpthread to DLL_LIBS
* Remove --version-info from the link command
+
* Set OTHER_OBJS = pa_sgi/pthread-pa_sgi.o
* Add ${SHARED_FLAGS} to the link command
+
 
 +
'''ENSURE YOUR LIBTOOL IS WORKING CORRECTLY'''
  
 
=== lang/gcc34 ===
 
=== lang/gcc34 ===
  
This is a big one. You need to fix several getopt.h problems, you need to edit the spec file in work/obj/gcc to remove the space after the -R several times(it comes back again and again). You need to edit the Makefile in work/obj/mips-sgi-irix6.5/libstdc++-v3 and work/obj/mips-sgi-irix6.5/libobjc and comment out the MULTIDIRS line. I have obtained a working gcc 3.4 compiler using this method with SGI's freeware gcc 3.3 compiler as the host.
+
This is a big one. You need to fix several getopt.h problems, you need to edit the spec file in work/obj/gcc to remove the space after the -R several times(it comes back again and again). You need to edit the Makefile in work/obj/mips-sgi-irix6.5/libstdc++-v3 and work/obj/mips-sgi-irix6.5/libobjc and comment out the MULTIDIRS line.
 +
 
 +
If you have compile errors related to ATTRIBUTE_NONNULL, make sure you don't have an ansidecl.h in your include path. If you do, rename it to something else and try again.
 +
 
 +
Also, pkgsrc's complier/gcc.mk assumes that if you're using gcc you're using the GNU linker, which on IRIX (unless you're using gcc4) is wrong. You'll probably want to add something like this to the file:
 +
 
 +
.if ${OPSYS} == "IRIX"
 +
# IRIX linker option used to set the rpath
 +
_LINKER_RPATH_FLAG= -rpath
 +
.else
 +
# GNU ld option used to set the rpath
 +
_LINKER_RPATH_FLAG= -R
 +
.endif
 +
 
 +
This *should* fix the proble with the spec file noted above.
 +
 
 +
Also, set USE_TOOLS+= perl in the pkgsrc Makefile.
 +
 
 +
I have obtained a working gcc 3.4 compiler using this method with SGI's freeware gcc 3.3 compiler as the host as well as upgrading gcc 3.4 using the gcc previously built from pkgsrc.
 +
 
 +
If you're doing a bmake replace (or something of that nature, you might have problems with libgcc_s.so.1 not being found when it tries to install. Temporarily add '/usr/pkgsrc/lang/gcc34/work/obj/gcc' to your LD_LIBRARYN32_PATH to get around this.
  
 
=== graphics/blender ===
 
=== graphics/blender ===
Line 214: Line 258:
 
'''NOTE''': I haven't got blender to build within the pkgsrc framework yet, but I can get it to (mostly?)build using all the dependencies installed from pkgsrc.
 
'''NOTE''': I haven't got blender to build within the pkgsrc framework yet, but I can get it to (mostly?)build using all the dependencies installed from pkgsrc.
  
* install lang/gcc34 '''YOU CANNOT USE 3.3!'''
+
Here's a [http://eagle.bsd.st/~andrew/IRIX/blender.diff patch] against 2.45. I had to mess with the library search paths to make it link against the pkgsrc libjpeg, but it seems to work fine now.
* Install all the blender deps in pkgsrc
 
* untar the blender source somewhere
 
* patch the SConstruct file (see [http://eagle.bsd.st/~andrew/IRIX/blender.diff My patch])
 
* run scons but kill it after it generates the config.opts file
 
* edit config.opts to use g++ as the CXX compiler (I can't get it to honor $CXX..?)
 
* remove references to start_movie and friends from <FILEICANTREMEMBERTHENAMEOF>
 
  
 +
=== www/firefox ===
  
=== www/firefox ===
+
Fails to build. I can get it to compile but I'm left with some unresolved C++ symbols. Here's some notes on getting that far:
  
 
Make sure your CFLAGS include '-DIP30 -DR10000'. Additionally, ld was missing the -n32 argument (it doesn't honor LDFLAGS). I wasn't clear how to fix this correctly, so I just did it by hand... There's also a missing -lpthread and a place where you need to change '-Wp,-traditional' to just '-traditional' when it's compiling some assembly. ugh
 
Make sure your CFLAGS include '-DIP30 -DR10000'. Additionally, ld was missing the -n32 argument (it doesn't honor LDFLAGS). I wasn't clear how to fix this correctly, so I just did it by hand... There's also a missing -lpthread and a place where you need to change '-Wp,-traditional' to just '-traditional' when it's compiling some assembly. ugh
  
Also, SGIs linker hates you and you have to do `export LD_LIBRARYN32_PATH=$LD_LIBRARYN32_PATH:/usr/pkgsrc/www/firefox/work/mozilla/dist/lib` so that it can find libssl3 when it's generating a key or something.
+
Also, SGIs linker hates you and you have to do  
 +
  export LD_LIBRARYN32_PATH=$LD_LIBRARYN32_PATH:/usr/pkgsrc/www/firefox/work/mozilla/dist/lib
 +
so that it can find libssl3 when it's generating a key or something.
 +
 
 +
=== security/sudo ===
 +
 
 +
Add c++ to USE_LANGUAGES in the pkgsrc Makefile.
 +
 
 +
=== fonts/Xft2 ===
 +
 
 +
Add c++ to USE_LANGUAGES in the pkgsrc Makefile.
 +
 
 +
=== mail/postfix ===
 +
 
 +
Add -ldb to AUXLIBS in the pkgsrc Makefile.
 +
 
 +
To enable logging add the following to /etc/syslog.conf and kill -HUP the syslog process:
 +
 
 +
  # mail logging
 +
  mail.info  /var/adm/maillog
 +
 
 +
Ensure that the whitespace between the facilty and the logfile is a tab, NOT a space!
 +
 
 +
Also, ensure that alias_maps and alias_database are set to hash:/etc/mail/aliases in main.cf.
 +
 
 +
You can find an init script [http://eagle.bsd.st/~andrew/IRIX/init-scripts/ Here].
 +
 
 +
=== x11/wxGTK ===
 +
 
 +
Builds fine with a valid libtool.
 +
 
 +
To install it correctly, remove the loop from the Makefile that loops over WX_LINGUAS.
 +
 
 +
=== audio/audacity ===
 +
 
 +
This port has quite a few problems. You need to disable nyquist and portmixer, you need to add the following to AudioIO.cpp:
 +
 
 +
#ifdef __sgi
 +
#include <alloca.h>
 +
#endif
 +
 
 +
Also, the configuration of the included libs doesn't work right, it passes -Wl,-R directives to the linker which makes it fail. I don't know how to fix this directly, so I just edited the configuration parameters and ran it manually. You also need to add -laudio to the LIBS in the work/audacity/src/Makefile to deal with unresolved symbols. If you built the pthread version of SGI portaudio, you need to add -lpthreads too.
 +
 
 +
If the linker segfaults when building soundtouch examples, just disable that example directory in the soundtouch Makefile.
 +
 
 +
=== multimedia/mplayer ===
 +
Has problems with PRI defines. IRIX lacks these so we need to define them ourselves...
 +
 
 +
After you've configured the source, edit config.h and add the following just before the final #endif:
 +
 
 +
#if !defined PRId64 || PRI_MACROS_BROKEN
 +
# undef PRId64
 +
# ifdef _ABI64
 +
#  define PRId64 "ld"
 +
# else
 +
#  define PRId64 "lld"
 +
# endif
 +
#endif<br/>
 +
#if !defined PRIu64 || PRI_MACROS_BROKEN
 +
# undef PRIu64
 +
# ifdef _ABI64
 +
#  define PRIu64 "lu"
 +
# else
 +
#  define PRIu64 "llu"
 +
# endif
 +
#endif<br/>
 +
#if !defined PRIx64 || PRI_MACROS_BROKEN
 +
# undef PRIx64
 +
# ifdef _ABI64
 +
#  define PRIx64 "lx"
 +
# else
 +
#  define PRIx64 "llx"
 +
# endif
 +
#endif<br/>
 +
#if !defined PRIX64 || PRI_MACROS_BROKEN
 +
# undef PRIX64
 +
# ifdef _ABI64
 +
#  define PRIX64 "lX"
 +
# else
 +
#  define PRIX64 "llX"
 +
# endif
 +
#endif<br/>
 +
/* Limit of `size_t' type.  */
 +
#if !defined SIZE_MAX
 +
# ifdef _ABI64
 +
#  define SIZE_MAX      (18446744073709551615UL)
 +
# else
 +
#  define SIZE_MAX      (4294967295U)
 +
# endif
 +
#endif
 +
 
 +
Also, run the following:
 +
 
 +
ln -sf /usr/include/inttypes.h work/.buildlink/include/stdint.h
 +
 
 +
That'll take care of any #includes for stdint.h (which IRIX lacks).
 +
 
 +
=== audio/speex ===
 +
 
 +
Add USE_LANGUAGES+= c++ to the Makefile.
 +
More of the finding the wrong getopt.h header. Fix as mentioned below.
 +
 
 +
=== audio/vorbis-tools ===
 +
 
 +
Add USE_LANGUAGES+= c++ to the Makefile.
 +
 
 +
  find . -name "*.[ch]" -exec perl -pi -e 's/#include [<"]getopt.h[>"]/#include "\/usr\/include\/getopt.h"/g' {} \;
 +
 
 +
=== print/ghostscript ===
 +
 
 +
Incorrectly tries to use mkstemp64 because it detects a 64 bit platform. Edit src/gp_unifs.c and add && !defined(__sgi) to the line that checks for HAVE_FILE64. The configure script could probably be patched to make this more correct. Additionally, add -liconv to EXTRALIBS in the Makefile.
 +
 
 +
find . -name "*.[ch]" -exec perl -pi -e 's/int_fast/int/g' {} \;
 +
find . -name "*.[ch]" -exec perl -pi -e 's/INT_FAST/INT/g' {} \;
 +
 
 +
(giant hack, I know).
 +
 
 +
=== graphics/gimp ===
 +
 
 +
Make sure you're compiling gimp 2.4 and set
 +
 
 +
  PKG_OPTIONS.gimp=  -gnome -mng -svg
 +
 
 +
in your mk.conf. If the build fails with something involving 'gimpstock' cd into work/gimp*, run
 +
 
 +
  make -C themes clean
 +
 
 +
and restart the build. The cause of this failure is unclear. You might also get a redecleration of attr_t in plug-ins/flame/rect.c. I just commented out the one in that file and it continued building. I'm not sure if this is valid or not.
 +
 
 +
=== devel/bmake ===
 +
 
 +
Only a problem as of 2008Q1, older releases worked fine.
 +
 
 +
Hangs while running testcases. Not sure why yet but [http://mail-index.netbsd.org/pkgsrc-bugs/2008/04/17/msg002090.html this dude has the same issue] when using MIPSPro. Looking into it.
 +
 
 +
=== shells/zsh ===
 +
 
 +
May have to add -liconv to LIBS in the work/zsh Makefile.
 +
 
 +
=== graphics/jasper ===
 +
If it fails to build and bitches about int_fast32_t, make sure you don't have typesize.h symlinked to stdint.h in /usr/include.
  
 
== Useful links ==
 
== Useful links ==

Latest revision as of 21:47, 4 January 2013

Introduction

SGI no longer packages 'freeware' for IRIX, as it was discontinued in 2006. Nekoware aims to be a community-driven replacement but I've found many packages to be compiled with far too many dependancies (vim needing GTK, etc) and not everything I want is available. Therefore, much like my experience with Opensolaris, I turned to pkgsrc...

Build machine

Here's the `hinv` output:

 2 300 MHZ IP30 Processors
 CPU: MIPS R12000 Processor Chip Revision: 2.3
 FPU: MIPS R12010 Floating Point Chip Revision: 0.0
 Main memory size: 2048 Mbytes
 Xbow ASIC: Revision 1.3
 Instruction cache size: 32 Kbytes
 Data cache size: 32 Kbytes
 Secondary unified instruction/data cache size: 2 Mbytes
 Integral SCSI controller 0: Version QL1040B (rev. 2), single ended
   Disk drive: unit 1 on SCSI controller 0
 Integral SCSI controller 1: Version QL1040B (rev. 2), single ended
   CDROM: unit 6 on SCSI controller 1
 IOC3/IOC4 serial port: tty1
 IOC3/IOC4 serial port: tty2
 IOC3 parallel port: plp1
 Graphics board: ESI with texture option
 Graphics board: ESI
 Integral Fast Ethernet: ef0, version 1, pci 2
 Iris Audio Processor: version RAD revision 12.0, number 1
 uname -a => IRIX64 IRIS 6.5 01090133 IP30

The machine is running a fresh install of IRIX 6.5.29.

Bootstrapping pkgsrc using gcc

As of pkgsrc 2007q1 pkgsrc bootstraps out of the box, unlike some earlier versions that have problems with PRIu64.

Download the SGI freeware binary of gcc from SGI freeware and read the documentation.

Make sure you have compiler_dev.sw.base installed (notably c_dev and c++_dev). These can be found on your IRIX 6.5 developer foundation CD.

Install the gcc tardist using the `tardist` command as root.

Add /usr/freeware/bin to your $PATH.

Configure /etc/compiler.defaults:

 -DEFAULT:abi=n32:isa=mips4:proc=r12k

Patch your spec file if you want to default gcc to 64 bit mips4 mode as noted here or download a pre-patched spec. I had to patch on a freebsd box because IRIX' patch didn't like the diff.

Download pkgsrc 2007q1 or later from netbsd's ftp and untar it to /usr.

cd into /usr/pkgsrc/bootstrap, set CC=gcc and ./bootstrap

TO BE CONTINUED

Build problems

devel/libtool

READ THIS

Libtool seems very prone to configuring itself incorrectly on IRIX. It has an issue with an incorrect global_symbol_pipe and it also has a problem with linking C++ shared libraries. Somehow, I've got it doing both correctly now, but I'm unsure of what is critical to change (I suspect removing the system sed from the $PATH is at least one of the 'fixes').

lang/perl5

Configure fails with invalid option -64 or some such nonsense, edit the pkgsrc Makefile and remove it.

In 32 bit mode, perl is a royal bitch. It's absolutely convinced that you want to build it in 64 bit mode on IRIX64. you have to edit the hints/irix_6 file to tell it not to do the -mabi=64 crap. Also, you need to add -lpthreads to `libs` in the toplevel Makefile. This was a major pain, might post detailed changes if I can ever be bothered to do it again...

Update: ensure you remove -64 and replace -L/usr/lib64 with -L/usr/lib32 in the hints file. Also in the pkgsrc makefile, where it checks the IRIX ABI, set the compiler for 32 bit mode to be passed -mabi=n32 instead of -n32. You might also have to add :/usr/pkgsrc/lang/perl5/work/perl-5.8.X to the LD_LIBRARYN32_PATH.

fonts/fontconfig

Makes dumbass assumptions about the system. Here's a patch for pkgsrc's makefile to make it work:

 diff -r1.62 Makefile
 30a31
 > CONFIGURE_ARGS+=      --libdir=/usr/pkg/lib --includedir=/usr/pkg/include --with-arch=mips4
 32a34,35
 > LDFLAGS+=-L/usr/pkg/lib
 >

archivers/unzip

The compiler coredumps when building. To fix:

 bmake build (wait for it to segfault)
 cd work/unzip*
 vi Makefile (and remove the definition of LF2)
 gmake clean; gmake generic2 (generic doesn't work..?)
 cd ../../
 bmake install clean

lang/ruby

For 32 bit mode, ensure that -n32 is in LDFLAGS and LDSHARED in the Makefile.

Additionally, you need to ensure that socket.c includes xti.h. This should be done by getting configure to set HAVE_XTI_H by adding xti.h to the 'for ac_header in ..' loop in configure and then checking for that ifdef in socket.c. If you don't do this not all of the socket parameters will be defined right.

Also: install devel/byacc and set

 TOOLS_PLATFORM.yacc?=       /usr/pkg/bin/yacc

in /usr/pkg/etc/mk.conf to avoid using the ancient IRIX yacc/bison.

See also my Bug report and patch for <xti.h>

graphics/tiff

This actually builds fine after you have a working libtool.

textproc/groff

groff by default depends on netpbm which depends on tiff, which won't work on 64 bit systems, so disable that stuff:

 PKG_OPTIONS.groff=      -x11 -groff-docs

If groff complains about a broken C++ compiler:

CXX=                    /usr/freeware/bin/g++

bmake clean and try to build it again.

After this, groff doesn't even work right, eqn is missing /usr/pub/eqnchar (not sure why it's looking there) and groff is missing tmac.an. I sorta "fixed" this by stealing the eqnchar file from the netbsd install on my alpha and by doing the following symlinks:

 ln -sf /usr/pkg/share/groff/1.19.2/tmac /usr/lib/tmac
 ln -sf /usr/lib/tmac/an.tmac /usr/lib/tmac/tmac.an

No idea what the proper fix is, I assume there's some IRIX config file that's wrong or something...

devel/ncurses

Builds fine with a valid libtool.

fonts/ttmkfdir2

If it complains about 'optarg' being undeclared it seems to be caused by pkgsrc using the wrong getopt.h header. I manually edited commandline.cpp to have

 #include "/usr/include/getopt.h"

instead of

 #include <getopt.h>

and it seemed to fix it, changing the order of the -I parameters to gcc might do it too...

devel/glib2

Make sure you build this with -lpthread or GTK2 will fail its configure test.

 CONFIGURE_ARGS+=    LIBS="-lintl -lpthread"

For some reason, the pkgsrc maintainer disable thread support in the Makefile, this makes glib pretty much worthless, so disable the if ${OPSYS} == IRIX nonsense at the bottom of the file relating to threads.

If you have problems building the gobject subfolder, remove the libtool wrapper in the work/glib* directory and replace it with a symlink to the real pkgsrc libtool.

Also: http://mail-index.netbsd.org/pkgsrc-bugs/2007/11/01/0007.html

lang/python24

Dunno. Seems broken somehow, haven't figured it out yet.

Update: I did actually get this to build in 32 bit mode, but I forgot to document it and now I can't remember what I did... :(

Update2: Add -n32 to LDSHARED and BDSHARED in work/Python-2.X/Makefile to make it compile in 32 bit mode.

lang/erlang

The build will fail with an undeclared shiftleft in os_mon. Use the patch from here (you may have to remove the DOS style newlines...) [this doesn't seem to be an issue as of erlang-11.5nb1]

The install will fail because IRIX' `chmod` doesn't support the -f parameter. Run `grep chmod **/Makefile*` to find the affected makefiles and remove the use of -f

OR

 find . -name Makefile -exec perl -pi -e 's/chmod -f/chmod/g' {} \;

wip/esdl

To fix the undeclared declaration of 'refc' use the patch from here. If you're using 64 bit mode you need to edit c_src/Makefile and set GL_LIBS to use ${OGLDIR}/lib64.

devel/pcre

If this fails with the 'unexpected |' error, rebuild libtool-base. This probably will fix glib2 too...

multimedia/libmp4v2

Doesn't build, don't care to even investigate why.

audio/musicpd

Before you build libao ensure you've enabled IRIX support in the Makefile.common. Check if the irix plugin has been built by doing `ls /usr/pkg/lib/ao/plugins-2`

Add the following to the pkgsrc Makefile:

 LDFLAGS+= -lgen
 CONFIGURE_ARGS+= --enable-ao

You can find an init script Here.

audio/flac

 perl -pi -e 's/SIZE_T_MAX/UINT_MAX/g' **/*.[ch]

audio/libsndfile

CFLAGS incorrectly include -pipe in the makefiles. Fix this somehow and it'll build.

perl -pi -e 's/-pipe//' **/Makefile

If you get a nonsense error like:

undefined macro: _m4_divert_diversion

do a

find . | xargs touch

to reset timestamps on all the files in the work directory. If it complains about linux and soundcard.h, cd into the work directory and run bmake manually (you might then get the above m4 error).

graphics/glitz

Inappropiate #include <stdint.h>. I've modified one of the pkgsrc patches to take care of this:

Edit patches/patch-ab and change:

 #  if defined(__OpenBSD__)

to

 #  if defined(__OpenBSD__) || defined(sgi)

you'll have to regenerate the patch checksum too; remove the line for patch-ab from distinfo and do:

 digest sha1 patch-ab >> ../distinfo

to regenerate the checksum for patch-ab

audio/portaudio

This port is fucked. I got it to build though:

  • bmake configure
  • Edit the work/portaudio Makefile
  • Ensure /usr/pkg/bin/install-sh is being used for INSTALL
  • Add -laudio -lpthread to DLL_LIBS
  • Set OTHER_OBJS = pa_sgi/pthread-pa_sgi.o

ENSURE YOUR LIBTOOL IS WORKING CORRECTLY

lang/gcc34

This is a big one. You need to fix several getopt.h problems, you need to edit the spec file in work/obj/gcc to remove the space after the -R several times(it comes back again and again). You need to edit the Makefile in work/obj/mips-sgi-irix6.5/libstdc++-v3 and work/obj/mips-sgi-irix6.5/libobjc and comment out the MULTIDIRS line.

If you have compile errors related to ATTRIBUTE_NONNULL, make sure you don't have an ansidecl.h in your include path. If you do, rename it to something else and try again.

Also, pkgsrc's complier/gcc.mk assumes that if you're using gcc you're using the GNU linker, which on IRIX (unless you're using gcc4) is wrong. You'll probably want to add something like this to the file:

.if ${OPSYS} == "IRIX"
# IRIX linker option used to set the rpath
_LINKER_RPATH_FLAG= -rpath
.else
# GNU ld option used to set the rpath
_LINKER_RPATH_FLAG= -R
.endif

This *should* fix the proble with the spec file noted above.

Also, set USE_TOOLS+= perl in the pkgsrc Makefile.

I have obtained a working gcc 3.4 compiler using this method with SGI's freeware gcc 3.3 compiler as the host as well as upgrading gcc 3.4 using the gcc previously built from pkgsrc.

If you're doing a bmake replace (or something of that nature, you might have problems with libgcc_s.so.1 not being found when it tries to install. Temporarily add '/usr/pkgsrc/lang/gcc34/work/obj/gcc' to your LD_LIBRARYN32_PATH to get around this.

graphics/blender

NOTE: I haven't got blender to build within the pkgsrc framework yet, but I can get it to (mostly?)build using all the dependencies installed from pkgsrc.

Here's a patch against 2.45. I had to mess with the library search paths to make it link against the pkgsrc libjpeg, but it seems to work fine now.

www/firefox

Fails to build. I can get it to compile but I'm left with some unresolved C++ symbols. Here's some notes on getting that far:

Make sure your CFLAGS include '-DIP30 -DR10000'. Additionally, ld was missing the -n32 argument (it doesn't honor LDFLAGS). I wasn't clear how to fix this correctly, so I just did it by hand... There's also a missing -lpthread and a place where you need to change '-Wp,-traditional' to just '-traditional' when it's compiling some assembly. ugh

Also, SGIs linker hates you and you have to do

 export LD_LIBRARYN32_PATH=$LD_LIBRARYN32_PATH:/usr/pkgsrc/www/firefox/work/mozilla/dist/lib

so that it can find libssl3 when it's generating a key or something.

security/sudo

Add c++ to USE_LANGUAGES in the pkgsrc Makefile.

fonts/Xft2

Add c++ to USE_LANGUAGES in the pkgsrc Makefile.

mail/postfix

Add -ldb to AUXLIBS in the pkgsrc Makefile.

To enable logging add the following to /etc/syslog.conf and kill -HUP the syslog process:

 # mail logging
 mail.info   /var/adm/maillog

Ensure that the whitespace between the facilty and the logfile is a tab, NOT a space!

Also, ensure that alias_maps and alias_database are set to hash:/etc/mail/aliases in main.cf.

You can find an init script Here.

x11/wxGTK

Builds fine with a valid libtool.

To install it correctly, remove the loop from the Makefile that loops over WX_LINGUAS.

audio/audacity

This port has quite a few problems. You need to disable nyquist and portmixer, you need to add the following to AudioIO.cpp:

#ifdef __sgi
#include <alloca.h>
#endif

Also, the configuration of the included libs doesn't work right, it passes -Wl,-R directives to the linker which makes it fail. I don't know how to fix this directly, so I just edited the configuration parameters and ran it manually. You also need to add -laudio to the LIBS in the work/audacity/src/Makefile to deal with unresolved symbols. If you built the pthread version of SGI portaudio, you need to add -lpthreads too.

If the linker segfaults when building soundtouch examples, just disable that example directory in the soundtouch Makefile.

multimedia/mplayer

Has problems with PRI defines. IRIX lacks these so we need to define them ourselves...

After you've configured the source, edit config.h and add the following just before the final #endif:

#if !defined PRId64 || PRI_MACROS_BROKEN
# undef PRId64
# ifdef _ABI64
#  define PRId64 "ld"
# else
#  define PRId64 "lld"
# endif
#endif
#if !defined PRIu64 || PRI_MACROS_BROKEN # undef PRIu64 # ifdef _ABI64 # define PRIu64 "lu" # else # define PRIu64 "llu" # endif #endif
#if !defined PRIx64 || PRI_MACROS_BROKEN # undef PRIx64 # ifdef _ABI64 # define PRIx64 "lx" # else # define PRIx64 "llx" # endif #endif
#if !defined PRIX64 || PRI_MACROS_BROKEN # undef PRIX64 # ifdef _ABI64 # define PRIX64 "lX" # else # define PRIX64 "llX" # endif #endif
/* Limit of `size_t' type. */ #if !defined SIZE_MAX # ifdef _ABI64 # define SIZE_MAX (18446744073709551615UL) # else # define SIZE_MAX (4294967295U) # endif #endif

Also, run the following:

ln -sf /usr/include/inttypes.h work/.buildlink/include/stdint.h

That'll take care of any #includes for stdint.h (which IRIX lacks).

audio/speex

Add USE_LANGUAGES+= c++ to the Makefile. More of the finding the wrong getopt.h header. Fix as mentioned below.

audio/vorbis-tools

Add USE_LANGUAGES+= c++ to the Makefile.

 find . -name "*.[ch]" -exec perl -pi -e 's/#include [<"]getopt.h[>"]/#include "\/usr\/include\/getopt.h"/g' {} \;

print/ghostscript

Incorrectly tries to use mkstemp64 because it detects a 64 bit platform. Edit src/gp_unifs.c and add && !defined(__sgi) to the line that checks for HAVE_FILE64. The configure script could probably be patched to make this more correct. Additionally, add -liconv to EXTRALIBS in the Makefile.

find . -name "*.[ch]" -exec perl -pi -e 's/int_fast/int/g' {} \;
find . -name "*.[ch]" -exec perl -pi -e 's/INT_FAST/INT/g' {} \;

(giant hack, I know).

graphics/gimp

Make sure you're compiling gimp 2.4 and set

 PKG_OPTIONS.gimp=   -gnome -mng -svg

in your mk.conf. If the build fails with something involving 'gimpstock' cd into work/gimp*, run

 make -C themes clean

and restart the build. The cause of this failure is unclear. You might also get a redecleration of attr_t in plug-ins/flame/rect.c. I just commented out the one in that file and it continued building. I'm not sure if this is valid or not.

devel/bmake

Only a problem as of 2008Q1, older releases worked fine.

Hangs while running testcases. Not sure why yet but this dude has the same issue when using MIPSPro. Looking into it.

shells/zsh

May have to add -liconv to LIBS in the work/zsh Makefile.

graphics/jasper

If it fails to build and bitches about int_fast32_t, make sure you don't have typesize.h symlinked to stdint.h in /usr/include.

Useful links