From adb9ffe921f71be43471acd9432fe5262d6809a9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Eric=20M=C3=BCller?= <mueller@kip.uni-heidelberg.de>
Date: Tue, 15 Mar 2022 13:15:36 +0100
Subject: [PATCH] Drop meta-brainscales (move dependencies into
 pynn-brainscales)

---
 packages/meta-brainscales/package.py | 68 ---------------------
 packages/pynn-brainscales/package.py | 90 +++++++++++++---------------
 2 files changed, 43 insertions(+), 115 deletions(-)
 delete mode 100644 packages/meta-brainscales/package.py

diff --git a/packages/meta-brainscales/package.py b/packages/meta-brainscales/package.py
deleted file mode 100644
index bed34fc8..00000000
--- a/packages/meta-brainscales/package.py
+++ /dev/null
@@ -1,68 +0,0 @@
-# Copyright 2013-2019 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 MetaBrainscales(Package):
-    """Core package that contains dependencies of the core DLS software
-    ONLY!"""
-
-    homepage = ''
-    # some random tarball, to make `spack fetch --dependencies visionary-defaults` work
-    url = 'https://github.com/electronicvisions/spack/archive/v0.8.tar.gz'
-
-    # This is only a dummy tarball (see difference between version numbers)
-    # TODO: as soon as a MetaPackage-concept has been merged, please update this package
-    version('1.0', '372ce038842f20bf0ae02de50c26e85d', url='https://github.com/electronicvisions/spack/archive/v0.8.tar.gz')
-
-    # PPU compiler dependencies
-    depends_on('gettext')
-    depends_on('zlib')
-    depends_on('bison')
-    depends_on('flex')
-    depends_on('m4')
-    depends_on('texinfo')
-    depends_on('wget')
-    conflicts('flex', when='@2.6.3', msg='Binutils 2.25 for Nux doesn\'t build with flex 2.6.3.')
-
-    # host software dependencies
-    depends_on('bitsery')
-    depends_on('binutils+gold+ld+plugins') # specialize
-    depends_on('boost@1.69.0: +graph+icu+mpi+python+numpy+coroutine+context cxxstd=17') # specialize boost (non-clingo)
-    depends_on('cereal')
-    depends_on('cppcheck')
-    depends_on('doxygen+graphviz')
-    depends_on('genpybind@ebrains')
-    depends_on('gflags')
-    depends_on('googletest@1.11.0: +gmock') # variadic templates needed
-    depends_on('intel-tbb')  # ppu gdbserver
-    depends_on('libelf')
-    depends_on('liblockfile')
-    depends_on('llvm')
-    depends_on('log4cxx')
-    depends_on('pkg-config')
-    depends_on('python@3.7.0:') # BrainScaleS(-2) only supports Python >= 3.7
-    depends_on('py-h5py') # PyNN tests need it
-    depends_on('py-matplotlib')
-    depends_on('py-nose')
-    depends_on('py-numpy')
-    depends_on('py-pybind11')
-    depends_on('py-pybind11-stubgen')
-    depends_on('py-pycodestyle')
-    depends_on('py-pyelftools')
-    depends_on('py-pylint')
-    depends_on('py-pynn@0.9.4:')
-    depends_on('py-pyyaml')
-    depends_on('py-scipy')
-    depends_on('py-sqlalchemy')
-    depends_on('util-linux')
-    depends_on('yaml-cpp+shared')
-
-
-    # dummy installer; it's a "meta" package
-    def install(self, spec, prefix):
-        mkdirp(prefix.etc)
-        install(__file__, join_path(prefix.etc, spec.name + '.py'))
diff --git a/packages/pynn-brainscales/package.py b/packages/pynn-brainscales/package.py
index 44582985..8a510de7 100644
--- a/packages/pynn-brainscales/package.py
+++ b/packages/pynn-brainscales/package.py
@@ -1,4 +1,4 @@
-# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
+# Copyright 2013-2022 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)
@@ -13,55 +13,51 @@ class PynnBrainscales(WafPackage):
     git      = "https://github.com/electronicvisions/pynn-brainscales.git"
 
     version('2.0-rc1', branch='waf')
-    depends_on('meta-brainscales', type=('build', 'link', 'run'))
-    depends_on('py-pyyaml', type=('build'))
-    extends('python')
-
-    def setup_build_environment(self, env):
-        """waf needs to find headers and libraries by itself (mostly `boost`
-        tool, but also `gtest`); it also needs to run executables during
-        configuration."""
-
-        include = []
-        for dep in self.spec.traverse(deptype='build'):
-            query = self.spec[dep.name]
-            try:
-                include.extend(query.headers.directories)
-                print('headers:', query.headers.directories, "\n")
-            except:
-                pass
 
-        library = []
-        for dep in self.spec.traverse(deptype=('link', 'run')):
-            query = self.spec[dep.name]
-            try:
-                library.extend(query.libs.directories)
-                print('libs:', query.libs.directories, "\n")
-            except:
-                pass
+    # PPU compiler dependencies
+    depends_on('gettext')
+    depends_on('zlib')
+    depends_on('bison')
+    depends_on('flex')
+    depends_on('m4')
+    depends_on('texinfo')
+    depends_on('wget')
+    conflicts('flex', when='@2.6.3', msg='Binutils 2.25 for Nux doesn\'t build with flex 2.6.3.')
 
-        path = []
-        for dep in self.spec.traverse(deptype=('build', 'link', 'run')):
-            query = self.spec[dep.name]
-            try:
-                path.append(query.prefix.bin)
-                print('bin:', query.prefix.bin, "\n")
-            except:
-                pass
-
-        # llvm might be built with ~shared_libs but still builds shared libs
-        if not any('llvm' in lib for lib in library):
-            library.append(self.spec['llvm'].prefix.lib)
-
-        env.set('CPATH', ':'.join(include))
-        env.set('C_INCLUDE_PATH', ':'.join(include))
-        env.set('CPLUS_INCLUDE_PATH', ':'.join(include))
-        env.set('LIBRARY_PATH', ':'.join(library))
-        env.set('LD_LIBRARY_PATH', ':'.join(library))
-        env.prepend_path('PATH', ':'.join(path))
+    # host software dependencies
+    depends_on('bitsery', type=('build', 'link', 'run'))
+    depends_on('binutils+gold+ld+plugins', type=('build', 'link', 'run')) # specialize
+    depends_on('boost@1.69.0: +graph+icu+mpi+python+numpy+coroutine+context cxxstd=17', type=('build', 'link', 'run')) # specialize boost (non-clingo, type=('build', 'link', 'run'))
+    depends_on('cereal', type=('build', 'link', 'run'))
+    depends_on('cppcheck', type=('build', 'link', 'run'))
+    depends_on('doxygen+graphviz', type=('build', 'link', 'run'))
+    depends_on('genpybind@ebrains', type=('build', 'link', 'run'))
+    depends_on('gflags', type=('build', 'link', 'run'))
+    depends_on('googletest@1.11.0: +gmock', type=('build', 'link', 'run')) # variadic templates needed
+    depends_on('intel-tbb', type=('build', 'link', 'run'))  # ppu gdbserver
+    depends_on('libelf', type=('build', 'link', 'run'))
+    depends_on('liblockfile', type=('build', 'link', 'run'))
+    depends_on('llvm', type=('build', 'link', 'run'))
+    depends_on('log4cxx', type=('build', 'link', 'run'))
+    depends_on('pkg-config', type=('build', 'link', 'run'))
+    depends_on('python@3.7.0:', type=('build', 'link', 'run')) # BrainScaleS(-2, type=('build', 'link', 'run')) only supports Python >= 3.7
+    depends_on('py-h5py', type=('build', 'link', 'run')) # PyNN tests need it
+    depends_on('py-matplotlib', type=('build', 'link', 'run'))
+    depends_on('py-nose', type=('build', 'link', 'run'))
+    depends_on('py-numpy', type=('build', 'link', 'run'))
+    depends_on('py-pybind11', type=('build', 'link', 'run'))
+    depends_on('py-pybind11-stubgen', type=('build', 'link', 'run'))
+    depends_on('py-pycodestyle', type=('build', 'link', 'run'))
+    depends_on('py-pyelftools', type=('build', 'link', 'run'))
+    depends_on('py-pylint', type=('build', 'link', 'run'))
+    depends_on('py-pynn@0.9.4:', type=('build', 'link', 'run'))
+    depends_on('py-pyyaml', type=('build', 'link', 'run'))
+    depends_on('py-scipy', type=('build', 'link', 'run'))
+    depends_on('py-sqlalchemy', type=('build', 'link', 'run'))
+    depends_on('util-linux', type=('build', 'link', 'run'))
+    depends_on('yaml-cpp+shared', type=('build', 'link', 'run'))
+    extends('python')
 
-    def setup_run_environment(self, env):
-        env.prepend_path('PYTHONPATH', self.prefix.lib)
 
     # override configure step as we perform a project setup first
     def configure(self, spec, prefix):
-- 
GitLab