jmacdonald / amp

A complete text editor for your terminal.
https://amp.rs
Other
3.73k stars 105 forks source link

amp 0.6.2 doesn't build on OpenBSD 6.6: libxcb not found #180

Open rialpamu opened 4 years ago

rialpamu commented 4 years ago

linker complains: ld: error: unable to find library -lxcb

but libxcb is there:

$ ls -l /usr/X11R6/lib/libxcb.* -r--r--r-- 1 root bin 1008860 Oct 12 19:28 /usr/X11R6/lib/libxcb.a -r--r--r-- 1 root bin 634520 Oct 12 19:28 /usr/X11R6/lib/libxcb.so.4.0

looks like a missing (or wrong) -L option passed to the linker

$ rustc --version; cargo --version rustc 1.38.0 cargo 1.38.0

pbgc commented 4 years ago

It builds on FreeBSD without problems using:

setenv LDFLAGS "-L/usr/local/lib -R/usr/local/lib"
rialpamu commented 4 years ago

RUSTFLAGS='-C link-args=-L/usr/X11R6/lib' cargo install amp worked

jmacdonald commented 4 years ago

Hi @rialpamu! Thanks for filing this. Any chance you'd be willing to issue a PR with installation instructions for FreeBSD? :innocent:

oldaccountdeadname commented 2 years ago

On FreeBSD, setting the RUSTFLAGS environment variable in my .shrc like the below works:

export RUSTFLAGS="-C link-args=-L/usr/local/lib"

Will follow up with a patch as soon as I get my ssh keys onto this FreeBSD install :)

nunotexbsd commented 2 years ago

FreeBSD amp port available.

Please take a look at port Makefile, I fixed RUSTFLAGS="-C link-args=-L/usr/local/lib"with:

USES= localbase:ldflags xorg
USE_XORG= xcb

and a reinplace for python: @${REINPLACE_CMD} 's|python3|python${PYTHON_VER}|' ${WRKSRC}/cargo-crates/xcb-0.8.2/build.rs

It runs ok and sintax highlight is working.

Cheers,

Nuno Teixeira