Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Add pkg-config file" #2

Merged
merged 1 commit into from
Feb 12, 2020
Merged

Revert "Add pkg-config file" #2

merged 1 commit into from
Feb 12, 2020

Conversation

johalun
Copy link
Member

@johalun johalun commented Mar 11, 2019

Reverts #1

This is included in the upcoming meson patch

@jbeich
Copy link
Contributor

jbeich commented Mar 11, 2019

Do you plan to remove other build systems? epoll-shim.pc on meson branch:

  • has broken Cflags
  • inconsistently uses lib suffix
  • doesn't support static linking
@@ -6,7 +5,5 @@
-Name: epoll-shim
-URL: https://github.com/FreeBSDDesktop/epoll-shim
-Description: Small epoll implementation using kqueue
-Version: 
+Name: libepoll-shim
+Description: small epoll implementation using kqueue
+Version: 0.0.1
 Libs: -L${libdir} -lepoll-shim
-Libs.private: -pthread -lrt
-Cflags: -I${includedir}/libepoll-shim
+Cflags: -I${includedir}

@zeising
Copy link
Member

zeising commented Mar 11, 2019

Yes, once those issues are fixed.

@ghost
Copy link

ghost commented Mar 12, 2019

I was really hoping that we could have a devel/libepoll-shim with a pkg-config file in the 2019Q2 ports branch for upstreaming work. I don't really want to submit patches that hardcode include/libepoll-shim etc. like it is now in libinput.

Is there any chance of this happening before 2019Q2?

@zeising
Copy link
Member

zeising commented Mar 12, 2019

I was really hoping that we could have a devel/libepoll-shim with a pkg-config file in the 2019Q2 ports branch for upstreaming work. I don't really want to submit patches that hardcode include/libepoll-shim etc. like it is now in libinput.

Is there any chance of this happening before 2019Q2?

I'll try to make this happen. I've been working on the mkfontdir/mkfontscale that just got in last night.

@zeising
Copy link
Member

zeising commented Mar 12, 2019

@t6 @jbeich Can you check that the .pc in this branch [1] does what you want?
You have to build it with meson, run

meson --buildtype release _build
ninja -C _build

You'll have the .pc in _build/meson-private/
Thanks!

[1] https://github.com/FreeBSDDesktop/epoll-shim/tree/zeising/meson

@jbeich
Copy link
Contributor

jbeich commented Mar 12, 2019

Cflags are still incorrect: ${includedir}/epoll-shim is not installed. Maybe define includedir=${prefix}/include/libepoll-shim and use default Cflags: -I${includedir}.

@@ -6,7 +5,7 @@
 Name: epoll-shim
+Description: small epoll implementation using kqueue
 URL: https://github.com/FreeBSDDesktop/epoll-shim
-Description: Small epoll implementation using kqueue
-Version: 
+Version: 0.0.1
 Libs: -L${libdir} -lepoll-shim
 Libs.private: -pthread -lrt
-Cflags: -I${includedir}/libepoll-shim
+Cflags: -I${includedir}/epoll-shim
$ meson --prefix=/tmp/foo _build; ninja -C _build install
$ cat a.c
#include <sys/epoll.h>

int main()
{
  epoll_create1(EPOLL_CLOEXEC);
  return 0;
}

$ cc a.c $(PKG_CONFIG_PATH=/tmp/foo/lib/pkgconfig pkg-config epoll-shim --cflags --libs)
a.c:1:10: fatal error: 'sys/epoll.h' file not found
#include <sys/epoll.h>
         ^~~~~~~~~~~~~
1 error generated.

@ghost
Copy link

ghost commented Mar 13, 2019

Cflags are still incorrect: ${includedir}/epoll-shim is not installed. Maybe define includedir=${prefix}/include/libepoll-shim and use default Cflags: -I${includedir}.

Any idea how to do that in Meson? Just setting subdirs to libepoll-shim in meson.build per [1] works but does not set includedir like you suggested in epoll-shim.pc:

--- a/meson.build
+++ b/meson.build
@@ -72,5 +72,5 @@ lib_libepollshim = both_libraries('epoll-shim',
 pkgconfig.generate(lib_libepollshim,
        url : 'https://github.com/FreeBSDDesktop/epoll-shim',
        description : 'small epoll implementation using kqueue',
-       subdirs : 'epoll-shim'
+       subdirs : 'libepoll-shim'
 )

[1] https://mesonbuild.com/Pkgconfig-module.html#pkgconfig-module

@ghost
Copy link

ghost commented Mar 13, 2019

Why is

libepollshim_so_version = '0.0.0'

different than the project version?

@zeising
Copy link
Member

zeising commented Mar 13, 2019

Why is

libepollshim_so_version = '0.0.0'

different than the project version?

I had to make up a project version, previously there were none. I still wanted to have a shared library with the same version, or as close to the same version, as before.

@zeising
Copy link
Member

zeising commented Mar 13, 2019

Cflags are still incorrect: ${includedir}/epoll-shim is not installed. Maybe define includedir=${prefix}/include/libepoll-shim and use default Cflags: -I${includedir}.

Any idea how to do that in Meson? Just setting subdirs to libepoll-shim in meson.build per [1] works but does not set includedir like you suggested in epoll-shim.pc:

--- a/meson.build
+++ b/meson.build
@@ -72,5 +72,5 @@ lib_libepollshim = both_libraries('epoll-shim',
 pkgconfig.generate(lib_libepollshim,
        url : 'https://github.com/FreeBSDDesktop/epoll-shim',
        description : 'small epoll implementation using kqueue',
-       subdirs : 'epoll-shim'
+       subdirs : 'libepoll-shim'
 )

[1] https://mesonbuild.com/Pkgconfig-module.html#pkgconfig-module

This worked for me. You might want to redo the meson step (remove _build and start over).

@zeising
Copy link
Member

zeising commented Mar 13, 2019

Cflags are still incorrect: ${includedir}/epoll-shim is not installed. Maybe define includedir=${prefix}/include/libepoll-shim and use default Cflags: -I${includedir}.

This should be fixed now, sorry about that.

@ghost
Copy link

ghost commented Mar 13, 2019

This worked for me. You might want to redo the meson step (remove _build and start over).

Yes, it also worked for me. What I meant was that this doesn't exactly do what @jbeich suggested in his comment earlier 😉.

Why is

libepollshim_so_version = '0.0.0'

different than the project version?

I had to make up a project version, previously there were none. I still wanted to have a shared library with the same version, or as close to the same version, as before.

Sure, but syncing it with the current project version 0.0.1 would still be compatible with what devel/libepoll-shim installs now:

/tmp/foo/lib/libepoll-shim.so
/tmp/foo/lib/libepoll-shim.so.0
/tmp/foo/lib/libepoll-shim.so.0.0.1

vs

/usr/local/lib/libepoll-shim.so
/usr/local/lib/libepoll-shim.so.0

Anyway, what's in zeising/meson now works for me.

@zeising
Copy link
Member

zeising commented Mar 13, 2019

Sure, but syncing it with the current project version 0.0.1 would still be compatible with what devel/libepoll-shim installs now:

/tmp/foo/lib/libepoll-shim.so
/tmp/foo/lib/libepoll-shim.so.0
/tmp/foo/lib/libepoll-shim.so.0.0.1

vs

/usr/local/lib/libepoll-shim.so
/usr/local/lib/libepoll-shim.so.0

Anyway, what's in zeising/meson now works for me.

I'll think a bit about it, perhaps it's better to have them match. Good that it's working, sorry about the include dir, that was just a braino on my part. I blame lack of coffee ;)

@jbeich
Copy link
Contributor

jbeich commented Mar 13, 2019

Maybe define includedir=${prefix}/include/libepoll-shim and use default Cflags: -I${includedir}.

Any idea how to do that in Meson?

Sorry, includedir variable is reserved and can only be set by user (or downstream) via --includedir option.
https://github.com/mesonbuild/meson/blob/0.49.2/mesonbuild/modules/pkgconfig.py#L273

@ghost
Copy link

ghost commented Apr 2, 2019

Any news here?

@zeising zeising merged commit 99ed35a into master Feb 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants