19 ms·
Using NetBSD’s pkgsrc everywhere I can
- inamiyar 5y agoVery interesting, I didn't know pkgsrc could be used on Linux, I'll check it out. In general the only things keeping me from BSD are non free apps like Zoom so the next best thing is to BSDify my systems.
- xaduha 5y agoI'd try nixpkgs before trying pkgsrc if for some reason I wasn't satisfied with ones that come with the distro. Not sure why BSDfying packages is desirable by itself.
- 1vuio0pswjnm7 5y agoNothing against nixpkgs, but if the user is curious about how things are done in BSD perhaps he should try xbps before nixpkgs. It was written by a former NetBSD committer who wrote some useful programs for NetBSD's userland. I am biased perhaps but I believe it is faster than any other Linux package manager. Always looking for something faster so I am welcome to being proven wrong on that. https://github.com/void-linux/xbps https://github.com/void-linux/xbps
- washbear 5y agoAs a pkgsrc committer, xbps is nothing like pkgsrc. The underlying stuff is much more similar to something like Arch or Alpine Linux than anything that exists in the BSD world, and it's much less configurable than pkgsrc.
- wsfull 5y agoCare to be more specific than "underlying stuff". The code and design of xbps looks nothing like the code or design of pacman or apk.
- washbear 5y agoActual package recipes. BSD-style packaging systems are written in BSD make using a mk/ framework rather than Arch-style shell scripts. If a package already exists for FreeBSD Ports I would check that first because it's much more similar to what I'm used to. Fundamentally pkgsrc is built on very low level tools, awk, shell, make, cwrappers, and pkg_install, although you can manage it with high-level ones (obviously pkgin is there, but there's also a lot of other third-party tooling).
- wsfull 5y agoWhy are you comparing pkgsrc to pacman. The orginal comparison suggested in the parent comment was between xbps and nixpkgs or other Linux package managers. pkgsrc boostraps itself using a program called "boostrap" in the pkgsrc directory. It builds a version of NetBSD's GCC toolchain and has no reliance on the host's userland. IME, this is very reliable and is its single greatest strength. Beyond that, pkgsrc is only as good as the build processes chosen by the author(s) of the software being built. These of course vary widely in sanity and depending on the packages one is building the otherwsise sane pkgsrc build process can quickly become a black box with packages that pull in many dependencies. It does break sometimes, but this is a fault of the target software authors, not pkgsrc. pkgsrc is first and foremost a system for building packages. Linux distributions OTOH tend to be much more focused on binary package managers. Most Linux users do not build packages from source. There is really no comparison. Your comments do not sound like those of a daily NetBSD user. I have been one for the last 15 years and am therefore all too familiar /usr/share/mk. Most Linux users do not seem very comfortable with BSD makefiles.
- washbear 5y ago> Why are you comparing pkgsrc to pacman. The original commented suggested that XBPS was similar to pkgsrc. I suggested that XBPS has far more in common with Arch Linux's package manager than pkgsrc or anything else in the BSD world. As you yourself note in your next paragraph... > Your comments do not sound like those of a daily NetBSD user. I have commit access. Since three years ago. My name is on the latest release announcement. You prick.
- pxc 5y agoCan xbps be used on foreign distros like pkgsrc? I'd be down to try it out on Ubuntu and NixOS if it supports that
- washbear 5y agoOne reason to try it might be that pkgsrc mostly solves the problems Nix solves with conflicts in a much simpler way, by allowing multiple co-existing branches installed to different prefixes.
- johnisgood 5y agopkgsrc does work on Linux, but pkgin does not. I have no idea how to update my mirror and so forth using pkgsrc alone. Do not I need pkgin? I cannot do `pkg_add` at all. I tried to make pkgin work, too, and I think it is possible to make it work with libbsd but I do not have the time. I wonder if anyone has done it.
- jperkin 5y agoI am the pkgin maintainer, and would be interested to hear about any issues you have building pkgin. It should build on any of the 23 platforms that pkgsrc supports, including Linux. I even offer daily binary package builds for CentOS here: https://pkgsrc.joyent.com/install-on-linux/ https://pkgsrc.joyent.com/install-on-linux/ Feel free to open up an issue at https://github.com/NetBSDfr/pkgin/issues https://github.com/NetBSDfr/pkgin/issues and we can take a look.
- pxc 5y agoThose binaries even sometimes work on Ubuntu, with a little manual linking and good luck, even though it's a total abuse. :D
- johnisgood 5y agoI am trying to compile it from source on Linux. I immediately ran into an annoying issue, which is having the need to specify those directories manually. So I did, and the configure finished successfully when I ran: ./configure --prefix=/home/john/.local/pkg/pkgin-20210529 --with-dbdir=/usr/ --with-libarchive=/usr/ --with-libfetch=/home/john/Downloads/libfetch-2.33 --with-openssl=/usr/ --with-sqlite3=/usr/ --with-pkg-install=/home/john/.local/pkg/pkgsrc-2021Q1/sbin/ --with-machine-arch=x86_64 When I ran `make`, I ran into: actions.c: In function ‘verb_flag’: actions.c:53:3: error: implicit declaration of function ‘strlcat’; did you mean ‘strncat’? [-Werror=implicit-function-declaration] 53 | strlcat(pkgtools_flags, "v", 1); | ^~~~~~~ | strncat Which tells me that I could fix it by providing `-I/usr/include/bsd/` and `-lbsd` or the like. I will give it a go. Any ideas anyway? Edit: I added the above, and it went on to: In function ‘strncpy’, inlined from ‘read_repos’ at fsops.c:133:6: /usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:10: error: ‘__builtin_strncpy’ specified bound 8192 equals destination size [-Werror=stringop-truncation] 106 | return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This does not sound too good, you probably want to fix it (along with the other warnings on Linux). In any case, I got rid of `-Werror` and I have a couple of undefined references. I will most likely get it to work, but you see my issue here, right? Is it the "official" way to compile it from source by the way? Edit #2: I got a working binary by making those changes[1]. Last few lines: CCLD pkgin /usr/bin/ld: external/pkgin-var.o: in function `var_get': /tmp/pkgin/external/var.c:99: warning: This function cannot be safely ported, use getline(3) instead, as it is supported by GNU and POSIX.1-2008. make[1]: Leaving directory '/tmp/pkgin' --- You might want to look into compiling it on Linux, because without those changes[1], you cannot do it. I was using commit e963d1e1a2409ed51d191d936b5f75e35bdf9197, version 20.12.1. [1] You also have to include `<bsd/string.h>` for `strlcpy` on Linux. Only `actions.c` is affected. --- If you want, I am willing to send you an e-mail with the diff, but I will fix the other warnings, too, then. Oh, and instead of relying on `libbsd`, one could just add `strlcpy` and the like themselves. --- By the way, from where do I get the `repositories.conf` exactly? The supplied `repositories.conf` seems outdated. I tried using both `ftp://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/$arch/5.1/All` and `http://mirror-master.dragonflybsd.org/packages/$arch/DragonFly-$osrelease/stable/All http://mirror-master.dragonflybsd.org/packages/$arch/DragonF...`, but they were not working. Hmm, I tried to use a working one, but I got this: processing remote summary (https://pkgsrc.joyent.com/packages/Linux/el7/trunk/x86_64/All)... SSL support disabled SSL support disabled SSL support disabled pkgin: Could not fetch https://pkgsrc.joyent.com/packages/Linux/el7/trunk/x86_64/All/pkg_summary.gz I am currently using `file://` that points to the manually downloaded `pkg_summary.gz`. Not sure why SSL support is disabled when I configured it, it specifically asked for it, and I provided it through `--with-openssl=/usr/` and it passed because it found it.
- LAC-Tech 5y agoI've been thinking of delegating mandatory crapware like zoom to my mobile phone. Needing to run stuff like that a few times a year is probably not worth preventing me from using an OS.
- xaduha 5y agoNo mention of DragonflyBSD? They used pkgsrc as their main package manager for 10 years, portable or not, it still required quite a bit of maintenance. Seems like it was too much in the end, second-class citizen rights are not great.
- pxc 5y agoI'd been wondering how good pgksrc is on macOS for a little while, previously having used Homebrew wherever Nixpkgs was inconvenient or incomplete. Could pkgsrc could be a better choice? pkgsrc is relatively nice for a cross-platform, source-based package manager in the old style, in that it provides convenient binary caches for most use cases. I wonder: Has the writer of the post in the OP tried any next-gen source-based package managers, where the kind of isolation he describes as desirable between system and user packages is guaranteed between all packages altogether?
- nerdponx 5y agoI'm always interested to try different things, but I don't understand why people seem to dislike Homebrew so much. I've been a mostly-happy user on both Mac and Linux for years.
- kelp 5y agoI dislike it because it’s really slow to do everything. Even printing help text is slow. Contrast with pacman on Arch, which is incredibly fast at nearly every operation. Unfortunately I’ve found all the package managers for macOS to be lacking. brew is slow, but has packages for most things and generally up to date. fink packages seem a bit out dated last I checked. At least the ones I cared about. MacPorts is also slow and somewhat out of date. pkgsrc doesn’t have Apple M1 binary packages available yet. I haven’t tried Nix. Sometimes I’m tempted to try my hand at writing my own package manager for macOS, but getting a critical mass of packaged software seems quite hard.
- johnklos 5y agoOther package management systems do one or two of the following things, but I haven't found any that can do all three at once, other than pkgsrc: 1) have good availability of pre-built binary packages for most platforms 2) facilitate building of packages directly from source, whether on non-mainstream platforms / architectures, and / or with or for the purpose of non-default package options 3) unprivileged builds / installations, packages rooted anywhere in filesystem, completely self-contained dependencies Having to use more than one package management system because one or the other doesn't do one of these things can be a real pain, and can make maintenance rather difficult.
- fiddlerwoaroof 5y agonix does all three of these, I think.
- fiddlerwoaroof 5y agoI guess 3 is sort of anti-nix, but I think nix effectively has this with the way nix-build/nix-shell work.
- johnklos 5y agoIt looks interesting. However, documentation is sparse. It doesn't clearly say what platforms are supported other than macOS and NixOS (which implies Linux in general, but doesn't clearly state it). Also, it seems to only target x86 and amd64. No mention is made of any other architecture, nor of any BSD other that macOS. Do you have more information?
- ProfDreamer 5y agoFrom <https://nixos.org/manual/nix/stable/#ch-supported-platforms https://nixos.org/manual/nix/stable/#ch-supported-platforms>: > Nix is currently supported on the following platforms: > - Linux (i686, x86_64, aarch64). > - macOS (x86_64).
- johnklos 5y agoHow does one bootstrap nixpkgs from source? Trying to install nix gives: sh install-nix-2.3.10 install-nix-2.3.10: sorry, there is no binary distribution of Nix for your platform
- sally1620 5y agoI wonder if anyone is going to create a linux distribution with a base system baked in with pkgsrc managing the applications. It would be very useful for containers and WSL.
- znpy 5y agoThere used to be one, which was based on Slackware (of course). If i find the name of that distro i'll either edit this post or reply to myself :) I tried hand-rolling something similar with slackware 11 or 12 (can't remember now).
- jmclnx 5y agoI always liked its concept and I am surprised very few projects are using it. On NetBSD it works well, I guess NIH (https://en.wikipedia.org/wiki/Not_invented_here https://en.wikipedia.org/wiki/Not_invented_here) syndrome :(
- washbear 5y agoSuch a thing exists - https://github.com/oasislinux/oasis https://github.com/oasislinux/oasis
- kchoudhu 5y agoI've been using pkgsrc to package our firm's stuff for Mac OS X clients, it works a charm. https://www.anserinae.net/setting-up-a-pkgsrc-repository.html#setting-up-a-pkgsrc-repository https://www.anserinae.net/setting-up-a-pkgsrc-repository.htm... Currently working on using it to distribute the same software to Linux. Will be great when it gets there, but we aren't quite ready yet.
- ehw3 5y agoI really like pkgsrc. I'm not really qualified to give a technical justification for it. It just had the right simple, clean feel to it, which NetBSD in general has. I would even go so far as to say that it was fun to use. I consequently once spent quite some time trying to get it working under Cygwin so I could use it at work, but never got past problems with Cygwin group names that have spaces in them. It was too complex for me to fix....
- protomyth 5y agoDoes pkgsrc have "port variants" like macports?
- pwrplus1 5y agoNot for prebuilt binaries (variants are just separate packages) but because the pkgsrc repo is just a collection of Makefiles, you can cd into the directory and run bmake show-options Then set PKG_OPTIONS.somepkg and bmake install Or even just edit the Makefile.
- guessbest 5y agoI wish there was a package manager for kde and konqueror for the mac
- weitzj 5y agoI used it with Netbsd 1 and it was the first thing to install in Solaris. Other question: how does one handle detection whether upgrades exist? Something like renovatebot but using pkgsrc. Or what is the best way in 2021 to trigger fresh builds against the latest packages?
- plextoria 5y agopkg_rolling-replace -u
- tingletech 5y agoit was a big help in Solaris to VWware migrations I did circa 2008-2012. I had one bash script that would install the whole site on either, bootstrapping almost everything from pkgsrc.
- klibertp 5y agoFrom pkgsrc homepage: > You can checkout pkgsrc HEAD with CVS: ...really? Not even Subversion, but CVS?
- jperkin 5y agoThe repository of record is CVS, but you can - like many of us do - use either the hg export (https://anonhg.netbsd.org/pkgsrc https://anonhg.netbsd.org/pkgsrc) or GitHub (https://github.com/netbsd/pkgsrc https://github.com/netbsd/pkgsrc) instead. At some point we will transition the repository of record to something else, but it's being done carefully. We want to do it right, and there aren't many volunteers willing help with the work.
- klibertp 5y agoNo, I was just surprised - I don't know anything about NetBSD (nor pkgsrc for that matter), but I worked with FreeBSD some 15 years ago and there were plans to move to SVN even back then. A quick search told me that the switch was completed in 2008 (a little bit after I left, begrudgingly, for Linux). What challenges are there in switching to another VCS? Is the difficulty coming from the need to preserve history, or the need to re-evaluate workflows around the repo, or something else entirely?