From 04458c143f1f6473d9f4d184d71386a00aab415e Mon Sep 17 00:00:00 2001 From: Zedhugh Chen Date: Thu, 7 Aug 2025 18:36:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20gentoo=20portage=20?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E5=B9=B6=E6=96=B0=E5=A2=9E=20portage=20?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E6=9B=B4=E6=96=B0=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gentoo_portage/env/lessThreads.conf | 1 - gentoo_portage/env/notmpfs.conf | 1 - gentoo_portage/make.conf | 30 +++---- gentoo_portage/package.accept_keywords | 35 +++++++- gentoo_portage/package.env | 14 +--- gentoo_portage/package.license | 12 ++- gentoo_portage/package.mask | 2 +- gentoo_portage/package.unmask | 1 - gentoo_portage/package.use | 111 ++++++++++--------------- gentoo_portage/sets/lsp-bridge | 9 ++ script/sync-portage-config.sh | 54 ++++++++++++ script/sync-portage-patch.sh | 15 ---- 12 files changed, 165 insertions(+), 120 deletions(-) delete mode 100644 gentoo_portage/env/lessThreads.conf delete mode 100644 gentoo_portage/env/notmpfs.conf delete mode 100644 gentoo_portage/package.unmask create mode 100644 gentoo_portage/sets/lsp-bridge create mode 100644 script/sync-portage-config.sh delete mode 100644 script/sync-portage-patch.sh diff --git a/gentoo_portage/env/lessThreads.conf b/gentoo_portage/env/lessThreads.conf deleted file mode 100644 index 8e75088..0000000 --- a/gentoo_portage/env/lessThreads.conf +++ /dev/null @@ -1 +0,0 @@ -MAKEOPTS="-j6" diff --git a/gentoo_portage/env/notmpfs.conf b/gentoo_portage/env/notmpfs.conf deleted file mode 100644 index b8a96f4..0000000 --- a/gentoo_portage/env/notmpfs.conf +++ /dev/null @@ -1 +0,0 @@ -PORTAGE_TMPDIR="/var/tmp/notmpfs" diff --git a/gentoo_portage/make.conf b/gentoo_portage/make.conf index d9275bb..c7bc6c0 100644 --- a/gentoo_portage/make.conf +++ b/gentoo_portage/make.conf @@ -9,45 +9,35 @@ FCFLAGS="${COMMON_FLAGS}" FFLAGS="${COMMON_FLAGS}" # NOTE: This stage was built with the bindist Use flag enabled -PORTDIR="/var/db/repos/gentoo" -DISTDIR="/var/cache/distfiles" -PKGDIR="/var/cache/binpkgs" # This sets the language of build output to English. # Please keep this setting intact when reporting bugs. -LC_MESSAGES=C +LC_MESSAGES=C.utf8 # binary package features FEATURES="buildpkg ${FEATURES}" QUICKPKG_DEFAULT_OPTS="--include-config y" -EMERGE_DEFAULT_OPTS="--buildpkg --buildpkg-exclude \"virtual/* sys-kernel/*-sources\" ${EMERGE_DEFAULT_OPTS}" -# PORTAGE_BINHOST="ssh://root@192.168.2.102/var/cache/binpkgs" +BINPKG_FORMAT="gpkg" +EMERGE_DEFAULT_OPTS="--buildpkg --buildpkg-exclude \"virtual/* sys-kernel/*-sources */*-bin\" ${EMERGE_DEFAULT_OPTS}" # ccache and distcc # FEATURES="distcc ${FEATURES}" +# CCACHE_DIR="/var/cache/ccache" +# FEATURES="ccache ${FEATURES}" # ABI_X86="32 64" ALSA_CARDS="hda-intel" -# CCACHE_DIR="/var/cache/ccache" -# FEATURES="ccache ${FEATURES}" +GRUB_PLATFORMS="efi-64" +INPUT_DEVICES="libinput" +VIDEO_CARDS="amdgpu dummy nouveau radeon radeonsi vesa fbdev nvidia" + GENTOO_MIRRORS=" https://mirrors.ustc.edu.cn/gentoo/ http://distfiles.gentoo.org/ https://mirrors.tuna.tsinghua.edu.cn/gentoo/ " -BINPKG_FORMAT="gpkg" -GRUB_PLATFORMS="efi-64" MAKEOPTS="-j9 ${MAKEOPTS}" -ACCEPT_KEYWORDS="amd64 ~amd64" -CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand sse sse2 sse3 sse4_1 sse4_2 ssse3" -INPUT_DEVICES="libinput" -# LUA_TARGETS="luajit" -# LUA_SINGLE_TARGET="luajit" -# PYTHON_TARGETS="python3_7 python3_8 python3_9" -# PYTHON_SINGLE_TARGET="python3_8" -#RUBY_TARGETS="ruby30" -VIDEO_CARDS="fbdev nvidia" -DESKTOP_USE="X alsa apng dbus fbcon ffmpeg flac fuse gif gtk gtk2 gtk3 http2 icu jpeg mp3 mp4 mpeg mtp nvidia ogg opengl pdf png pulseaudio svg tiff unicode vaapi vdpau webp xinerama xv xvmc" +DESKTOP_USE="X alsa apng dbus fbcon ffmpeg flac fuse gif gtk gtk2 gtk3 http2 icu jack jpeg mp3 mp4 mpeg mtp nvidia ogg opengl pdf png pipewire pulseaudio svg tiff unicode vaapi vdpau webp xinerama xv xvmc" #USE="${USE} ${DESKTOP_USE} consolekit cups policykit pulseaudio truetype udev xft xcb xkb -bluetooth -gpm -libva -modemmanager" USE="${USE} ${DESKTOP_USE} bluetooth cups elogind policykit truetype udev xft xcb xkb -gpm -libva -modemmanager" diff --git a/gentoo_portage/package.accept_keywords b/gentoo_portage/package.accept_keywords index e5abd2f..ba6efac 100644 --- a/gentoo_portage/package.accept_keywords +++ b/gentoo_portage/package.accept_keywords @@ -1,3 +1,34 @@ +# editor +app-editors/cursor ~amd64 app-editors/emacs ** -sys-kernel/gentoo-sources -~amd64 -x11-libs/libX11 -~amd64 +app-editors/vscode ~amd64 +app-emacs/emacs-common ~amd64 + +# imput method +app-i18n/fcitx ~amd64 +app-i18n/fcitx-configtool ~amd64 +app-i18n/fcitx-meta ~amd64 +app-i18n/fcitx-rime ~amd64 +app-i18n/librime ~amd64 + +# tree sitter +dev-libs/tree-sitter* ~amd64 + +# audroid studio +dev-util/android-studio::gentoo ~amd64 + +# frp +net-vpn/frp ~amd64 + +# firefox +dev-libs/nspr ~amd64 +dev-libs/nss ~amd64 +www-client/firefox ~amd64 + +media-fonts/sarasa-gothic ~amd64 +media-sound/bluez-alsa ~amd64 + +*/*-bin ~amd64 + +net-wireless/iwgtk ~amd64 +sys-fs/jmtpfs ~amd64 \ No newline at end of file diff --git a/gentoo_portage/package.env b/gentoo_portage/package.env index 66afac7..11ddd51 100644 --- a/gentoo_portage/package.env +++ b/gentoo_portage/package.env @@ -1,13 +1 @@ -app-office/libreoffice notmpfs.conf -dev-lang/ghc notmpfs.conf -dev-lang/mono notmpfs.conf -dev-lang/rust notmpfs.conf -dev-lang/spidermonkey notmpfs.conf -dev-java/icedtea notmpfs.conf -mail-client/thunderbird notmpfs.conf -sys-devel/gcc notmpfs.conf -www-client/chromium notmpfs.conf -www-client/firefox notmpfs.conf - -sys-libs/glibc valgrind.conf -sys-devel/clang lessThreads.conf \ No newline at end of file +sys-libs/glibc valgrind.conf diff --git a/gentoo_portage/package.license b/gentoo_portage/package.license index fb10d74..a2c38da 100644 --- a/gentoo_portage/package.license +++ b/gentoo_portage/package.license @@ -1,18 +1,28 @@ app-arch/p7zip unRAR +app-editors/cursor cursor app-editors/vscode Microsoft-vscode app-emulation/virtualbox-bin PUEL app-office/wps-office WPS-EULA dev-embedded/sdcc MicroChip-SDCC dev-db/mongodb SSPL-1 +dev-libs/cudnn NVIDIA-cuDNN +dev-util/nvidia-cuda-toolkit NVIDIA-CUDA +dev-util/android-studio android +dev-util/pycharm-community JetBrains-business JSON +dev-util/pycharm-professional JetBrains-business JSON media-fonts/font-bh-ttf bh-luxi media-fonts/font-bh-type1 bh-luxi +media-tv/plex-media-server Plex net-analyzer/nmap NPSL net-im/deepin-wine-wechat Tencent net-im/dingtalk all-rights-reserved +net-im/wechat all-rights-reserved +net-im/wechat-universal-bwrap all-rights-reserved net-misc/anydesk AnyDesk-TOS +net-misc/baidunetdisk BaiduNetDisk net-misc/teamviewer TeamViewer sys-kernel/linux-firmware no-source-code linux-fw-redistributable www-client/google-chrome google-chrome www-client/microsoft-edge microsoft-edge www-plugins/adobe-flash AdobeFlash-11.x -x11-drivers/nvidia-drivers NVIDIA-r2 +x11-drivers/nvidia-drivers NVIDIA-r2 NVIDIA-2023 NVIDIA-2025 diff --git a/gentoo_portage/package.mask b/gentoo_portage/package.mask index 4a0ec59..f410843 100644 --- a/gentoo_portage/package.mask +++ b/gentoo_portage/package.mask @@ -1,3 +1,3 @@ app-office/wps-office::gentoo-zh -dev-libs/tree-sitter-typescript::gentoo +dev-lang/rust net-proxy/shadowsocks-rust::gentoo-zh diff --git a/gentoo_portage/package.unmask b/gentoo_portage/package.unmask deleted file mode 100644 index 3bc2843..0000000 --- a/gentoo_portage/package.unmask +++ /dev/null @@ -1 +0,0 @@ -app-text/sdcv::gentoo-zedhugh diff --git a/gentoo_portage/package.use b/gentoo_portage/package.use index a1ba91f..4f83e2f 100644 --- a/gentoo_portage/package.use +++ b/gentoo_portage/package.use @@ -1,40 +1,10 @@ -# abi -# dev-libs/glib abi_x86_32 -# dev-libs/libffi abi_x86_32 -# dev-libs/libpcre abi_x86_32 -# dev-libs/libpthread-stubs abi_x86_32 -# dev-util/pkgconfig abi_x86_32 -# sys-apps/attr abi_x86_32 -# sys-apps/util-linux abi_x86_32 -# sys-libs/zlib abi_x86_32 -# virtual/libffi abi_x86_32 -# virtual/libiconv abi_x86_32 -# virtual/libintl abi_x86_32 -# virtual/pkgconfig abi_x86_32 -# x11-libs/libX11 abi_x86_32 -# x11-libs/libXau abi_x86_32 -# x11-libs/libXdmcp abi_x86_32 -# x11-libs/libXext abi_x86_32 -# x11-libs/libvdpau abi_x86_32 -# x11-libs/libxcb abi_x86_32 -# x11-base/xcb-proto abi_x86_32 -# sys-libs/libxcrypt abi_x86_32 -# virtual/libcrypt abi_x86_32 - app-text/xmlto text -dev-lang/python sqlite -dev-libs/gmp static-libs -dev-libs/libpcre2 pcre16 -# media-libs/mesa -vaapi -gallium net-misc/curl telnet net-misc/openssh libedit -sys-apps/util-linux static-libs sys-boot/grub mount -sys-libs/zlib static-libs -#sys-devel/binutils gold default-gold -# nvidia driver -x11-drivers/nvidia-drivers -abi_x86_32 +# kernel +sys-kernel/installkernel dracut grub # terminal x11-terms/xterm sixel xinerama @@ -44,13 +14,14 @@ x11-terms/rxvt-unicode 256-color blink fading-colors pixbuf unicode3 #www-servers/uwsgi cgi python # emacs -app-editors/emacs dynamic-loading gui gzip-el json sound source sqlite tree-sitter wide-int -gtk +app-editors/emacs dynamic-loading -gtk gui gzip-el harfbuzz json libxml2 sound source sqlite tree-sitter wide-int app-emacs/emacs-common gui sys-devel/gcc jit # p7zip app-arch/p7zip rar -wxwidgets +# vim app-editors/vim lua python # file manager @@ -59,28 +30,16 @@ app-editors/vim lua python #x11-libs/libfm udisks # firefox -media-libs/libvpx postproc +# media-libs/libvpx postproc #www-client/firefox -clang -system-av1 -system-harfbuzz -system-icu -system-jpeg -system-libevent -system-libvpx -system-png -system-webp -#www-client/firefox -clang - -# postgresql -dev-db/postgresql python +# www-client/firefox -clang # imagemagick media-gfx/imagemagick svg xml -# pulseaudio -media-sound/pulseaudio aptx -orc - # terminus font media-fonts/terminus-font otf -net-misc/aria2 bittorrent metalink tcmalloc xmlrpc - -# awesome use lua5.3 for utf-8 issue -dev-lua/lgi LUA_TARGETS: lua5-1 lua5-3 -x11-wm/awesome LUA_SINGLE_TARGET: lua5-3 -lua5-1 - # MCU develop dev-embedded/sdcc device-lib mcs51 packihx @@ -90,22 +49,8 @@ media-sound/ncmpcpp clock outputs taglib visualizer # graphviz media-libs/gd fontconfig -# deepin-wine-wechat -# media-libs/libcanberra pulseaudio -# media-libs/mesa osmesa -vaapi -# media-plugins/alsa-plugins pulseaudio -# x11-drivers/nvidia-drivers abi_x86_32 -# x11-libs/libva -opengl - # fcitx5 -app-i18n/fcitx-configtool qt5 -kcm -app-i18n/fcitx-meta rime -chinese-addons -app-i18n/fcitx-qt qt5 -# media-libs/mesa wayland -# x11-libs/gtk+ wayland - -# nodejs use corepack manage package manager -net-libs/nodejs corepack -npm +app-i18n/fcitx-meta gtk4 rime -chinese-addons # dwm x11-misc/dmenu xinerama @@ -122,7 +67,43 @@ app-text/texlive-core cjk xetex net-fs/samba client # mpv -media-video/mpv bluray +media-video/mpv bluray dvd nvenc pipewire -vulkan -# librime -app-i18n/librime octagram +# pdf-tools need poppler-glib library +app-text/poppler cairo + +# qbittorrent +net-p2p/qbittorrent webui + +# ffmpeg encoder +media-video/ffmpeg bluray cuda libass nvenc opus vorbis vpx x264 x265 + +# pipewire +media-video/pipewire extra jack-sdk pipewire-alsa sound-server + +# calibra +dev-python/pyqt6 qml quick vulkan webchannel +dev-qt/qtbase vulkan +dev-qt/qtdeclarative vulkan +dev-qt/qtgui egl vulkan +dev-qt/qtimageformats mng +dev-qt/qttools qml vulkan +dev-qt/qtwebchannel qml +dev-qt/qtwebengine bindist qml vulkan -pulseaudio -vaapi + +# rust +dev-lang/rust clippy rust-analyzer rust-src rustfmt +dev-lang/rust-bin clippy rust-analyzer rust-src rustfmt + +# webkit-gtk as dependency of tauri +# net-libs/webkit-gtk keyring lcms spell wayland +# x11-libs/gtk+ wayland +# media-libs/mesa wayland +# media-libs/vulkan-loader wayland +# gui-libs/gtk wayland + +# mkvtoolnix +media-video/mkvtoolnix -dbus + +# fwupd +sys-apps/fwupd bash-completion gnutls logitech nvme synaptics \ No newline at end of file diff --git a/gentoo_portage/sets/lsp-bridge b/gentoo_portage/sets/lsp-bridge new file mode 100644 index 0000000..5ca8ba6 --- /dev/null +++ b/gentoo_portage/sets/lsp-bridge @@ -0,0 +1,9 @@ +dev-python/epc +dev-python/orjson +dev-python/sexpdata +dev-python/six +dev-python/setuptools +dev-python/paramiko +dev-python/rapidfuzz +dev-python/watchdog +dev-python/packaging \ No newline at end of file diff --git a/script/sync-portage-config.sh b/script/sync-portage-config.sh new file mode 100644 index 0000000..d1af18a --- /dev/null +++ b/script/sync-portage-config.sh @@ -0,0 +1,54 @@ +#!/bin/sh + +check_root_permissioin() { + local SCRIPT_NAME=$(basename $0) + + if [[ "$UID" != "0" ]]; then + echo "${SCRIPT_NAME}: must run this as root" + exit 1 + fi +} + +sync_portage_config() { + local SCRIPT_DIR=$(dirname $0) + local CONFIG_DIR=$(realpath "${SCRIPT_DIR}/../gentoo_portage") + local DEST_DIR="/etc/portage" + + # 常用配置文件列表 + local CONFIG_FILES=( + # 仓库配置 + "binrepos.conf" + "repos.conf" + + # 构建配置 + "make.conf" + "package.accept_keywords" + "package.license" + "package.mask" + "package.unmask" + "package.use" + + # 单独的 env 配置 + "env" + "package.env" + + "sets" + "patches" + ) + for CONFIG_FILE in "${CONFIG_FILES[@]}"; do + local SOURCE_FILE="${CONFIG_DIR}/${CONFIG_FILE}" + local TARGET_FILE="${DEST_DIR}/${CONFIG_FILE}" + + # 清理原先的配置 + rm -rf $TARGET_FILE + + # 将新的配置通过软链接链接到目标目录 + if [[ -e $SOURCE_FILE ]]; then + echo "link: ${SOURCE_FILE} -> ${TARGET_FILE}" + ln -s $SOURCE_FILE $TARGET_FILE + fi + done +} + +check_root_permissioin +sync_portage_config diff --git a/script/sync-portage-patch.sh b/script/sync-portage-patch.sh deleted file mode 100644 index 95245d8..0000000 --- a/script/sync-portage-patch.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -if [ "${UID}" != "0" ]; then - SCRIPT_NAME=$(basename $0) - echo "${SCRIPT_NAME}: must run this as root" - exit 1 -fi - -SCRIPT_DIR=$(dirname $0) - -# 此处目录后面的 / 不能少 -SOURCE_DIR="${SCRIPT_DIR}/../gentoo_portage/patches/" -DEST_DIR="/etc/portage/patches/" - -rsync -r --delete --mkpath $SOURCE_DIR $DEST_DIR