forked from Lainports/freebsd-ports
Nix is a purely functional package manager. This means that it treats packages like values in purely functional programming languages such as Haskell -- they are built by functions that don't have side-effects, and they never change after they have been built. FreeBSD support in Nix is not fully complete yet. This commit only brings the Nix package manager to the ports. Hopefully, this port will streamline the work of bootstrapping of Nix packages on FreeBSD. Thanks to all the kind folks who contributed to the porting efforts. It was a fun journey. WWW: https://nixos.org/nix/ Differential Revision: https://reviews.freebsd.org/D17766
29 lines
937 B
C++
29 lines
937 B
C++
--- src/libstore/build.cc.orig 2019-11-28 21:39:47 UTC
|
|
+++ src/libstore/build.cc
|
|
@@ -44,12 +44,16 @@
|
|
#include <grp.h>
|
|
|
|
/* Includes required for chroot support. */
|
|
-#if __linux__
|
|
+#if __linux__ || __FreeBSD__
|
|
#include <sys/socket.h>
|
|
#include <sys/ioctl.h>
|
|
#include <net/if.h>
|
|
+#endif
|
|
+#if __linux__
|
|
#include <netinet/ip.h>
|
|
#include <sys/personality.h>
|
|
+#endif
|
|
+#if __linux__ || __FreeBSD__
|
|
#include <sys/mman.h>
|
|
#include <sched.h>
|
|
#include <sys/param.h>
|
|
@@ -1943,7 +1947,7 @@ void DerivationGoal::startBuilder()
|
|
/* If `build-users-group' is not empty, then we have to build as
|
|
one of the members of that group. */
|
|
if (settings.buildUsersGroup != "" && getuid() == 0) {
|
|
-#if defined(__linux__) || defined(__APPLE__)
|
|
+#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__)
|
|
buildUser = std::make_unique<UserLock>();
|
|
|
|
/* Make sure that no other processes are executing under this
|