Conversation
5974991 to
45e9022
Compare
|
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/prs-ready-for-review/3032/5947 |
| let | ||
| inherit (onscripter) stdenv; | ||
| in | ||
| onscripter.overrideAttrs ( |
There was a problem hiding this comment.
We should avoid introducing new uses of overrideAttrs. This would ideally be a flag in the onscripter package, but considering this is a version from 2011, has no maintainer, and the upstream source is apparently gone, perhaps it would be better to simply drop this package?
It seems like there are active forks, though:
There was a problem hiding this comment.
I've now removed ONScripter EN because 1. there should be English support in ONScripter upstream, 2. I'm not a user of ONScripter EN so it's better for actual users to test and maintain the package if needed.
| src = fetchFromGitHub { | ||
| owner = "ogapee"; | ||
| repo = "onscripter"; | ||
| rev = finalAttrs.version; | ||
| hash = "sha256-XaZTtOkV+2dHmcgZ4GbyiMxRBYdwT5eHxx+r05eAmBw="; | ||
| }; |
There was a problem hiding this comment.
Is this the official upstream? It seems like maintenance may be abandoned?
There was a problem hiding this comment.
Yes, this is the official upstream. It's a clone of a game engine from the 2000s, with over 20 years of development history. So it's stable and has less churn these days.
I've been able to complete a whole game with this build, so functionality-wise, things should be okay.
4140238 to
1a2bea9
Compare
emilazy
left a comment
There was a problem hiding this comment.
Thanks, this looks good to me with a few minor issues (which I should have gone over more thoroughly in the previous review; sorry about that).
pkgs/top-level/all-packages.nix
Outdated
| onscripter = callPackage ../by-name/on/onscripter/package.nix { | ||
| # Check unpatched Makefile.Linux for the Lua version | ||
| lua = lua5_1; | ||
| }; |
There was a problem hiding this comment.
I think per #444420 we would prefer this to be an explicit lua5_1 argument in onscripter now rather than adding an entry to all-packages.nix.
| ++ (if stdenv.isDarwin then [ freetype ] else [ fontconfig ]); | ||
|
|
||
| # The build script for BSDs also fall under Makefile.Linux | ||
| makefile = if stdenv.isDarwin then "Makefile.MacOSX" else "Makefile.Linux"; |
There was a problem hiding this comment.
We are trying to deprecate stdenv.isFoo since it is ambiguous in the presence of cross‐compilation, so:
| ++ (if stdenv.isDarwin then [ freetype ] else [ fontconfig ]); | |
| # The build script for BSDs also fall under Makefile.Linux | |
| makefile = if stdenv.isDarwin then "Makefile.MacOSX" else "Makefile.Linux"; | |
| ++ (if stdenv.hostPlatform.isDarwin then [ freetype ] else [ fontconfig ]); | |
| # The build script for BSDs also fall under Makefile.Linux | |
| makefile = if stdenv.hostPlatform.isDarwin then "Makefile.MacOSX" else "Makefile.Linux"; |
| # 1. Remove direct linker flags for macOS SDKs. | ||
| # 2. Build with Lua | ||
| # | ||
| # ONScripter appears to depend on macOS SDKs only indirectly through SDL, so flags provided by | ||
| # the sdl-config command should suffice. The existing flags also referenced the deprecated | ||
| # QuickTime framework, resulting in a build failure. |
There was a problem hiding this comment.
The -framework part of this patch should no longer be necessary, since the entire SDK is available by default these days. (Though from the sounds of it, it shouldn’t do any harm either.)
There was a problem hiding this comment.
The patch removes -framework flags instead of adding them. It was actually breaking the build because -framework QuickTime no longer works with newer SDKs.
| nativeBuildInputs = [ | ||
| freetype | ||
| SDL | ||
| smpeg | ||
| ]; |
There was a problem hiding this comment.
I am not totally sure these are correct in the presence of cross‐compilation, as I believe the sdl-config would give the flags for the build rather than host platform. My understanding is that you want the sdl-config from the host platform SDL instead – when building cross, the executable will be for the build platform.
I am not sure exactly how this should be expressed; export PATH=${lib.getDev SDL}/bin:$PATH would do it, I believe, but is inelegant. The ideal thing may be to patch the build to use pkg-config instead, since we’re already touching those lines, and drop these from nativeBuildInputs.
I could be wrong here, though; cc @NixOS/sdl perhaps?
There was a problem hiding this comment.
I replaced it with the following:
nativeBuildInputs = [
# Take cross compilation into account
(runCommand "onscripter-host-deps" {} ''
mkdir -p $out/bin
ln -s \
${lib.getDev freetype}/bin/freetype-config \
${lib.getDev SDL}/bin/sdl-config \
${lib.getDev smpeg}/bin/smpeg-config \
$out/bin
'')
];|
Oh, this also needs a |
1a2bea9 to
68ac240
Compare
Also fix Darwin build.
68ac240 to
b225803
Compare
|
@emilazy Thanks. Could you take another look? |
| runCommand "onscripter-host-deps" { } '' | ||
| mkdir -p $out/bin | ||
| ln -s ${lib.escapeShellArgs commands} $out/bin | ||
| '' |
There was a problem hiding this comment.
I think this should technically be buildPackages.runCommand, but it shouldn’t make a difference in practice.
Things done
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.Add a 👍 reaction to pull requests you find important.