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
srb2: init at 2.2.8 #105087
srb2: init at 2.2.8 #105087
Conversation
7b6e12c
to
df36e3f
Compare
I created a nur package if anyone wants to try this https://github.com/ZerataX/nur-packages/blob/master/pkgs/srb2/default.nix |
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.
$ srb2
Compiled for SDL version: 2.0.14
Linked with SDL version: 2.0.14
Setting up SRB2...
Sonic Robo Blast 2
Copyright (C) 1998-2020 by Sonic Team Junior
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
and/or modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
See the 'LICENSE.txt' file for details.
Sonic the Hedgehog and related characters are trademarks of SEGA.
We do not claim ownership of SEGA's intellectual property used
in this program.
M_StartupLocale...
Looking for WADs in: SRB2WADDIR,.,/usr/local/share/games/SRB2,/usr/local/games/SRB2,/usr/share/games/SRB2,/usr/games/SRB2,HOME, in:/usr/local/games, in:/usr/games, in:/usr/local
I_Error(): srb2.pk3 not found! Expected in /home/mcgibbon/.cache/nixpkgs-review/pr-105087, ss file: /home/mcgibbon/.cache/nixpkgs-review/pr-105087/srb2.pk3
I_ShutdownGraphics(): graphics never started
I_ShutdownSystem(): end of logstream.
Shutdown tty console
Doesn't seem to boot on my machine (x86_64-linux)
@rmcgibbo hmm I can't replicate that at all?
seems weird to me especially since this file just gets downloaded and then unzipped with 7zip? not sure what could go wrong there? |
It looks for the file at the wrong directories, to be exact not in the nix store. This needs to be patched. |
@SuperSandro2000 So I would remove the check for the cwd and remove every but 1 definition for the nix store? I am just not sure how to most elegantly patch this? with a normal patch file i don't know where the location in the nix store will be? |
where the srb2.pk3 file is located.
Take a look how it is done in this package with substituteAll and @MPV@
|
6e1e45d
to
fb5cc8c
Compare
my current solution isn't exactly elegant, but I don't know how else to access Open to suggestions @SuperSandro2000 |
The name of the phase is postPatch or prePatch. |
@SuperSandro2000 right sorry I did that but it doesn't work |
As long as you are overwriting patchPhase it does not. |
does not what? |
@SuperSandro2000 Instead of changing the patch file i just changed the src file after it's patched. nixpkgs/pkgs/games/srb2/default.nix Lines 67 to 74 in 9254c68
|
I marked this as stale due to inactivity. → More info |
still waiting for someone to review this. |
]; | ||
|
||
cmakeFlags = [ | ||
"-DSRB2_ASSET_DIRECTORY=/build/source/assets" |
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.
We can't hardcode /build/.
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.
"-DSRB2_ASSET_DIRECTORY=/build/source/assets" | |
"-DSRB2_ASSET_DIRECTORY=${src}/assets" |
|
||
in stdenv.mkDerivation rec { | ||
pname = "srb2"; | ||
version = "2.2.8"; |
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.
version = "2.2.8"; | |
version = "2.2.10"; |
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.
Update the sha too.
]; | ||
|
||
cmakeFlags = [ | ||
"-DSRB2_ASSET_DIRECTORY=/build/source/assets" |
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.
"-DSRB2_ASSET_DIRECTORY=/build/source/assets" | |
"-DSRB2_ASSET_DIRECTORY=${src}/assets" |
7z x ${assets} -o"/build/source/assets" -aos | ||
7z x ${assets_optional} -o"/build/source/assets" -aos |
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.
7z x ${assets} -o"/build/source/assets" -aos | |
7z x ${assets_optional} -o"/build/source/assets" -aos | |
7z x ${assets} -o"${src}/assets" -aos | |
7z x ${assets_optional} -o" ${src}/assets" -aos |
]; | ||
|
||
postPatch = '' | ||
substituteInPlace src/sdl/i_system.c \ |
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.
substituteInPlace src/sdl/i_system.c \ | |
substituteInPlace ${src}/sdl/i_system.c \ |
Merged in in #172761 |
Motivation for this change
added Sonic Robo Blast 2 to my best abilties with what I saw from their CI and wiki:
https://github.com/STJr/SRB2/blob/master/.travis.yml
http://wiki.srb2.org/wiki/Source_code_compiling/CMake
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)