descent3: init at 1.5.0-beta-unstable-2024-10-29
By default, Descent 3 will only look for game files in the current working directory. In order to function properly, Descent 3 needs to look for some of its files in the Nix store. This commit creates a wrapper around the main Descent3 executable that automatically looks in the correct path in the Nix store. Hopefully, this wrapper will only exist temporarily. I have an unfinished Descent 3 pull request that adds a DEFAULT_ADDITIONAL_DIRS CMake option [1]. Once I can finish that pull request (DescentDevelopers/Descent3#623 needs to get merged first), we’ll be able to get rid of this wrapper and use DEFAULT_ADDITIONAL_DIRS instead. Additionally, if DescentDevelopers/Descent3#628 gets merged first, then that pull request will also probably make this wrapper unnecessary. [1]: <https://github.com/DescentDevelopers/Descent3/pull/471>
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
{
|
||||
descent3-unwrapped,
|
||||
lib,
|
||||
makeBinaryWrapper,
|
||||
runCommand,
|
||||
}:
|
||||
|
||||
runCommand "descent3-${descent3-unwrapped.version}"
|
||||
{
|
||||
pname = "descent3";
|
||||
inherit (descent3-unwrapped) version;
|
||||
nativeBuildInputs = [ makeBinaryWrapper ];
|
||||
passthru.unwrapped = descent3-unwrapped;
|
||||
|
||||
meta = descent3-unwrapped.meta // {
|
||||
# The code that produces the wrapper is in the Nixpkgs repo, and the
|
||||
# Nixpkgs repo is MIT Licensed.
|
||||
license = [ lib.licenses.mit ];
|
||||
longDescription = ''
|
||||
Playing Descent 3 using the Nix package manager is a little bit awkward
|
||||
at the moment. This wrapper makes it slightly less awkward. Here’s how
|
||||
you use this wrapper:
|
||||
|
||||
1. Install the `descent3` package, or start an ephemeral shell with the
|
||||
`descent3` package.
|
||||
|
||||
2. Find the documentation folder for `descent3-unwrapped` by running this
|
||||
command:
|
||||
|
||||
```bash
|
||||
nix-instantiate --eval --expr '(import <nixpkgs> { }).descent3-unwrapped + "/share/doc/Descent3"'
|
||||
```
|
||||
|
||||
3. Open `<descent3-unwrapped-doc-folder>/USAGE.md`.
|
||||
|
||||
4. Follow steps 1–6 of Descent 3’s usage instructions.
|
||||
|
||||
5. Change directory into the `D3-open-source` folder:
|
||||
|
||||
```bash
|
||||
cd <path-to-D3-open-source>
|
||||
```
|
||||
|
||||
6. Start Descent 3 by running this command:
|
||||
|
||||
```bash
|
||||
Descent3
|
||||
```
|
||||
'';
|
||||
};
|
||||
}
|
||||
''
|
||||
mkdir --parents "$out/bin"
|
||||
descent3_unwrapped=${lib.strings.escapeShellArg descent3-unwrapped}
|
||||
makeBinaryWrapper \
|
||||
"$descent3_unwrapped/bin/Descent3" \
|
||||
"$out/bin/Descent3" \
|
||||
--append-flags -additionaldir \
|
||||
--append-flags "$descent3_unwrapped/share"
|
||||
''
|
||||
Reference in New Issue
Block a user