Repository: spack/spack

Issue:
Racket packages were not correctly converted in #30738
### Steps to reproduce

```console
$ spack install rkt-base
```


### Error message

<details><summary>Error message</summary>

<pre>
==> Error: ProcessError: Command exited with status 1:
    'raco' 'pkg' 'install' '-t' 'dir' '-n' 'base' '--deps' 'fail' '--ignore-implies' '--copy' '-i' '-j' '8' '--skip-installed' '--' '/tmp/ubuntu/spack-stage/spack-stage-rkt-base-8.3-3rprlc7zcocklfaacdocsgktqiigv6t3/spack-src'
See build log for details:
  /tmp/ubuntu/spack-stage/spack-stage-rkt-base-8.3-3rprlc7zcocklfaacdocsgktqiigv6t3/spack-build-out.txt</pre></details>


### Information on your system

* **Spack:** 0.20.1 (8c89bf555d2f31298a3ced4a065df57baddcb929)
* **Python:** 3.10.12
* **Platform:** linux-ubuntu22.04-aarch64
* **Concretizer:** clingo


The problem is that `subdirectory` property on the package is no longer being set correctly.
The `spack-build-out.txt` shows that this command is executing:
```shell
'raco' 'pkg' 'install' '-t' 'dir' '-n' 'base' '--deps' 'fail' '--ignore-implies' '--copy' '-i' '-j' '8' '--' '/tmp/ubuntu/spack-stage/spack-stage-rkt-base-8.3-3rprlc7zcocklfaacdocsgktqiigv6t3/spack-src'
```

However the **correct** command in this instance would be:

```shell
'raco' 'pkg' 'install' '-t' 'dir' '-n' 'base' '--deps' 'fail' '--ignore-implies' '--copy' '-i' '-j' '8' '--' '/tmp/ubuntu/spack-stage/spack-stage-rkt-base-8.3-3rprlc7zcocklfaacdocsgktqiigv6t3/spack-src/pkgs/base'
```

I'm a maintainer for the Racket packages; however, I am unfamiliar with these build system changes and was not consulted when @alalazo updated them. I would guess that @arjunguha (the maintainer of the main Racket package) was also not informed as this seems like it should have been caught in testing that the refactoring didn't break packages using this build system.

### General information

- [X] I have run `spack debug report` and reported the version of Spack/Python/Platform
- [X] I have searched the issues of this repo and believe this is not a duplicate
- [X] I have run the failing commands in debug mode and reported the output


Discussion:

Resolving patch:
diff --git a/lib/spack/spack/build_systems/racket.py b/lib/spack/spack/build_systems/racket.py
--- a/lib/spack/spack/build_systems/racket.py
+++ b/lib/spack/spack/build_systems/racket.py
@@ -64,7 +64,7 @@ class RacketBuilder(spack.builder.Builder):
 
     @property
     def subdirectory(self):
-        if self.racket_name:
+        if self.pkg.racket_name:
             return "pkgs/{0}".format(self.pkg.racket_name)
         return None
 
diff --git a/var/spack/repos/builtin/packages/rkt-racket-lib/package.py b/var/spack/repos/builtin/packages/rkt-racket-lib/package.py
new file mode 100644
--- /dev/null
+++ b/var/spack/repos/builtin/packages/rkt-racket-lib/package.py
@@ -0,0 +1,20 @@
+# Copyright 2013-2023 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.package import *
+
+
+class RktRacketLib(RacketPackage):
+    """Stub package for packages which are currently part of core
+    racket installation (but which may change in the future)."""
+
+    git = "ssh://git@github.com/racket/racket.git"
+
+    maintainers = ["elfprince13"]
+
+    version("8.3", commit="cab83438422bfea0e4bd74bc3e8305e6517cf25f")  # tag="v8.3"
+    depends_on("racket@8.3", type=("build", "run"), when="@8.3")
+
+    racket_name = "racket-lib"
diff --git a/var/spack/repos/builtin/packages/rkt-scheme-lib/package.py b/var/spack/repos/builtin/packages/rkt-scheme-lib/package.py
--- a/var/spack/repos/builtin/packages/rkt-scheme-lib/package.py
+++ b/var/spack/repos/builtin/packages/rkt-scheme-lib/package.py
@@ -17,3 +17,4 @@ class RktSchemeLib(RacketPackage):
     depends_on("rkt-base@8.3", type=("build", "run"), when="@8.3")
 
     racket_name = "scheme-lib"
+    subdirectory = None


Test patch: