summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorJohn W. Parent <45471568+johnwparent@users.noreply.github.com>2024-09-06 08:26:46 -0400
committerGitHub <noreply@github.com>2024-09-06 14:26:46 +0200
commit4042afaa99426d8ed35643e531b69a8012fbd3f2 (patch)
tree5ff5555897e77f6538a192ee623595b54bbccc90 /var
parent7fdf1029b747555f1d3040075bfeaf322ee6837e (diff)
downloadspack-4042afaa99426d8ed35643e531b69a8012fbd3f2.tar.gz
spack-4042afaa99426d8ed35643e531b69a8012fbd3f2.tar.bz2
spack-4042afaa99426d8ed35643e531b69a8012fbd3f2.tar.xz
spack-4042afaa99426d8ed35643e531b69a8012fbd3f2.zip
Bootstrap GnuPG and `file` on Windows (#41810)
Spack can now bootstrap two new dependencies on Windows: GnuPG, and file. These dependencies are modeled as a separate package, and they install a cross-compiled binary. Details on how they binaries are built are in https://github.com/spack/windows-bootstrap-resources
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/win-file/package.py35
-rw-r--r--var/spack/repos/builtin/packages/win-gpg/package.py36
2 files changed, 71 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/win-file/package.py b/var/spack/repos/builtin/packages/win-file/package.py
new file mode 100644
index 0000000000..2196be842d
--- /dev/null
+++ b/var/spack/repos/builtin/packages/win-file/package.py
@@ -0,0 +1,35 @@
+# Copyright 2013-2024 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)
+import os
+import re
+import shutil
+
+from spack.package import *
+
+
+class WinFile(Package):
+ """File "file type guesser" system utility cross compiled for x86_64 Windows
+ systems via the Mingw-w64 cross compiler and a custom Spack repository
+ """
+
+ homepage = "https://spack.github.io/windows-bootstrap-resources"
+ url = (
+ "https://spack.github.io/windows-bootstrap-resources/resources/file/5.45/file_5.45.tar.gz"
+ )
+
+ executables = ["^file$"]
+
+ version("5.45", sha256="11b8f3abf647c711bc50ef8451c8d6e955f11c4afd8b0a98f2ac65e9b6e10d5e")
+
+ @classmethod
+ def determine_version(cls, exe):
+ output = Executable(exe)("--version", output=str, error=str)
+ match = re.search(r"file-(\S+)", output)
+ return match.group(1) if match else None
+
+ def install(self, spec, prefix):
+ mkdirp(prefix)
+ for subdir in os.listdir(self.stage.source_path):
+ shutil.move(subdir, prefix)
diff --git a/var/spack/repos/builtin/packages/win-gpg/package.py b/var/spack/repos/builtin/packages/win-gpg/package.py
new file mode 100644
index 0000000000..f2fef7ff6d
--- /dev/null
+++ b/var/spack/repos/builtin/packages/win-gpg/package.py
@@ -0,0 +1,36 @@
+# Copyright 2013-2024 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)
+import os
+import re
+import shutil
+
+from spack.package import *
+
+
+class WinGpg(Package):
+ """GnuPG is a complete and free implementation of the OpenPGP
+ standard as defined by RFC4880 (also known as PGP).
+
+ This utility was cross compiled for x86_64 Windows
+ systems via the Mingw-w64 cross compiler and a custom Spack repository
+ """
+
+ homepage = "https://spack.github.io/windows-bootstrap-resources/"
+ url = "https://spack.github.io/windows-bootstrap-resources/resources/gpg/2.4.5/gpg4win_2.4.5.tar.gz"
+
+ executables = ["^gpg$"]
+
+ version("2.4.5", sha256="249ab87bd06abea3140054089bad44d9a5d1531413590576da609142db2673ec")
+
+ @classmethod
+ def determine_version(cls, exe):
+ output = Executable(exe)("--version", output=str, error=str)
+ match = re.search(r"gpg (\S+)", output)
+ return match.group(1) if match else None
+
+ def install(self, spec, prefix):
+ mkdirp(prefix)
+ for subdir in os.listdir(self.stage.source_path):
+ shutil.move(subdir, prefix)