summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam J. Stewart <ajstewart426@gmail.com>2021-01-06 01:59:12 -0600
committerGitHub <noreply@github.com>2021-01-06 08:59:12 +0100
commit323667ce2a84e17c42f193be9eff15ac492ca4d0 (patch)
tree56e28ecc4180c8d1936e3b44d3f795692b70281a
parent564aebdb1a7ae3294801c9eceed08202fd665fe7 (diff)
downloadspack-323667ce2a84e17c42f193be9eff15ac492ca4d0.tar.gz
spack-323667ce2a84e17c42f193be9eff15ac492ca4d0.tar.bz2
spack-323667ce2a84e17c42f193be9eff15ac492ca4d0.tar.xz
spack-323667ce2a84e17c42f193be9eff15ac492ca4d0.zip
fakexrandr: add new package (#20687)
-rw-r--r--var/spack/repos/builtin/packages/fakexrandr/package.py46
1 files changed, 46 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/fakexrandr/package.py b/var/spack/repos/builtin/packages/fakexrandr/package.py
new file mode 100644
index 0000000000..aa38531906
--- /dev/null
+++ b/var/spack/repos/builtin/packages/fakexrandr/package.py
@@ -0,0 +1,46 @@
+# Copyright 2013-2021 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 Fakexrandr(MakefilePackage):
+ """This is a tool to cheat an X11 server to believe that there are more
+ monitors than there actually are."""
+
+ homepage = "https://github.com/phillipberndt/fakexrandr"
+ git = "https://github.com/phillipberndt/fakexrandr.git"
+
+ version('master', branch='master')
+
+ depends_on('libxrandr')
+ depends_on('libxinerama')
+ depends_on('libx11')
+ depends_on('python', type=('build', 'run'))
+
+ def edit(self, spec, prefix):
+ # Installation instructions involve running `configure` script,
+ # but this script just writes a `config.h` file like below.
+ version = spec['libxrandr'].version
+ with open('config.h', 'w') as config:
+ config.write("""
+#define XRANDR_MAJOR {0}
+#define XRANDR_MINOR {1}
+#define XRANDR_PATCH {2}
+#define REAL_XRANDR_LIB "{3}"
+#define FAKEXRANDR_INSTALL_DIR "{4}"
+""".format(version[0], version[1], version[2],
+ spec['libxrandr'].libs[0], prefix.lib))
+
+ # Also need to hack Makefile
+ makefile = FileFilter('Makefile')
+ makefile.filter('PREFIX=/usr', 'PREFIX=' + prefix)
+ makefile.filter('-fPIC', self.compiler.cc_pic_flag)
+
+ # And tool used to generate skeleton
+ filter_file('gcc', spack_cc, 'make_skeleton.py')
+
+ if 'platform=darwin' in spec:
+ makefile.filter('ldconfig', '')