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

Add a list of Linux dependencies #256

Open
RazrFalcon opened this issue Apr 3, 2020 · 13 comments
Open

Add a list of Linux dependencies #256

RazrFalcon opened this issue Apr 3, 2020 · 13 comments

Comments

@RazrFalcon
Copy link

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

@hecrj hecrj added the improvement An internal improvement label Apr 3, 2020
@hecrj
Copy link
Member

hecrj commented Apr 3, 2020

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.

@manokara
Copy link

manokara commented Apr 3, 2020

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.

@RazrFalcon
Copy link
Author

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

@RazrFalcon
Copy link
Author

@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.

@jc00ke
Copy link

jc00ke commented Apr 4, 2020

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
Copy link

jc00ke commented Apr 5, 2020

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

@quietlychris
Copy link

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.

@suhr
Copy link

suhr commented Aug 9, 2020

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;
}

@mitchmindtree
Copy link

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

@adsick
Copy link

adsick commented Oct 23, 2022

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

@samuelmay
Copy link

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

@darosior
Copy link

A list of dependencies would be very helpful for downstream users of this project. If this effort is undertaken, drawing a line between build-time and runtime dependencies would be nice. Downstream project could leverage this to quickly figure out:

  • What dependencies they need to distribute a reliable binary of the application (for instance the required dependencies in a container for reproducible builds).
  • What users in turn need to have on their machine to be able to reliably run this binary.

@wiiznokes
Copy link
Contributor

Hi, on Fedora, I ended up installing these listed packages

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

plus libX11-devel after replacing iced = { path = "../..", features = ["async-std", "debug"] } by iced = { version = "0.8", features = ["async-std", "debug"] } in the Cargo.toml todos file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests