How to use propagated build inputs here?

I am trying to build a derivation for ilia and the build ran fine but got this error during runtime that some modules and dependencies do not load, searched and found that for runtime dependencies need to be added to propogated build inputs. Well even when I added them all to it nothing new happens?

Am I missing something?

Also, I am settings GSettings Schema directory and making a copy of the executable cuz when I tried to just replace the actual one it didn’t ran and gave a blank screen, Wonder if anyone has a solution for that.

Thanks,

{
  pkg-config,
  libgee,
  ninja,
  gtk-layer-shell,
  pkgs,
  lib,
  stdenv,
  makeWrapper,
  fetchgit,
  json-glib,
  gettext,
  gobject-introspection,
  intltool,
  gtk3,
  tracker,
  meson,
  vala,
  cmake,
}:

stdenv.mkDerivation {
  pname = "ilia";
  version = "3.2";
  
  src = pkgs.fetchFromGitHub {
    owner = "regolith-linux";
    repo = "ilia";
    rev = "r3_2-beta1-ubuntu-jammy";
    hash = "sha256-4MKVwaepLOaxHFSwiks5InDbKt+B/Q2c97mM5yHz4eU=";
  };


  buildInputs = [
    
  ];

  propagatedBuildInputs = [
    makeWrapper
    json-glib
    gettext
    gobject-introspection
    intltool
    gtk3
    tracker
    meson
    vala
    cmake
    pkg-config
    libgee
    ninja
    gtk-layer-shell
  ];

  installPhase = ''
    mkdir -p $out/bin
    mkdir -p $out/share
    cp src/ilia $out/share
    runHook postInstall
  '';

  postInstall = ''
    mkdir -p $out/share/glib-2.0/schemas/
    glib-compile-schemas --targetdir=$out/share/glib-2.0/schemas $src/data
    makeWrapper $out/share/ilia $out/bin/ilia --set GSETTINGS_SCHEMA_DIR $out/share/gsettings-schemas/ilia-3.2/glib-2.0/schemas
  '';

  meta = {
    mainProgram = "ilia";
    description = "A GTK-based Desktop Executor";
    homepage = "https://github.com/regolith-linux/ilia";
    license = lib.licenses.gpl3Plus;
  };
}

Error:

/nix/store/r73vd0anxg8qhwv967hz4z404crv03hl-dconf-0.40.0-lib/lib/gio/modules/libdconfsettings.so: undefined symbol: g_assertion_message_cmpint
Failed to load module: /nix/store/r73vd0anxg8qhwv967hz4z404crv03hl-dconf-0.40.0-lib/lib/gio/modules/libdconfsettings.so
/nix/store/vnwdak3n1w2jjil119j65k8mw1z23p84-glibc-2.35-224/lib/libc.so.6: version `GLIBC_2.38' not found (required by /nix/store/9dj0v04wg47nxvr7ildwwkdk731mhnby-gvfs-1.52.2/lib/gio/modules/libgvfsdbus.so)
Failed to load module: /nix/store/9dj0v04wg47nxvr7ildwwkdk731mhnby-gvfs-1.52.2/lib/gio/modules/libgvfsdbus.so

** (ilia:150991): WARNING **: 02:37:35.869: gtk-layer-shell v0.7.0 may not work on GTK v3.24.35. If you experience crashes, check https://github.com/wmww/gtk-layer-shell/blob/5f71546112fd284aced13e7b2391a601204bcacd/compatibility.md

That only refers to when a setup hook has dependencies, that you want to make available during the build of packages using the setup hook.

At runtime, in this context, refers to the platform on which programs can/are supposed to be executed. It is also called host platform, as contrasted to build platform. There is no guarantee that the dependencies specified as propagated input will actually be available at runtime.

Actually making sure a program can find its dependencies at runtime is responsibility of the builder. For example the (default) generic builder will ensure ELF programs can load libraries listed in buildInputs it links to.

The most common reason to propagate inputs are the following:

  • You are packaging a library that includes another library in its headers.
  • You are building a Python package – the Python builder expects Python package dependencies to be propagated.

Meson should install the files just fine, including compiling the schemas. The reason you are probably getting an error is that the script has /bin/bash as interpreter, which is not available in build sandbox. It should be possible to fix it with:

postPatch = ''
  patchShebangs meson_scripts/install_schemas.sh
'';

That sounds like a conflict between some plug-in from environment and ilia’s dependencies. It will most likely will be fixed by using wrapGAppsHook3 instead of the manual wrapping. I would recommend going through the GNOME section of the Nixpkgs manual.


You probably do not need this.


Also note that there are several other people attempting to package it, so it might be a good idea to coordinate

@strawhatluffy in Help with building ilia from source and someone else on Matrix looks like that was you.

1 Like

Thanks @jtojnar.
.
I am just trying to package regolith-linux to something as nixos friendly and similar to nixvim.
Could you just help me naming some good blogs and documentation on how to create flakes and modules? And anything else required for that?

Thanks again.

I would say start with Writing NixOS Modules section of the NixOS manual, then look at gnome.nix for inspiration.

For flakes, I started with the Writing your first flake section of the Tweag blog post. It is a bit older but, other than defaultPackage.x86_64-linux being deprecated in favour of packages.x86_64-linux.default, it still looks okay. The wiki article on Flakes has a useful overview of the structure of flake.nix file.

2 Likes

I have some (outdated, but mostly still relevant) videos on the matter:

2 Likes