Commit 4df15f77 authored by Hanspeter Portner's avatar Hanspeter Portner

get rid of libuv dependency for simple_ui.

parent dadfd3ba
......@@ -14,8 +14,7 @@ before_install:
- wget http://download.drobilla.net/sratom-0.4.6.tar.bz2
- wget http://download.drobilla.net/lilv-0.22.0.tar.bz2
- wget https://github.com/nanomsg/nanomsg/releases/download/0.8-beta/nanomsg-0.8-beta.tar.gz
- wget https://github.com/libuv/libuv/archive/v1.7.5.tar.gz
- wget https://github.com/warmcat/libwebsockets/archive/v1.7.0.tar.gz
- wget https://github.com/warmcat/libwebsockets/archive/v1.7.5.tar.gz
- tar xjf lv2-1.12.0.tar.bz2
- tar xjf serd-0.22.0.tar.bz2
- tar xjf sord-0.14.0.tar.bz2
......@@ -23,7 +22,6 @@ before_install:
- tar xjf lilv-0.22.0.tar.bz2
- tar xzf nanomsg-0.8-beta.tar.gz
- tar xzf v1.7.5.tar.gz
- tar xzf v1.7.0.tar.gz
- if [ "$CC" = "clang" ]; then sudo add-apt-repository -y ppa:h-rayflood/llvm-upper; fi
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
- sudo add-apt-repository -y ppa:andykimpe/cmake
......@@ -39,8 +37,7 @@ install:
- pushd sratom-0.4.6 && ./waf configure --prefix=/usr && ./waf build && sudo ./waf install && popd
- pushd lilv-0.22.0 && ./waf configure --no-utils --prefix=/usr && ./waf build && sudo ./waf install && popd
- pushd nanomsg-0.8-beta && ./configure --prefix=/usr && make && sudo make install && popd
- pushd libuv-1.7.5 && sh autogen.sh && ./configure --prefix=/usr && make && sudo make install && popd
- pushd libwebsockets-1.7.0 && mkdir build && pushd build && cmake -DCMAKE_INSTALL_PREFIX=/usr .. && make && sudo make install && popd && popd
- pushd libwebsockets-1.7.5 && mkdir build && pushd build && cmake -DCMAKE_INSTALL_PREFIX=/usr .. && make && sudo make install && popd && popd
before_script:
- if [ "$CC" = "clang" ]; then export CXX="clang++-3.6" CC="clang-3.6" CFLAGS="-ffreestanding"; fi
- if [ "$CC" = "gcc" ]; then export CXX="g++-5" CC="gcc-5"; fi
......
......@@ -55,7 +55,6 @@ include(CMakeDependentOption)
option(BUILD_COMMON_UI "Build common embeddable UI" OFF)
option(BUILD_SIMPLE_UI "Build simple external UI" OFF)
option(BUILD_WEB_UI "Build web-based external UI" ON)
cmake_dependent_option(USE_FS_EVENT "Use filesystem notify events" ON "BUILD_SIMPLE_UI" OFF)
if(BUILD_COMMON_UI)
pkg_search_module(ELM REQUIRED elementary>=1.8)
......@@ -117,18 +116,6 @@ else()
endif()
if(BUILD_SIMPLE_UI)
if(USE_FS_EVENT)
add_definitions("-DUSE_FS_EVENT=1")
endif()
pkg_search_module(UV REQUIRED libuv>=1.0)
include_directories(${UV_INCLUDE_DIRS})
if(DEFINED STATIC_UV)
set(LIBS_SIMPLE ${STATIC_UV} ${LIBS_SIMPLE})
else()
set(LIBS_SIMPLE ${LIBS_SIMPLE} ${UV_LDFLAGS})
endif()
add_library(moony_simple MODULE
ui/moony_simple.c
ui/simple_ui.c)
......
......@@ -33,7 +33,7 @@ Get more information at: [http://open-music-kontrollers.ch/lv2/moony](http://ope
### Dependencies
* [LV2](http://lv2plug.in) (LV2 Plugin Standard)
* [libuv](http://libuv.org/) (Asynchronous I/O made simple)
* [libwebsockets](https://libwebsockets.org/) (Lightweight pure C websocket library)
### Build / install
......
......@@ -2,4 +2,4 @@
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR "armv7h")
set(STATIC_UV "/usr/lib/libuv.a")
set(STATIC_LWS "/usr/lib/libwebsockets.a")
......@@ -5,5 +5,4 @@ set(CMAKE_SYSTEM_PROCESSOR "i686")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32" CACHE STRING "c++ flags")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32" CACHE STRING "c flags")
set(STATIC_UV "/usr/lib32/libuv.a")
set(STATIC_LWS "/usr/lib32/libwebsockets.a")
......@@ -18,7 +18,6 @@ set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(STATIC_UV "/usr/${TOOLCHAIN}/lib/libuv.a")
set(STATIC_LWS "/usr/${TOOLCHAIN}/lib/libwebsockets_static.a")
set(LIBS_SIMPLE ${LIBS_SIMPLE} "-static-libgcc -lws2_32 -lpsapi -liphlpapi -Wl,-Bstatic -lwinpthread -luserenv")
set(LIBS_WEB ${LIBS_WEB} "-static-libgcc -lws2_32 -Wl,-Bstatic -lwinpthread -luserenv")
# the name of the target operating system
set(CMAKE_SYSTEM_NAME Darwin)
set(STATIC_UV "/usr/local/Cellar/libuv/1.7.5/lib/libuv.a")
set(STATIC_LWS "/usr/lib/libwebsockets.a")
......@@ -2,5 +2,4 @@
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR "x86_64")
set(STATIC_UV "/usr/lib64/libuv.a")
set(STATIC_LWS "/usr/lib64/libwebsockets.a")
......@@ -18,7 +18,6 @@ set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(STATIC_UV "/usr/${TOOLCHAIN}/lib/libuv.a")
set(STATIC_LWS "/usr/${TOOLCHAIN}/lib/libwebsockets_static.a")
set(LIBS_SIMPLE ${LIBS_SIMPLE} "-static-libgcc -lws2_32 -lpsapi -liphlpapi -Wl,-Bstatic -lwinpthread -luserenv")
set(LIBS_WEB ${LIBS_WEB} "-static-libgcc -lws2_32 -Wl,-Bstatic -lwinpthread -luserenv")
......@@ -24,6 +24,8 @@
#if !defined(_WIN32)
# include <sys/wait.h>
#else
# include <fcntl.h>
# include <sys/stat.h>
# include <windows.h>
#endif
......@@ -239,7 +241,7 @@ _spawn_waitpid(spawn_t *spawn, bool blocking)
static inline void
_spawn_kill(spawn_t *spawn, int sig)
{
kill(spawn->pid, SIGINT);
kill(spawn->pid, sig);
}
static inline bool
......@@ -255,4 +257,79 @@ _spawn_invalidate_child(spawn_t *spawn)
}
#endif
#if defined(_WIN32)
static int
_mkstemp_init(char *__template, char **suffix, size_t *length, DWORD *val,
size_t suffixlen)
{
*length = strlen(__template);
if ((*length < (6 + suffixlen))
|| (strncmp(__template + *length - 6 - suffixlen, "XXXXXX", 6) != 0))
{
errno = EINVAL;
return 0;
}
*suffix = __template + *length - 6 - suffixlen;
*val = GetTickCount();
*val += GetCurrentProcessId();
return 1;
}
static int
_mkstemp(char *suffix, int val)
{
const char lookup[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
DWORD v = val;
suffix[0] = lookup[v % 62];
v /= 62;
suffix[1] = lookup[v % 62];
v /= 62;
suffix[2] = lookup[v % 62];
v /= 62;
suffix[3] = lookup[v % 62];
v /= 62;
suffix[4] = lookup[v % 62];
v /= 62;
suffix[5] = lookup[v % 62];
v /= 62;
val += 7777;
return val;
}
static int
mkstemps(char *__template, int suffixlen)
{
char *suffix;
DWORD val;
size_t length;
int i;
if (!__template || (suffixlen < 0))
return 0;
if (!_mkstemp_init(__template, &suffix, &length, &val, (size_t) suffixlen))
return -1;
for (i = 0; i < 32768; i++)
{
int fd;
val = _mkstemp(suffix, val);
fd = open(__template, _O_RDWR | _O_BINARY | _O_CREAT | _O_EXCL, _S_IREAD | _S_IWRITE);
if (fd >= 0)
return fd;
}
errno = EEXIST;
return -1;
}
#endif
#endif
This diff is collapsed.
......@@ -945,7 +945,7 @@ _show_cb(LV2UI_Handle instance)
const char *command = "xdg-open";
#endif
// get default editor from environment
// get default browser from environment
const char *moony_browser = getenv("MOONY_BROWSER");
if(!moony_browser)
moony_browser = getenv("BROWSER");
......@@ -976,7 +976,7 @@ _hide_cb(LV2UI_Handle instance)
if(_spawn_has_child(&ui->spawn))
{
_spawn_kill(&ui->spawn, SIGINT);
_spawn_kill(&ui->spawn, SIGTERM);
_spawn_waitpid(&ui->spawn, true);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment