summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--var/spack/repos/builtin/packages/plink/dynamic_zlib.patch70
-rw-r--r--var/spack/repos/builtin/packages/plink/package.py30
2 files changed, 96 insertions, 4 deletions
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 <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
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
@@ -14,6 +14,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",
url="https://s3.amazonaws.com/plink1-assets/plink_linux_x86_64_20190617.zip",
@@ -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)