Lazarus packages: moved, renamed

Posted on

lazarus-installnew-31
Installing Lazarus package with TCastleControl - 2
Installing Lazarus package with TCastleControl - 3
Registering Lazarus packages

We did a few moves and renames to our Lazarus packages.

After upgrading to the latest engine version, be sure to run again “Register Lazarus Packages” button (from the “Preferences -> FPC and Lazarus” in our editor, as documented in our Lazarus docs).

Note that the existing applications will continue to work even without you doing the above, because new packages provide the old names too. But we advise to just use new names from now on.

The short version of the changes: Lazarus packages are now in the packages/lazarus/ subdirectory of the repository, with some better names.

Full list of changes and their reasons:

  1. We moved Lazarus packages to subdirectory packages/lazarus.

    Reason: This is consistent (sibling) to Delphi packages in packages/delphi, and good for TMS Smart Setup, and likely just more obvious to both Lazarus and Delphi users.

  2. We rename packages to add _engine. So we have

    • castle_base.lpk -> castle_engine_base.lpk
    • castle_window.lpk -> castle_engine_window.lpk
    • and so on.

    Reason:

    • Avoids having castlewindow.pas and castle_window.pas (the latter just auto-generated package unit) being too close to each other. They are completely unrelated units.
    • New names are consistent with Delphi packages (which always had the _engine part).
  3. We rename castle_components to castle_engine_lcl. So in addition to adding _engine, we change components -> lcl.

    Reason:

    • The components word there was confusing for a long time. Because this is not the only package with “components”, other packages (including base) also provide components (though they don’t register them now in Lazarus component palette, but they did in the past). However, this is the only package that depends on LCL and thus provides TCastleControl that uses LCL. This package may provide more LCL components in the future.
    • It also makes name of alternative_castle_engine_window_based_on_lcl.lpk more obvious. Now alternative_castle_engine_window_based_on_lcl.lpk depends on castle_engine_lcl.lpk — which looks obvious and natural.
    • We have planned to do this rename for quite a while now. We mentioned it in TCastleControl docs and packages README that “this should probably be renamed to castle_lcl” already.
    • This seemed to be a good moment to do this, as we go with rename/move anyway.

Note that the packages/lazarus/README.md has been updated to reflect it all. We also updated Lazarus docs, TCastleControl docs and everything else we found.

Notable Replies

  1. not sure if I’m doing everything right, but when I tried new packages all looks fine and works ok, except for rebuilding editor with custom components (which I use for my game), and I get “cge/packages/castle_base.lpk not found”, however I checked both folders (editor inside cge and my project folder) and I see no usage of it, I deleted the editor folder inside my project output folder, and also tried to launch compiling editor from lazarus and I even get it working (with working custom components) after compiling, but still menuitem to rebuild editor isn’t working :frowning:

  2. Hm, I tested now with example examples/advanced_editor/custom_component/ and it works OK on my side. That is, opening the project offers me to rebuild the editor (and if I confirm, it goes OK). Once the project is open, I can use menu item “Project → Restart Editor (With Custom Components)” also OK.

    In the engine, nothing refers to the old name castle_base anymore, as you say. The only occurrence is that castle_engine_base.lpk provides the name castle_base (so the new name should be considered by Lazarus a drop-in replacement for old name).

    Hm, I see you already checked that your engine and your project don’t refer to castle_base, this was my first suggestion.

    • Can you check examples/advanced_editor/custom_component/ on your side? Does it also fail, or it works?

    • Make sure you have 1 CGE installation, and the FPC/Lazarus version used (set in editor preferences, if you set it) is the one that should be used.

    • Look at Lazarus config files. Their location depends on the installation way, if you used FpcUpDeluxe they are in a subdirectory config_lazarus of your FPC/Lazarus installation created by FpcUpDeluxe. See if removing them (move them like to config_lazarus.backup) fixes the issue – if yes, look inside for mentions of castle_base that would explain the issue.

  3. Thanks I fixed that, I’ve updated engine fully, from releases (not only from git + rebuild) and seems that the castle-engine binary itself was the issue, as rebuild started working after overwrite of bin folder :+1:

Continue the discussion at Castle Game Engine Forum

Participants

Avatar for phomm Avatar for michalis