mapmaker stable port information

Package: mapmaker
Version: 3.0
Revision: 1017
Description: Interactive genetic linkage mapping package
DescDetail: <<
MAPMAKER/EXP is a linkage analysis package designed to help construct
primary linkage maps of markers segregating in experimental crosses.
MAPMAKER/EXP performs full multipoint linkage analysis (simultaneous
estimation of all recombination fractions from the primary data) for
dominant, recessive, and co- dominant (e.g. RFLP-like) markers.
MAPMAKER/EXP is an experimental-cross-only successor to the original
MAPMAKER program.

MAPMAKER/QTL is a companion program to MAPMAKER/EXP which allows one
to map genes controlling polygenic quantitative traits in F2
intercrosses and BC1 backcrosses relative to a genetic linkage map.
More information on MAPMAKER/QTL can be found in the technical report
(included with MAPMAKER/QTL).
<<
DescUsage: <<
'mapmaker -help' or 'qtl -help' to get started

Screen drawing is a bit off sometimes, so it might be best to save a
transcript of your work (use -out or -photo) or else disable fancy
screen things (use -simple).

There is a tutorial and several formats of program documentation in
share/doc/mapmaker
<<
DescPort: <<
Compiled using -D_BIG_DATASETS (allows ca. 5000 loci).

Here's my thoughts on lib/system.h:
-D_SYS_UNIX (so we don't get DOSish artifacts).
-DSIGHANDLE=void (from the signal() manpage).
-DUSE_DRAND48 (drand48() uses 48 bits vs 31 for random())
Some -D to get correct typedefs according to the relevant manpages):
void * calloc(size_t number, size_t size);
void qsort(void *base, size_t nmemb, size_t size,
int (*compar)(const void *, const void *));
(not sure about QSORT_DATA_PTR_TO)
-DUSE_LIB (/usr/include has all the resulting INC_*-caused .h files).

Other lib/system.h things:
Use system maximum-pathlength def (in sys/param.h) for PATH_LENGTH.
We have strerror().
We don't (seem to?) have matherror(), but we'll leave HAVE_MATHERR
defined for now.
We have getenv() and getcwd() but not chdir(), but let's see what
happens if we say we go with the default of saying we have 'em all.
Leaving the "Terminal I/O" stuff as-is for now.
Removed malloc.h (malloc() is in stdlib.h).
Removed USE_DRAND48 prototyping (it's in stdlib.h).

lib/iolib.h: /usr/include/stdio.h provides a conflicting prototype for
a (seemingly?) different fgetln() (from libc). Will do a brute-force
renaming and hope for the best.

A lot of calls to make_filename*(), fprint() and fwrite() pass
constant strings as param 3 which get passed to depsace() which tried
to modify them, causing a bus error. Thanks to Alexander Strange, who
notes that -fwritable-strings fixes this deprecated behavior.

info.c's allocate_three_entries() is recursive, leading to a stack
overflow for large datasets (while running 'pd', "Illegal instruction"
(EXC_BAD_ACCESS/KERN_INVALID_ADDRESS in xalloc()). Thanks to Ben Hines

The xterm wrappers are in sun/ but Makefile forgets to look there so
we link them into the main directory. And we fix a silly typo in them.
for pointing out the -stack_size solution.

Readline is giving problems so we disable it for now.

There's something goofy with the termcap.

CompileScript contains some ugly hacks to convert *.help (used by
online help facility in the programs) into HTML with linked TOCs.

Make a global variable static to maybe avoid core-dump on 10.4.

Source2 (mapmaker.html) no longer appears available upstream. Was a
usage tutorial:(
<<
Homepage: http://www.broadinstitute.org/science/software
License: Restrictive
Maintainer: Daniel Macks
BuildDepends: fink (>= 0.24.12-1)
Recommends: x11, ghostscript
#Source: http://www-genome.wi.mit.edu/ftp/distribution/software/mapmaker3/mapm3-source.tar.Z
Source: http://www.broad.mit.edu/ftp/distribution/software/mapmaker3/mapm3-source.tar.Z
Source-MD5: 8aa7a061d32a49c8704c1a5c4b31aa2d
NoSourceDirectory: true
#Source2: http://www-genome.wi.mit.edu/genome_software/other/mapmaker.html
#Source2-MD5: 90eaaf5e1d89030cfe9c5d3b7be5566e
PatchFile: %n.patch
PatchFile-MD5: 52432abb8d2e23c99b7663f3a7b2187c
PatchScript: <<
%{default_script}
perl -pi.bak -e 's/fgetln/myfgetln/g' `grep -lr fgetln .`
<<
CompileScript: <<
#!/bin/sh -ex
make
ln -s sun/* .
for prog in mapmaker qtl; do
rm -f ${prog}-body.html ${prog}-toc.html ${prog}-help.html
perl -n -e 'if (s/^@//) {if ($not_first) {@lines=("

\n",@lines,"
\n") } else {@lines=("
    \n")}; print @lines; @lines=();chomp; $htype = 3 - s/^TOPIC //; $htype==2 && $not_first++ && print "
\n"; if (/^end$/) {print "\n"} else {($link=$_)=~tr/ /_/;print "
  • $_
  • \n"; $htype==2 && print "
      \n"}} else {push @lines, $_}' ${prog}.help > ${prog}-body.html
      perl -n -e 's/<\/?h.>//g,print if ( s//)' ${prog}-body.html > ${prog}-toc.html
      ( echo "${prog} helpfile

      $prog helpfile

      Translated from %p/share/%n/${prog}.help by Fink %f.info

      table of contents

      " ; cat ${prog}-toc.html ; echo "
      " ; cat ${prog}-body.html ; echo "" ) > ${prog}-help.html
      done
      <<
      InstallScript: <<
      install -d -m0755 %i/bin %i/share/%n %i/share/doc/%n/tutorial %i/share/doc/%n/html
      make DIR=%i/bin install
      mv %i/bin/*.help %i/share/%n
      install -m0644 mouse.* sample.* %i/share/doc/%n/tutorial
      # install -m0644 mapmaker.html %i/share/doc/%n/tutorial/mapmaker.html
      install -m0644 *-help.html %i/share/doc/%n/html
      <<
      RuntimeVars: <<
      MAPM_LIB: %p/share/%n
      <<
      DocFiles: CHANGE.ME COVER.ME FEED.ME INSTALL.ME READ.ME WANT.ME mapmaker.ps qtl.ps

      mapmaker stable port .patch

      diff -Nurd -x'*~' mapm3-source.orig/Makefile mapm3-source/Makefile
      --- mapm3-source.orig/Makefile 2003-04-19 07:53:22.000000000 -0400
      +++ mapm3-source/Makefile 2003-04-29 01:23:22.000000000 -0400
      @@ -24,7 +24,7 @@
      #### datasets (roughly 5000 loci vs 1000 loci). For even bigger datasets,
      #### modify mapm/mapm.h.

      -SYS= -D_SYS_SUNOS
      +SYS= -D_BIG_DATASETS

      #### Next define the system libraries to link with Mapmaker. On SunOS, Ultrix
      #### and other vanilla-ish BSD systems, the correct setting is:
      @@ -35,7 +35,7 @@
      #### is probably best (for ex: on A/UX or HP/UX, respectively).
      #### On A/UX -lmalloc is likely a good idea too.

      -SYS_LIBS= -lm -ltermcap
      +SYS_LIBS= -ltermcap

      #### Below we define the directories for these programs. Set DIR to the place
      #### in which the executables and help files should permanently be installed
      @@ -70,9 +70,9 @@
      #### (see the end of readline/readline.c). Readline will not compile on
      #### A/UX without using GCC instead of A/UX's cc (because it needs alloca).

      -OUR_LIB= gnu.o
      -GNU_OPT= -D_GNU_READLINE -I.
      -GNU_LIBS= -L$(RDLN) -lreadline
      +OUR_LIB= lib.o
      +GNU_OPT=
      +GNU_LIBS=

      #### Now we specify the commands used to compile MAPMAKER. The stuff
      #### below works on Sun SPARCStations running SunOS 4.1.x (aka Solaris 1.x)
      @@ -82,8 +82,8 @@
      #### person at your site should be able to figure out what to do almost
      #### trivially. See the file INSTALL.ME for details.

      -COMPILE= cc
      -LINKALL= cc
      +COMPILE= cc -fwritable-strings
      +LINKALL= cc -Wl,-stack_size -Wl,4048000
      LINKLIB= ld -r
      DELETE= rm -f
      INSTALL= cp
      @@ -249,7 +249,7 @@
      $(LINTALL) $(MAPM_LN) $(LIB_LN) $(SYS_LIBS) >Temp.lint
      echo "=======================================" >>Temp.lint
      fgrep -v -f Lint.grep Temp.lint $(MAPM_LINT) $(LIB_LINT) >mapm.lint
      -
      +
      .c.ln:
      $(LINT) -I$(LIB) $(SYS) -c $< -o $*.ln >$*.lint

      diff -Nurd -x'*~' mapm3-source.orig/lib/system.h mapm3-source/lib/system.h
      --- mapm3-source.orig/lib/system.h 2003-04-19 07:53:22.000000000 -0400
      +++ mapm3-source/lib/system.h 2003-04-27 23:18:40.000000000 -0400
      @@ -94,13 +94,23 @@
      #endif


      +#define _SYS_UNIX
      +#define SIGHANDLE void
      +#define USE_DRAND48
      +#define CALLOC_PTR_TO void
      +#define CALLOC_NUM_TYPE size_t
      +#define SIZEOF_TYPE size_t
      +#define QSORT_LENGTH size_t
      +#define QSORT_DATA_PTR_TO void
      +#define INC_LIB

      /************************ File name syntax ****************************
      Setup the following for the OS's path types (these are used by the
      make_filename() procedure in iolib.c). Note that the lengths of various
      elements of a path are not checked, only its total length.
      *************************************************************************/
      -#define PATH_LENGTH 200
      +#include
      +#define PATH_LENGTH MAXPATHLEN

      #ifndef _SYS_DOS /* e.g. _SYS_UNIX or some POSIX like thing */
      #define HELP_EXT ".help"
      @@ -583,7 +593,6 @@
      #include
      #include
      #include /* for ctime() def - Who does not have this file? */
      -#include
      #include

      #ifdef TRY_WINSIZE
      @@ -598,8 +607,6 @@

      /* The HPUX (and System V?) random number functions... ditto */
      #ifdef USE_DRAND48
      -double drand48();
      -void srand48();
      #endif

      /* Library declarations only to be used by the helpers library code itself */
      diff -Nurd -x'*~' mapm3-source.orig/mapm/lowlevel.h mapm3-source/mapm/lowlevel.h
      --- mapm3-source.orig/mapm/lowlevel.h 1993-02-09 11:35:06.000000000 -0500
      +++ mapm3-source/mapm/lowlevel.h 2006-06-12 16:00:55.000000000 -0400
      @@ -44,7 +44,11 @@
      } data;
      } RAW_DATA;

      +#ifdef ACTUAL_RAW
      +static RAW_DATA raw;
      +#else
      extern RAW_DATA raw;
      +#endif

      /****************************************************************************/

      diff -Nurd -x'*~' mapm3-source.orig/mapm/reader.c mapm3-source/mapm/reader.c
      --- mapm3-source.orig/mapm/reader.c 1993-02-09 11:35:05.000000000 -0500
      +++ mapm3-source/mapm/reader.c 2006-06-12 16:01:10.000000000 -0400
      @@ -14,9 +14,9 @@
      #define INC_LIB
      #define INC_SHELL
      #define INC_EQN
      +#define ACTUAL_RAW
      #include "mapm.h"

      -RAW_DATA raw;
      int original_markers;

      #define end_of_text(fp) feof(fp)
      diff -Nurd -x'*~' mapm3-source.orig/sun/xmapmaker mapm3-source/sun/xmapmaker
      --- mapm3-source.orig/sun/xmapmaker 2003-04-19 07:53:23.000000000 -0400
      +++ mapm3-source/sun/xmapmaker 2003-04-19 09:15:38.000000000 -0400
      @@ -10,5 +10,5 @@
      else if (-e /usr/openwin/demo/xterm) then
      exec /usr/openwin/demo/xterm $xoptions $fontsize -e $program $*
      else
      - exec xterm $options $fontsize -e $program
      + exec xterm $xoptions $fontsize -e $program
      endif
      diff -Nurd -x'*~' mapm3-source.orig/sun/xqtl mapm3-source/sun/xqtl
      --- mapm3-source.orig/sun/xqtl 2003-04-19 07:53:23.000000000 -0400
      +++ mapm3-source/sun/xqtl 2003-04-19 09:15:44.000000000 -0400
      @@ -10,5 +10,5 @@
      else if (-e /usr/openwin/demo/xterm) then
      exec /usr/openwin/demo/xterm $xoptions $fontsize -e $program $*
      else
      - exec xterm $options $fontsize -e $program
      + exec xterm $xoptions $fontsize -e $program
      endif

      mapmaker _unstable_ port .patch