| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This should make all the extra unpackCmd attributes for the GOG games
superfluous and make the expression way less convoluted, especially the
games based on Unity3D.
Right now however, the gogUnpackHook is added to buildGame, which is
used for all games, not only for the GOG ones. While it doesn't really
hurt or affect non-GOG games, it's still part of the build closure so we
might want to apply this to GOG only at some day.
For that, we need to restructure our whole packaging layout, because we
want to have a way to override buildGame only for a certain namespace
but without introducing too much churn or duplicating things.
Signed-off-by: aszlig <aszlig@nix.build>
Cc: @layus
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is quite redundant because autoPatchelfHook already scans all
shared objects and executables for dependencies and bails out with an
error if a dependency isn't found, which is similar to what we're doing
in installCheckPhase.
Removing this should also speed up builds, especially those with lots of
files.
Signed-off-by: aszlig <aszlig@nix.build>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
So far we only checked for the source root by checking only one level of
directories, so for example if the source code is unpacked into
something like "a/b/c" and only "c" contains files, the previous
implementation would set the source root to be "a".
In addition we didn't do a check on the type of the contents, so for
example if the archive contains only *one* file, that *file* itself
would be set as the source root and the chdir to that will fail later.
What we do now is recursively search through directories in order to
find the last directory that does not contain *only* a subdirectory.
Signed-off-by: aszlig <aszlig@nix.build>
|
|
|
|
|
|
|
|
| |
Having a function in autoPatchelfHook that's unused inside the setup
hook is a bit of weird, because the actual usage is within buildGame and
thus it should stay there for now.
Signed-off-by: aszlig <aszlig@nix.build>
|
|
|
|
|
|
|
|
|
| |
This is really not game-specific, so let's put it at the top-level and
also make sure we substitute all the commands we're using there, even
though a few of them are in PATH of stdenv so that it will always work
even when the programs available in stdenv should change someday.
Signed-off-by: aszlig <aszlig@nix.build>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We now distinguish between paths that have to exist and paths that are
fine to skip during bind mounting.
So far we had hard failures whenever a path that needed to be mounted
didn't exist, for example something like $XDG_CONFIG_HOME/unity3d failed
whenever the directory didn't exist.
Apart from that we now have a more clean attribute structure for sandbox
parameters, which are now:
* paths.required: Created prior to bind-mounting
* paths.wanted: Skipped if it doesn't exist
* paths.runtimeVars: Extracted from PATH-like environment variables
Signed-off-by: aszlig <aszlig@nix.build>
|
|
|
|
|
|
|
|
|
| |
This is using buildSandbox with the addition of adding LD_LIBRARY_PATH
to the default runtimePathVars. I've also renamed the attribute to be
called runtimePathVars instead of runtimePathVariables, simply because
it's shorter.
Signed-off-by: aszlig <aszlig@redmoonstudios.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
So far creating the sandbox has been a setup hook, however it's a bit
ugly how we gathered the needed paths for the chroot file system by
recursively searching for store paths.
While I'd like to have the sandbox being built within the main
derivation, it really isn't very practical when the build takes longer
than 10 minutes.
With this implementation however the sandbox builds really fast and we
can also modify the sandbox without needing to rebuild a particular
game.
Signed-off-by: aszlig <aszlig@redmoonstudios.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is basically to make sure various games can't write to whatever
they want in the file system, so it's not a complete sandboxing
solution.
Currently there's a drawback in that we can't easily determine the
runtime dependencies while building a particular game, so we need to
recursively dig through all referenced store paths to look them up.
A better solution for this would be to gather the build time reference
graph prior to building so that we can limit searching for these
references within only the actual build outputs instead of churning
through all inputs.
In addition to that, we currently mount the namespaced root file system
on top of /tmp, which makes the real /tmp unavailable to us. While in
theory this shouldn't be a problem, it actually turns out it is indeed a
problem if the application wants to connect to the X server socket,
which is at something like /tmp/.X11-unix/X0 for display :0.
Apart from these drawbacks we have a working solution for simple
applications (not games, because they usually require X), which now get
its own chroot with only the paths accessible that are strictly
necessary.
Signed-off-by: aszlig <aszlig@redmoonstudios.org>
|
|
|
|
|
|
|
|
|
| |
Most older games don't cope very well with PulseAudio, so let's add ALSA
so that a fallback is available. This is also very useful if
withPulseAudio is set to false, because this would actually mean "no
audio at all".
Signed-off-by: aszlig <aszlig@redmoonstudios.org>
|
|
|
|
|
|
|
|
|
|
|
| |
A lot of games come as a Zip archive, so let's add it to
nativeBuildInputs by default so we no longer need to deal with that for
every single game.
This also removes that line from Invisigun Heroes, so the package now is
pretty much minimal and very clean :-)
Signed-off-by: aszlig <aszlig@redmoonstudios.org>
|
|
|
|
|
|
|
|
|
|
| |
A lot of games (especially Unity games) come as a tarbomb, so in order
to avoid having those files all over the place we now create an
additional directory before unpack and set the sourceRoot to that if
it's a tarbomb and if that's not the case set it to the single file
within that directory.
Signed-off-by: aszlig <aszlig@redmoonstudios.org>
|
|
|
|
|
|
|
| |
This allows us to add libraries to the RPATH despite being required by
the respective game. By default there is only PulseAudio at the moment.
Signed-off-by: aszlig <aszlig@redmoonstudios.org>
|
|
The main functionality for this function is to gather missing
dependencies in ELF executables and shared libraries and using patchelf
to set the right RPATH.
All of the dependencies are searched based on what we have in one of the
buildInputs variables, so all we need to do is list them in there.
One thing that's still left to solve is adding libraries to the RPATH
which are only required at runtime. An example for this would be the
pulseaudio library.
Signed-off-by: aszlig <aszlig@redmoonstudios.org>
|