hn.today

How I Use Pkgsrc

wisellama.rocks4 points0 comments
Screenshot of How I Use Pkgsrc

This explains how to run pkgsrc on Debian to build and install packages from source into a non-root, user-local prefix so system packages stay separate. Goals are non-root install, separate install from the base system, local network distfile mirror, and multi-platform support. The workflow uses a cloned pkgsrc quarterly branch (example: pkgsrc-2022Q1), a user PREFIXDIR of ~/pkg, and a bootstrap invocation configured for an unprivileged install with Clang as the compiler, MAKE_JOBS=4, and a centralized WORKDIR and DISTDIR. An advanced (and discouraged) bootstrapping loop is described to build Clang with pkgsrc and then re-bootstrap to use that Clang. The setup creates a symlink at ~/pkg/usr/pkgsrc, updates PATH/MANPATH to include ~/pkg/bin and ~/pkg/man, and runs packages with bmake install from the package directory.

Configuration specifics include an mk.conf fragment that sets WRKOBJDIR and DISTDIR under ${LOCALBASE}/usr, PKGSRCDIR pointing to the pkgsrc symlink, MASTER_SITE_OVERRIDE to use a personal distfile mirror, PKG_RESUME_TRANSFERS=YES, ACCEPTABLE_LICENSES additions, and PYTHON_VERSION_DEFAULT=310. Package-specific PKG_OPTIONS are set (examples: cmus and vlc with pulseaudio, retroarch with opengl). Examples show installing pfetch and building firefox-esr; Firefox builds pull many deps, can take hours, and surface issues (some packages require GCC/libgcc or older Python). Fonts must be installed inside the pkgsrc prefix (fonts/noto-ttf) and a symlink to ~/pkg/share/fonts/X11 plus a Firefox sandbox config change were required to get a usable build.

Read on wisellama.rocks0 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Programming

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.