-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
the-dark-mod: init at 2.12 #356578
base: master
Are you sure you want to change the base?
the-dark-mod: init at 2.12 #356578
Conversation
a0789d1
to
9b849f4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should probably use lib.sourceTypes.binaryNativeCode
for its meta.sourceProvenance
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd just make this a sub-file from the-dark-mod-unwrapped
and make it passthru.assets
.
I think that's the more common pattern, but I speak mostly from an experience of packages needing to i.e: build a webui.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For games? Not necessarily, since often times assets have to be requireFile
'd from an installer and so are usually made separate
# We use the SVN repo as it contains built static binaries that are not | ||
# present in the Git mirror. Currently Nixpkgs only supports a limited set | ||
# of packages that can be statically linked (notably excluding ffmpeg, pulseaudio | ||
# and pipewire), so we couldn't build everything from scratch even if we want to :( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I understand this: can't we just make them buildInputs
and/or link them into the expected place in the repo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No — it specifically expects statically-linked libraries (.a) which Nixpkgs has a very limited support for right now: PulseAudio, Pipewire and libav are all marked broken when evaluated under pkgsStatic
. I did manage to get some of them working including patching OpenAL, and some of them already have prebuilt statically-linked libraries, but trying to coerce FFmpeg into building statically is a rabbithole I really don't want to get down right now.
I'm open to devendoring them when we have support for static linking for all of these dependencies.
gameDir=''${XDG_DATA_HOME:-$HOME/.local/share}/darkmod | ||
mkdir -p "$gameDir" | ||
lndir -silent ${the-dark-mod-assets} "$gameDir" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if the assets are updated (or a file gets removed): do stale links linger?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any updated files will be re-linked but old files won't be purged. I think what we have to do is remove all symlinks that belonged to the last version of assets first, like what I've done for nzportable
export ALSOFT_CONF=$gameDir/alsoft.ini | ||
|
||
${lib.getExe the-dark-mod-unwrapped} \ | ||
+set fs_basepath "$gameDir" \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume this is for the assets? If so, why can't it just directly point to the nix store and instead need linking into XDG_DATA_HOME
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It really wants to write things directly next to itself, or to the game data folder. Internal comments indicate that fs_gamepath
is supposed to be read-only but that's just not the case after very extensive testing
(I've genuinely wasted ~3-4 hours trying to coax it into working. It just doesn't.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would upstream be receptive to a bug report (definitely not a blocker for merging the package)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Certainly
9b849f4
to
32608fe
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to committers: this PR would likely have to depend on a PR I'll make that unifies the pattern of "program wants writable working directory that also contains all the assets" pattern that I've seen in at least three games I've packaged now. It's simply too common and annoying to deal with to justify having a bespoke solution for each package... |
32608fe
to
6f90f72
Compare
b341e66
to
ca2dd4e
Compare
ca2dd4e
to
f6542b2
Compare
f6542b2
to
46d714a
Compare
46d714a
to
559cab0
Compare
I don't exactly know why but now TDM complains about missing savegames despite me nuking the game directory multiple times and it doesn't seem to keep track of all the savegames I've made... No idea if it would happen elsewhere |
One day I have to ask myself why I have such a penchant for spending days on packaging retro video games
I'm not super confident that the game assets are 100% reproducible due to how the installer works — try building it yourself and see if it works
Closes #300213
Depends on #361114
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.