Skip to content
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

daggerfall-unity: init at 1.1.1 #350177

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

l0b0
Copy link
Contributor

@l0b0 l0b0 commented Oct 21, 2024

Open source recreation of Daggerfall in the Unity engine

I could not figure out how to build this from source. The upstream build docs only explain how to do it from the Unity GUI, and there is no .csproj or .sln file in the project to use with buildDotnetModule or the like.

Closes #109385.

Tested:

  • ./result/DaggerfallUnity.x86_64 starts the GUI and asks for the Daggerfall game files.

  • nix-shell maintainers/scripts/update.nix --argstr package daggerfall-unity breaks badly. Diff:

    diff --git a/pkgs/by-name/da/daggerfall-unity/package.nix b/pkgs/by-name/da/daggerfall-unity/package.nix
    index 1f420d039922..c81efb930eb6 100644
    --- a/pkgs/by-name/da/daggerfall-unity/package.nix
    +++ b/pkgs/by-name/da/daggerfall-unity/package.nix
    @@ -20,7 +20,7 @@
     }:
     stdenv.mkDerivation (finalAttrs: {
       pname = "daggerfall-unity";
    -  version = "1.1.1";
    +  version = "1.1.1-pac";
    
       src = fetchzip {
         url = "https://github.com/Interkarma/daggerfall-unity/releases/download/v${finalAttrs.version}/dfu_linux_64bit-v${finalAttrs.version}.zip";

    Output:

    nix-shell maintainers/scripts/update.nix --argstr package daggerfall-unity
    
    Going to be running update for following packages:
     - daggerfall-unity-1.1.1
    
    Press Enter key to continue...
    
    Running update for:
     - daggerfall-unity-1.1.1: UPDATING ...
     - daggerfall-unity-1.1.1: ERROR
    
    --- SHOWING ERROR LOG FOR daggerfall-unity-1.1.1 ----------------------
    
    warning: found empty hash, assuming 'sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA='
    this derivation will be built:
      /nix/store/a07ymxsql86w1pbaz5mpval5dhhxhchm-source.drv
    building '/nix/store/a07ymxsql86w1pbaz5mpval5dhhxhchm-source.drv'...
    
    trying https://github.com/Interkarma/daggerfall-unity/releases/download/v1.1.1-pac/dfu_linux_64bit-v1.1.1-pac.zip
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
      0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
    curl: (22) The requested URL returned error: 404
    error: cannot download source from any mirror
    error: builder for '/nix/store/a07ymxsql86w1pbaz5mpval5dhhxhchm-source.drv' failed with exit code 1;
           last 7 log lines:
           >
           > trying https://github.com/Interkarma/daggerfall-unity/releases/download/v1.1.1-pac/dfu_linux_64bit-v1.1.1-pac.zip
           >   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
           >                                  Dload  Upload   Total   Spent    Left  Speed
           >   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
           > curl: (22) The requested URL returned error: 404
           > error: cannot download source from any mirror
           For full logs, run 'nix log /nix/store/a07ymxsql86w1pbaz5mpval5dhhxhchm-source.drv'.
    Traceback (most recent call last):
      File "/nix/store/2rmd04kr8i2ib2gkfa2amyxmsl0a7p6s-nix-update-1.5.2/bin/.nix-update-wrapped", line 9, in <module>
        sys.exit(main())
                 ^^^^^^
      File "/nix/store/2rmd04kr8i2ib2gkfa2amyxmsl0a7p6s-nix-update-1.5.2/lib/python3.12/site-packages/nix_update/__init__.py", line 311, in main
        package = update(options)
                  ^^^^^^^^^^^^^^^
      File "/nix/store/2rmd04kr8i2ib2gkfa2amyxmsl0a7p6s-nix-update-1.5.2/lib/python3.12/site-packages/nix_update/update.py", line 454, in update
        update_src_hash(opts, package.filename, package.hash)
      File "/nix/store/2rmd04kr8i2ib2gkfa2amyxmsl0a7p6s-nix-update-1.5.2/lib/python3.12/site-packages/nix_update/update.py", line 146, in update_src_hash
        target_hash = nix_prefetch(opts, "src")
                      ^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/nix/store/2rmd04kr8i2ib2gkfa2amyxmsl0a7p6s-nix-update-1.5.2/lib/python3.12/site-packages/nix_update/update.py", line 128, in nix_prefetch
        raise UpdateError(
    nix_update.errors.UpdateError: failed to retrieve hash when trying to update daggerfall-unity.src
    
    
    --- SHOWING ERROR LOG FOR daggerfall-unity-1.1.1 ----------------------
    The update script for daggerfall-unity-1.1.1 failed with exit code 1

    No idea what's going on there.

Remaining issues:

  • strings ./result/UnityPlayer.so | grep '\.so' listed two libraries I could not find, but which did not seem to be necessary, at least for basic functionality: libGLES_CM.so.1, and libmono.so. Please add a comment if you know where to find them, or why they would not be necessary.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.11 Release Notes (or backporting 23.11 and 24.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@ofborg ofborg bot added 8.has: package (new) This PR adds a new package 11.by: package-maintainer This PR was created by the maintainer of the package it changes 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild 10.rebuild-linux: 1-10 10.rebuild-linux: 1 labels Oct 21, 2024
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/nix-update-script-version-regex-mismatch/55578/1

runHook postInstall
'';

appendRunpaths = map (pkg: "${lib.getLib pkg}/lib") (finalAttrs.buildInputs);
Copy link
Member

Choose a reason for hiding this comment

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

Can we use lib.makeLibraryPath here?

Copy link
Contributor

Choose a reason for hiding this comment

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

this might work tho the script expects an array of paths not a colon separated string

@l0b0 l0b0 force-pushed the daggerfall-unity branch 3 times, most recently from b4239ba to 201391a Compare November 7, 2024 01:04
Includes the manual for Daggerfall Unity.

daggerfall-unity-unfree also includes the manual for Daggerfall itself.

Closes NixOS#109385.

Co-authored-by: Sandro <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.has: package (new) This PR adds a new package 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild 10.rebuild-linux: 1-10 10.rebuild-linux: 1 11.by: package-maintainer This PR was created by the maintainer of the package it changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Daggerfall Unity
5 participants