src tree assistance

Howdy,
Im Ryan and Im new to FreeBSD. I am happy to learn as much as possible about this system, and it's been a log of fun so far. I use Nobara Linux (Fedora 38) on my desktop, which daily drives me right now. I have FreeBSD set up on my laptop. For compiling from source, I know the way to compile programs via the src tree. Is there a way to look at programs in the src tree? Like 'pkg search firefox' returns all the programs or things to install that have firefox in the name. I guess I'm just confused because I do 'cd /directory/of/program' then 'make install clean'. I looked in the handbook and Im still confused a bit. There was something about subscribing to the mailing list but that just made me more confused. Please and thanks. Sorry for the wordy question
 
The source tree (/usr/src) is where the FreeBSD OS lives, not third party applications. That's the ports tree, usually /usr/ports.

I suggest you start here: https://docs.freebsd.org/en/books/handbook/ports/#ports-using
Then read ports(7). If you still want more: https://docs.freebsd.org/en/books/porters-handbook/
Just to underline what SirDice said, FreeeBSD separates the OS, from applications... /usr/src for FreeBSD, /usr/ports for applications. I guess this is very different from Linux, (which, IMV is a mess).
 
Welcome!

… the src tree? Like 'pkg search firefox' …

The best known source trees for FreeBSD are:
  • doc (documentation)
  • ports (ports of software, separate from the base operating system)
  • src (FreeBSD base).
Those three are amongst the five pinned repos at <https://github.com/freebsd/>:
  • freebsd-doc
  • freebsd-ports
  • freebsd-src.
It's traditional to think of ports as the source from which packages are built. You'll see a lot of this.

In addition, we now have packages of the base operating system: PkgBase.

Seeing your <https://forums.freebsd.org/posts/631108>, for a newcomer I should recommend making things simple for yourself whilst learning:
  • use packages of ports, unless there's an absolute requirement for you to build a port from source.
FreshPorts is our friend. There's a search box, advanced search, and so on.
 
Is there a way to look at programs in the src tree?
f you want to learn more about FreeBSD, explore /usr/src. Download https://download.freebsd.org/releases/amd64/amd64/14.0-RELEASE/src.txz and as super user "cd / ; tar xvf src.txz" to install sources in /usr/src. It contains sources to programs in /bin, /sbin, /usr/bin and /usr/sbin and libraries in /lib and /usr/lib (+ more stuff). Also, use the man command to learn more about how standard programs work.

Ports/packages get installed under /usr/local. They are built out of /usr/ports (which you can download). But the thing to remember is that typically these programs run on multiple OSes and what goes under /usr/ports is changes specific to FreeBSD (actual sources are downloaded from elsewhere). If I were you, I'd leave learning more about ports for later.
 
First I've heard of PkgBase


<https://forums.freebsd.org/posts/627331> on page two is where things get interesting.

<https://wiki.freebsd.org/PkgBase> is outdated, sorry. (Normally I'd update it. Strange times.)
 
Back
Top