summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--var/spack/repos/builtin/packages/bcache/func_crc64.patch13
-rw-r--r--var/spack/repos/builtin/packages/bcache/package.py36
2 files changed, 49 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/bcache/func_crc64.patch b/var/spack/repos/builtin/packages/bcache/func_crc64.patch
new file mode 100644
index 0000000000..7acc312139
--- /dev/null
+++ b/var/spack/repos/builtin/packages/bcache/func_crc64.patch
@@ -0,0 +1,13 @@
+diff --git a/bcache.c b/bcache.c
+index 8f37445..8b4b986 100644
+--- a/bcache.c
++++ b/bcache.c
+@@ -115,7 +115,7 @@ static const uint64_t crc_table[256] = {
+ 0x9AFCE626CE85B507ULL
+ };
+
+-inline uint64_t crc64(const void *_data, size_t len)
++uint64_t crc64(const void *_data, size_t len)
+ {
+ uint64_t crc = 0xFFFFFFFFFFFFFFFFULL;
+ const unsigned char *data = _data;
diff --git a/var/spack/repos/builtin/packages/bcache/package.py b/var/spack/repos/builtin/packages/bcache/package.py
new file mode 100644
index 0000000000..63c42de333
--- /dev/null
+++ b/var/spack/repos/builtin/packages/bcache/package.py
@@ -0,0 +1,36 @@
+# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
+# Spack Project Developers. See the top-level COPYRIGHT file for details.
+#
+# SPDX-License-Identifier: (Apache-2.0 OR MIT)
+
+from spack import *
+
+
+class Bcache(MakefilePackage):
+ """Bcache is a patch for the Linux kernel to use SSDs to cache other block
+ devices."""
+
+ homepage = "http://bcache.evilpiepirate.org"
+ url = "https://github.com/g2p/bcache-tools/archive/v1.0.8.tar.gz"
+
+ version('1.0.8', sha256='d56923936f37287efc57a46315679102ef2c86cd0be5874590320acd48c1201c')
+ version('1.0.7', sha256='64d76d1085afba8c3d5037beb67bf9d69ee163f357016e267bf328c0b1807abd')
+ version('1.0.6', sha256='9677c6da3ceac4e1799d560617c4d00ea7e9d26031928f8f94b8ab327496d4e0')
+ version('1.0.5', sha256='1449294ef545b3dc6f715f7b063bc2c8656984ad73bcd81a0dc048cbba416ea9')
+ version('1.0.4', sha256='102ffc3a8389180f4b491188c3520f8a4b1a84e5a7ca26d2bd6de1821f4d913d')
+
+ depends_on('libuuid')
+ depends_on('util-linux')
+ depends_on('gettext')
+
+ def setup_build_environment(self, env):
+ env.append_flags('LDFLAGS', '-lintl')
+
+ patch('func_crc64.patch', sha256='558b35cadab4f410ce8f87f0766424a429ca0611aa2fd247326ad10da115737d')
+
+ def install(self, spec, prefix):
+ mkdirp(prefix.bin)
+ install('bcache-register', prefix.bin)
+ install('bcache-super-show', prefix.bin)
+ install('make-bcache', prefix.bin)
+ install('probe-bcache', prefix.bin)