summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwiedi <wiedi@pkgsrc.org>2014-02-08 12:27:14 +0000
committerwiedi <wiedi@pkgsrc.org>2014-02-08 12:27:14 +0000
commit581e71fe0bfa452f406b8bd6fe5cb10d280756c0 (patch)
treeb6c0b8e5a47ea19a6af2130c083cda9126306a38
parente6472ce8fc8e7d1655c7014cb7d29119153edf13 (diff)
downloadpkgsrc-581e71fe0bfa452f406b8bd6fe5cb10d280756c0.tar.gz
fix build on SunOS
-rw-r--r--biology/plinkseq/Makefile4
-rw-r--r--biology/plinkseq/distinfo7
-rw-r--r--biology/plinkseq/patches/patch-browser_main.c16
-rw-r--r--biology/plinkseq/patches/patch-browser_mongoose.c15
-rw-r--r--biology/plinkseq/patches/patch-lib_annot.cpp14
-rw-r--r--biology/plinkseq/patches/patch-lib_annot.h14
-rw-r--r--biology/plinkseq/patches/patch-lib_token.cpp72
7 files changed, 140 insertions, 2 deletions
diff --git a/biology/plinkseq/Makefile b/biology/plinkseq/Makefile
index 93b002a32a1..52e7e6c74ff 100644
--- a/biology/plinkseq/Makefile
+++ b/biology/plinkseq/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.2 2013/03/26 20:11:19 asau Exp $
+# $NetBSD: Makefile,v 1.3 2014/02/08 12:27:14 wiedi Exp $
DISTNAME= plinkseq-0.08
PKGREVISION= 1
@@ -16,6 +16,8 @@ USE_LANGUAGES= c c++
USE_TOOLS= bash:run
REPLACE_BASH= browser/pbrowse.in index/index.in
+LDFLAGS.SunOS+= -lsocket -lnsl
+
.include "../../mk/bsd.prefs.mk"
.if $(OPSYS) != "Linux"
diff --git a/biology/plinkseq/distinfo b/biology/plinkseq/distinfo
index f3abc62c19b..d34cce4afc0 100644
--- a/biology/plinkseq/distinfo
+++ b/biology/plinkseq/distinfo
@@ -1,5 +1,10 @@
-$NetBSD: distinfo,v 1.1 2012/11/01 04:06:21 asau Exp $
+$NetBSD: distinfo,v 1.2 2014/02/08 12:27:14 wiedi Exp $
SHA1 (plinkseq-0.08.tar.gz) = 8bff6b32750eee85559dda2c7c3cf9aea423a3d7
RMD160 (plinkseq-0.08.tar.gz) = bce0966ea5f25d8c1091157561aaf533a98595ec
Size (plinkseq-0.08.tar.gz) = 2991871 bytes
+SHA1 (patch-browser_main.c) = 2bbeed764180b0a0e30f134b40c650cfa20bdcec
+SHA1 (patch-browser_mongoose.c) = 8bec1f482c05f9a2fcf0acb8fbb8d5d79f279566
+SHA1 (patch-lib_annot.cpp) = b405bca26186ea08241ad5936c2a1b43212d8dec
+SHA1 (patch-lib_annot.h) = 5efccddf878b4628ae7186d59a726a157d356196
+SHA1 (patch-lib_token.cpp) = 848e7b790db6a4784697482ea330b4d474731368
diff --git a/biology/plinkseq/patches/patch-browser_main.c b/biology/plinkseq/patches/patch-browser_main.c
new file mode 100644
index 00000000000..4b698bb5843
--- /dev/null
+++ b/biology/plinkseq/patches/patch-browser_main.c
@@ -0,0 +1,16 @@
+$NetBSD: patch-browser_main.c,v 1.1 2014/02/08 12:27:14 wiedi Exp $
+
+not needed on sunos
+--- browser/main.c.orig 2011-11-17 17:17:36.000000000 +0000
++++ browser/main.c
+@@ -21,8 +21,10 @@
+ #if defined(_WIN32)
+ #define _CRT_SECURE_NO_WARNINGS // Disable deprecation warning in VS2005
+ #else
++#if !defined(__sun)
+ #define _XOPEN_SOURCE 600 // For PATH_MAX on linux
+ #endif
++#endif
+
+ #include <sys/stat.h>
+ #include <stdio.h>
diff --git a/biology/plinkseq/patches/patch-browser_mongoose.c b/biology/plinkseq/patches/patch-browser_mongoose.c
new file mode 100644
index 00000000000..2a6d30d53e6
--- /dev/null
+++ b/biology/plinkseq/patches/patch-browser_mongoose.c
@@ -0,0 +1,15 @@
+$NetBSD: patch-browser_mongoose.c,v 1.1 2014/02/08 12:27:14 wiedi Exp $
+
+not needed on sunos
+--- browser/mongoose.c.orig 2011-11-17 17:17:36.000000000 +0000
++++ browser/mongoose.c
+@@ -21,7 +21,9 @@
+ #if defined(_WIN32)
+ #define _CRT_SECURE_NO_WARNINGS // Disable deprecation warning in VS2005
+ #else
++#if !defined(__sun)
+ #define _XOPEN_SOURCE 600 // For flockfile() on Linux
++#endif
+ #define _LARGEFILE_SOURCE // Enable 64-bit file offsets
+ #define __STDC_FORMAT_MACROS // <inttypes.h> wants this for C++
+ #endif
diff --git a/biology/plinkseq/patches/patch-lib_annot.cpp b/biology/plinkseq/patches/patch-lib_annot.cpp
new file mode 100644
index 00000000000..1b67dd4dde4
--- /dev/null
+++ b/biology/plinkseq/patches/patch-lib_annot.cpp
@@ -0,0 +1,14 @@
+$NetBSD: patch-lib_annot.cpp,v 1.1 2014/02/08 12:27:14 wiedi Exp $
+
+rename to avoid collision on sunos
+--- lib/annot.cpp.orig 2012-03-19 20:00:45.000000000 +0000
++++ lib/annot.cpp
+@@ -34,7 +34,7 @@ std::map<seq_annot_t,std::string> popula
+ m[SPLICE3] = "splice3";
+ m[ESPLICE3] = "esplice3";
+ m[ESPLICE5] = "esplice5";
+- m[FS] = "frameshift";
++ m[FS_] = "frameshift";
+ m[RT] = "readthrough";
+ return m;
+ }
diff --git a/biology/plinkseq/patches/patch-lib_annot.h b/biology/plinkseq/patches/patch-lib_annot.h
new file mode 100644
index 00000000000..aa6570c0ced
--- /dev/null
+++ b/biology/plinkseq/patches/patch-lib_annot.h
@@ -0,0 +1,14 @@
+$NetBSD: patch-lib_annot.h,v 1.1 2014/02/08 12:27:14 wiedi Exp $
+
+rename to avoid collision on sunos
+--- lib/annot.h.orig 2012-03-19 11:35:59.000000000 +0000
++++ lib/annot.h
+@@ -35,7 +35,7 @@ enum seq_annot_t { UNDEF = 0 , //
+ ESPLICE5 = 27 , // Essential 5' splice-site
+ ESPLICE3 = 28 , // Essential 3' splice-site
+ NON = 24 , // nonsense allele
+- FS = 25 , // frameshift
++ FS_ = 25 , // frameshift
+ RT = 26 }; // readthrough
+
+ struct SeqInfo {
diff --git a/biology/plinkseq/patches/patch-lib_token.cpp b/biology/plinkseq/patches/patch-lib_token.cpp
new file mode 100644
index 00000000000..61510f40f39
--- /dev/null
+++ b/biology/plinkseq/patches/patch-lib_token.cpp
@@ -0,0 +1,72 @@
+$NetBSD: patch-lib_token.cpp,v 1.1 2014/02/08 12:27:14 wiedi Exp $
+
+fix math ambiguity on sunos
+--- lib/token.cpp.orig 2012-03-17 17:06:01.000000000 +0000
++++ lib/token.cpp
+@@ -1232,7 +1232,7 @@ Token Token::operator^(const Token & rhs
+ const int sz = size();
+ if ( sz == 0 ) return Token();
+ std::vector<double> ans( sz );
+- if ( rhs.is_int() ) for (int i=0; i<sz; i++) ans[i] = pow( ivec[i] , rhs.ival );
++ if ( rhs.is_int() ) for (int i=0; i<sz; i++) ans[i] = pow( ivec[i] , (double) rhs.ival );
+ else if ( rhs.is_float() ) for (int i=0; i<sz; i++) ans[i] = pow( ivec[i] , rhs.fval );
+ return Token( ans );
+ }
+@@ -1249,7 +1249,7 @@ Token Token::operator^(const Token & rhs
+
+ if ( is_int() )
+ {
+- if ( rhs.is_int() ) return Token( pow( ival , rhs.ival ) );
++ if ( rhs.is_int() ) return Token( pow( ival , (double) rhs.ival ) );
+ if ( rhs.is_float() ) return Token( pow( ival , rhs.fval ) );
+ }
+ if ( is_float() )
+@@ -2141,7 +2141,7 @@ Token TokenFunctions::fn_set( const Toke
+
+ Token TokenFunctions::fn_sqrt( const Token & tok ) const
+ {
+- if ( tok.is_int() ) return Token( sqrt( tok.as_int() ) );
++ if ( tok.is_int() ) return Token( sqrt( (double) tok.as_int() ) );
+ if ( tok.is_float() ) return Token( sqrt( tok.as_float() ) );
+ if ( tok.is_int_vector() || tok.is_float_vector() )
+ {
+@@ -2154,7 +2154,7 @@ Token TokenFunctions::fn_sqrt( const Tok
+
+ Token TokenFunctions::fn_log( const Token & tok ) const
+ {
+- if ( tok.is_int() ) return Token( log( tok.as_int() ) );
++ if ( tok.is_int() ) return Token( log( (double) tok.as_int() ) );
+ if ( tok.is_float() ) return Token( log( tok.as_float() ) );
+ if ( tok.is_int_vector() || tok.is_float_vector() )
+ {
+@@ -2168,7 +2168,7 @@ Token TokenFunctions::fn_log( const Toke
+
+ Token TokenFunctions::fn_log10( const Token & tok ) const
+ {
+- if ( tok.is_int() ) return Token( log10( tok.as_int() ) );
++ if ( tok.is_int() ) return Token( log10( (double) tok.as_int() ) );
+ if ( tok.is_float() ) return Token( log10( tok.as_float() ) );
+ if ( tok.is_int_vector() || tok.is_float_vector() )
+ {
+@@ -2181,7 +2181,7 @@ Token TokenFunctions::fn_log10( const To
+
+ Token TokenFunctions::fn_exp( const Token & tok ) const
+ {
+- if ( tok.is_int() ) return Token( exp( tok.as_int() ) );
++ if ( tok.is_int() ) return Token( exp( (double) tok.as_int() ) );
+ if ( tok.is_float() ) return Token( exp( tok.as_float() ) );
+ if ( tok.is_int_vector() || tok.is_float_vector() )
+ {
+@@ -2202,10 +2202,10 @@ Token TokenFunctions::fn_pow( const Toke
+
+ if ( is_int_type && tok2.is_int() )
+ {
+- if ( tok.is_scalar() ) return Token( (int)(pow( tok.as_int() , tok2.as_int() )) );
++ if ( tok.is_scalar() ) return Token( (int)(pow( tok.as_int() , (double) tok2.as_int() )) );
+ std::vector<int> ans = tok.as_int_vector();
+ const int ev = tok2.as_int();
+- for (int i=0; i<ans.size(); i++) ans[i] = (int)(pow( ans[i] , ev ) );
++ for (int i=0; i<ans.size(); i++) ans[i] = (int)(pow( ans[i] , (double) ev ) );
+ return Token( ans );
+ }
+