From c248f3adf5f0ebb797d253465eeac85211096574 Mon Sep 17 00:00:00 2001 From: Maxim Likhachev Date: Thu, 21 Oct 2021 17:03:13 +0300 Subject: [PATCH] linux-gentoo: add overlays, update applist --- roles/linux-gentoo/tasks/main.yml | 1 + roles/linux-gentoo/tasks/portage.yml | 18 ++++++ .../templates/portage/env/no-tmpfs.conf | 2 +- roles/linux-gentoo/templates/portage/make.conf.j2 | 12 +++- .../templates/portage/repos.conf/overlays.conf.j2 | 7 +++ roles/linux-gentoo/vars/applications.yml | 16 ++++-- roles/linux-gentoo/vars/overlays.yml | 7 +++ roles/linux-gentoo/vars/portage.yml | 64 ++++++++++++++-------- scripts/doc.sh | 5 +- 9 files changed, 101 insertions(+), 31 deletions(-) create mode 100644 roles/linux-gentoo/templates/portage/repos.conf/overlays.conf.j2 create mode 100644 roles/linux-gentoo/vars/overlays.yml diff --git a/roles/linux-gentoo/tasks/main.yml b/roles/linux-gentoo/tasks/main.yml index 1f2f643..6be7fd6 100644 --- a/roles/linux-gentoo/tasks/main.yml +++ b/roles/linux-gentoo/tasks/main.yml @@ -4,6 +4,7 @@ - include_vars: grub.yml - include_vars: mount.yml - include_vars: portage.yml +- include_vars: overlays.yml - include_vars: applications.yml - include_vars: xorg.yml - include_vars: cleanup.yml diff --git a/roles/linux-gentoo/tasks/portage.yml b/roles/linux-gentoo/tasks/portage.yml index ab13e5b..08f9370 100644 --- a/roles/linux-gentoo/tasks/portage.yml +++ b/roles/linux-gentoo/tasks/portage.yml @@ -4,6 +4,13 @@ dest: /etc/portage/make.conf/custom.clt notify: emerge world +- name: Create extra portage directory + become: yes + file: + path: "{{ gentoo.portage.extra_directories[item] }}" + state: directory + loop: "{{ gentoo.portage.extra_directories.keys() }}" + - name: Enable SQLite in portage lineinfile: path: /etc/portage/modules @@ -27,3 +34,14 @@ - name: Update eix cache shell: eix-update when: eix_configured.changed + +- name: Configure additional overlays + template: + src: portage/repos.conf/overlays.conf.j2 + dest: /etc/portage/repos.conf/zz-overlays.conf + register: overlays_updated + +- name: Sync portage overlays + shell: emerge --sync + when: overlays_updated.changed + diff --git a/roles/linux-gentoo/templates/portage/env/no-tmpfs.conf b/roles/linux-gentoo/templates/portage/env/no-tmpfs.conf index b34da85..8f5d413 100644 --- a/roles/linux-gentoo/templates/portage/env/no-tmpfs.conf +++ b/roles/linux-gentoo/templates/portage/env/no-tmpfs.conf @@ -1,4 +1,4 @@ -PORTAGE_TMPDIR="/var/tmp/notmpfs" +PORTAGE_TMPDIR="{{ gentoo.portage.extra_directories.notmpfs }}" LDLAGS="-fno-lto -fno-use-linker-plugin -fuse-ld=bfd" LD=ld.bfd CFLAGS="-march=native -O2 -pipe -Wno-all -fno-lto -fno-use-linker-plugin -fuse-ld=bfd" diff --git a/roles/linux-gentoo/templates/portage/make.conf.j2 b/roles/linux-gentoo/templates/portage/make.conf.j2 index f1ecae2..e168cec 100644 --- a/roles/linux-gentoo/templates/portage/make.conf.j2 +++ b/roles/linux-gentoo/templates/portage/make.conf.j2 @@ -3,7 +3,9 @@ #------------------------------------ # Основные опции сборки #------------------------------------ -FEATURES="{{ gentoo.portage.features | join(' ') }}" +FEATURES="{{ gentoo.portage.features | join(' ') }} {{ 'ccache' if gentoo.portage.ccache.enabled == true else '' }}" + +LC_MESSAGES="C" #------------------------------------ # Настройки компилятора @@ -18,12 +20,16 @@ LDFLAGS="${LDFLAGS} {{ gentoo.portage.ldflags | join(' ') }}" CFLAGS="{{ gentoo.portage.cflags | join(' ') }}" CXXFLAGS="${CFLAGS}" +# PORTAGE_NICENESS={{ gentoo.portage.niceness }} +# PORTAGE_IONICE_COMMAND="ionice -c 3 -p \${PID}" + MAKEOPTS="{{ gentoo.portage.buildopts.common | join(' ') }} {{ gentoo.portage.buildopts.make | join(' ') }}" # Количество пакетов для одновременной сборки. EMERGE_DEFAULT_OPTS="${EMERGE_DEFAULT_OPTS} {{ gentoo.portage.buildopts.common | join(' ') }} {{ gentoo.portage.buildopts.emerge | join(' ') }}" -#PORTAGE_BUNZIP2_COMMAND="lbunzip2 -nX" +# PORTAGE_BZIP2_COMMAND="lbunzip2 -n{{ ansible_processor_vcpus * 2 }}" +# PORTAGE_BUNZIP2_COMMAND="lbzip2 -n{{ ansible_processor_vcpus * 2 }}" #---------------------------------- # Поддерживаемые архитектуры @@ -64,6 +70,8 @@ GRUB_PLATFORMS="efi-64 pc" PORTAGE_ELOG_CLASSES="warn error log" PORTAGE_ELOG_SYSTEM="save" +CCACHE_SIZE="{{ gentoo.portage.ccache.size }}" + #---------------------------------- # USE-Флаги #---------------------------------- diff --git a/roles/linux-gentoo/templates/portage/repos.conf/overlays.conf.j2 b/roles/linux-gentoo/templates/portage/repos.conf/overlays.conf.j2 new file mode 100644 index 0000000..45c5e3e --- /dev/null +++ b/roles/linux-gentoo/templates/portage/repos.conf/overlays.conf.j2 @@ -0,0 +1,7 @@ +{% for overlay in overlays %} +[{{ overlay }}] +location = {{ overlays[overlay]["location"] }} +sync-type = {{ overlays[overlay]["sync-type"] }} +sync-uri = {{ overlays[overlay]["sync-uri"] }} + +{% endfor %} diff --git a/roles/linux-gentoo/vars/applications.yml b/roles/linux-gentoo/vars/applications.yml index 92dc250..76cce04 100644 --- a/roles/linux-gentoo/vars/applications.yml +++ b/roles/linux-gentoo/vars/applications.yml @@ -31,6 +31,7 @@ apps: mask: unmask: - media-libs/libepoxy + - net-misc/lagrange - app-admin/ansible-lint - app-benchmarks/hyperfine - sys-power/acpi_call @@ -61,7 +62,9 @@ apps: - app-text/zathura-pdf-poppler - dev-tcltk/tklib - dev-haskell/stack-bin ~amd64 - #- sys-apps/bat + + - dev-libs/girara ~amd64 + - sys-apps/bat #- dev-haskell/hlint install: @@ -93,16 +96,18 @@ apps: #- games-engines/openmw # https://openmw.org/ Open source reimplementation of TES III. Morrowind. - dev-haskell/stack-bin # https://haskellstack.org/ The Haskell Tool Stack. - dev-lang/go # https://golang.org Programming language to build simple/reliable/efficient software. + - dev-lang/jimtcl # http://jim.tcl.tk/ Small footprint implementation of Tcl programming language. - dev-lang/tcl # https://tcl.tk TCL Programming language. - dev-lang/tk # https://tcl.tk GUI ToolKit for TCL Programming language. - =dev-libs/xapian-1.2.25 # https://www.xapian.org/ Xapian Probabilistic Information Retrieval library. - dev-python/pip # https://pip.pypa.io/ Installs python packages. + - dev-util/git-delta # https://github.com/dandavison/delta A syntax-highlighting pager for git. - dev-util/shellcheck-bin # https://www.shellcheck.net/ Static analysis and lint tool, for (ba)sh scripts. - dev-util/ccache # https://ccache.dev/ Fast compiler cache. - dev-vcs/git # https://git-scm.com Distributed revision control system. - mail-client/mutt # http://www.mutt.org/ A small but very powerful text-based mail client. - mail-filter/procmail # http://www.procmail.org/ Mail delivery agent. - - media-gfx/geeqie # http://www.geeqie.org/ lightweight image viewer for Linux, BSDs and compatibles. + # - media-gfx/geeqie # http://www.geeqie.org/ lightweight image viewer for Linux, BSDs and compatibles. - media-gfx/imagemagick # https://www.imagemagick.org/ Tools and libraries to manipulate images in many formats. - media-gfx/sxiv # https://github.com/muennich/sxiv Simple X Image Viewer. - media-libs/exiftool # https://www.sno.phy.queensu.ca/~phil/exiftool/index.html Perl lib for reading and writing EXIF metadata. @@ -113,16 +118,18 @@ apps: - media-sound/ncmpcpp # https://rybczak.net/ncmpcpp/ NCurses Music Player Client (Plus Plus). - media-video/mpv # https://mpv.io/ Free, open source, and cross-platform media player. - net-fs/sshfs # https://github.com/libfuse/sshfs A network filesystem client to connect to SSH servers. - #- net-news/newsboat # https://newsboat.org/ An RSS/Atom feed reader for text terminals. - net-libs/nodejs # https://nodejs.org Platform built on V8 to build network applications. - net-mail/fetchmail # https://www.fetchmail.info Full-featured, robust, well-documented remote-mail retrieval and forwarding utility. - net-misc/aria2 # https://aria2.github.io Lightweight multi-protocol & multi-source command-line download utility. - net-misc/connman # https://01.org/connman Internet connection daemon. - net-misc/curl # https://curl.haxx.se/ Get a file from an HTTP, HTTPS or FTP server. + - net-misc/lagrange # https://gmi.skyjake.fi/lagrange/ https://git.skyjake.fi/gemini/lagrange Desktop GUI client for browsing Geminispace. - net-misc/wget # https://www.gnu.org/software/wget/ Internet file retriever. - sys-apps/coreutils # https://www.gnu.org/software/coreutils GNU File, Shell, and Text utilities. + #- sys-cluster/k9scli # https://k9scli.io terminal based UI to manage kubernetes clusters. #- sys-fs/android-file-transfer-linux # https://github.com/whoozle/android-file-transfer-linux Android File Transfer for Linux. - sys-fs/dfc # https://projects.gw-computing.net/projects/dfc Display graphs and colors of file system space/usage. + - sys-apps/bat # https://github.com/sharkdp/bat Clone of cat(1) with syntax highlighting and Git integration. **[BIN]** - sys-apps/findutils # https://www.gnu.org/software/findutils/ Collection of GNU find, xargs, and locate. - sys-apps/gawk # https://www.gnu.org/software/gawk/ GNU awk utility. - sys-fs/ntfs3g # https://www.tuxera.com/community/open-source-ntfs-3g/ Read-write NTFS driver for FUSE. @@ -143,7 +150,7 @@ apps: - www-client/vivaldi # https://vivaldi.com A web browser which works without pulse-audio. - www-client/w3m # https://github.com/tats/w3m Text based WWW browser, supports tables and frames. - sys-kernel/linux-firmware # https://git.kernel.org/?p=linux/kernel/git/firmware/linux-firmware.git Linux firmware files. - - sys-apps/ripgrep # https://github.com/BurntSushi/ripgrep Search tool like grep and The Silver Searcher. + # - sys-apps/ripgrep # https://github.com/BurntSushi/ripgrep Search tool like grep and The Silver Searcher. - sys-apps/fd # https://github.com/sharkdp/fd Simple, fast and user-friendly alternative to find. - sys-apps/preload @@ -169,7 +176,6 @@ apps: #- app-text/odt2txt # https://github.com/dstosberg/odt2txt/ Convert OpenDocument files to plain text. #- dev-haskell/hlint # https://github.com/ndmitchell/hlint Haskell source code suggestions. **[BIN]** - #- sys-apps/bat # https://github.com/sharkdp/bat Clone of cat(1) with syntax highlighting and Git integration. **[BIN]** #- media-gfx/graphviz #- x11-misc/dunst diff --git a/roles/linux-gentoo/vars/overlays.yml b/roles/linux-gentoo/vars/overlays.yml new file mode 100644 index 0000000..873b590 --- /dev/null +++ b/roles/linux-gentoo/vars/overlays.yml @@ -0,0 +1,7 @@ + +overlays: + guru: + location: /var/db/repos/guru + sync-type: git + sync-uri: https://github.com/gentoo-mirror/guru.git + diff --git a/roles/linux-gentoo/vars/portage.yml b/roles/linux-gentoo/vars/portage.yml index 1cb48b6..c428aea 100644 --- a/roles/linux-gentoo/vars/portage.yml +++ b/roles/linux-gentoo/vars/portage.yml @@ -19,10 +19,23 @@ gentoo: video: - intel portage: + extra_directories: + notmpfs: /var/portage features: - -getbinpkg - - parallel-fetch + - parallel-fetch # enabled by default + - parallel-install - metadata-transfer + - cgroup + - collision-protect + - nodoc + - noinfo + - sandbox + - strict + - userfetch + - usersandbox + - usersync + - xattr ldflags: - -O2 # - -flto={{ ansible_processor_vcpus }} @@ -49,6 +62,7 @@ gentoo: #- -msse4.2 #- -mssse3 #- -ftree-vectorize + niceness: 0 buildopts: common: - --jobs={{ ansible_processor_vcpus * 2 }} # Максимальное количество запускаемых копий make @@ -57,6 +71,10 @@ gentoo: - -s # Уменьшение количества выводимой информации emerge: - --keep-going # Не прерывать сборку при ошибках + - --jobs 9 + ccache: + enabled: true + size: 5G eix: colorscheme: 1 @@ -66,10 +84,10 @@ gentoo: cache_method: sqlite use: - env: [] - # - template: no-lto.conf - # packages: - # - app-text/poppler + env: + - template: no-tmpfs.conf + packages: + - sys-devel/gcc config: - x11-misc/dmenu @@ -79,19 +97,19 @@ gentoo: custom: ######## python 2.7 only ######## - - sys-apps/calculate-utils minimal gpg -backup -install -console python_targets_python2_7 + # - sys-apps/calculate-utils minimal gpg -backup -install -console python_targets_python2_7 # - "app-emulation/virtualbox-bin PYTHON_TARGETS: python2_7" # - "app-emulation/virtualbox-modules PYTHON_TARGETS: python2_7" - - dev-python/setuptools python_targets_python3_9 - - dev-python/setuptools-python2 python_targets_python2_7 - - dev-python/certifi-python2 python_targets_python2_7 - - dev-python/cython-python2 python_targets_python2_7 - - "dev-python/soaplib PYTHON_TARGETS: python2_7" - - "dev-python/pytz PYTHON_TARGETS: python2_7" - - "dev-python/pyxml PYTHON_TARGETS: python2_7" - - "dev-python/pexpect-python2 PYTHON_TARGETS: python2_7" - - "dev-python/passlib PYTHON_TARGETS: python2_7" + # - dev-python/setuptools python_targets_python3_9 + # - dev-python/setuptools-python2 python_targets_python2_7 + # - dev-python/certifi-python2 python_targets_python2_7 + # - dev-python/cython-python2 python_targets_python2_7 + # - "dev-python/soaplib PYTHON_TARGETS: python2_7" + # - "dev-python/pytz PYTHON_TARGETS: python2_7" + # - "dev-python/pyxml PYTHON_TARGETS: python2_7" + # - "dev-python/pexpect-python2 PYTHON_TARGETS: python2_7" + # - "dev-python/passlib PYTHON_TARGETS: python2_7" - dev-lua/lpeg lua_targets_luajit - dev-lua/mpack lua_targets_luajit @@ -99,13 +117,13 @@ gentoo: - media-libs/libepoxy X ######## python 2.7 and 3.10 ######## - - dev-python/lxml-python2 python_targets_python2_7 python_targets_python3_9 + # - dev-python/lxml-python2 python_targets_python2_7 python_targets_python3_9 # - dev-python/lxml python_targets_python2_7 python_targets_python3_9 - - dev-python/certifi python_targets_python3_9 - - dev-python/cython python_targets_python3_9 - - dev-python/pexpect python_targets_python2_7 python_targets_python3_9 - - dev-python/ptyprocess-python2 python_targets_python2_7 - - dev-python/pytz-python2 python_targets_python2_7 + # - dev-python/certifi python_targets_python3_9 + # - dev-python/cython python_targets_python3_9 + # - dev-python/pexpect python_targets_python2_7 python_targets_python3_9 + # - dev-python/ptyprocess-python2 python_targets_python2_7 + # - dev-python/pytz-python2 python_targets_python2_7 # - app-i18n/uim X # - dev-libs/glib dbus @@ -141,6 +159,7 @@ gentoo: - dev-python/ipython -smp - dev-python/netaddr -cli - dev-python/pyyaml libyaml + - dev-util/pkgconf pkg-config - dev-vcs/git blksha1 curl pcre-jit webdav - dev-games/openscenegraph-openmw ffmpeg svg - games-engines/openmw osg-fork @@ -166,6 +185,7 @@ gentoo: - media-video/ffmpeg -amr -jpeg2k -libaom -network -openssl -postproc -sdl -webp gpl gnutls encode cpudetection chromium # chromium for vivaldi - media-video/mpv X cli -egl -iconv -jpeg -libmpv -sdl -xv - net-firewall/iptables ipv6 # Required by libpod/podman + - net-libs/nodejs npm - net-misc/aria2 bittorrent gnutls libxml2 nettle - net-misc/connman iptables wifi - net-misc/curl http2 openssl progress-meter @@ -202,7 +222,7 @@ gentoo: - x11-base/xorg-server -minimal xorg suid - x11-drivers/xf86-video-intel dri sna uddev uxa xvmc # Default USE flags. - x11-drivers/nvidia-drivers X driver tools - - x11-libs/cairo svg # Required by gtk+ + - x11-libs/cairo X svg # Required by gtk+ - x11-libs/gtk+ X - x11-libs/libxcb X xkb - x11-libs/pango X diff --git a/scripts/doc.sh b/scripts/doc.sh index c767eb5..cedd520 100755 --- a/scripts/doc.sh +++ b/scripts/doc.sh @@ -11,14 +11,17 @@ APP_ALIASES=$(cat <<-EOF firefox:firefox-bin ghostscript:ghostscript-gpl haskell-stack:stack-bin + k9s:k9scli ntfs-3g:ntfs3g + rar:unrar shellcheck:shellcheck-bin + tcl:jimtcl tk:tcl-tk EOF ) get_alias() { - grep -E ":?${1}:?" <<<"${APP_ALIASES[*]}" | sed -E "s/:?${1}:?//" + ugrep -E ":?${1}:?" <<<"${APP_ALIASES[*]}" | sed -E "s/:?${1}:?//" } description() {