iced icon indicating copy to clipboard operation
iced copied to clipboard

Add a list of Linux dependencies

Open RazrFalcon opened this issue 4 years ago • 10 comments

For example, on Gentoo we have to install media-libs/vulkan-loader, otherwise it will not work.

RazrFalcon avatar Apr 03 '20 13:04 RazrFalcon

Hey @RazrFalcon, thanks for all your work on resvg!

I explained my reasoning on why a dependency list is not present yet in #210. But I don't have a strong opinion here, I believe we could try to maintain an INSTALLATION.md or BUILD.md file.

hecrj avatar Apr 03 '20 18:04 hecrj

Running lsof on each of the examples and combining the libs, I get this:

libbz2.so
libcrypto.so
libdrm_amdgpu.so
libdrm.so
libedit.so
libexpat.so
libffi.so
libfontconfig.so
libfreetype.so
libgcc_s.so
libgraphite2.so
libharfbuzz.so
liblzma.so
libncursesw.so
libnss_mdns4_minimal.so
libnss_mymachines.so
libpcre.so
libpng16.so
libssl.so
libuuid.so
libvulkan_intel.so
libvulkan_radeon.so
libvulkan.so
libX11.so
libXau.so
libxcb.so
libXcursor.so
libXdmcp.so
libXext.so
libXfixes.so
libXi.so
libxml2.so
libXrandr.so
libXrender.so
libxshmfence.so
libz.so

Now you'd have to run a script to check which packages on your distro have these libraries. On Solus they would be:

sudo eopkg install bzip2-devel expat-devel fontconfig-devel freetype2-devel graphite2-devel harfbuzz-devel libdrm-devel libedit libffi-devel libgcc-devel libpcre3-devel libpcre-devel libpng-devel libx11-devel libxau-devel libxcb-devel libxcursor-devel libxdmcp-devel libxext-devel libxfixes-devel libxi-devel libxml2-devel libxrandr-devel libxrender-devel libxshmfence-devel mesalib-devel ncurses-devel nss-mdns-devel openssl-devel systemd util-linux-devel vulkan-devel xz-devel zlib-devel

That list could be narrowed down a bit (for distros in general) as some of these libs are likely already installed, some may not even be available (systemd, maybe other package provides libnss_mymachines). Like Hector said, dependency tracking is quite troublesome, specially in those early stages.

We could have INSTALLATION.md contain package lists for every distro people write a PR for, hopefully keeping it up to date with the latest changes in master.

manokara avatar Apr 03 '20 18:04 manokara

The problem is that I've spent like 10 min searching through issues to figure it out. Which is not very user-friendly.

RazrFalcon avatar Apr 03 '20 18:04 RazrFalcon

@manokara The library doesn't actually use harfbuzz, afaik (probably pulled by freetype). And graphite2 is a harfbuzz dependency. So those two are out.

expat is a fontconfig dependency. No sure if it used. I thought that iced uses rusttype and not fontkit.

Basically, iced should mention only direct dependencies.

RazrFalcon avatar Apr 03 '20 18:04 RazrFalcon

libfreetype6-dev is at least one dep for Ubuntu that I didn't have installed. I'm running into other errors though so not sure if there are more I'm missing ATM.

MAKEFLAGS error

--- stderr make[1]: warning: -j8 forced in submake: resetting jobserver mode. /home/jesse/.asdf/installs/rust/1.42.0/registry/src/github.com-1ecc6299db9ec823/servo-fontconfig-sys-4.0.9/missing: line 81: gperf: command not found WARNING: 'gperf' is missing on your system. You might have modified some files without having the proper tools for further handling them. Check the 'README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package contains this missing 'gperf' program. make[3]: *** [Makefile:882: fcobjshash.h] Error 1 make[2]: *** [Makefile:562: all-recursive] Error 1 make[1]: *** [Makefile:445: all] Error 2 make: *** [makefile.cargo:61: /home/jesse/projects/iced/target/debug/build/servo-fontconfig-sys-b4ca3dfac10986fc/out/libfontconfig.a] Error 2 thread 'main' panicked at 'assertion failed: Command::new("make").env("MAKEFLAGS", env::var("CARGO_MAKEFLAGS").unwrap_or_default()).args(&["-R", "-f", "makefile.cargo"]).status().unwrap().success()', /home/jesse/.asdf/installs/rust/1.42.0/registry/src/github.com-1ecc6299db9ec823/servo-fontconfig-sys-4.0.9/build.rs:20:5

jc00ke avatar Apr 04 '20 00:04 jc00ke

sudo apt install gperf did the trick. I can now run the tour.

jc00ke avatar Apr 05 '20 22:04 jc00ke

Just wanted to add a +1 for this idea--my demo builds were working until I found the answer for installing Freetype2 using $ apt-get install libfreetype-dev, per @jc00ke's comment . I'm running Pop!_OS 20.04, which is a pretty vanilla Ubuntu derivative, so I'm sure that there are a fair number of other interested users who have/will run into similar problems.

quietlychris avatar Jul 25 '20 02:07 quietlychris

Let me answer this with nix-shell:

with import <nixpkgs> {};

stdenv.mkDerivation rec {
  name = "iced-env";
  buildInputs = [
    xorg.libX11 xorg.libXcursor xorg.libXi xorg.libXrandr libGL freetype pkgconfig freetype.dev expat
  ];

  LD_LIBRARY_PATH = builtins.foldl'
    (a: b: "${a}:${b}/lib") "${vulkan-loader}/lib" buildInputs;
}

suhr avatar Aug 09 '20 09:08 suhr

Thanks @suhr that did the trick, though I also needed the libxkbcommon build input.

mitchmindtree avatar Jul 09 '21 13:07 mitchmindtree

Hello, I was trying to build iced for quite more time than I'd expect on my Ubuntu 22.10, the issue was finally resolved when I headed to https://github.com/servo/font-kit and on the bottom of it's README.md there was a note:

Dependencies

Ubuntu Linux

sudo apt install pkg-config libfreetype6-dev libfontconfig1-dev

adsick avatar Oct 23 '22 17:10 adsick

Hi, similarly on Fedora, I ended up installing 3 packages to be able to build and run the tour:

sudo dnf install freetype-devel fontconfig-devel expat-devel

samuelmay avatar Nov 10 '22 08:11 samuelmay