Skip to content

onscripter: init at 20230825#451514

Merged
emilazy merged 3 commits intoNixOS:masterfrom
midchildan:feat/add-onscripter
Oct 20, 2025
Merged

onscripter: init at 20230825#451514
emilazy merged 3 commits intoNixOS:masterfrom
midchildan:feat/add-onscripter

Conversation

@midchildan
Copy link
Member

  • Add package for ONScripter
  • Base the existing package for the fork, ONScripter EN, on the new package
  • Fix Darwin build for ONScripter EN

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

Add a 👍 reaction to pull requests you find important.

@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 9.needs: reviewer This PR currently has no reviewers requested and needs attention. labels Oct 13, 2025
@Sigmanificient
Copy link
Member

nixpkgs-review result

Generated using nixpkgs-review-gha

Command: nixpkgs-review pr 451514
Commit: 45e902296e7f6be4c8cf9dfbd9137ed0d789bddb (subsequent changes)
Merge: aa4848a44ca48852b017bb0b9410f22e993d6ad7

Logs: https://github.com/Sigmanificient/nixpkgs-review-gha/actions/runs/18480843180


x86_64-linux

✅ 2 packages built:
  • onscripter
  • onscripter-en

aarch64-linux

✅ 2 packages built:
  • onscripter
  • onscripter-en

x86_64-darwin (sandbox = true)

✅ 2 packages built:
  • onscripter
  • onscripter-en

aarch64-darwin (sandbox = true)

✅ 2 packages built:
  • onscripter
  • onscripter-en

@nixos-discourse
Copy link

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 (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +24 to +29
src = fetchFromGitHub {
owner = "ogapee";
repo = "onscripter";
rev = finalAttrs.version;
hash = "sha256-XaZTtOkV+2dHmcgZ4GbyiMxRBYdwT5eHxx+r05eAmBw=";
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the official upstream? It seems like maintenance may be abandoned?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@nixpkgs-ci nixpkgs-ci bot removed the 9.needs: reviewer This PR currently has no reviewers requested and needs attention. label Oct 15, 2025
@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. labels Oct 16, 2025
Copy link
Member

@emilazy emilazy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Comment on lines +13505 to +13508
onscripter = callPackage ../by-name/on/onscripter/package.nix {
# Check unpatched Makefile.Linux for the Lua version
lua = lua5_1;
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +65 to +68
++ (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";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are trying to deprecate stdenv.isFoo since it is ambiguous in the presence of cross‐compilation, so:

Suggested change
++ (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";

Comment on lines +37 to +42
# 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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.)

Copy link
Member Author

@midchildan midchildan Oct 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The patch removes -framework flags instead of adding them. It was actually breaking the build because -framework QuickTime no longer works with newer SDKs.

Comment on lines +46 to +50
nativeBuildInputs = [
freetype
SDL
smpeg
];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
    '')
  ];

@emilazy
Copy link
Member

emilazy commented Oct 16, 2025

Oh, this also needs a throw for onscripter-en in aliases.nix.

@midchildan
Copy link
Member Author

@emilazy Thanks. Could you take another look?

Copy link
Member

@emilazy emilazy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks.

Comment on lines +62 to +65
runCommand "onscripter-host-deps" { } ''
mkdir -p $out/bin
ln -s ${lib.escapeShellArgs commands} $out/bin
''
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should technically be buildPackages.runCommand, but it shouldn’t make a difference in practice.

@emilazy emilazy added this pull request to the merge queue Oct 20, 2025
Merged via the queue into NixOS:master with commit eaa4d38 Oct 20, 2025
25 checks passed
@nixpkgs-ci nixpkgs-ci bot added the 12.approvals: 1 This PR was reviewed and approved by one person. label Oct 20, 2025
@midchildan midchildan deleted the feat/add-onscripter branch October 22, 2025 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 12.approvals: 1 This PR was reviewed and approved by one person.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants