baskerville / plato

Document reader
Other
1.26k stars 105 forks source link

Can't build #371

Open arjpar opened 1 month ago

arjpar commented 1 month ago

After following the instructions in build.md and running the build script, I can't seem to build Plato, since libev-dev isn't found, despite the fact that I have it installed (libev). Thus, cross-compilation doesn't work. I tried building it using Docker, but that doesn't work too due to platform config for Docker (building it using the right platform target). I think I'm doing something wrong but I'm not sure.

error: failed to run custom build command for `evdev-sys v0.2.5`

Caused by:
  process didn't exit successfully: `/Users/a/ProgrammingProjects/Kobo/aristotle/target/release/build/evdev-sys-5d65f9d9fcb5c24a/build-script-build` (exit status: 101)
  --- stdout
  running: "git" "submodule" "update" "--init" "--depth" "1"
  running: cd "/Users/a/.cargo/registry/src/index.crates.io-6f17d22bba15001f/evdev-sys-0.2.5" && "cp" "-r" "/Users/a/.cargo/registry/src/index.crates.io-6f17d22bba15001f/evdev-sys-0.2.5/libevdev/" "/Users/a/ProgrammingProjects/Kobo/aristotle/target/arm-unknown-linux-gnueabihf/release/build/evdev-sys-91bed9e2eabfdf20/out"
  cargo:rustc-link-search=/Users/a/ProgrammingProjects/Kobo/aristotle/target/arm-unknown-linux-gnueabihf/release/build/evdev-sys-91bed9e2eabfdf20/out/lib
  cargo:root=/Users/a/ProgrammingProjects/Kobo/aristotle/target/arm-unknown-linux-gnueabihf/release/build/evdev-sys-91bed9e2eabfdf20/out
  cargo:include=/Users/a/ProgrammingProjects/Kobo/aristotle/target/arm-unknown-linux-gnueabihf/release/build/evdev-sys-91bed9e2eabfdf20/out/include
  cargo:rerun-if-changed=libevdev
  cargo:rustc-link-lib=static=evdev
  OPT_LEVEL = Some(3)
  TARGET = Some(arm-unknown-linux-gnueabihf)
  HOST = Some(aarch64-apple-darwin)
  cargo:rerun-if-env-changed=CC_arm-unknown-linux-gnueabihf
  CC_arm-unknown-linux-gnueabihf = None
  cargo:rerun-if-env-changed=CC_arm_unknown_linux_gnueabihf
  CC_arm_unknown_linux_gnueabihf = None
  cargo:rerun-if-env-changed=TARGET_CC
  TARGET_CC = None
  cargo:rerun-if-env-changed=CC
  CC = None
  RUSTC_LINKER = Some(arm-linux-gnueabihf-gcc)
  cargo:rerun-if-env-changed=CROSS_COMPILE
  CROSS_COMPILE = None
  cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some(false)
  CARGO_CFG_TARGET_FEATURE = None
  cargo:rerun-if-env-changed=CFLAGS_arm-unknown-linux-gnueabihf
  CFLAGS_arm-unknown-linux-gnueabihf = None
  cargo:rerun-if-env-changed=CFLAGS_arm_unknown_linux_gnueabihf
  CFLAGS_arm_unknown_linux_gnueabihf = None
  cargo:rerun-if-env-changed=TARGET_CFLAGS
  TARGET_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = None
  running: cd "/Users/a/ProgrammingProjects/Kobo/aristotle/target/arm-unknown-linux-gnueabihf/release/build/evdev-sys-91bed9e2eabfdf20/out/build" && CC="arm-linux-gnueabihf-gcc" CFLAGS="-O3 -ffunction-sections -fdata-sections -fPIC -march=armv6 -marm -mfpu=vfp -Wall -Wextra " "sh" "/Users/a/ProgrammingProjects/Kobo/aristotle/target/arm-unknown-linux-gnueabihf/release/build/evdev-sys-91bed9e2eabfdf20/out/libevdev/autogen.sh" "--host=aarch64-apple-darwin" "--target=arm-unknown-linux-gnueabihf" "--prefix=/Users/a/ProgrammingProjects/Kobo/aristotle/target/arm-unknown-linux-gnueabihf/release/build/evdev-sys-91bed9e2eabfdf20/out"

  --- stderr
  fatal: not a git repository (or any of the parent directories): .git
  sh: /Users/a/ProgrammingProjects/Kobo/aristotle/target/arm-unknown-linux-gnueabihf/release/build/evdev-sys-91bed9e2eabfdf20/out/libevdev/autogen.sh: No such file or directory
  thread 'main' panicked at /Users/a/.cargo/registry/src/index.crates.io-6f17d22bba15001f/evdev-sys-0.2.5/build.rs:121:5:
  assertion failed: cmd.status()?.success()
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
randomnoise commented 3 weeks ago

First line of stderr might be relevant: fatal: not a git repository (or any of the parent directories): .git

Did you clone the repository with git or just download the zip file and extract? If that is an issue, a change in build.md would be useful.

Also, not revelant to your issue but did you rename the project's folder as aristotle on your computer? 😂

arjpar commented 3 weeks ago

@randomnoise I managed to fix that issue, but it still doesn't build because ev-dev isn't found despite the fact that I installed it. I checked (did some google searches) and apparently it seems like the build process won't work for macOS because it requires some Linux specific things? I dunno, it's been a few weeks so it's IIRC. I tried building it with docker, and it still doesn't work. I really don't know what to do.

randomnoise commented 3 weeks ago

I've tried building Plato using Docker for different reasons. (I did not want to install MuPDF dependencies on my local machine) It was successful for me and ev-dev was not an issue.

You can look into builder.Dockerfile on https://github.com/randomnoise/plato-in-container

I hope it helps.