Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to run nixpkgs on FreeBSD host #38

Open
itzwam opened this issue Jan 3, 2025 · 1 comment
Open

Ability to run nixpkgs on FreeBSD host #38

itzwam opened this issue Jan 3, 2025 · 1 comment

Comments

@itzwam
Copy link

itzwam commented Jan 3, 2025

When I dont force the MAKEOBJDIRPREFIX var to /
I can't build most of the system libraries when running on a FreeBSD host (w/ Lix compiled from srcs)
most of the lib files are built in a place where linker cannot find it,

https://github.com/lattera/freebsd/blob/master/share/mk/bsd.obj.mk#L56-L63
by exporting MAKEOBJDIRPREFIX=/ compilations will now produce all obj outputs in source directory, linker then finds them well 👍

With this issue fixed I'm able to launch most basic nix-shells in a FreeBSD host using nixbsd pkgs fork 🥳

@itzwam
Copy link
Author

itzwam commented Jan 3, 2025

diff --git a/pkgs/stdenv/generic/default.nix b/pkgs/stdenv/generic/default.nix
index 2cda43d5632f..c8d9c232a26a 100644
--- a/pkgs/stdenv/generic/default.nix
+++ b/pkgs/stdenv/generic/default.nix
@@ -114,6 +114,8 @@ let
         export NIX_NO_SELF_RPATH=1
       '' + lib.optionalString (hostPlatform.isDarwin && hostPlatform.isMacOS) ''
         export MACOSX_DEPLOYMENT_TARGET=${hostPlatform.darwinMinVersion}
+      '' + lib.optionalString (hostPlatform.isFreeBSD) ''
+        export MAKEOBJDIRPREFIX=/
       ''
       # TODO this should be uncommented, but it causes stupid mass rebuilds. I
       # think the best solution would just be to fixup linux RPATHs so we don't

@itzwam itzwam changed the title strange behavior in some package builds on FreeBSD host if MAKEOBJDIRPREFIX != / Ability to run nixpkgs on FreeBSD host Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant