No leap-seconds.list file provided by tzdata package

I was reading Hare’s requirements for distributions when I’ve stumbled upon the following statement:

Timekeeping requirements

Hare’s timekeeping support in the standard library relies on a local
installation of the IANA time zone database. Important: Hare uses the
local leap second list as well, at /usr/share/zoneinfo/leap-seconds.list by
default, which is often not installed by many distributions. Please update
your tzdata package accordingly when packaging Hare.

So I went and checked the nixpkgs’ tzdata package derivation to see if there was such file. To my surprise, such file is absent. That is, running the following command — as well as manual inspection — yields no result for the leap-seconds.list file:

find $(nix build --json "nixpkgs#tzdata.out" | jq -r '.[]."outputs"."out"') -name "leap-seconds.list" -print

I’ve checked other two distributions, Arch and Alpine Linux, and they both include the leap-seconds.list file, since it is mentioned in each of their recipes, respectively, here for Arch and here for Alpine.

Would there be any reason for Nix not to include it? If not, what in the current implementation of the tzdata package is causing that file not to be included in any of its outputs, be it out, dev, bin or man — although, as I believe, it should be in the first one —?


I guess no-one needed it yet.

Many Nixpkgs maintainers prefer to build projects in their default upstream configuration and since the upstream Makefile does not install those files, neither does the Nixpkgs package.

As you note, the packages in other distros install the file by explicitly copying it. We could probably do the same but it would be preferable if there were a flag for installing the file and we passed the flag to make install. Maybe the following is relevant:

1 Like

Thanks for the explanation, @jtojnar.

I’ve tried using the LEAPSECONDS make variable but it does not cause
the leap-seconds.list file to be installed.

I’ve managed to install it by copying the file — adding a cp call to
the postInstall hook — like both Arch and Alpine do.

Would you happen know if I were to make this change to the tzdata and
hare packages, would one pull request suffice it or would I had to
create one for the former and subsequently another for the latter?