pop-os / popsicle

Multiple USB File Flasher
MIT License
633 stars 76 forks source link

building on macos #194

Closed monomycelium closed 1 year ago

monomycelium commented 1 year ago

distribution:

macOS 12.6 21G115 arm64

issue:

I know popsicle is not exactly intended for macOS, but I'm sick of dual-booting. So I tried building on macOS (I'm badass enough to use arm64), but it fails:

mycelium@mycelium ~/D/c/popsicle> make gtk && sudo make install-gtk                                                 master
cargo build --manifest-path gtk/Cargo.toml --release
   Compiling loopdev v0.4.0
   Compiling gio v0.15.12
   Compiling cairo-rs v0.15.12
   Compiling pango v0.15.10
   Compiling atk v0.15.1
   Compiling gtk-sys v0.15.3
error: failed to run custom build command for `loopdev v0.4.0`

Caused by:
  process didn't exit successfully: `/Users/mycelium/Documents/cache/popsicle/target/release/build/loopdev-be20e3be1750e79b/build-script-build` (exit status: 101)
  --- stderr
  /Users/mycelium/.cargo/registry/src/github.com-1ecc6299db9ec823/loopdev-0.4.0/wrapper.h:1:10: fatal error: 'linux/loop.h' file not found
  /Users/mycelium/.cargo/registry/src/github.com-1ecc6299db9ec823/loopdev-0.4.0/wrapper.h:1:10: fatal error: 'linux/loop.h' file not found, err: true
  thread 'main' panicked at 'Could not generate bindings: ()', /Users/mycelium/.cargo/registry/src/github.com-1ecc6299db9ec823/loopdev-0.4.0/build.rs:11:10
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
make: *** [target/release/popsicle-gtk] Error 101

I already have gtk+, gtk4, dbus and dbus-glib installed from homebrew. I even used an official script from gtk to set up the libraries and stuff. But the error seems to be with loopdev, which was probably not intended from mac (twice as badly!). But the command-line version seems to work. I expect everything to build just fine on a machine a paid more than a grand for, okay, apple? Anyway, this is not my place to vent so I'll end off on a sweet note. I love popsicle (and pop-os, despite the debian-ness of it), especially when it's faster than the bloated balenaetcher. Amazing work, you amazing developers. I just wish people who are bound to use macos can use your amazing software, don't you?

mmstick commented 1 year ago

It requires the equivalent of clang-dev to be installed. You can see the required dependencies in debian/control

mmstick commented 1 year ago

I'm not too confident this will work out of the box on Mac without some patches to add Mac-specific support.

ids1024 commented 1 year ago

Currently it only works through Udisks2, which presumably wouldn't be available on macOS.

To work on Windows and macOS it really would need some backend abstraction over multiple ways to enumerate and write drives.