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

Various cross-compilation fixes #51154

Merged
merged 3 commits into from
Dec 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions pkgs/development/libraries/freetype/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ in stdenv.mkDerivation rec {
doCheck = true;

postInstall = glib.flattenInclude + ''
substituteInPlace $dev/bin/freetype-config \
--replace ${buildPackages.pkgconfig} ${pkgconfig}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this correct? I would think you would want buildPackages pkgconfig in this case.

Copy link
Member Author

@Mic92 Mic92 Nov 28, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so freetype-config is build for the host machine and buildPackages.pkgconfig has the wrong architecture. We also have a check for that to warn about those cases.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dealing with -config style applications is a different challenge we have to face. This would need some kind of buildPackage that points to the host packages.

Copy link
Member

@Ericson2314 Ericson2314 Nov 29, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I would straight up

rm "$dev/bin"
cp -r "${buildPackages.freetype.dev}/bin" "$dev/"

and file an issue upstream with the maintainer so we can easily build *-config as a separate derivation and sidestep the issue entirely.

*-config style stuff sucks for the same reason compilers insisting on building their own standard libraries sucks. Packages' installations should be for only one platform (/ not cross bootstrapping stages).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh wait, I forgot that the *-config binaries are hard-coded with that necessary data often, so my cp -r won't work. Ugh!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we also discuss this here: #51176

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.


wrapProgram "$dev/bin/freetype-config" \
--set PKG_CONFIG_PATH "$PKG_CONFIG_PATH:$dev/lib/pkgconfig"
'';
Expand Down
5 changes: 5 additions & 0 deletions pkgs/development/libraries/libpfm/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ stdenv.mkDerivation rec {

installFlags = "DESTDIR=\${out} PREFIX= LDCONFIG=true";

makeFlags = [
"ARCH=${stdenv.targetPlatform.uname.processor}"
"SYS=${stdenv.targetPlatform.uname.system}"
];

NIX_CFLAGS_COMPILE = [ "-Wno-error" ];

meta = with stdenv.lib; {
Expand Down
17 changes: 13 additions & 4 deletions pkgs/development/libraries/wayland/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{ lib, stdenv, fetchurl, pkgconfig
, libffi, libxml2
, libffi, libxml2, wayland
, expat ? null # Build wayland-scanner (currently cannot be disabled as of 1.7.0)
}:

Expand All @@ -15,9 +15,18 @@ stdenv.mkDerivation rec {
sha256 = "1xajhxad43izq9f7sbww1hlg42nayijy8xnp21kgpk09c6sw4wjf";
};

configureFlags = [ "--with-scanner" "--disable-documentation" ];

nativeBuildInputs = [ pkgconfig ];
configureFlags = [
"--disable-documentation"
] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
"--with-host-scanner"
];

nativeBuildInputs = [
pkgconfig
] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
# for wayland-scanner during build
wayland
];

buildInputs = [ libffi /* docbook_xsl doxygen graphviz libxslt xmlto */ expat libxml2 ];

Expand Down