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

support cross-compilation #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Mindavi
Copy link

@Mindavi Mindavi commented Jul 7, 2021

By marking wayland-scanner as native dependency.

I've verified that this builds by applying this patch on nixpkgs and running the build recipe.

Just for reference, this is the change applied to nixpkgs:

diff --git a/pkgs/applications/misc/dmenu/wayland.nix b/pkgs/applications/misc/dmenu/wayland.nix
index 8d77588ce8f..41ac43a4ff4 100644
--- a/pkgs/applications/misc/dmenu/wayland.nix
+++ b/pkgs/applications/misc/dmenu/wayland.nix
@@ -1,5 +1,5 @@
 { lib, stdenv, fetchFromGitHub, meson, ninja, cairo, pango, pkg-config, wayland-protocols
-, glib, wayland, libxkbcommon, makeWrapper
+, glib, wayland, libxkbcommon, makeWrapper, wayland-scanner
 }:
 
 stdenv.mkDerivation rec {
@@ -15,9 +15,15 @@ stdenv.mkDerivation rec {
 
   outputs = [ "out" "man" ];
 
-  nativeBuildInputs = [ meson ninja pkg-config makeWrapper ];
+  depsBuildBuild = [ pkg-config ];
+  nativeBuildInputs = [ meson ninja pkg-config makeWrapper wayland-scanner ];
   buildInputs = [ cairo pango wayland-protocols glib wayland libxkbcommon ];
 
+  postPatch = ''
+    substituteInPlace meson.build \
+      --replace "dependency('wayland-scanner')" "dependency('wayland-scanner', native: true)"
+  '';
+
   postInstall = ''
     wrapProgram $out/bin/dmenu-wl_run \
       --prefix PATH : $out/bin

(which is basically the same as this patch).

I did not verify if the binary runs properly, but it at least builds this way and the meson.build script should be more correct for the cross-compilation usecase.

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

Successfully merging this pull request may close these issues.

1 participant