the Fink project is an effort to port
popular Unix programs to Mac OS X
Info2: <<
Package: nan%type_pkg[-atlas]-oct%type_pkg[oct]
Version: 2.5.5
Type: oct (3.6.0 3.6.1), forge (nan), -atlas (boolean), gcc (4.7)
Revision: 3
Architecture: <<
i386,
( %type_raw[-atlas] = -atlas ) x86_64
<<
Maintainer: Alexander Hansen
# unfortunately, Homepage won't do types
Homepage: http://octave.sourceforge.net/nan/index.html
Description: Missing value statistical toolbox for Octave
DescDetail: <<
A statistics and machine learning toolbox for Octave for data with and without
missing values.
This package provides the following additional functions:
coefficient_of_variation
geomean
meansq
skewness
covm
cor
cov
corrcoef
harmmean
median
statistic
detrend
kurtosis
moment
std
mad
naninsttest
nantest
nansum
nanstd
nanconv
nanfft
nanfilter
nanfilter1uc
normpdf
normcdf
norminv
meandev
percentile
quantile
rankcorr
ranks
rms
sumskipnan
var
mean
sem
spearman
trimean
tpdf
tcdf
tinv
zscore
flag_implicit_significance
xcovf
train_sc
test_sc
xval
classify
train_lda_sparse
decovm
gscatter
mahal
cdfplot
hist2res
ttest
ttest2
xptopen
bland_altman
cumsumskipnan
range
<<
License: GPL3+
# Most octave-forge packages have to have the following BuildDepends:
# liboctave%type_pkg[oct]-gcc%type_pkg[gcc]-dev,
# fftw3,
# ( %type_pkg[oct] = 305 ) hdf5.7-oldapi,
# ( %type_pkg[oct] != 305 ) hdf5.7
#
# Packages which serve only Octave-3.0.5 or only Octave > 3.0.5 need
# not use the conditional, of course.
BuildDepends: <<
(%type_raw[-atlas] = -atlas) atlas,
(%type_raw[-atlas] = -atlas) liboctave%type_pkg[oct]-atlas-dev,
(%type_raw[-atlas] != -atlas) liboctave%type_pkg[oct]-veclib-dev,
liboctave%type_pkg[oct]-gcc%type_pkg[gcc]-dev,
fftw3,
hdf5.7
<<
Depends: <<
(%type_raw[-atlas] = -atlas) atlas-shlibs,
(%type_raw[-atlas] = -atlas) octave%type_pkg[oct]-interpreter-atlas,
(%type_raw[-atlas] != -atlas) octave%type_pkg[oct]-interpreter-veclib,
gcc%type_pkg[gcc]-shlibs
<<
Conflicts: <<
octave-forge,
octave-forge-%type_raw[forge] (<< 1.0.7-999),
%type_raw[forge]-atlas-oct%type_pkg[oct],
%type_raw[forge]-oct%type_pkg[oct]
<<
Replaces: <<
octave-forge-%type_raw[forge] (<< 1.0.7-999),
%type_raw[forge]-atlas-oct%type_pkg[oct],
%type_raw[forge]-oct%type_pkg[oct]
<<
Source-MD5: 59b62a01b832f3c269a65f1a92b56f58
#### Insert required changes here ####
SourceDirectory: NaN
PatchFile: %{Ni}.patch
PatchFile-MD5: 990f9f68a41dffeb6bfdf71ee9af1c65
PatchScript: <<
#!/bin/sh -ev
sed -e 's|@FINKPREFIX@|%p|g' \
-e 's|@OCTVERSION@|%type_raw[oct]|g' \
-e "s|@BLAS_LIBS@|`mkoctfile-%type_raw[oct]-gcc%type_raw[gcc] -p BLAS_LIBS`|" \
-e 's|@GCC@|%type_raw[gcc]|' \
%{PatchFile} | patch -p1
<<
SetLIBS: -L%p/lib/gcc%type_raw[gcc]/lib/
DescPort: <<
Wants libgomp; we use gcc47-compiler to avoid mixing clang and llvm stuff.
src/Makefile: patch in the locations of the gcc47-compiler executables and the
gcc47-enabled mkoctfile executable from octaveN-dev; also set LIBS.
src/xptopen.cpp: OS X defines __DARWIN_BYTE_ORDER, __DARWIN_BIG_ENDIAN, and
__DARWIN_LITTLE_ENDIAN rather than just __BYTE_ORDER,
__BIG_ENDIAN, and __LITTLE_ENDIAN, respectively, so we
#define the latter as their __DARWIN_ counterparts.
<<
######################################
# Do not change anything from this point down, unless absolutely necessary,
# since the foo-oct%type_pkg[oct] packages are designed to be built/installed
# in the same way.
Source: mirror:sourceforge:octave/%type_raw[forge]-%v.tar.gz
NoSetCPPFLAGS: true
NoSetLDFLAGS: true
SetLIBRARY_PATH: /usr/X11R6/lib:%p/lib
UseMaxBuildJobs: false
BuildAsNobody: false
CompileScript: <<
#!/bin/sh -ev
if [ $UID -ne 0 ]
then
echo "%n cannot be built with --build-as-nobody"
exit 1
fi
export OCTAVE=%p/bin/octave-%type_raw[oct]
# repack tarball, since the source directory name doesn't correspond
# to the package name, and Octave's pkg tool hates that.
pushd ..
tar -cf %type_raw[forge].tar NaN
pkgsrc=%type_raw[forge].tar
popd
%p/share/octave/%type_raw[oct]/scripts/octave-forge-compile.sh $pkgsrc
<<
InstallScript: <<
#!/bin/sh -ev
%p/share/octave/%type_raw[oct]/scripts/octave-forge-install.sh %type_raw[forge]-%v %i %b
mkdir -p %i/share/octave/%type_raw[oct]/%type_raw[forge]-%v
# copy template scripts
cp %p/share/octave/%type_raw[oct]/scripts/octave-forge-prerm %p/share/octave/%type_raw[oct]/scripts/octave-forge-postinst %i/share/octave/%type_raw[oct]/%type_raw[forge]-%v
cd %i/share/octave/%type_raw[oct]/%type_raw[forge]-%v
sed -i -e 's/@PKGNAME@/%type_raw[forge]-%v/' octave-forge-postinst
sed -i -e 's/@PKGNAME@/%type_raw[forge]/' octave-forge-prerm
chmod a+x octave-forge*
<<
PostInstScript: <<
if [ -s %p/var/octave/%type_raw[oct]/octave_packages ] && [ -f %p/var/octave/%type_raw[oct]/octave_packages ]
then
%p/share/octave/%type_raw[oct]/%type_raw[forge]-%v/octave-forge-postinst
else
mv %p/share/octave/%type_raw[oct]/packages/%type_raw[forge]-%v/octave_packages %p/var/octave/%type_raw[oct]/octave_packages
fi
<<
PreRmScript: %p/share/octave/%type_raw[oct]/%type_raw[forge]-%v/octave-forge-prerm
DescPackaging: <<
This package:
Patch to Use BLAS_LIBS output from mkoctfile rather than just -lblas.
Common for all octave-forge packages:
We read in postinst and prerm template scripts installed by octaveN and modify
them to use the name of this package because Octave's package manager can't
cope with non-literal arguments.
The Type: forge (pkgname) is used to minimize what needs to be changed when
using this .info file as a template.
<<
<<
diff -Nurd NaN/src/xptopen.cpp NaN.patched/src/xptopen.cpp
--- NaN/src/xptopen.cpp 2011-11-14 14:18:38.000000000 -0500
+++ NaN.patched/src/xptopen.cpp 2011-11-16 20:53:54.000000000 -0500
@@ -72,23 +72,9 @@
#define max(a,b) (((a) > (b)) ? (a) : (b))
#define min(a,b) (((a) < (b)) ? (a) : (b))
-#ifdef __linux__
-/* use byteswap macros from the host system, hopefully optimized ones ;-) */
-#include
-#endif
-
-#ifdef _WIN32
-#define __LITTLE_ENDIAN 1234
-#define __BIG_ENDIAN 4321
-#define __BYTE_ORDER __LITTLE_ENDIAN
-#endif
-
-#if (defined(BSD) && (BSD >= 199103))
-#include
-#define __BIG_ENDIAN _BIG_ENDIAN
-#define __LITTLE_ENDIAN _LITTLE_ENDIAN
-#define __BYTE_ORDER _BYTE_ORDER
-#endif
+#define __LITTLE_ENDIAN __DARWIN_LITTLE_ENDIAN
+#define __BIG_ENDIAN __DARWIN_BIG_ENDIAN
+#define __BYTE_ORDER __DARWIN_BYTE_ORDER
#ifndef _BYTESWAP_H
/* define our own version - needed for Max OS X*/
diff -Nurd NaN/src/Makefile NaN.patched/src/Makefile
--- NaN/src/Makefile 2012-02-10 04:59:46.000000000 -0500
+++ NaN.patched/src/Makefile 2012-02-12 16:57:39.000000000 -0500
@@ -28,10 +28,10 @@
# Instead of building "mex shortpath.c" and "mex uigetpath.c", I used empty m-functions within argout=argin;
####################################################
-CC = gcc
-CXX = g++
+CC = @FINKPREFIX@/bin/gcc-fsf-@GCC@
+CXX = @FINKPREFIX@/bin/g++-fsf-@GCC@
CFLAGS = -fopenmp -Wall -Wextra -Wconversion -O2 -fPIC
-OCTMEX = mkoctfile$(OCTAVE_VERSION) --mex
+OCTMEX = mkoctfile-@OCTVERSION@-gcc@GCC@ --mex
RM = rm
MEX_OPTION += -lgomp CC\#$(CXX) CXX\#$(CXX) CFLAGS\#"$(CFLAGS)" CXXFLAGS\#"$(CFLAGS)"
@@ -79,11 +79,11 @@
train.$(MEX_EXT) predict.$(MEX_EXT): train.c linear.h tron.o linear.o linear_model_matlab.c
$(CC) $(CFLAGS) -I $(MATLABDIR)/extern/include -c linear_model_matlab.c
- $(MATMEX) -lblas train.c tron.o linear.o linear_model_matlab.o
+ $(MATMEX) @BLAS_LIBS@ train.c tron.o linear.o linear_model_matlab.o
#$(MATMEX) -lblas predict.c tron.o linear.o linear_model_matlab.o
train.mex predict.mex: train.c linear.h tron.o linear.o linear_model_matlab.c
- env CC=$(CXX) $(OCTMEX) -lblas train.c tron.o linear.o linear_model_matlab.c
+ env CC=$(CXX) $(OCTMEX) @BLAS_LIBS@ train.c tron.o linear.o linear_model_matlab.c
#env CC=$(CXX) $(OCTMEX) -lblas predict.c tron.o linear.o linear_model_matlab.o
linear.o: linear.cpp linear.h