From b94030cc5ddf74c664d4a9fdf7b0f45f85c675e6 Mon Sep 17 00:00:00 2001 From: Glenn Johnson Date: Tue, 10 Jan 2023 18:55:45 -0600 Subject: plink: add new version (#34741) The distribution of this has jumped around a bit. I left the previous versions as-is. --- .../builtin/packages/plink/dynamic_zlib.patch | 70 ++++++++++++++++++++++ var/spack/repos/builtin/packages/plink/package.py | 30 ++++++++-- 2 files changed, 96 insertions(+), 4 deletions(-) create mode 100644 var/spack/repos/builtin/packages/plink/dynamic_zlib.patch (limited to 'var') diff --git a/var/spack/repos/builtin/packages/plink/dynamic_zlib.patch b/var/spack/repos/builtin/packages/plink/dynamic_zlib.patch new file mode 100644 index 0000000000..301f4a0eda --- /dev/null +++ b/var/spack/repos/builtin/packages/plink/dynamic_zlib.patch @@ -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 . + ++#include "plink_common.h" ++ + #include + #include + #include +@@ -96,7 +98,11 @@ + #endif + #endif + +-#include "../zlib-1.2.12/zlib.h" ++#ifdef DYNAMIC_ZLIB ++ #include ++#else ++ #include "../zlib-1.2.12/zlib.h" ++#endif + + #ifdef __APPLE__ + #include +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 + #include + +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 diff --git a/var/spack/repos/builtin/packages/plink/package.py b/var/spack/repos/builtin/packages/plink/package.py index b1e549052e..21ba61a82b 100644 --- a/var/spack/repos/builtin/packages/plink/package.py +++ b/var/spack/repos/builtin/packages/plink/package.py @@ -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 @@ class Plink(Package): 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) -- cgit v1.2.3-70-g09d2