darrylb123 / usbrelay

Control usb relay - based on hidapi
GNU General Public License v2.0
315 stars 98 forks source link

Improve makefile #104

Closed herve0742 closed 1 year ago

herve0742 commented 1 year ago

I need to launch make with custom variables like LIBDIR, PREFIX, and to have a pkgconfig file. So I propose these commits to be added to the master branch.

darrylb123 commented 1 year ago

You'll have to excuse my ignorance. I know nothing about pkgconfig until I read a little about it today. I still do not understand what it does for usbrelay. That said, that is no reason to reject your changes.

Your changes break the rpm build because of the file /usr/lib64/pkgconfig/libusbrelay.pc

On my fedora system there are a few .pc files in /usr/lib64/pkgconfig mainly to do with python so I need to decide what to do about the breakage. I need to fix that quickly if I pull in your changes. First of all, what do you recommend?

herve0742 commented 1 year ago

It's too bad for the break. I recommend to fix the error before the merge. What's the error output ?

For pkgconfig, it does nothing for usbrelay. It helps those who wants to compile against libusbrelay. The produced .pc file retains all informations needed for that compilation. With this .pc file and the binary pkg-config we can get needed compiler flags with something like pkg-config --cflags --libs libusbrelay.

herve0742 commented 1 year ago

Following my guess, I add this commit in the hope that it will do the job. I haven't tested it, let me know the result.

herve0742 commented 1 year ago

This one has a better chance. I think..

darrylb123 commented 1 year ago

I see Fedora has a recommendation to use pkgconfig if you've got it. I'll try it later. Your patch looks like it would do the trick.

I'll try it later.

Darryl

On Thu, 18 May 2023, 12:28 am herve0742, @.***> wrote:

This one has a better chance. I think..

— Reply to this email directly, view it on GitHub https://github.com/darrylb123/usbrelay/pull/104#issuecomment-1551506715, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTSUVJKIBXI7L6S3SBCNGLXGTN77ANCNFSM6AAAAAAYEWAQ5A . You are receiving this because you commented.Message ID: @.***>

darrylb123 commented 1 year ago

Yes, that works nicely. https://docs.fedoraproject.org/en-US/packaging-guidelines/PkgConfigBuildRequires/ This was not required as it builds the library too.

I shall merge you changes.