fink / fink-distributions

Package descriptions and patches for Fink
25 stars 38 forks source link

libusb-0.1.12 FTBFS on macOS12 (deprecated IOMasterPort) #863

Open nieder opened 2 years ago

nieder commented 2 years ago

The older libusb-0.1.12 fails to build on macOS 12.1 with this error:

 gcc -DHAVE_CONFIG_H -I. -I/opt/sw/include -Werror -no-cpp-precomp -g -O2 -g -Wall -MT darwin.lo -MD -MP -MF .deps/darwin.Tpo -c darwin.c  -fno-common -DPIC -o .libs/darwin.o
darwin.c:1171:5: error: 'IOMasterPort' is deprecated: first deprecated in macOS 12.0 [-Werror,-Wdeprecated-declarations]
    IOMasterPort(masterPort, &masterPort);
    ^~~~~~~~~~~~
    IOMainPort
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:132:1: note: 'IOMasterPort' has been explicitly marked deprecated here
IOMasterPort( mach_port_t       bootstrapPort,
^
1 error generated.
make[2]: *** [darwin.lo] Error 1

This old libN is long abandoned. It's used by the following packages:

dmacks commented 2 years ago

This FTBFS can surely be resolved by removing -Werror, but we should also work on migrating as much as possible off an old libversion.

dmacks commented 2 years ago

I'm tagging "OLD_USB" for ones that cannot easily be migrated.

clepple commented 2 years ago

Theoretically, we're close to upgrading NUT to libusb-1.0, but TBH userspace access to USB devices on macOS seems to keep breaking at runtime in ways that aren't easy to debug or fix (despite libusb-0.1 having worked just fine on other platforms for years after it was abandoned upstream).

dmacks commented 2 years ago

ztex's recent upstream versions use newer libusb, but they distribute only a prebuilt libusb4java.dylib that apparently embeds its own copy of it rather than a source that compiles and links against it.

dmacks commented 2 years ago

gnokii is dead upstream and debian's packaging of it still uses old libusb.

dmacks commented 2 years ago

@mringwal there's a new avrdude upstream that has a --disable-libusb_1_0 flag (https://github.com/avrdudes/avrdude/commit/9cb9f504ae886003be6fe2d24249479a444b23d5). Not sure why it would ever actually want to use older and newer, rather than just one or the other anyway.

mringwal commented 2 years ago

@dmacks Thanks for looking into this. If avrdude compiels with libusb-1.0, please update it. If not, no idea what to do. I'm not using Fink anymore. Could you remove me from the maintainer field please? Thanks again!

jimklimov commented 2 years ago

Just in case, is it an option to use libusb-compat for those projects on MacOS? https://github.com/libusb/libusb-compat-0.1

This is supposed to be a sort of fork from libusb-1.0 codebase with API for 0.1 replacement, with some caveats reported in their README. I am not sure how much they are otherwise in- or out- of sync with "true" libusb-1.0.

nieder commented 2 years ago

@jimklimov thanks for the pointer on libusb-compat-0.1. I've successfully built it on 12.1. Will now try to use it to compile one of our current packages using the old libusb-0.1. @dmacks it builds the library libusb-0.1.4.dylib, so I'll call the packages libusb-compat-0.1.4-shlibs and libusb-compat-0.1.4-dev

nieder commented 2 years ago

libusb-compat successfully worked with gnupg-unified, avrdude, and mspdebug.

dmacks commented 2 years ago

@dmacks I'm not using Fink anymore. Could you remove me from the maintainer field please? Thanks again!

@mringwal Done. Thanks for your many years of maintaining so many packages!

dmacks commented 2 years ago

libusb-compat successfully worked with gnupg-unified, avrdude, and mspdebug.

I pushed avrdude's new version using libusb-compat. Thanks @jimklimov !

jimklimov commented 2 years ago

Super, glad to help from the peanut gallery ;)

NUT master branch should be good with libusb-1.0 soon.

On Tue, Jan 4, 2022, 20:30 Daniel Macks @.***> wrote:

libusb-compat successfully worked with gnupg-unified, avrdude, and mspdebug.

I pushed avrdude's new version using libusb-compat. Thanks @jimklimov https://github.com/jimklimov !

— Reply to this email directly, view it on GitHub https://github.com/fink/fink-distributions/issues/863#issuecomment-1005109942, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMPTFFPAZTDQBCT23625RTUUNDGDANCNFSM5KZR74NQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>

mringwal commented 2 years ago

@dmacks I'm not using Fink anymore. Could you remove me from the maintainer field please? Thanks again!

@mringwal Done. Thanks for your many years of maintaining so many packages!

@dmacks You're welcome, but I have to thank you and the other old timers for all your work!

jimklimov commented 2 years ago

Hi, on behalf of the mentioned NUT project, the master branch now includes the changes for "native" libusb-1.0 support (release-cutting would happen later, though - got some more PRs pending to merge, at least).

If anyone here gets to testing the building and/or actual UPS/PDU/... monitoring with whatever media and protocol, including USB, news from that would be welcome in https://github.com/networkupstools/nut/issues/ - good or bad, any are useful :)

Also, regarding builds of NUT on MacOS (with Fink): if you would take notes to add a PR for a new chapter in https://github.com/networkupstools/nut/blob/master/docs/config-prereqs.txt that would be very welcome too.

nieder commented 1 week ago

With db8d3cb8b760454345014d7344ac091a3d5c15e2 for gpsbabel, the old libN of nut (v2.7.4) is the last user of the really old libusb-0.1 package. I can't find anything using the old libupsclient4-shlibs and libnutclient0-shlibs libraries from nut-2.7.4.