Patching
The file lit.site.cfg has to be inspected for any incorrect calls to executables. For example see src_prepare function form dev-lang/boogie.
Eclasses
Because we will need to specify how many threads should lit run we need to inherit multiprocessing to detect how many parallel jobs the portage config sets.
Dependencies
Ensure that dev-python/lit is in BDEPEND, but also additional packages may be needed, for example dev-python/OutputCheck.
|
|
BDEPEND="
${RDEPEND}
test? (
dev-python/lit
dev-python/OutputCheck
)
"
|
Bad tests
To deal with bad test you can simply remove the files causing the failures.
|
|
local -a bad_tests=(
civl/inductive-sequentialization/BroadcastConsensus.bpl
civl/inductive-sequentialization/PingPong.bpl
livevars/bla1.bpl
)
local bad_test
for bad_test in ${bad_tests[@]} ; do
rm "${S}"/Test/${bad_test} || die
done
|
Test phase
--threads $(makeopts_jobs) specifies how many parallel tests to run.
--verbose option will show output of failed tests.
Last lit argument specifies where lit should look for lit.site.cfg and tests.
|
|
src_test() {
lit --threads $(makeopts_jobs) --verbose "${S}"/Test || die
}
|
Prototype
Recently while browsing the Alpine git repo I noticed they have a function called snapshot, see: https://git.alpinelinux.org/aports/tree/testing/dart/APKBUILD#n45 I am not 100% sure about how that works but a wild guess is that the developers can run that function to fetch the sources and maybe later upload them to the Alpine repo or some sort of (cloud?) storage.
In Portage there exists a pkg_config function used to run miscellaneous configuration for packages. The only major difference between src_snapshot and that would of course be that users would never run snapshot.
Sandbox
Probably only the network sandbox would have to be lifted out… to fetch the sources of course.
But also a few (at least one?) special directories and variables would be useful.
Portage
Configure the following for Portage.
Emerge
Emerge the following packages:
app-emacs/company-ebuild
dev-util/pkgcheck
Company-Ebuild should pull in app-emacs/ebuild-mode, if that does not happen, then report a bug ;-D
Standard
Add the following to your user's Emacs initialization file. The initialization file is either ~/.emacs.d/init.el or ~/.config/emacs/init.el for newer versions of GNU Emacs.
|
|
(require 'ebuild-mode)
(require 'company-ebuild)
(require 'flycheck)
(require 'flycheck-pkgcheck)
(add-hook 'ebuild-mode-hook 'company-ebuild-setup)
(add-hook 'ebuild-mode-hook 'flycheck-mode)
(add-hook 'ebuild-mode-hook 'flycheck-pkgcheck-setup)
|
Use-Package
We can also configure our environment using a use-package macro that simplifies the setup a little bit.
To use the below configuration the app-emacs/use-package package will have to be installed.
|
|
(require 'use-package)
(use-package ebuild-mode
:defer t
:mode "\\.\\(ebuild\\|eclass\\)\\'"
:hook
((ebuild-mode . company-ebuild-setup)
(ebuild-mode . flycheck-mode)
(ebuild-mode . flycheck-pkgcheck-setup)))
|
The :defer t and :mode "..." enable deferred loading which theoretically speeds up GNU Emacs initialization time at the cost of running the whole use-package block of ebuild-mode configuration when the :mode condition is met.
Fosstodon
If you prefer to follow my posts on Fosstodon via RSS, then here is the link: fosstodon.org/users/xgqt.rss.
Dark interface
Force web UI dark mode
|
|
--enable-features=WebUIDarkMode --force-dark-mode
|
Hardware acceleration
Accelerated video decoding and GPU support
|
|
--enable-accelerated-video-decode --enable-gpu
|
Reader mode
Runtime cache
Use the cache directory /run/user/1000/chrome/cache
|
|
--disk-cache-dir=${XDG_RUNTIME_DIR}/chrome/cache
|
Window size
Sawn a window of size 1200x900
Full config
The file /etc/chromium/default is sourced by the Chromium launcher, that's why we can sue bash syntax here.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 |
#!/usr/bin/env bash
# Dark interface
# Force web UI dark mode
CHROMIUM_FLAGS="${CHROMIUM_FLAGS} --enable-features=WebUIDarkMode --force-dark-mode"
# Hardware acceleration
# Accelerated video decoding and GPU support
CHROMIUM_FLAGS="${CHROMIUM_FLAGS} --enable-accelerated-video-decode --enable-gpu"
# Reader mode
CHROMIUM_FLAGS="${CHROMIUM_FLAGS} --enable-reader-mode"
# Runtime cache
# Use the cache directory /run/user/1000/chrome/cache
CHROMIUM_FLAGS="${CHROMIUM_FLAGS} --disk-cache-dir=${XDG_RUNTIME_DIR}/chrome/cache"
# Window size
# Sawn a window of size 1200x900
CHROMIUM_FLAGS="${CHROMIUM_FLAGS} --window-size=1200,900"
|
Binary
If you use www-client/chromium-bin, then the config is located at /etc/chromium/default and CHROMIUM_FLAGS is CHROMIUM_BIN_FLAGS.