Re: [PATCH libinput] FreeBSD portability fixes

2017-12-01 Thread Greg V

On 12/01/2017 03:10, Peter Hutterer wrote:

is there a freebsd image on the docker registry that's reliable? adding this
to circleci seems like the only way to make sure it keeps building.
CircleCI doesn't allow nested KVM so I guess you can only run slow 
software emulation in qemu…


But you can cross-compile like Rust does:

https://github.com/rust-lang/rust/tree/master/src/ci/docker

P.S. sent v2 patch as a separate email
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH libinput] FreeBSD portability fixes

2017-11-30 Thread Peter Hutterer
On Thu, Nov 23, 2017 at 09:15:27PM +0300, Greg V wrote:
> - some items in meson were missing a dependency on udev
> - libdl does not exist on FreeBSD, dlopen is in libc
> - no linux/types.h on FreeBSD
> - stdarg.h included when variadic functions are used
> - and other fixes
> ---
>  include/linux/input.h | 11 +++
>  meson.build   |  9 +++--
>  src/evdev.h   |  1 +
>  src/libinput-private.h|  1 +
>  src/libinput-util.h   |  4 
>  src/libinput.c|  1 +
>  src/libinput.h|  1 +
>  test/litest.c | 27 +--
>  test/litest.h |  1 +
>  test/test-log.c   |  1 +
>  test/test-misc.c  |  1 +
>  test/test-pointer.c   |  2 ++
>  test/test-tablet.c|  1 +
>  tools/libinput-debug-events.c |  1 +
>  tools/libinput-debug-gui.c|  1 +
>  tools/ptraccel-debug.c|  8 +++-
>  16 files changed, 66 insertions(+), 5 deletions(-)
> 
> diff --git a/include/linux/input.h b/include/linux/input.h
> index 06316b27..95134d8e 100644
> --- a/include/linux/input.h
> +++ b/include/linux/input.h
> @@ -11,7 +11,18 @@
>  #include 
>  #include 
>  #include 
> +#ifdef __FreeBSD__
> +#define __u8 uint8_t
> +#define __u16 uint16_t
> +#define __u32 uint32_t
> +#define __u64 uint64_t
> +#define __s16 int16_t
> +#define __s32 int32_t
> +#define _IOC_READ IOC_OUT
> +#define _IOC_WRITE IOC_IN
> +#else
>  #include 
> +#endif

I'd rather have these defines in the config.h for BSD if possible. This
header file should be modified as little as possible.

>  #include "input-event-codes.h"
>  
> diff --git a/meson.build b/meson.build
> index 13c6a27f..5d9db605 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -145,7 +145,9 @@ src_libfilter = [
>   'src/filter.h',
>   'src/filter-private.h'
>  ]
> -libfilter = static_library('filter', src_libfilter)
> +libfilter = static_library('filter', src_libfilter,
> +dependencies : dep_udev,
> +include_directories : includes_include)
>  dep_libfilter = declare_dependency(link_with : libfilter)
>  
>   libinput.so 
> @@ -598,7 +600,7 @@ if get_option('tests')
>   'test/litest.c'
>   ]
>  
> - dep_dl = cc.find_library('dl')
> + dep_dl = cc.find_library('dl', required : false)
>   deps_litest = [
>   dep_libinput,
>   dep_check,
> @@ -689,12 +691,14 @@ if get_option('tests')
>   # build-test only
>  executable('test-build-pedantic',
>  'test/build-pedantic.c',
> +dependencies : [dep_udev],
>  include_directories : [includes_src, includes_include],
>  c_args : ['-std=c99', '-pedantic', '-Werror'],
>  install : false)
>   # build-test only
>  executable('test-build-std-gnuc90',
>  'test/build-pedantic.c',
> +dependencies : [dep_udev],
>  include_directories : [includes_src, includes_include],
>  c_args : ['-std=gnu90', '-Werror'],
>  install : false)
> @@ -707,6 +711,7 @@ if get_option('tests')
>   # test including from C++
>   executable('test-build-cxx',
>  'test/build-cxx.cc',
> +dependencies : [dep_udev],
>  include_directories : [includes_src, includes_include],
>  install : false)
>  

I split those into a separate commit, pushed, thanks.

> diff --git a/src/evdev.h b/src/evdev.h
> index 11ed7da5..75223852 100644
> --- a/src/evdev.h
> +++ b/src/evdev.h
> @@ -29,6 +29,7 @@
>  #include "config.h"
>  
>  #include 
> +#include 

I split all the stdarg.h into a separate commit, pushed, thanks.

> diff --git a/src/libinput-util.h b/src/libinput-util.h
> index 57bcdbb5..a4522f6b 100644
> --- a/src/libinput-util.h
> +++ b/src/libinput-util.h
> @@ -30,7 +30,11 @@
>  #include 
>  #include 
>  #include 
> +#ifdef __FreeBSD__
> +#include 
> +#else
>  #include 
> +#endif

is there a freebsd image on the docker registry that's reliable? adding this
to circleci seems like the only way to make sure it keeps building.

>  #include 
>  #include 
>  #include 
> diff --git a/src/libinput.c b/src/libinput.c
> index 49de8f27..d85693a4 100644
> --- a/src/libinput.c
> +++ b/src/libinput.c
> @@ -28,6 +28,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
> diff --git a/src/libinput.h b/src/libinput.h
> index 1a06bc7c..759bce91 100644
> --- a/src/libinput.h
> +++ b/src/libinput.h
> @@ -31,6 +31,7 @@ extern "C" {
>  
>  #include 
>  #include 
> +#include 
>  #include 
>  
>  #define LIBINPUT_ATTRIBUTE_PRINTF(_format, _args) \
> diff --git a/test/litest.c b/test/litest.c
> index 3ca319c2..c27c2369 100644
> --- a/test/litest.c
> +++ b/test/litest.c
> @@ -36,12 +36,17 @@
>  #include 
>  #include