alex-courtis / wideriver

GNU General Public License v3.0
25 stars 3 forks source link

Cannot build in NixOS #14

Open Yappaholic opened 3 days ago

Yappaholic commented 3 days ago

Expected behavior

Running make compiles app package

Actual behavior

Make returns a lot of undefined reference errors and exits with make: *** [GNUmakefile:35: wideriver] Error 1

Steps to reproduce

Launch nix-shell with gnumake libgcc wayland wayland-protocols wlroots and run make inside the wideriver directory

river version

0.3.3

wideriver version

1.2.0

Startup logs

make: pkg-config: No such file or directory
gcc -o wideriver src/args.o src/arrange.o src/cfg.o src/cmd.o src/control.o src/displ.o src/enum.o src/layout.o src/listener_registry.o src/listener_river_command_callback.o src/listener_river_layout.o src/listener_river_output_status.o src/listener_river_seat_status.o src/log.o src/main.o src/mem.o src/output.o src/tag.o src/usage.o pro/river-control-unstable-v1.o pro/river-layout-v3.o pro/river-status-unstable-v1.o lib/col/src/fn.o lib/col/src/itable.o lib/col/src/oset.o lib/col/src/ptable.o lib/col/src/slist.o lib/col/src/stable.o
/nix/store/wwfrj9kvfi14xclc38qfwm71ah6aawdh-binutils-2.41/bin/ld: src/main.o: in function `init_pfds':
/home/savvy/wideriver/src/main.c:23:(.text+0x5e): undefined reference to `wl_display_get_fd'
/nix/store/wwfrj9kvfi14xclc38qfwm71ah6aawdh-binutils-2.41/bin/ld: src/main.o: in function `loop':
/home/savvy/wideriver/src/main.c:64:(.text+0x191): undefined reference to `wl_display_dispatch_pending'
/nix/store/wwfrj9kvfi14xclc38qfwm71ah6aawdh-binutils-2.41/bin/ld: /home/savvy/wideriver/src/main.c:63:(.text+0x1a2): undefined reference to `wl_display_prepare_read'
/nix/store/wwfrj9kvfi14xclc38qfwm71ah6aawdh-binutils-2.41/bin/ld: /home/savvy/wideriver/src/main.c:70:(.text+0x1ae): undefined reference to `wl_display_flush'
/nix/store/wwfrj9kvfi14xclc38qfwm71ah6aawdh-binutils-2.41/bin/ld: /home/savvy/wideriver/src/main.c:90:(.text+0x203): undefined reference to `wl_display_read_events'
/nix/store/wwfrj9kvfi14xclc38qfwm71ah6aawdh-binutils-2.41/bin/ld: src/control.o: in function `zriver_control_v1_add_argument':
/home/savvy/wideriver/pro/river-control-unstable-v1.h:157:(.text+0x49): undefined reference to `wl_proxy_get_version'
/nix/store/wwfrj9kvfi14xclc38qfwm71ah6aawdh-binutils-2.41/bin/ld: /home/savvy/wideriver/pro/river-control-unstable-v1.h:157:(.text+0x63): undefined reference to `wl_proxy_marshal_flags'
/nix/store/wwfrj9kvfi14xclc38qfwm71ah6aawdh-binutils-2.41/bin/ld: /home/savvy/wideriver/pro/river-control-unstable-v1.h:157:(.text+0xda): undefined reference to `wl_proxy_get_version'
/nix/store/wwfrj9kvfi14xclc38qfwm71ah6aawdh-binutils-2.41/bin/ld: /home/savvy/wideriver/pro/river-control-unstable-v1.h:157:(.text+0xf4): undefined reference to `wl_proxy_marshal_flags'
/nix/store/wwfrj9kvfi14xclc38qfwm71ah6aawdh-binutils-2.41/bin/ld: src/control.o: in function `zriver_control_v1_run_command':
/home/savvy/wideriver/pro/river-control-unstable-v1.h:172:(.text+0x126): undefined reference to `wl_proxy_get_version'
/nix/store/wwfrj9kvfi14xclc38qfwm71ah6aawdh-binutils-2.41/bin/ld: /home/savvy/wideriver/pro/river-control-unstable-v1.h:172:(.text+0x14a): undefined reference to `wl_proxy_marshal_flags'
/nix/store/wwfrj9kvfi14xclc38qfwm71ah6aawdh-binutils-2.41/bin/ld: src/control.o: in function `zriver_command_callback_v1_add_listener':
/home/savvy/wideriver/pro/river-control-unstable-v1.h:214:(.text+0x170): undefined reference to `wl_proxy_add_listener'
/nix/store/wwfrj9kvfi14xclc38qfwm71ah6aawdh-binutils-2.41/bin/ld: src/displ.o: in function `zriver_control_v1_destroy':
/home/savvy/wideriver/pro/river-control-unstable-v1.h:144:(.text+0x2a3): undefined reference to `wl_proxy_get_version'
/nix/store/wwfrj9kvfi14xclc38qfwm71ah6aawdh-binutils-2.41/bin/ld: /home/savvy/wideriver/pro/river-control-unstable-v1.h:144:(.text+0x2b9): undefined reference to `wl_proxy_marshal_flags'
/nix/store/wwfrj9kvfi14xclc38qfwm71ah6aawdh-binutils-2.41/bin/ld: /home/savvy/wideriver/pro/river-control-unstable-v1.h:144:(.text+0x2e3): undefined reference to `wl_proxy_get_version'
/nix/store/wwfrj9kvfi14xclc38qfwm71ah6aawdh-binutils-2.41/bin/ld: /home/savvy/wideriver/pro/river-control-unstable-v1.h:144:(.text+0x2f9): undefined reference to `wl_proxy_marshal_flags'
/nix/store/wwfrj9kvfi14xclc38qfwm71ah6aawdh-binutils-2.41/bin/ld: /home/savvy/wideriver/pro/river-control-unstable-v1.h:144:(.text+0x323): undefined reference to `wl_proxy_get_version'
/nix/store/wwfrj9kvfi14xclc38qfwm71ah6aawdh-binutils-2.41/bin/ld: /home/savvy/wideriver/pro/river-control-unstable-v1.h:144:(.text+0x339): undefined reference to `wl_proxy_marshal_flags'
/nix/store/wwfrj9kvfi14xclc38qfwm71ah6aawdh-binutils-2.41/bin/ld: /home/savvy/wideriver/pro/river-control-unstable-v1.h:144:(.text+0x363): undefined reference to `wl_proxy_get_version'
/nix/store/wwfrj9kvfi14xclc38qfwm71ah6aawdh-binutils-2.41/bin/ld: /home/savvy/wideriver/pro/river-control-unstable-v1.h:144:(.text+0x379): undefined reference to `wl_proxy_marshal_flags'
/nix/store/wwfrj9kvfi14xclc38qfwm71ah6aawdh-binutils-2.41/bin/ld: src/displ.o: in function `wl_seat_destroy':
/nix/store/kzj3j17d50pv9nv5dnqf1bbiv2ixny6y-wayland-1.22.0-dev/include/wayland-client-protocol.h:4295:(.text+0x3a0): undefined reference to `wl_proxy_destroy'
/nix/store/wwfrj9kvfi14xclc38qfwm71ah6aawdh-binutils-2.41/bin/ld: src/displ.o: in function `wl_registry_destroy':
/nix/store/kzj3j17d50pv9nv5dnqf1bbiv2ixny6y-wayland-1.22.0-dev/include/wayland-client-protocol.h:1173:(.text+0x3c7): undefined reference to `wl_proxy_destroy'
/nix/store/wwfrj9kvfi14xclc38qfwm71ah6aawdh-binutils-2.41/bin/ld: src/displ.o: in function `displ_destroy':
/home/savvy/wideriver/src/displ.c:168:(.text+0x3fd): undefined reference to `wl_display_disconnect'
/nix/store/wwfrj9kvfi14xclc38qfwm71ah6aawdh-binutils-2.41/bin/ld: src/displ.o: in function `displ_init':
/home/savvy/wideriver/src/displ.c:93:(.text+0x44b): undefined reference to `wl_display_connect'
/nix/store/wwfrj9kvfi14xclc38qfwm71ah6aawdh-binutils-2.41/bin/ld: src/displ.o: in function `wl_display_get_registry':
/nix/store/kzj3j17d50pv9nv5dnqf1bbiv2ixny6y-wayland-1.22.0-dev/include/wayland-client-protocol.h:1074:(.text+0x462): undefined reference to `wl_proxy_get_version'
/nix/store/wwfrj9kvfi14xclc38qfwm71ah6aawdh-binutils-2.41/bin/ld: /nix/store/kzj3j17d50pv9nv5dnqf1bbiv2ixny6y-wayland-1.22.0-dev/include/wayland-client-protocol.h:1074:(.text+0x474): undefined reference to `wl_registry_interface'
/nix/store/wwfrj9kvfi14xclc38qfwm71ah6aawdh-binutils-2.41/bin/ld: /nix/store/kzj3j17d50pv9nv5dnqf1bbiv2ixny6y-wayland-1.22.0-dev/include/wayland-client-protocol.h:1074:(.text+0x480): undefined reference to `wl_proxy_marshal_flags'
/nix/store/wwfrj9kvfi14xclc38qfwm71ah6aawdh-binutils-2.41/bin/ld: src/displ.o: in function `wl_registry_add_listener':
/nix/store/kzj3j17d50pv9nv5dnqf1bbiv2ixny6y-wayland-1.22.0-dev/include/wayland-client-protocol.h:1129:(.text+0x4a1): undefined reference to `wl_proxy_add_listener'
/nix/store/wwfrj9kvfi14xclc38qfwm71ah6aawdh-binutils-2.41/bin/ld: src/displ.o: in function `displ_init':
/home/savvy/wideriver/src/displ.c:107:(.text+0x4a9): undefined reference to `wl_display_roundtrip'
/nix/store/wwfrj9kvfi14xclc38qfwm71ah6aawdh-binutils-2.41/bin/ld: src/layout.o: in function `river_layout_v3_push_view_dimensions':
/home/savvy/wideriver/pro/river-layout-v3.h:369:(.text+0x861): undefined reference to `wl_proxy_get_version'
/nix/store/wwfrj9kvfi14xclc38qfwm71ah6aawdh-binutils-2.41/bin/ld: /home/savvy/wideriver/pro/river-layout-v3.h:369:(.text+0x887): undefined reference to `wl_proxy_marshal_flags'
/nix/store/wwfrj9kvfi14xclc38qfwm71ah6aawdh-binutils-2.41/bin/ld: src/listener_registry.o: in function `global':
/home/savvy/wideriver/src/listener_registry.c:31:(.text+0xa3): undefined reference to `wl_seat_interface'
/nix/store/wwfrj9kvfi14xclc38qfwm71ah6aawdh-binutils-2.41/bin/ld: src/listener_registry.o: in function `wl_registry_bind':
/nix/store/kzj3j17d50pv9nv5dnqf1bbiv2ixny6y-wayland-1.22.0-dev/include/wayland-client-protocol.h:1187:(.text+0xfe): undefined reference to `wl_proxy_marshal_flags'
/nix/store/wwfrj9kvfi14xclc38qfwm71ah6aawdh-binutils-2.41/bin/ld: src/listener_registry.o: in function `global':
/home/savvy/wideriver/src/listener_registry.c:62:(.text+0x16d): undefined reference to `wl_output_interface'
/nix/store/wwfrj9kvfi14xclc38qfwm71ah6aawdh-binutils-2.41/bin/ld: src/listener_registry.o: in function `wl_registry_bind':
/nix/store/kzj3j17d50pv9nv5dnqf1bbiv2ixny6y-wayland-1.22.0-dev/include/wayland-client-protocol.h:1187:(.text+0x18e): undefined reference to `wl_output_interface'
/nix/store/wwfrj9kvfi14xclc38qfwm71ah6aawdh-binutils-2.41/bin/ld: /nix/store/kzj3j17d50pv9nv5dnqf1bbiv2ixny6y-wayland-1.22.0-dev/include/wayland-client-protocol.h:1187:(.text+0x1a5): undefined reference to `wl_proxy_marshal_flags'
/nix/store/wwfrj9kvfi14xclc38qfwm71ah6aawdh-binutils-2.41/bin/ld: /nix/store/kzj3j17d50pv9nv5dnqf1bbiv2ixny6y-wayland-1.22.0-dev/include/wayland-client-protocol.h:1187:(.text+0x20f): undefined reference to `wl_seat_interface'
/nix/store/wwfrj9kvfi14xclc38qfwm71ah6aawdh-binutils-2.41/bin/ld: /nix/store/kzj3j17d50pv9nv5dnqf1bbiv2ixny6y-wayland-1.22.0-dev/include/wayland-client-protocol.h:1187:(.text+0x226): undefined reference to `wl_proxy_marshal_flags'
/nix/store/wwfrj9kvfi14xclc38qfwm71ah6aawdh-binutils-2.41/bin/ld: /nix/store/kzj3j17d50pv9nv5dnqf1bbiv2ixny6y-wayland-1.22.0-dev/include/wayland-client-protocol.h:1187:(.text+0x25e): undefined reference to `wl_proxy_marshal_flags'
/nix/store/wwfrj9kvfi14xclc38qfwm71ah6aawdh-binutils-2.41/bin/ld: src/listener_registry.o: in function `zriver_status_manager_v1_get_river_seat_status':
/home/savvy/wideriver/pro/river-status-unstable-v1.h:182:(.text+0x28f): undefined reference to `wl_proxy_get_version'
/nix/store/wwfrj9kvfi14xclc38qfwm71ah6aawdh-binutils-2.41/bin/ld: /home/savvy/wideriver/pro/river-status-unstable-v1.h:182:(.text+0x2b2): undefined reference to `wl_proxy_marshal_flags'
/nix/store/wwfrj9kvfi14xclc38qfwm71ah6aawdh-binutils-2.41/bin/ld: src/listener_registry.o: in function `wl_registry_bind':
/nix/store/kzj3j17d50pv9nv5dnqf1bbiv2ixny6y-wayland-1.22.0-dev/include/wayland-client-protocol.h:1187:(.text+0x326): undefined reference to `wl_proxy_marshal_flags'
/nix/store/wwfrj9kvfi14xclc38qfwm71ah6aawdh-binutils-2.41/bin/ld: src/listener_registry.o: in function `zriver_seat_status_v1_add_listener':
/home/savvy/wideriver/pro/river-status-unstable-v1.h:373:(.text+0x2d8): undefined reference to `wl_proxy_add_listener'
/nix/store/wwfrj9kvfi14xclc38qfwm71ah6aawdh-binutils-2.41/bin/ld: src/listener_river_command_callback.o: in function `zriver_command_callback_v1_destroy':
/home/savvy/wideriver/pro/river-control-unstable-v1.h:252:(.text+0x21): undefined reference to `wl_proxy_destroy'
/nix/store/wwfrj9kvfi14xclc38qfwm71ah6aawdh-binutils-2.41/bin/ld: /home/savvy/wideriver/pro/river-control-unstable-v1.h:252:(.text+0x48): undefined reference to `wl_proxy_destroy'
/nix/store/wwfrj9kvfi14xclc38qfwm71ah6aawdh-binutils-2.41/bin/ld: src/listener_river_layout.o: in function `river_layout_v3_commit':
/home/savvy/wideriver/pro/river-layout-v3.h:392:(.text+0x1cb): undefined reference to `wl_proxy_get_version'
/nix/store/wwfrj9kvfi14xclc38qfwm71ah6aawdh-binutils-2.41/bin/ld: /home/savvy/wideriver/pro/river-layout-v3.h:392:(.text+0x1ed): undefined reference to `wl_proxy_marshal_flags'
/nix/store/wwfrj9kvfi14xclc38qfwm71ah6aawdh-binutils-2.41/bin/ld: src/output.o: in function `river_layout_manager_v3_get_layout':
/home/savvy/wideriver/pro/river-layout-v3.h:171:(.text+0x33): undefined reference to `wl_proxy_get_version'
/nix/store/wwfrj9kvfi14xclc38qfwm71ah6aawdh-binutils-2.41/bin/ld: /home/savvy/wideriver/pro/river-layout-v3.h:171:(.text+0x5a): undefined reference to `wl_proxy_marshal_flags'
/nix/store/wwfrj9kvfi14xclc38qfwm71ah6aawdh-binutils-2.41/bin/ld: src/output.o: in function `zriver_status_manager_v1_get_river_output_status':
/home/savvy/wideriver/pro/river-status-unstable-v1.h:166:(.text+0x81): undefined reference to `wl_proxy_get_version'
/nix/store/wwfrj9kvfi14xclc38qfwm71ah6aawdh-binutils-2.41/bin/ld: /home/savvy/wideriver/pro/river-status-unstable-v1.h:166:(.text+0xa4): undefined reference to `wl_proxy_marshal_flags'
/nix/store/wwfrj9kvfi14xclc38qfwm71ah6aawdh-binutils-2.41/bin/ld: src/output.o: in function `river_layout_v3_add_listener':
/home/savvy/wideriver/pro/river-layout-v3.h:281:(.text+0x101): undefined reference to `wl_proxy_add_listener'
/nix/store/wwfrj9kvfi14xclc38qfwm71ah6aawdh-binutils-2.41/bin/ld: src/output.o: in function `zriver_output_status_v1_add_listener':
/home/savvy/wideriver/pro/river-status-unstable-v1.h:254:(.text+0x115): undefined reference to `wl_proxy_add_listener'
/nix/store/wwfrj9kvfi14xclc38qfwm71ah6aawdh-binutils-2.41/bin/ld: src/output.o: in function `river_layout_v3_destroy':
/home/savvy/wideriver/pro/river-layout-v3.h:348:(.text+0x1da): undefined reference to `wl_proxy_get_version'
/nix/store/wwfrj9kvfi14xclc38qfwm71ah6aawdh-binutils-2.41/bin/ld: /home/savvy/wideriver/pro/river-layout-v3.h:348:(.text+0x1f0): undefined reference to `wl_proxy_marshal_flags'
/nix/store/wwfrj9kvfi14xclc38qfwm71ah6aawdh-binutils-2.41/bin/ld: /home/savvy/wideriver/pro/river-layout-v3.h:348:(.text+0x21a): undefined reference to `wl_proxy_get_version'
/nix/store/wwfrj9kvfi14xclc38qfwm71ah6aawdh-binutils-2.41/bin/ld: /home/savvy/wideriver/pro/river-layout-v3.h:348:(.text+0x230): undefined reference to `wl_proxy_marshal_flags'
/nix/store/wwfrj9kvfi14xclc38qfwm71ah6aawdh-binutils-2.41/bin/ld: src/output.o: in function `wl_output_destroy':
/nix/store/kzj3j17d50pv9nv5dnqf1bbiv2ixny6y-wayland-1.22.0-dev/include/wayland-client-protocol.h:5849:(.text+0x256): undefined reference to `wl_proxy_destroy'
/nix/store/wwfrj9kvfi14xclc38qfwm71ah6aawdh-binutils-2.41/bin/ld: pro/river-control-unstable-v1.o:(.data.rel+0x8): undefined reference to `wl_seat_interface'
/nix/store/wwfrj9kvfi14xclc38qfwm71ah6aawdh-binutils-2.41/bin/ld: pro/river-layout-v3.o:(.data.rel+0x30): undefined reference to `wl_output_interface'
/nix/store/wwfrj9kvfi14xclc38qfwm71ah6aawdh-binutils-2.41/bin/ld: pro/river-status-unstable-v1.o:(.data.rel+0x10): undefined reference to `wl_output_interface'
/nix/store/wwfrj9kvfi14xclc38qfwm71ah6aawdh-binutils-2.41/bin/ld: pro/river-status-unstable-v1.o:(.data.rel+0x20): undefined reference to `wl_seat_interface'
/nix/store/wwfrj9kvfi14xclc38qfwm71ah6aawdh-binutils-2.41/bin/ld: pro/river-status-unstable-v1.o:(.data.rel+0x28): undefined reference to `wl_output_interface'
/nix/store/wwfrj9kvfi14xclc38qfwm71ah6aawdh-binutils-2.41/bin/ld: pro/river-status-unstable-v1.o:(.data.rel+0x30): undefined reference to `wl_output_interface'
collect2: error: ld returned 1 exit status
make: *** [GNUmakefile:35: wideriver] Error 1
alex-courtis commented 2 days ago

wideriver uses pkg-config to install dependencies, just wayland-client which it looks like you have, along with the other dependencies.

I'm not familiar with nix, however I suggest you take a look at the nixos builds from a similar utility with similar requirements: way-displays . nixpkgs unstable and 24.05 are at latest version and seem to be working.

Yappaholic commented 1 day ago

So I tried to make a default.nix file for wideriver and managed to resolve problem with fetching(I'm fairly new to nix too).

Now I can open shell environment with the default package, but can't launch, as it is not installed. Maybe any tips?

{ lib
, stdenv
, fetchFromGitHub
, pkg-config
, wayland
}:

stdenv.mkDerivation rec {
  pname = "wideriver";
  version = "1.2.0";

  src = fetchFromGitHub {
    owner = "alex-courtis";
    repo = "wideriver";
    rev = version;
    sha256 =  "16i0mzgxn32nrh5ajn0kb4xdwmsjg03amhasxhwyvspar5y4flhg";
  };

  strictDeps = true;

  nativeBuildInputs = [
    pkg-config
    wayland
  ];

  buildInputs = [
    wayland
  ];

  makeFlags = [
    "PREFIX=${placeholder "out"}"
    "PREFIX_ETC=${placeholder "out"}"
    "CC:=$(CC)"
    "CXX:=$(CXX)"
  ];

  meta = with lib; {
    homepage = "https://github.com/alex-courtis/wideriver";
    description = "Tiling window manager for the river wayland compositor";
    license = licenses.mit;
    platforms = platforms.linux;
    mainProgram = "wideriver";
  };
}