Skip to main content

Arch User Repository

紀錄一下我用 Arch User Repository (AUR) 時用的東西。

安裝 yay

不知道從什麼時候開始要先關掉 makepkg 會自己製作 debug 套件,不然安裝的時候會多跑一個套件,如果真的不慎安裝了還是有辦法刪除啦

#########################################################################
# GLOBAL PACKAGE OPTIONS
#   These are default values for the options=() settings
#########################################################################
#
# Makepkg defaults: OPTIONS=(!strip docs libtool staticlibs emptydirs !zipman !purge !debug !lto)
#  A negated option will do the opposite of the comments below.
#
#-- strip:      Strip symbols from binaries/libraries
#-- docs:       Save doc directories specified by DOC_DIRS
#-- libtool:    Leave libtool (.la) files in packages
#-- staticlibs: Leave static library (.a) files in packages
#-- emptydirs:  Leave empty directories in packages
#-- zipman:     Compress manual (man and info) pages in MAN_DIRS with gzip
#-- purge:      Remove files specified by PURGE_TARGETS
#-- debug:      Add debugging flags as specified in DEBUG_* variables
#-- lto:        Add compile flags for building with link time optimization
#
OPTIONS=(strip docs !libtool !staticlibs emptydirs zipman purge !debug lto)

debug 前面加上驚嘆號就好了。接著就可以安裝 yay:

sudo pacman -S --needed base-devel git
git clone https://aur.archlinux.org/yay.git 
cd yay
makepkg -si

makepkg.conf 內的多執行緒策略

先改 MAKEFLAGS 那行,用 nproc 偵測執行緒的數量

MAKEFLAGS="-j$(nproc)"

然後安裝幾款支援多執行緒壓縮 / 解壓縮的軟體:

yay -S pigz pbzip2 lbzip2 plzip

然後就是大改特改環節了:

COMPRESSGZ=(pigz -c -f -n)
COMPRESSBZ2=(pbzip2 -c -f)
COMPRESSXZ=(xz -c -z -)
COMPRESSZST=(zstd -c -T0 --ultra -20 -)
COMPRESSLRZ=(lrzip -q)
COMPRESSLZO=(lzop -q)
COMPRESSZ=(compress -c -f)
COMPRESSLZ4=(lz4 -q)
COMPRESSLZ=(plzip -c -f)