This redoes all the packaging for their new build-system.
It feels a bit fragile, but in practice it works.
Basically, we build most of it in nix, write some wrapper scripts to
mock out stuff we just did in nix, and then call thier build system to
make a wheel
anki-bin is built with buildFHSUserEnv on Linux, which makes using overrides
to pass in command line arguments impossible. This commit adds the
commandLineArgs argument to the package inputs and appends the string
to the runscript, allowing pkgs.override to add flags to pass to anki
when the derivation is built.
This is useful when anki's desired directory isn't the default, allowing
users to specify the directory in their overlays instead of adding a
flag everytime they call the program.
anki-bin is built with buildFHSUserEnv on Linux, which doesn't set a
version for the resulting derivation. This commit overrides the
resulting derivation to have a version set correctly.
This is important for end-users to be able to easily tell what
version of Anki they will get when they install `anki-bin`. It is
normally very important to use the correct version of Anki.
checkInputs used to be added to nativeBuildInputs. Now we have
nativeCheckInputs to do that instead. Doing this treewide change allows
to keep hashes identical to before the introduction of
nativeCheckInputs.
Since the previous version of anki no longer works on nixos-unstable
due to glibc changes the version was bumped to 2.1.51 which works.
Also adds support for aarch64 on apple silicon
Fixes#167765
This reverts commit 847b317a95.
It is no longer necessary to disable wayland support, anki does that by itself
nowadays and actually works really well when wayland is forced on via
$ANKI_WAYLAND despite upstream claiming it's still buggy.
@the-kenny did a good job in the past and is set as maintainer in many package,
however since 2017-2018 he stopped contributing. To create less confusion
in pull requests when people try to request his feedback, I removed him as
maintainer from all packages.
Related: #68314
This fixes startup of anki, which currently shows this in a dialog:
Error during startup:
Traceback (most recent call last):
File "/nix/store/0h395dwc6b80n5xg93p86ywaz6kpz6ck-anki-2.1.15/lib/python3.7/site-packages/aqt/main.py", line 46, in __init__
self.setupAddons()
File "/nix/store/0h395dwc6b80n5xg93p86ywaz6kpz6ck-anki-2.1.15/lib/python3.7/site-packages/aqt/main.py", line 657, in setupAddons
import aqt.addons
File "/nix/store/0h395dwc6b80n5xg93p86ywaz6kpz6ck-anki-2.1.15/lib/python3.7/site-packages/aqt/addons.py", line 9, in <module>
import markdown
File "/nix/store/knq8798kl0xzzr7ii4bchskg1c8mq6pj-python3.7-Markdown-3.1.1/lib/python3.7/site-packages/markdown/__init__.py", line 25, in <module>
from .core import Markdown, markdown, markdownFromFile
File "/nix/store/knq8798kl0xzzr7ii4bchskg1c8mq6pj-python3.7-Markdown-3.1.1/lib/python3.7/site-packages/markdown/core.py", line 29, in <module>
import pkg_resources
ModuleNotFoundError: No module named 'pkg_resources'
The Anki manual is distibuted in a separate repository and has to be
patched a bit to work offline.
The in-program manual now points to our distributed offline version.
Runtime doesn't work:
ModuleNotFoundError: No module named 'PyQt5.QtWebEngineWidgets'
This is probably because qtwebengine is broken on darwin, but doesn't
fail the build (#40149)
Semi-automatic update generated by https://github.com/ryantm/nixpkgs-update tools.
This update was made based on information from https://repology.org/metapackage/anki/versions.
These checks were done:
- built on NixOS
- /nix/store/2dqw72sffcynzzgcfk0k9mh7jn8sw0kw-anki-2.0.52/bin/anki passed the binary check.
- /nix/store/2dqw72sffcynzzgcfk0k9mh7jn8sw0kw-anki-2.0.52/bin/..anki-wrapped-wrapped passed the binary check.
- /nix/store/2dqw72sffcynzzgcfk0k9mh7jn8sw0kw-anki-2.0.52/bin/.anki-wrapped passed the binary check.
- 3 of 3 passed binary check by having a zero exit code.
- 3 of 3 passed binary check by having the new version present in output.
- found 2.0.52 with grep in /nix/store/2dqw72sffcynzzgcfk0k9mh7jn8sw0kw-anki-2.0.52
- directory tree listing: https://gist.github.com/1a53026ee3eea78708113c1b6e9d857f
- du listing: https://gist.github.com/c8dcabda5b46155a959b86843ee24ddd
Semi-automatic update generated by https://github.com/ryantm/nixpkgs-update tools.
This update was made based on information from https://repology.org/metapackage/anki/versions.
These checks were done:
- built on NixOS
- ran `/nix/store/pc80xsrc6hc3xw5fibqhcd3xy2z6krj8-anki-2.0.51/bin/anki -h` got 0 exit code
- ran `/nix/store/pc80xsrc6hc3xw5fibqhcd3xy2z6krj8-anki-2.0.51/bin/anki --help` got 0 exit code
- ran `/nix/store/pc80xsrc6hc3xw5fibqhcd3xy2z6krj8-anki-2.0.51/bin/anki --version` and found version 2.0.51
- ran `/nix/store/pc80xsrc6hc3xw5fibqhcd3xy2z6krj8-anki-2.0.51/bin/..anki-wrapped-wrapped -h` got 0 exit code
- ran `/nix/store/pc80xsrc6hc3xw5fibqhcd3xy2z6krj8-anki-2.0.51/bin/..anki-wrapped-wrapped --help` got 0 exit code
- ran `/nix/store/pc80xsrc6hc3xw5fibqhcd3xy2z6krj8-anki-2.0.51/bin/..anki-wrapped-wrapped --version` and found version 2.0.51
- ran `/nix/store/pc80xsrc6hc3xw5fibqhcd3xy2z6krj8-anki-2.0.51/bin/.anki-wrapped -h` got 0 exit code
- ran `/nix/store/pc80xsrc6hc3xw5fibqhcd3xy2z6krj8-anki-2.0.51/bin/.anki-wrapped --help` got 0 exit code
- ran `/nix/store/pc80xsrc6hc3xw5fibqhcd3xy2z6krj8-anki-2.0.51/bin/.anki-wrapped --version` and found version 2.0.51
- found 2.0.51 with grep in /nix/store/pc80xsrc6hc3xw5fibqhcd3xy2z6krj8-anki-2.0.51
- directory tree listing: https://gist.github.com/47b6928b65d620f470e7c7f117898265
Semi-automatic update generated by https://github.com/ryantm/nix-update tools. These checks were done:
- built on NixOS
- ran `/nix/store/yxxxxgsdxr65bgnv1xn0h9pdivpm2bvx-anki-2.0.50/bin/..anki-wrapped-wrapped -h` got 0 exit code
- ran `/nix/store/yxxxxgsdxr65bgnv1xn0h9pdivpm2bvx-anki-2.0.50/bin/..anki-wrapped-wrapped --help` got 0 exit code
- ran `/nix/store/yxxxxgsdxr65bgnv1xn0h9pdivpm2bvx-anki-2.0.50/bin/..anki-wrapped-wrapped --version` and found version 2.0.50
- ran `/nix/store/yxxxxgsdxr65bgnv1xn0h9pdivpm2bvx-anki-2.0.50/bin/anki -h` got 0 exit code
- ran `/nix/store/yxxxxgsdxr65bgnv1xn0h9pdivpm2bvx-anki-2.0.50/bin/anki --help` got 0 exit code
- ran `/nix/store/yxxxxgsdxr65bgnv1xn0h9pdivpm2bvx-anki-2.0.50/bin/anki --version` and found version 2.0.50
- ran `/nix/store/yxxxxgsdxr65bgnv1xn0h9pdivpm2bvx-anki-2.0.50/bin/.anki-wrapped -h` got 0 exit code
- ran `/nix/store/yxxxxgsdxr65bgnv1xn0h9pdivpm2bvx-anki-2.0.50/bin/.anki-wrapped --help` got 0 exit code
- ran `/nix/store/yxxxxgsdxr65bgnv1xn0h9pdivpm2bvx-anki-2.0.50/bin/.anki-wrapped --version` and found version 2.0.50
- found 2.0.50 with grep in /nix/store/yxxxxgsdxr65bgnv1xn0h9pdivpm2bvx-anki-2.0.50
Searching the web for the base-16 encoded hash of the one we have in the
Nix expression didn't give any results and I also couldn't find the
older tarball anywhere (even the mirrors I've checked don't have it).
So checking the updated hash I've found that other distros use this, so
I'd bet it's safe to do this.
I've tested building the package but I didn't do any runtime test.
Signed-off-by: aszlig <aszlig@nix.build>
Cc: @the-kenny
SQLAlchemy-0.9.9 was broken recently, probably because of an sqlite
update. So we just use the latest version.
The build expression used to take the entire package set as an argument,
which is poor style because it hides the true dependencies from the
interface. I've change the code to expect the appropriate individual
packages instead.
This refactoring changes a number of things:
- use system copies of Python libraries BeautifulSoup, and HTTPLIB2,
- custom install to avoid installation of unnecessary files and poor
directory structure, and
- add patch for sorting out file paths, in particular this fixes
localization.