plink: add new version (#34741)

The distribution of this has jumped around a bit. I left the previous
versions as-is.
This commit is contained in:
Glenn Johnson 2023-01-10 18:55:45 -06:00 committed by GitHub
parent 4414161787
commit b94030cc5d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 96 additions and 4 deletions

View file

@ -0,0 +1,70 @@
diff -ur a/1.9/dose2plink.c b/1.9/dose2plink.c
--- a/1.9/dose2plink.c 2022-12-19 11:00:05.000000000 -0600
+++ b/1.9/dose2plink.c 2022-12-19 13:08:50.022275377 -0600
@@ -15,6 +15,8 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
+#include "plink_common.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -96,7 +98,11 @@
#endif
#endif
-#include "../zlib-1.2.12/zlib.h"
+#ifdef DYNAMIC_ZLIB
+ #include <zlib.h>
+#else
+ #include "../zlib-1.2.12/zlib.h"
+#endif
#ifdef __APPLE__
#include <sys/sysctl.h>
diff -ur a/1.9/pigz.c b/1.9/pigz.c
--- a/1.9/pigz.c 2022-12-19 11:00:05.000000000 -0600
+++ b/1.9/pigz.c 2022-12-19 13:06:08.562023953 -0600
@@ -485,6 +485,8 @@
}
#else
+#include "pigz.h"
+
#define VERSION "pigz 2.3\n"
/* use large file functions if available */
@@ -543,8 +545,6 @@
release(), peek_lock(), free_lock(), yarn_name */
#endif
-#include "pigz.h"
-
/* for local functions and globals */
#define local static
diff -ur a/1.9/pigz.h b/1.9/pigz.h
--- a/1.9/pigz.h 2022-12-19 11:00:05.000000000 -0600
+++ b/1.9/pigz.h 2022-12-19 12:58:40.385103423 -0600
@@ -1,6 +1,8 @@
#ifndef __PIGZ_H__
#define __PIGZ_H__
+#include "plink_common.h"
+
#include <stdint.h>
#include <inttypes.h>
diff -ur a/1.9/plink_common.h b/1.9/plink_common.h
--- a/1.9/plink_common.h 2022-12-19 11:00:06.000000000 -0600
+++ b/1.9/plink_common.h 2022-12-19 12:58:06.819259147 -0600
@@ -41,6 +41,8 @@
// Uncomment this to build this without CBLAS/CLAPACK.
// #define NOLAPACK
+#define DYNAMIC_ZLIB
+
// Uncomment this to prevent all unstable features from being accessible from
// the command line.
#define STABLE_BUILD

View file

@ -13,6 +13,11 @@ class Plink(Package):
homepage = "https://www.cog-genomics.org/plink/1.9/"
version(
"1.9-beta6.27",
commit="a2ea957c893fbb0558358edef27f3ecbf3d360f8",
git="https://github.com/chrchang/plink-ng.git",
)
version(
"1.9-beta6.10",
sha256="f8438656996c55a5edd95c223cce96277de6efaab1b9b1d457bfee0c272058d8",
@ -30,10 +35,15 @@ class Plink(Package):
preferred=True,
)
depends_on("atlas", when="@1.9-beta5")
depends_on("netlib-lapack", when="@1.9-beta5")
depends_on("atlas", when="@1.9-beta6.10")
depends_on("netlib-lapack", when="@1.9-beta6.10")
depends_on("atlas", when="@1.9-beta5:1.9-beta6.10")
depends_on("netlib-lapack", when="@1.9-beta5:1.9-beta6.10")
with when("@1.9-beta-6.27:"):
depends_on("zlib", when="@1.9-beta6.27:")
depends_on("blas", when="@1.9-beta6.27:")
depends_on("lapack", when="@1.9-beta6.27:")
patch("dynamic_zlib.patch", when="@1.9-beta6.27:")
def install(self, spec, prefix):
mkdirp(prefix.bin)
@ -47,3 +57,15 @@ def install(self, spec, prefix):
install("plink", prefix.bin)
if spec.version == Version("1.9-beta6.10"):
install("plink", prefix.bin)
@when("@1.9-beta6.27:")
def setup_build_environment(self, env):
env.set("BLASFLAGS", self.spec["blas"].libs.ld_flags)
env.set("ZLIB", self.spec["zlib"].libs.ld_flags)
@when("@1.9-beta6.27:")
def install(self, spec, prefix):
with working_dir("1.9"):
make()
mkdir(prefix.bin)
install("plink", prefix.bin)