Tips
目录
Tips
- Quote all path variables, or whitespace will make this script explode horribly.
- do not depend on cmake directly
- Don't align backslashes.
- Add indent to followup lines to make continuation stand out.
- Per the policy, systemd services are to be installed unconditionally.
- := on all libs you're linking to, to enforce rebuilds when SOVERSION changes.
- test deps go into test?, with IUSE=test and RESTRICT="!test? ( test)" in ebuild.
- All uses of Python must go through one of python-* eclasses, as documented on wiki.gentoo.org/wiki/Project:Python/Eclasses
From: https://github.com/gentoo/gentoo/pull/9776
- The DOCS variable has a default value (see eclass documentation). Meaning that things like DOCS=( README.md ) are usually not necessary.
- Try to avoid having a "." or a white space at the end of DESCRIPTION
- No symlinks in the repository please. I understand why you would want to do this, however there are some very good reasons no to do this: https://forums.gentoo.org/viewtopic-p-8202534.html?sid=290d68129893b7435e6ecf9c528171a
- If you have optional dependencies you might want to use the optfeature function from eutils.eclass instead of elog. I haven't changed this in the ebuild, because it is not strictly necessary
- f some of the tests from your package are not working, it is considered good practice to not remove support for tests from the ebuild completely. Instead add RESTRICT="test" to your ebuild to disable the test phase. This makes it easier to re-enable tests in the future, since all the dependencies and functions are still there, you just have to remove the RESTRICT="test" line.
From Andrew Ammerlaan's GURU review