Solved Why Ports ? Why not only pkg ?

I never installed a single app using ports. Two reasons for that. The first reason is less powerful hardware. The second reason is I never understood the reason behind the creation of this ports system. I mean when installing a package is a simple pkg install <package> why waste time in compiling ?

If I compare FreeBSD with popular GNU/Linux distros like Debian, Ubuntu, Fedora, openSUSE of non these have ports. The only Linux distro that has ports is Gentoo.

So my question is why did the FreeBSD devs create this Ports system ?
 
Ports are more up-to-date
That means apps reach the ports system first then it reaches pkg. If apps were directly offered in the pkg repos users will get updates fast. Isn't it ?

you can enable or disable features when compiling.
This I understand but I wonder were this will prove advantagous. I mean if I take Firefox as an example. Which feature of Firefox that is offered in repos will I want to enable or disable.
 
I take Firefox as an example. Which feature of Firefox that is offered in repos will I want to enable or disable.
For a list of compile options, see www/firefox:

Configuration Options:
===> The following configuration options are available for firefox-97.0_2,2:
CANBERRA=off: Sound theme alerts
DBUS=on: D-Bus IPC system support
DEBUG=off: Build with debugging support
FFMPEG=on: FFmpeg support (WMA, AIFF, AC3, APE...)
LIBPROXY=off: Proxy support via libproxy
LTO=on: Use Link-Time Optimization
OPTIMIZED_CFLAGS=on: Use extra compiler optimizations
PROFILE=on: Build with profiling support
TEST=off: Build and/or run tests
====> Extra cubeb audio backends (OSS is always available)
ALSA=off: ALSA audio architecture support
JACK=on: JACK audio server support
PULSEAUDIO=on: PulseAudio sound server support
SNDIO=on: Sndio audio support
 
  • Like
Reactions: drr
In the beginning, the hardware (mainframes) was the product and the software was delivered for free in a non-standard ecosystem. The source code was used to adjust to the peculiarities of the hardware. Does this scenario exist today?
 
Think about you being a developer and want to debug Firefox. Then you'd enable DEBUG and disable OPTIMIZED_CFLAGS.
Understood. I created this thread coz even the official page for ports says this

For most ports, a precompiled package also exists, saving the user the work and time of having to compile anything at all. Use pkg install to securely download and install the precompiled version of a port. For more information see Using pkg for Binary Package Management
 
I never understood the reason behind the creation of this ports system.
Ports are a sane, elegant, reproducible, ... build system for packages.

Having it public for all users enables them to build their own custom packages (different build-time options, different dependent default versions, etc) when needed.

Without ports, there would be no packages (well, think about it).
 
Without ports, there would be no packages (well, think about it).
Since I am new to FreeBSD let me understand this. So under Linux let's say Ubuntu one can install a package from the repo using apt which most users do. Other than that a user can visit the homepage of that app, download the source and compile it. So the the FreeBSD ports system is a centralized place where all sources are hosted.

Is this ^^ an accurate understanding ?
 
So under Linux let's say Ubuntu one can install a package from the repo using apt which most users do.
Ubuntu uses Debian packages, they are created by a build system around the "debhelper" tools.
Other than that a user can visit the homepage of that app, download the source and compile it.
Or they could download the "source package" (also available via APT) and compile the package locally. The difference here is that Debian/Ubuntu doesn't have a central repository including ALL the source packages in a single tree.
So the the FreeBSD ports system is a centralized place where all sources are hosted ?
Well, all the makefiles, patches etc specific to FreeBSD. The upstream source is downloaded automatically from the original location when building a port.
 
So the the FreeBSD ports system is a centralized place where all sources are hosted.

Is this ^^ an accurate understanding ?
Yes. Also, ports pre-date packages by quite some time. Compiling your programmes was the original way. Packages came later, as an added convenience.

Personally, I use packages for most things, but always use ports for FFMPeG, Sox and Pan because the out-of-the-box packages are not what I want or need. There are options I add for features I want. In the case of Pan, it's limited to 4 connections as per RFCs but my news provider allows many more connections and Pan downloads faster with more connections so I'm happy to do make extract, edit the source, then make install to get what *I* want, not what the author/package maintainers want. On the other hand, many people, you being one apparently, are happy to accept other peoples choices or are unaware there ARE other choices and thus work within those limitation.

An obvious example of rolling your own would be building a headless server which needs programmes but the default settings pull in X and loads of GUI based stuff that's a waste of space and possibly bringing in security problems that are better not to have to deal with on a server. The few ports/packages to mainteain, the better in terms of your maintenance time and monitoring for issue/vulnerabilities.
 
for example Firefox is updated (security) but package came out after days...
If you mean the delayed update to 96.0 which was discussed here recently, it's the port itself which took a long time to follow upstream, not packages in particular.
 
Another advantage of ports is that some software can't be distributed in compiled form for legal reasons. One example of this is vice.

I've rarely used the ports collection, but I still think it's an amazing system, and a definite advantage over other OSes.
 
If I compare FreeBSD with popular GNU/Linux distros like Debian, Ubuntu, Fedora, openSUSE of non these have ports. The only Linux distro that has ports is Gentoo.
So those linux distributions just summon the packages out of the limbo or they have a build system? Oh, then they need a build system to make the binary packages... Arch have PKGBUILD, debian-based systems have their own chimichanga, and the list goes on. Right... now guess what happens in FreeBSD? :p
The only difference is: FreeBSD have this build system called "ports", the maintainers make ports, send a PR, and if gets commited, soon will reach binary packages, because we still don't have binary incoming from limbo.
 
Back
Top