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

dwarf-fortress: Update themes, add themes update script #79121

Merged
merged 2 commits into from Feb 3, 2020

Conversation

shazow
Copy link
Contributor

@shazow shazow commented Feb 2, 2020

Motivation for this change

There has been a new major Dwarf Fortress release, and the hardcoded themes json is stale. This PR adds a script to update the themes.json and also updates said themes.json.

Related to #78901, though it should not conflict and should be mergeable in parallel.

I didn't add myself to the maintainers set just to avoid a PR conflict, but happy to do that.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

curl "https://api.github.com/users/dfgraphics/repos" | jq -r '.[].name | ascii_downcase' | while read repo; do
version="$(curl "https://api.github.com/repos/DFgraphics/${repo}/releases/latest" | jq -r .tag_name)"
sha256="$(nix-prefetch-git "https://github.com/DFgraphics/${repo}" "${version}" | jq -r ".sha256")"
echo "{}" | jq ".sha256=\"${sha256}\" | .name=\"${repo}\" | .version=\"${version}\""
Copy link
Contributor

Choose a reason for hiding this comment

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

not sure if you can, but do you mind changing the order of version and sha? generally sha comes last with most fetches

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you mean just the key ordering? I actually sort the keys at the end. Is that undesirable?

Copy link
Contributor

Choose a reason for hiding this comment

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

I would say yes, however, it's generated output, so it might not matter so much.

However it's very typical for fetches to looks like:

src = fetchurl {
   name = "...";
   url = "...";
   sha256 = "...";
};

Copy link
Contributor

Choose a reason for hiding this comment

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

which for this case I would say should look like:

{
  name = "..";
  version = "..";
  sha = "..";
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, and removed the key sorting.

Copy link
Contributor

@jonringer jonringer left a comment

Choose a reason for hiding this comment

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

diff LGTM
commits LGTM

failure is related to latest staging-next merge

[34 built (1 failed), 14 copied (407.3 MiB), 329.6 MiB DL]
error: build of '/nix/store/qgkys6hg1av7afk8abh5xj90pbgp6hpq-env.drv' failed
https://github.com/NixOS/nixpkgs/pull/79121
1 package failed to build:
dwarf-fortress-packages.dwarf-fortress-full

10 package built:
dwarf-fortress-packages.cla-theme dwarf-fortress-packages.phoebus-theme dwarf-fortress-packages.themes.afro-graphics dwarf-fortress-packages.themes.dfgraphics dwarf-fortress-packages.themes.ironhand dwarf-fortress-packages.themes.jolly-bastion dwarf-fortress-packages.themes.mayday dwarf-fortress-packages.themes.obsidian dwarf-fortress-packages.themes.rally-ho dwarf-fortress-packages.themes.spacefox

@jonringer jonringer merged commit 1a0f594 into NixOS:master Feb 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants