Attachment 'sage-4.1.1.patch'

Download

   1 local/bin/sh000755 001752 001752 00000000000 11226071440 017141 2/usr/local/bin/bashustar00peterpeter000000 000000 local/bin/make000755 001752 001752 00000000000 11226071440 017613 2/usr/local/bin/gmakeustar00peterpeter000000 000000 local/bin/gfortran000755 001752 001752 00000000000 11236642376 021442 2/usr/local/bin/gfortran43ustar00peterpeter000000 000000 local/bin/gcc000755 001752 001752 00000000000 11226071440 017251 2/usr/local/bin/gcc43ustar00peterpeter000000 000000 local/bin/g++000755 001752 001752 00000000000 11226071440 016711 2/usr/local/bin/g++43ustar00peterpeter000000 000000 spkg/base/sage-spkg000755 001752 001752 00000024077 11237740730 015065 0ustar00peterpeter000000 000000 #!/usr/bin/env bash
   2 
   3 # William Stein, 2005-12-20 -- removed "m" option from tar,
   4 # which was seriously confusing the build process on some
   5 # (too fast?) machines, especially for mpfr. 
   6 
   7 #######################################################
   8 #  Install a SAGE package.  This script is
   9 #  typically invoked by giving the command
  10 #      sage -i <package name>
  11 #
  12 #  A package may assume that the following environment 
  13 #  variables are defined:
  14 #
  15 #      SAGE_ROOT   -- root directory of sage install
  16 #      SAGE_LOCAL  -- $SAGE_ROOT/local
  17 #      SAGE_DATA   -- $SAGE_ROOT/data
  18 #      LIBRARY_PATH, PYTHONPATH, LD_LIBRARY_PATH, DYLD_LIBRARY_PATH
  19 #      CC, CXX, CFLAGS, CXXFLAGS, LDFLAGS, MAKE
  20 #
  21 #  Your package script should try to build using the giving CC, CXX,
  22 #  CFLAGS, MAKE, etc, via a file spkg-install in your script.
  23 #
  24 #  This script does the following:
  25 #
  26 #      1. Set environment variables (by calling sage-env)
  27 #      2. Decompress package into a build directory
  28 #      3. Run the script in the package called spkg-install
  29 #      4. Return error 1 if anything goes wrong.
  30 #
  31 #######################################################
  32 
  33 mymkdir()
  34 {
  35     if [ ! -d $1 ]; then
  36 	mkdir $1
  37     fi
  38 }
  39 
  40 # The following sets environment variables for building
  41 # packages.  (Using dot suggested by W. Cheung.)
  42 
  43 . "$SAGE_ROOT/local/bin/sage-env"
  44 
  45 cd "$SAGE_PACKAGES"
  46 
  47 if [ $# -eq 0 ]; then
  48     echo "Currently installed packages:"
  49     /bin/ls -1 "$SAGE_PACKAGES/installed/"
  50     exit 0
  51 fi
  52 
  53 
  54 cd "$SAGE_PACKAGES"
  55 mymkdir "$BUILD"
  56 mymkdir installed
  57 cd "$BUILD"
  58 mymkdir old
  59 
  60 # the following two options are mutually exclusive -- i.e., you
  61 # can give only one. 
  62 
  63 INFO=0
  64 if [ $1 = '-info' ]; then
  65     INFO=1
  66     shift
  67 fi
  68 
  69 FORCE=0
  70 if [ $1 = '-f' ]; then
  71    FORCE=1
  72    shift
  73 fi
  74 export FORCE
  75 
  76 DELETE_TMP=0
  77 if [ $1 = '-s' -o $1 = '-m' ]; then
  78    DELETE_TMP=0
  79    shift
  80 fi
  81 
  82 INSTALLED="$SAGE_PACKAGES/installed/"
  83 PKG_NAME=`echo "$1" | sed -e "s/\.spkg$//"`
  84 PKG_NAME=`basename "$PKG_NAME"`
  85 PKG_SRC="$1"
  86 PKG_BASE=`echo "$PKG_NAME" | sed -e "s/-.*//"`
  87 # check if noclobber is set and warn about it
  88 if [ $PKG_SRC == "noclobber" ]; then
  89     echo "***********************************************************"
  90     echo "* WARNING WARNING WARNING WARNING WARNING WARNING WARNING *"
  91     echo "*                                                         *"
  92     echo "* noclobber is set in .bashrc and/or .bash_profile - you  *"
  93     echo "* should consider disabling it. The Sage install should   *"
  94     echo "* continue to work, so don't worry about it too much.     *"
  95     echo "*                                                         *"
  96     echo "* WARNING WARNING WARNING WARNING WARNING WARNING WARNING *"
  97     echo "***********************************************************"
  98     exit 0
  99 fi
 100 
 101 if [ ! -f "$PKG_SRC" ]; then
 102     if [ -f "$SAGE_PACKAGES/standard/$PKG_NAME.spkg" ]; then
 103         PKG_SRC="$SAGE_PACKAGES/standard/$PKG_NAME.spkg"
 104     else
 105         if [ -f "$SAGE_PACKAGES/optional/$PKG_NAME.spkg" ]; then
 106             PKG_SRC="$SAGE_PACKAGES/optional/$PKG_NAME.spkg"
 107         fi
 108     fi
 109 fi
 110 
 111 if [ $INFO -ne 0 ]; then
 112     if [ ! -f "$PKG_SRC" ]; then
 113         echo "Package $PKG_NAME not found"
 114     fi
 115     bunzip2 -c "$PKG_SRC" 2>/dev/null | tar Ofx - $PKG_NAME/SAGE.txt 2>/dev/null
 116     if [ $? -ne 0 ]; then
 117         tar Ofx  "$PKG_SRC" "$PKG_NAME/SAGE.txt" 2>/dev/null
 118     fi
 119     echo ""
 120     if [ $? -ne 0 ]; then
 121         echo "No file SAGE.txt in $PKG_NAME"
 122         exit 1
 123     fi
 124     exit 0
 125 fi
 126 
 127 echo "$PKG_NAME"
 128 
 129 echo "Machine:"
 130 uname -a
 131 
 132 if [ -f "$INSTALLED/$PKG_NAME" -a $FORCE -eq 0 ]; then
 133     echo "sage: $1 is already installed"
 134     touch "$INSTALLED/$PKG_NAME"
 135     exit 0
 136 fi
 137 
 138 cd "$SAGE_PACKAGES/build"
 139 
 140 if [ $DELETE_TMP -eq 1 ]; then
 141     echo "Deleting directories from past builds of previous/current versions of $PKG_NAME"
 142     # Make triply sure that we are in the build directory before doing 
 143     # a scary "rm -rf".
 144     cd "$SAGE_PACKAGES/build"
 145     if [ $? -ne 0 ]; then 
 146          echo "Unable to find build directory."
 147     else
 148         rm -rf "$PKG_BASE-"* 
 149     fi 
 150 else
 151     echo "Moving directories from past builds of previous/current versions of $PKG_NAME to build/old"
 152     mv -f "$PKG_BASE-"* old/  2>/dev/null
 153 fi
 154 
 155 if [ ! -f "$PKG_SRC" ]; then
 156 
 157     echo "$0: file $PKG_NAME does not exist" 
 158     echo "Attempting to download it."
 159     CUR=`pwd`
 160     cd "$SAGE_PACKAGES"
 161     if [ ! -d optional ]; then
 162         $MKDIR optional
 163     fi
 164     cd optional
 165     sage-download_package "$1"
 166     if [ ! -f "$PKG_NAME.spkg" ]; then 
 167 	echo "sage: Failed to download package $PKG_NAME from $SAGE_SERVER"
 168 	exit 1
 169     fi
 170     PKG_SRC="`pwd`/$PKG_NAME.spkg"
 171     cd "$CUR"
 172 fi
 173 
 174 # * The -i option below to ignore checksum errors, since 
 175 #   I've had problems with this on Solaris.
 176 # * The m option avoids clock skew problems.    
 177 
 178 echo "Extracting package $PKG_SRC ..."
 179 ls -l "$PKG_SRC"
 180 
 181 if [ -d "$PKG_NAME" ]; then
 182     echo "Removing previous version."
 183     rm -rf "$PKG_NAME"
 184 fi
 185 
 186 bunzip2 -c "$PKG_SRC" 2>/dev/null | tar fxv -  2>/dev/null
 187 if [ ! -d "$PKG_NAME" ]; then
 188     tar fxv "$PKG_SRC"
 189 fi
 190 echo "Finished extraction"
 191 
 192 if [ ! -d "$PKG_NAME" ]; then
 193    echo "sage: After decompressing the directory $PKG_NAME does not exist"
 194    echo "This means that the corresponding .spkg needs to be downloaded"
 195    echo "again."
 196    sage-download_package "$PKG_NAME"
 197    echo `pwd`
 198    bunzip2 -c "$PKG_NAME.spkg"  | tar fxv - 
 199    if [ ! -d "$PKG_NAME.spkg" ]; then
 200        tar fxv "$PKG_NAME.spkg"
 201    fi
 202    if [ ! -d "$PKG_NAME" ]; then
 203        echo "Second download resulted in a corrupted package."
 204        exit 1
 205    fi
 206 fi
 207 
 208 if [ -f "$SAGE_PACKAGES/patches/$PKG_NAME.patch" ]; then
 209     echo "Applying local patches for $PKG_NAME"
 210     if ! patch -p0 < "$SAGE_PACKAGES/patches/$PKG_NAME.patch"; then
 211 	echo "Patching failed"
 212 	exit 1
 213     fi
 214 fi
 215 
 216 cd "$PKG_NAME"
 217 if [ ! -f spkg-install ]; then
 218   echo "#!/usr/bin/env bash" > spkg-install
 219   echo "" >> spkg-install
 220   if [ -f setup.py ]; then
 221       echo "python setup.py install" >> spkg-install
 222   else
 223       if [ -f configure ]; then
 224          echo "./configure --prefix=\$SAGE_ROOT/local/" >> spkg-install
 225          echo "make" >> spkg-install
 226          echo "make install" >> spkg-install 
 227       else
 228          echo "There is no spkg-install script, no setup.py, and no configure script,"
 229          echo "so I do not know how to install $PKG_SRC."
 230          exit 1
 231       fi
 232   fi
 233 fi
 234 
 235 chmod +x spkg-install
 236 
 237 # this is just wrong... (so don't do it)
 238 #echo "TOUCHING"
 239 #touch * */* */*/* */*/*/* 1>/dev/null 2>/dev/null
 240 
 241 echo "****************************************************"
 242 echo "Host system"
 243 echo "uname -a:"
 244 uname -a
 245 if [ $? -ne 0 ]; then
 246    echo "Unable to determine host system information."
 247 fi
 248 echo "****************************************************"
 249 
 250 echo "****************************************************"
 251 echo "CC Version"
 252 echo "$CC -v"
 253 $CC -v
 254 if [ $? -ne 0 ]; then
 255    echo "Unable to determine C compiler version."
 256 fi
 257 echo "****************************************************"
 258 
 259 BASEDIR=`pwd`
 260 if [ -n "$DEBIAN_RELEASE" ]; then
 261     SAGE_CHECK=''
 262     if [ -e ./spkg-debian ]; then
 263 	time ./spkg-debian
 264     else
 265 	time sage-build-debian $BASEDIR
 266     fi
 267 else
 268     time ./spkg-install
 269 fi
 270 
 271 if [ $? -eq 0 ]; then
 272    cd $INSTALLED
 273    # TURNED OFF: Remove all old packages with the same name up to the first "-":
 274    # rm -f $PKG_BASE-*
 275 
 276    # Mark that the new package has been installed. 
 277    # This file will eventually be a certificate like in OS X.
 278    echo "PACKAGE NAME: $PKG_NAME" > "$PKG_NAME"
 279    echo "INSTALL DATE: `date`" >> "$PKG_NAME"
 280    echo "UNAME: `uname -a`" >> "$PKG_NAME"
 281    echo "Sage VERSION: `grep Sage $SAGE_LOCAL/bin/sage-banner`" >> "$PKG_NAME"
 282    echo "Successfully installed $PKG_NAME"
 283 
 284    cd $BASEDIR
 285    if [ "$SAGE_CHECK" != "" -a -f spkg-check ]; then
 286        echo "Running the test suite."
 287        chmod +x spkg-check
 288        ./spkg-check
 289        if [ $? -ne 0 ]; then
 290            echo "*************************************"
 291            echo "Error testing package ** $PKG_NAME **"
 292            echo "*************************************"
 293            rm -f $SAGE_ROOT/spkg/installed/$PKG_NAME
 294            echo "sage: An error occurred while testing $PKG_NAME"
 295            echo "Please email sage-devel http://groups.google.com/group/sage-devel"
 296            echo "explaining the problem and send the relevant part of"
 297            echo "of $SAGE_ROOT/install.log.  Describe your computer, operating system, etc."
 298            echo "If you want to try to fix the problem, yourself *don't* just cd to"
 299            echo "`pwd` and type 'make check' or whatever is appropriate."
 300            echo "Instead type \"$SAGE_ROOT/sage -sh\""
 301            echo "in order to set all environment variables correctly, then cd to"
 302            echo "`pwd`"
 303            echo "(When you are done debugging, you can type \"exit\" to leave the"
 304            echo "subshell.)"
 305            exit 1
 306        else 
 307            echo "TEST SUITE: passed" >> "$PKG_NAME"
 308        fi
 309    fi
 310 
 311 
 312    # Delete the temporary build directory if required.
 313    if [ $DELETE_TMP -eq 1 ]; then
 314        echo "Now cleaning up tmp files."
 315        if [ -d "$SAGE_PACKAGES/build/$PKG_NAME" ]; then
 316            # the if is there only to avoid the possibility of a weird bug.
 317            rm -rf "$SAGE_PACKAGES/build/$PKG_NAME"
 318        fi
 319    else
 320        echo "You can safely delete the temporary build directory"
 321        echo "$SAGE_PACKAGES/build/$PKG_NAME"
 322    fi
 323 
 324 else
 325 
 326    echo "sage: An error occurred while installing $PKG_NAME"
 327    echo "Please email sage-devel http://groups.google.com/group/sage-devel"
 328    echo "explaining the problem and send the relevant part of"
 329    echo "of $SAGE_ROOT/install.log.  Describe your computer, operating system, etc."
 330    echo "If you want to try to fix the problem, yourself *don't* just cd to"
 331    echo "`pwd` and type 'make'."
 332    echo "Instead type \"$SAGE_ROOT/sage -sh\""
 333    echo "in order to set all environment variables correctly, then cd to"
 334    echo "`pwd`"
 335    echo "(When you are done debugging, you can type \"exit\" to leave the"
 336    echo "subshell.)"
 337    exit 1
 338 fi
 339 
 340 
 341 echo "Making Sage/Python scripts relocatable..."
 342 
 343 cd "$SAGE_LOCAL"/bin
 344 ./sage-make_relative
 345 
 346 echo "Finished installing $PKG_NAME.spkg" 
 347 
 348 # It's OK if they above fails -- in fact it will until Python
 349 # itself gets installed. That's fine. 
 350 exit 0   
 351 spkg/patches/000755 001752 001752 00000000000 11243334664 013763 5ustar00peterpeter000000 000000 spkg/patches/base.patch000644 001752 001752 00000000730 11225763755 015725 0ustar00peterpeter000000 000000 --- spkg/base/sage-spkg~	2009-02-21 20:38:33.000000000 +1100
 352 +++ spkg/base/sage-spkg	2009-03-01 07:51:32.465298061 +1100
 353 @@ -205,6 +205,14 @@
 354     fi
 355  fi
 356  
 357 +if [ -f "$SAGE_PACKAGES/patches/$PKG_NAME.patch" ]; then
 358 +    echo "Applying local patches for $PKG_NAME"
 359 +    if ! patch -p0 < "$SAGE_PACKAGES/patches/$PKG_NAME.patch"; then
 360 +	echo "Patching failed"
 361 +	exit 1
 362 +    fi
 363 +fi
 364 +
 365  cd "$PKG_NAME"
 366  if [ ! -f spkg-install ]; then
 367    echo "#!/usr/bin/env bash" > spkg-install
 368 spkg/patches/r-2.6.1.p23.patch000644 001752 001752 00000002410 11237006537 016305 0ustar00peterpeter000000 000000 --- r-2.6.1.p23/spkg-install~	2009-01-20 21:22:33.000000000 +1100
 369 +++ r-2.6.1.p23/spkg-install	2009-03-20 05:46:02.702566714 +1100
 370 @@ -21,7 +21,7 @@
 371  CUR=`pwd`
 372  
 373  # set CPPFLAGS so that Sage's readline is picked up
 374 -CPPFLAGS=-I"$SAGE_LOCAL"/inlcude; export CPPFLAGS
 375 +CPPFLAGS="-I$SAGE_LOCAL/include $CPPFLAGS"; export CPPFLAGS
 376  
 377  # copy an R file that has corrected R includes, i.e. <foo.h> vs. "foo.h"
 378  cp patches/sys-std.c src/src/unix/sys-std.c
 379 @@ -74,8 +74,17 @@
 380  
 381  # These flags are *critical* so that R will be built against Sage's 
 382  # copy of readline and ATLAS.
 383 -CFLAGS="-I$SAGE_LOCAL/include -L$SAGE_LOCAL/lib/ "$CFLAGS; export CFLAGS
 384 -LDFLAGS="-L$SAGE_LOCAL/lib/ "$LDFLAGS; export LDFLAGS   
 385 +CFLAGS="-I$SAGE_LOCAL/include -L$SAGE_LOCAL/lib/ $CFLAGS"; export CFLAGS
 386 +LDFLAGS="-L$SAGE_LOCAL/lib/ $LDFLAGS"; export LDFLAGS   
 387 
 388 +# FreeBSD needs the path to libiconv to be explicitly specified.  In theory,
 389 +# --with-libiconv-prefix should work but configure script is broken and
 390 +# ignores that path when looking for libiconv.  Hard-wire via xxFLAGS.
 391 +if [ `uname` = "FreeBSD" ]; then
 392 +    CPPFLAGS="$CPPFLAGS -I/usr/local/include"
 393 +    CFLAGS="$CFLAGS -I/usr/local/include"
 394 +    LDFLAGS="$LDFLAGS -L/usr/local/lib"
 395 +fi
 396 +
 397  # do not build recommended packages for now, for speed.
 398  
 399 spkg/patches/matplotlib-0.98.5.3rc0-svn6910.p4.patch000644 001752 001752 00000004044 11236752717 022135 0ustar00peterpeter000000 000000 --- matplotlib-0.98.5.3rc0-svn6910.p4/patches/setupext.py~	2009-03-15 17:24:10.279608339 +1100
 400 +++ matplotlib-0.98.5.3rc0-svn6910.p4/patches/setupext.py	2009-03-15 21:52:55.397113345 +1100
 401 @@ -45,6 +45,7 @@
 402  import re
 403  import subprocess
 404  ### FOR SAGE
 405 +sage_base = os.environ['SAGE_LOCAL']
 406  sage_inc = os.environ['SAGE_LOCAL'] + '/include/'
 407  sage_lib = os.environ['SAGE_LOCAL'] + '/lib/'
 408  
 409 @@ -57,6 +58,8 @@
 410      'freebsd4' : ['/usr/local', '/usr'],
 411      'freebsd5' : ['/usr/local', '/usr'],
 412      'freebsd6' : ['/usr/local', '/usr'],
 413 +    'freebsd7' : [sage_base, '/usr/local', '/usr'],
 414 +    'freebsd8' : [sage_base, '/usr/local', '/usr'],
 415      'sunos5' : [os.getenv('MPLIB_BASE') or '/usr/local',],
 416      'gnukfreebsd5' : ['/usr/local', '/usr'],
 417      'gnukfreebsd6' : ['/usr/local', '/usr'],
 418 --- matplotlib-0.98.5.3rc0-svn6910.p4/src/ttconv/pprdrv.h~	2008-05-08 05:41:26.000000000 +1000
 419 +++ matplotlib-0.98.5.3rc0-svn6910.p4/src/ttconv/pprdrv.h	2009-03-19 06:00:07.875942989 +1100
 420 @@ -21,6 +21,7 @@
 421  
 422  #include <vector>
 423  #include <cassert>
 424 +#undef putchar		/* gcc43 is broken */
 425  
 426  /*
 427   * Encapsulates all of the output to write to an arbitrary output
 428 --- matplotlib-0.98.5.3rc0-svn6910.p4/src/ttconv/truetype.h~	2008-05-02 04:24:54.000000000 +1000
 429 +++ matplotlib-0.98.5.3rc0-svn6910.p4/src/ttconv/truetype.h	2009-03-19 20:13:28.247298109 +1100
 430 @@ -5,6 +5,7 @@
 431   */
 432  
 433  #include <stdio.h>
 434 +#undef putchar	/* Broken g++43 */
 435  
 436  /*
 437  ** ~ppr/src/include/typetype.h
 438 --- matplotlib-0.98.5.3rc0-svn6910.p4/src/lib/matplotlib/afm.py~	2008-10-05 21:14:42.000000000 +1100
 439 +++ matplotlib-0.98.5.3rc0-svn6910.p4/src/lib/matplotlib/afm.py	2009-03-29 08:16:04.656668429 +1100
 440 @@ -165,7 +165,7 @@
 441          num = _to_int(vals[0].split()[1])
 442          wx = _to_float(vals[1].split()[1])
 443          name = vals[2].split()[1]
 444 -        bbox = _to_list_of_ints(vals[3][2:])
 445 +        bbox = _to_list_of_floats(vals[3][2:])
 446          # Workaround: If the character name is 'Euro', give it the corresponding
 447          # character code, according to WinAnsiEncoding (see PDF Reference).
 448          if name == 'Euro':
 449 spkg/patches/sage-4.1.1.patch000644 001752 001752 00000011111 11243354646 016357 0ustar00peterpeter000000 000000 --- sage-4.1.1/sage/misc/freebsd_memory_usage.c.orig	2009-08-13 16:35:40.000000000 +1000
 450 +++ sage-4.1.1/sage/misc/freebsd_memory_usage.c	2009-08-13 16:36:24.000000000 +1000
 451 @@ -0,0 +1,27 @@
 452 +#include <sys/types.h>
 453 +#include <fcntl.h>
 454 +#include <kvm.h>
 455 +#include <limits.h>	/* for _POSIX2_LINE_MAX */
 456 +#include <stdio.h>
 457 +#include <unistd.h>
 458 +
 459 +/* Return virtual size of current process in bytes */
 460 +unsigned long long freebsd_virtual_size()
 461 +{
 462 +	static kvm_t	*kvm;
 463 +	chat	errbuf[_POSIX2_LINE_MAX];
 464 +	struct kinfo_proc *ki;
 465 +	int	cnt;
 466 +
 467 +	if (!kvm) {
 468 +		kvm = kvm_open(NULL, "/dev/null", NULL, O_RDONLY, errbuf);
 469 +		if (!kvm)
 470 +			return 0;	/* Don't report errors */
 471 +	}
 472 +
 473 +	ki = kvm_procs(kvm, KERN_PROC_PID, getpid(), &cnt);
 474 +	if (!ki)
 475 +		return 0;
 476 +
 477 +	return ki_size
 478 +}
 479 --- sage-4.1.1/sage/misc/freebsd_memory_usage.h.orig	2009-08-13 16:35:40.000000000 +1000
 480 +++ sage-4.1.1/sage/misc/freebsd_memory_usage.h	2009-08-13 16:37:31.000000000 +1000
 481 @@ -0,0 +1,2 @@
 482 +/* Return virtual size of current process in bytes */
 483 +unsigned long long freebsd_virtual_size(void);
 484 --- sage-4.1.1/sage/misc/freebsd_utilities.pyx.orig	2009-08-13 16:35:40.000000000 +1000
 485 +++ sage-4.1.1/sage/misc/freebsd_utilities.pyx	2009-08-13 16:38:38.000000000 +1000
 486 @@ -0,0 +1,30 @@
 487 +# freebsd_utilities extension module built only on FreeBSD (see end of module_list.py)
 488 +
 489 +cdef extern from "freebsd_memory_usage.h":
 490 +    cdef unsigned long long freebsd_virtual_size()
 491 +
 492 +def freebsd_memory_usage():
 493 +    r"""
 494 +    On Freebsd, returns the virtual size of the process in bytes.
 495 +    This will match what "top" reports as the VSIZE.
 496 +    Raises on all other platforms
 497 +    
 498 +    EXAMPLES
 499 +        sage: uname = os.uname()
 500 +        sage: if uname[0] == 'FreeBSD':
 501 +        ...       from sage.misc.freebsd_utilities import freebsd_memory_usage
 502 +        ...       memory_usage = freebsd_memory_usage()
 503 +        
 504 +        sage: uname = os.uname()
 505 +        sage: if uname[0] != 'FreeBSD':
 506 +        ...       try:
 507 +        ...           from sage.misc.freebsd_utilities import freebsd_memory_usage
 508 +        ...           memory_usage = freebsd_memory_usage()
 509 +        ...           print "doctest failure!"
 510 +        ...           print "freebsd_memory_usage() not implemented on platform %s"%uname[0]
 511 +        ...       except ImportError:
 512 +        ...           pass
 513 +        
 514 +
 515 +    """
 516 +    return freebsd_virtual_size()
 517 --- sage-4.1.1/sage/combinat/partitions_c.cc.orig	2009-08-01 07:45:19.000000000 +1000
 518 +++ sage-4.1.1/sage/combinat/partitions_c.cc	2009-08-11 19:06:52.000000000 +1000
 519 @@ -94,6 +94,11 @@
 520  extern "C" long double coshl (long double);
 521  extern "C" long double sinhl (long double);
 522  #endif
 523 +/* FreeBSD pre-8.x doesn't have sqrtl() et al.  Hack around it for now
 524 + * since this sage code will be changed shortly */
 525 +#if defined(__FreeBSD__) && __FreeBSD__ < 8
 526 +#define sqrtl(x)	sqrt(x)
 527 +#endif
 528  
 529  
 530  
 531 --- sage-4.1.1/sage/ext/fast_eval.pyx.orig	2009-08-06 02:11:12.000000000 +1000
 532 +++ sage-4.1.1/sage/ext/fast_eval.pyx	2009-08-11 19:06:52.000000000 +1000
 533 @@ -127,13 +127,20 @@
 534      double exp(double)
 535      double log(double)
 536      double log10(double)
 537 -    double log2_ "log2"(double)
 538 +
 539 +IF UNAME_SYSNAME != "FreeBSD":
 540 +    cdef extern from "math.h":
 541 +        double log2_ "log2"(double)
 542  
 543  
 544  # This is only needed on Cygwin since log2 is a macro.
 545  # If we don't do this the cygwin GCC gets very confused.
 546 -cdef inline double log2(double x): 
 547 -    return log2_(x)
 548 +IF UNAME_SYSNAME != "FreeBSD":
 549 +    cdef inline double log2(double x): 
 550 +       return log2_(x)
 551 +ELSE:
 552 +    cdef inline double log2(double x):
 553 +        return 1.442695040888963407359924681*log(x)
 554  
 555  cdef extern from *:
 556      void* memcpy(void* dst, void* src, size_t len)
 557 --- sage-4.1.1/module_list.py.orig	2009-08-01 08:46:13.000000000 +1000
 558 +++ sage-4.1.1/module_list.py	2009-08-14 05:55:29.000000000 +1000
 559 @@ -1325,8 +1325,8 @@
 560      ]
 561  
 562  
 563 -# Only include darwin_utilities on OS_X >= 10.5
 564  UNAME = os.uname()
 565 +# Only include darwin_utilities on OS_X >= 10.5
 566  if UNAME[0] == "Darwin" and not UNAME[2].startswith('8.'):
 567      ext_modules.append(
 568          Extension('sage.misc.darwin_utilities',
 569 @@ -1334,5 +1334,14 @@
 570                         'sage/misc/darwin_utilities.pyx'],
 571              depends = ['sage/misc/darwin_memory_usage.h'])
 572          )
 573 -        
 574 + 
 575 +# Only include freebsd_utilities on FreeBSD       
 576 +if UNAME[0] == "FreeBSD":
 577 +    ext_modules.append(
 578 +        Extension('sage.misc.freebsd_utilities',
 579 +            sources = ['sage/misc/freebsd_memory_usage.c',
 580 +                       'sage/misc/freebsd_utilities.pyx'],
 581 +            depends = ['sage/misc/freebsd_memory_usage.h'],
 582 +            libraries = ["kvm"])
 583 +        )
 584  
 585 spkg/patches/numpy-1.3.0.p1.patch000644 001752 001752 00000002242 11237737452 017135 0ustar00peterpeter000000 000000 --- numpy-1.3.0.p1/patches/__init__.py~	2008-09-26 14:02:13.000000000 +1000
 586 +++ numpy-1.3.0.p1/patches/__init__.py	2009-03-09 21:38:51.369170316 +1100
 587 @@ -686,6 +686,7 @@
 588      ('linux.*', ('sage_fortran','gnu','intel','lahey','pg','absoft','nag','vast','compaq',
 589                  'intele','intelem','gnu95','g95')),
 590      ('darwin.*', ('sage_fortran','nag', 'absoft', 'ibm', 'intel', 'gnu', 'gnu95', 'g95')),
 591 +    ('freebsd.*', ('sage_fortran','gnu','gnu95','g95')),
 592      ('sunos.*', ('sage_fortran','sun','gnu','gnu95','g95')),
 593      ('irix.*', ('mips','gnu','gnu95',)),
 594      ('aix.*', ('ibm','gnu','gnu95',)),
 595 --- numpy-1.3.0.p1/src/numpy/distutils/system_info.py~	2008-09-26 09:10:02.000000000 +1000
 596 +++ numpy-1.3.0.p1/src/numpy/distutils/system_info.py	2009-03-11 05:21:41.081498204 +1100
 597 @@ -853,12 +853,8 @@
 598      section = 'atlas'
 599      dir_env_var = 'ATLAS'
 600      _lib_names = ['f77blas','cblas']
 601 -    if sys.platform[:7]=='freebsd':
 602 -        _lib_atlas = ['atlas_r']
 603 -        _lib_lapack = ['alapack_r']
 604 -    else:
 605 -        _lib_atlas = ['atlas']
 606 -        _lib_lapack = ['lapack']
 607 +    _lib_atlas = ['atlas']
 608 +    _lib_lapack = ['lapack']
 609  
 610      notfounderror = AtlasNotFoundError
 611 
 612 spkg/patches/atlas-3.8.3.p7.patch000644 001752 001752 00000002224 11243332630 017073 0ustar00peterpeter000000 000000 --- atlas-3.8.3.p7/src/CONFIG/src/SpewMakeInc.c~	2009-02-19 05:47:37.000000000 +1100
 613 +++ atlas-3.8.3.p7/src/CONFIG/src/SpewMakeInc.c	2009-03-01 16:24:42.131861605 +1100
 614 @@ -664,6 +664,8 @@
 615           fprintf(fpout, " -melf_i386");
 616        else if (ptrbits == 64)
 617           fprintf(fpout, " -melf_x86_64");
 618 +      if (OS == OSFreeBSD)
 619 +	 fprintf(fpout, "_fbsd");
 620     }
 621     fprintf(fpout, "\n   F77SYSLIB = %s\n", f77lib ? f77lib : "");
 622     fprintf(fpout, "   BC = $(ICC)\n");
 623 --- atlas-3.8.3.p7/make_correct_shared.sh.orig	2009-02-03 07:22:04.000000000 +1100
 624 +++ atlas-3.8.3.p7/make_correct_shared.sh	2009-03-09 20:40:10.327469958 +1100
 625 @@ -26,10 +26,10 @@
 626  
 627  
 628  
 629 -if [ `uname` = "Linux" ]; then
 630 +if [ `uname` = "Linux" -o `uname` = "FreeBSD" ]; then
 631      if [ `./fortran_type.pl` =  "g95" ]; then
 632  	cd "$SAGE_LOCAL"/lib
 633  	lapack_command="ld -L"$f95_dir" -L"$SAGE_LOCAL"/lib  -shared -soname liblapack.so -o liblapack.so  --whole-archive liblapack.a --no-whole-archive -lc -lm -lf95"
 634  	f77blas_command="ld -L"$f95_dir" -L"$SAGE_LOCAL"/lib  -shared -soname libf77blas.so -o libf77blas.so  --whole-archive libf77blas.a --no-whole-archive -lc -lm -lf95"
 635  
 636  	echo $lapack_command
 637 spkg/patches/sage_scripts-4.1.1.patch000644 001752 001752 00000001154 11243332731 020123 0ustar00peterpeter000000 000000 --- sage_scripts-4.1.1/sage-spkg~	2009-02-21 20:38:33.000000000 +1100
 638 +++ sage_scripts-4.1.1/sage-spkg	2009-03-01 07:51:32.465298061 +1100
 639 @@ -73,7 +73,7 @@
 640  fi
 641  export FORCE
 642  
 643 -DELETE_TMP=1
 644 +DELETE_TMP=0
 645  if [ $1 = '-s' -o $1 = '-m' ]; then
 646     DELETE_TMP=0
 647     shift
 648 @@ -205,6 +205,14 @@
 649     fi
 650  fi
 651  
 652 +if [ -f "$SAGE_PACKAGES/patches/$PKG_NAME.patch" ]; then
 653 +    echo "Applying local patches for $PKG_NAME"
 654 +    if ! patch -p0 < "$SAGE_PACKAGES/patches/$PKG_NAME.patch"; then
 655 +	echo "Patching failed"
 656 +	exit 1
 657 +    fi
 658 +fi
 659 +
 660  cd "$PKG_NAME"
 661  if [ ! -f spkg-install ]; then
 662    echo "#!/usr/bin/env bash" > spkg-install
 663 

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2009-10-01 19:15:58, 32.0 KB) [[attachment:sage-4.1.1.patch]]
  • [get | view] (2009-08-10 18:57:12, 184.6 KB) [[attachment:sage-4.1.1.rc2.freebsd32.test.log]]
  • [get | view] (2009-08-10 18:57:29, 28.5 KB) [[attachment:sage-4.1.1.rc2.patch]]
  • [get | view] (2009-08-10 18:57:49, 184.4 KB) [[attachment:sage-4.1.freebsd32.test.log]]
  • [get | view] (2009-08-09 20:26:37, 34.0 KB) [[attachment:sage-4.1.patch]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.