Posts tagged tutorial
News
Repository
With this commit first GNU Emacs integration was merged into the pkgcheck repository.
History
Thanks
Huge thanks to Sam James and Arthur Zamarin for support and interest in getting this feature done.
Installation
Unmasking
The Flycheck integration is unreleased as of now, this will (hopefully) change in the future, but for now You need live versions of snakeoil
, pkgcore
and pkgcheck
.
File: /etc/portage/package.accept_keywords/pkgcore.conf
dev-python/snakeoil **
sys-apps/pkgcore **
dev-util/pkgcheck **
Also You will need to unmask app-emacs/flycheck
and its dependencies.
File: /etc/portage/package.accept_keywords/emacs.conf
app-emacs/epl
app-emacs/pkg-info
app-emacs/flycheck
Emerging
Install pkgcheck with the emacs
USE flag enabled.
File: /etc/portage/package.use/pkgcore.conf
Afterwards run:
emerge -1av dev-python/snakeoil sys-apps/pkgcore dev-util/pkgcheck
emerge -av --noreplace dev-util/pkgcheck
Configuration
Following is what I would suggest to put into your Emacs config file:
(require 'ebuild-mode)
(require 'flycheck)
(require 'flycheck-pkgcheck)
(setq flycheck-pkgcheck-enable t)
(add-hook 'ebuild-mode-hook 'flycheck-mode)
(add-hook 'ebuild-mode-hook 'flycheck-pkgcheck-setup)
If You are using use-package
:
(use-package flycheck
:ensure nil)
(use-package ebuild-mode
:ensure nil
:hook ((ebuild-mode . flycheck-mode)))
(use-package flycheck-pkgcheck
:ensure nil
:custom ((flycheck-pkgcheck-enable t))
:hook ((ebuild-mode . flycheck-pkgcheck-setup)))
The lines with :ensure nil
are there to prevent use-package
from trying to download the particular package from Elpa (because we use system packages for this configuration).
Preparation
First using a needle or a toothpick click a button on the right side of the laptop (indicated by a bent arrow), this will start the machine up in BIOS selection menu where you choose the BIOS setup option.
Then, in the BIOS menu disable option to check laptop charge level while it is shut down. If not disabled it will interfere with key combination that has to be pressed while laptop is shut down. This can be turned back after the advanced BIOS menu is enabled.
After that "Exit saving changes" and shutdown.
Keys
I thought it was a joke at first but it really is true that a special combination of keys has to be pressed depending on the laptop model (while it is shut down).
For my laptop it is as follows:
F4 4 r f v
F5 5 t g b
F6 6 y h n
References
Template
File: /etc/systemd/system/APP.service
[Unit]
Description=Run APP application
[Service]
Type=simple
ExecStart=/usr/bin/LANG APP_DIR/APP APP_ARGS
Restart=on-failure
User=root
WorkingDirectory=APP_DIR
[Install]
WantedBy=multi-user.target
Also, the application might need to reference a PID file, let systemD know abut it via PIDFile
.
Example
File: /etc/systemd/system/julia_dash_app.service
[Unit]
Description=Run Julia Dash application
[Service]
Type=simple
ExecStart=/usr/bin/julia /root/julia_dash_app/main.jl
Restart=on-failure
User=root
WorkingDirectory=/root/julia_dash_app
[Install]
WantedBy=multi-user.target
Intro
Sage may be available on your distro but on Gentoo such frivolities for students are not there yet, so I had to install it the manual way.
User
I went to the Sage website, to the "download-source" link. The source mirror I picked was France.
Ok, so let's follow Sage Math build instructions and get it going
wget www-ftp.lip6.fr/pub/math/sagemath/src/sage-9.2.tar.gz
tar xvf sage-9.2.tar.gz
cd sage-9.2
./configure
make
And now, let's wait…
Portage
After a long, long, long time waiting I remembered that there existed a Gentoo overlay for Sage. And in the meantime I thought I'd try that solution instead since some good Gentoo people already did most of the effort.
Just a few files to edit…
File: /etc/portage/repos.conf/sage-on-gentoo.conf
# -*- conf -*-
[sage-on-gentoo]
auto-sync = yes
location = /var/db/repos/sage-on-gentoo
priority = 999
sync-git-clone-extra-opts = --depth=999999999 --no-shallow-submodules --verbose
sync-git-pull-extra-opts = --verbose
sync-type = git
sync-umask = 022
sync-uri = https://github.com/cschwan/sage-on-gentoo.git
sync-user = root:portage
File: /etc/portage/package.accept~keywords~/zz-sage
# -*- conf -*-
sci-mathematics/sage **
*/*::sage-on-gentoo
dev-python/cvxopt
media-gfx/tachyon
sci-libs/bliss
sci-libs/dsdp
sci-libs/fflas-ffpack
sci-libs/fplll
sci-libs/libhomfly
sci-libs/linbox
sci-libs/m4rie
sci-mathematics/glpk
File: /etc/portage/package.use/zz-sage
# -*- conf -*-
sci-mathematics/sage -doc-html -doc-html-bin
sci-mathematics/sage -doc-pdf -doc-pdf-bin
sci-mathematics/sage -jmol
sci-mathematics/sage X bliss meataxe
dev-python/pplpy doc
sci-libs/cddlib tools
sci-libs/pynac -giac
sci-mathematics/eclib flint
sci-mathematics/flint ntl
sci-mathematics/glpk gmp
sci-mathematics/gmp-ecm -openmp
sci-mathematics/lcalc pari
sci-mathematics/maxima ecls
sci-mathematics/pari gmp doc
Now - let's build Sage with Portage!
>>> Emerging (1 of 100) sci-mathematics/cliquer–1.21::gentoo
At least I know more or less how long I'm going to wait and know what exactly fails to build, if anything does.
Final
Build
$ qlop -tv sage
> 2021–03–23T20:49:12 >>> sci-mathematics/sage–9999: 55′04″
Git stats
Overlays
This info we can easily gather with executing:
Gentoo' HEAD: 33f2d770c28307b1e9a1199c681e1c543602c6d4
Sage-on-Gentoo's HEAD: f7eac5b7e1a844132164b7593dab85cd87918664
Sage
Sage repository's HEAD (because we are using the live (9999) ebuild):
cat /var/cache/distfiles/git3-src/sagemath_sage.git/refs/heads/develop
Which returns: 5cb72aade9b297c10bb0f1ae8529466e5b5eb41d