This really depends if the software build system is prepared for static builds, but in 75% of packages you can accomplish this by setting CFLAGS and LDFLAGS like so: $ printf 'CFLAGS="-static"\nLDFLAGS="-static"\n' >> srcpkgs/grep/template If you want to make this permanent it would be better if you conditionalize those settings in a `static` build option, as has been done already in some packages.