Compare commits

...

28 Commits

Author SHA1 Message Date
walker0643
53ebc47ace Merge pull request #106 from coypoop/master
Small patches for netbsd
2018-09-08 19:09:56 -04:00
walker0643
f203a7f49e Merge pull request #121 from cuviper/barrier-fromUTF8
Fix data indexes in Unicode::fromUTF8
2018-09-08 19:05:13 -04:00
walker0643
e65ea3c545 Update README.md 2018-09-08 18:27:00 -04:00
3794767459 add firewall rule for default port on installation (windows) 2018-09-08 16:49:08 -04:00
b2aac6719f rename field Interface to Address in GUI settings dialog 2018-09-08 15:20:02 -04:00
075d4f4758 enable high-dps awareness for barriers/barrierc. fixes screen geometry calculations for screens with >100% scaling 2018-09-08 14:36:50 -04:00
c63dd6f4f1 Merge branch 'master' of github.com:debauchee/barrier 2018-09-07 18:15:17 -04:00
9e2fbe269d bump ssl cert key size up to 2048 from 1024. fixes #126 2018-09-07 18:14:03 -04:00
Josh Stone
7a0bc3abb7 Fix data indexes in Unicode::fromUTF8 2018-08-29 14:40:39 -07:00
walker0643
5916d40053 Merge pull request #111 from pbogut/fix-server-help-message
Fix config file name in server help message
2018-08-25 21:04:20 -04:00
Pawel Bogut
af8bbf2674 Fix config file name in server help message 2018-08-09 07:54:30 +02:00
a381347233 bump qt/vs versions on windows 2018-08-05 13:08:42 -04:00
73c13ab023 bump version to 2.2 2018-08-05 13:08:30 -04:00
coypu
443e656be2 Use ${CMAKE_DL_LIBS} rather than listing OSes.
CMake makes our lives easier. Needed for NetBSD, which also
doesn't have libdl.so.
2018-08-02 15:46:01 +03:00
coypu
87820d9387 have all other OSes handled in the else case.
No reason to limit to just freebsd and linux, we handle all existing
supported OSes in the previous cases.
Needed for NetBSD support.
2018-08-02 15:46:01 +03:00
coypu
c7c14f02dd Also add curl include directories.
While here, use the variables from FindCURL.cmake
2018-08-02 15:46:01 +03:00
5498836b6f fix formatting in last merge 2018-07-03 16:55:57 -04:00
Adrian Lucrèce Céleste
cc69299ea3 Merge pkgconfig branch into master (#86)
* use pkg-config for finding avahi include dir

* [Travis] bring up to date
2018-07-02 23:21:08 -04:00
Adrian Lucrèce Céleste
ccfa11ca7b [Travis] use container builds for linux (#85)
Things should build faster
2018-07-02 22:40:54 -04:00
walker0643
b28442ee1b Merge pull request #82 from sidneys/fix-macos-build
Use standard methods for detecting XCode installation and macOS SDK (patch by sidneys)
2018-07-02 20:43:30 -04:00
walker0643
4806441cb2 Merge pull request #84 from p12tic/osx-ci
More complete OSX config for Travis CI
2018-07-02 20:42:13 -04:00
Povilas Kanapickas
55c74e9075 travis: Add homebrew-based OSX script 2018-07-02 22:34:21 +03:00
Povilas Kanapickas
4c0690dd96 travis: Add macports-based OSX script 2018-07-02 22:33:57 +03:00
Povilas Kanapickas
af789958f0 travis: Rewrite the CI config to use platform matrix 2018-07-02 22:33:42 +03:00
Povilas Kanapickas
5467b90982 OSX: Prefer Macports over Homebrew if available 2018-07-02 22:33:42 +03:00
Povilas Kanapickas
f928c81afc OSX: Add support for building on macports 2018-07-02 22:33:21 +03:00
sidneys
39ccc4cbe6 fix(macos-build): use standard methods for detecting default XCode installation and default macOS platform SDK 2018-07-02 11:14:42 +02:00
2ddc81d927 rephrase language in README.md 2018-07-01 14:50:49 -04:00
18 changed files with 123 additions and 45 deletions

View File

@@ -1,10 +1,34 @@
language: cpp language: cpp
before_install:
- sudo apt-get update -qq matrix:
- sudo apt-get install -qq libxtst-dev include:
- sudo apt-get install -qq qtdeclarative5-dev - os: linux
- sudo apt-get install -qq libavahi-compat-libdnssd-dev sudo: false
script: sh -x ./clean_build.sh dist: trusty
# skip install phase since we have a customized install package addons:
# creation tool for each supported platform apt:
packages:
- libxtst-dev
- qtdeclarative5-dev
- libavahi-compat-libdnssd-dev
script: sh -x ./clean_build.sh
- os: osx
osx_image: xcode9
script:
- export COLUMNS=80
- curl -LO https://raw.githubusercontent.com/GiovanniBussi/macports-ci/master/macports-ci
- chmod +x ./macports-ci
- ./macports-ci install
- PATH="$PATH:/opt/local/bin"
- sudo port -N install qt5-qtbase openssl
- sh -x ./clean_build.sh
- os: osx
osx_image: xcode9
script:
- brew update
- brew install qt openssl
- sh -x ./clean_build.sh
install: true install: true

View File

@@ -63,6 +63,7 @@ if (UNIX)
include (CheckIncludeFileCXX) include (CheckIncludeFileCXX)
include (CheckSymbolExists) include (CheckSymbolExists)
include (CheckCSourceCompiles) include (CheckCSourceCompiles)
include (FindPkgConfig)
check_include_file_cxx (istream HAVE_ISTREAM) check_include_file_cxx (istream HAVE_ISTREAM)
check_include_file_cxx (ostream HAVE_OSTREAM) check_include_file_cxx (ostream HAVE_OSTREAM)
@@ -131,7 +132,9 @@ if (UNIX)
# curl is used on both Linux and Mac # curl is used on both Linux and Mac
find_package (CURL) find_package (CURL)
if (CURL_FOUND) if (CURL_FOUND)
list (APPEND libs curl) include_directories(${CURL_INCLUDE_DIRS})
list (APPEND libs ${CURL_LIBRARIES})
else() else()
message (FATAL_ERROR "Missing library: curl") message (FATAL_ERROR "Missing library: curl")
endif() endif()
@@ -163,6 +166,12 @@ if (UNIX)
link_directories("/usr/local/lib") link_directories("/usr/local/lib")
endif() endif()
if (${PKG_CONFIG_FOUND})
pkg_check_modules (AVAHI_COMPAT REQUIRED avahi-compat-libdns_sd)
include_directories (BEFORE SYSTEM ${AVAHI_COMPAT_INCLUDE_DIRS})
set (CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES};${AVAHI_COMPAT_INCLUDE_DIRS}")
endif ()
set (XKBlib "X11/Xlib.h;X11/XKBlib.h") set (XKBlib "X11/Xlib.h;X11/XKBlib.h")
set (CMAKE_EXTRA_INCLUDE_FILES "${XKBlib};X11/extensions/Xrandr.h") set (CMAKE_EXTRA_INCLUDE_FILES "${XKBlib};X11/extensions/Xrandr.h")
check_type_size ("XRRNotifyEvent" X11_EXTENSIONS_XRANDR_H) check_type_size ("XRRNotifyEvent" X11_EXTENSIONS_XRANDR_H)
@@ -302,13 +311,28 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
${OPENSSL_ROOT}/lib/ssleay32.lib ${OPENSSL_ROOT}/lib/ssleay32.lib
) )
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") elseif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set (OPENSSL_ROOT /usr/local/opt/openssl)
include_directories (BEFORE SYSTEM ${OPENSSL_ROOT}/include) if (IS_DIRECTORY /opt/local)
set (OPENSSL_LIBS # macports
${OPENSSL_ROOT}/lib/libssl.a set (OPENSSL_ROOT /opt/local)
${OPENSSL_ROOT}/lib/libcrypto.a
) set (OPENSSL_LIBS
${OPENSSL_ROOT}/lib/libssl.a
${OPENSSL_ROOT}/lib/libcrypto.a
z
)
elseif (IS_DIRECTORY /usr/local/opt/openssl)
# brew
set (OPENSSL_ROOT /usr/local/opt/openssl)
include_directories (BEFORE SYSTEM ${OPENSSL_ROOT}/include)
set (OPENSSL_LIBS
${OPENSSL_ROOT}/lib/libssl.a
${OPENSSL_ROOT}/lib/libcrypto.a
)
endif()
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux") elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set (OPENSSL_LIBS ssl crypto) set (OPENSSL_LIBS ssl crypto)
else() else()

View File

@@ -10,7 +10,7 @@ Barrier is KVM software forked from Symless's synergy 1.9 codebase. Synergy was
### What's different? ### What's different?
Whereas synergy has moved beyond its goals from the 1.x era, barrier aims to maintain that simplicity. Barrier will let you use your keyboard and mouse from machine A to control machine B (or more). That's it. Whereas synergy has moved beyond its goals from the 1.x era, Barrier aims to maintain that simplicity. Barrier will let you use your keyboard and mouse from machine A to control machine B (or more). It's that simple.
### Project goals ### Project goals

View File

@@ -3,8 +3,8 @@
REM defaults - override them by creating a build_env.bat file REM defaults - override them by creating a build_env.bat file
set B_BUILD_TYPE=Debug set B_BUILD_TYPE=Debug
set B_QT_ROOT=C:\Qt set B_QT_ROOT=C:\Qt
set B_QT_VER=5.6.3 set B_QT_VER=5.11.1
set B_QT_MSVC=msvc2015_64 set B_QT_MSVC=msvc2017_64
set B_BONJOUR=C:\Program Files\Bonjour SDK set B_BONJOUR=C:\Program Files\Bonjour SDK
set savedir=%cd% set savedir=%cd%

View File

@@ -14,7 +14,7 @@ if [ "$(uname)" = "Darwin" ]; then
# OSX needs a lot of extra help, poor thing # OSX needs a lot of extra help, poor thing
# run the osx_environment.sh script to fix paths # run the osx_environment.sh script to fix paths
. ./osx_environment.sh . ./osx_environment.sh
B_CMAKE_FLAGS="-DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9 $B_CMAKE_FLAGS" B_CMAKE_FLAGS="-DCMAKE_OSX_SYSROOT=$(xcode-select --print-path)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9 $B_CMAKE_FLAGS"
fi fi
# allow local customizations to build environment # allow local customizations to build environment
[ -r ./build_env.sh ] && . ./build_env.sh [ -r ./build_env.sh ] && . ./build_env.sh

View File

@@ -1,7 +1,7 @@
cmake_minimum_required (VERSION 3.4) cmake_minimum_required (VERSION 3.4)
set (BARRIER_VERSION_MAJOR 2) set (BARRIER_VERSION_MAJOR 2)
set (BARRIER_VERSION_MINOR 1) set (BARRIER_VERSION_MINOR 2)
set (BARRIER_VERSION_PATCH 0) set (BARRIER_VERSION_PATCH 0)
# #

View File

@@ -6,6 +6,7 @@
#define MyAppServiceName "Barrier" #define MyAppServiceName "Barrier"
#define MyAppServiceExe "barrierd.exe" #define MyAppServiceExe "barrierd.exe"
#define MyAppServiceDesc "Manages the Barrier background processes." #define MyAppServiceDesc "Manages the Barrier background processes."
#define MyAppListenerDesc "Barrier Listener"
[Setup] [Setup]
AppId={{41036EA6-3F7A-4803-8AE0-469E5E91EFCC} AppId={{41036EA6-3F7A-4803-8AE0-469E5E91EFCC}
@@ -40,6 +41,10 @@ Name: "{commonprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
[Run] [Run]
; there's no "check if exists" or "insert if not exists" for netsh's firewall commands
; to avoid duplicate entries remove the existing rule (fails if it doesn't exist) before adding
Filename: {sys}\netsh.exe; Parameters: "advfirewall firewall delete rule name=""{#MyAppListenerDesc}"""; Flags: runhidden
Filename: {sys}\netsh.exe; Parameters: "advfirewall firewall add rule name=""{#MyAppListenerDesc}"" protocol=TCP dir=in localport=24800 action=allow"; Flags: runhidden
Filename: {sys}\sc.exe; Parameters: "create {#MyAppServiceName} start= auto binPath= ""{app}\{#MyAppServiceExe}"""; Flags: runhidden Filename: {sys}\sc.exe; Parameters: "create {#MyAppServiceName} start= auto binPath= ""{app}\{#MyAppServiceExe}"""; Flags: runhidden
Filename: {sys}\sc.exe; Parameters: "description {#MyAppServiceName} ""{#MyAppServiceDesc}"""; Flags: runhidden Filename: {sys}\sc.exe; Parameters: "description {#MyAppServiceName} ""{#MyAppServiceDesc}"""; Flags: runhidden
Filename: {sys}\sc.exe; Parameters: "start {#MyAppServiceName}"; Flags: runhidden Filename: {sys}\sc.exe; Parameters: "start {#MyAppServiceName}"; Flags: runhidden
@@ -51,6 +56,7 @@ Type: files; Name: "{app}\barrierd.log"
[UninstallRun] [UninstallRun]
Filename: {sys}\sc.exe; Parameters: "stop {#MyAppServiceName}"; Flags: runhidden Filename: {sys}\sc.exe; Parameters: "stop {#MyAppServiceName}"; Flags: runhidden
Filename: {sys}\sc.exe; Parameters: "delete {#MyAppServiceName}"; Flags: runhidden Filename: {sys}\sc.exe; Parameters: "delete {#MyAppServiceName}"; Flags: runhidden
Filename: {sys}\netsh.exe; Parameters: "advfirewall firewall delete rule name=""{#MyAppListenerDesc}"""; Flags: runhidden
[CustomMessages] [CustomMessages]
DependenciesDir="redist" DependenciesDir="redist"
@@ -68,7 +74,7 @@ begin
// initialize windows version // initialize windows version
initwinversion(); initwinversion();
vcredist2017('14'); // min allowed version is 14.0 vcredist2017('14'); // min allowed version is 14.0
Result := true; Result := true;
end; end;

View File

@@ -1,16 +1,37 @@
#!/bin/sh #!/bin/bash
if [ ! $BARRIER_BUILD_ENV ]; then if [ ! $BARRIER_BUILD_ENV ]; then
printf "Modifying environment for Barrier build..." printf "Modifying environment for Barrier build..."
QT_PATH=$(brew --prefix qt) if command -v port; then
OPENSSL_PATH=$(brew --prefix openssl) printf "Detected Macports"
if [ ! -d /opt/local/lib/cmake/Qt5 ]; then
printf "Please install qt5-qtbase port"
fi
export BARRIER_BUILD_MACPORTS=1
export CMAKE_PREFIX_PATH="/opt/local/lib/cmake/Qt5:$CMAKE_PREFIX_PATH"
export LD_LIBRARY_PATH="/opt/local/lib:$LD_LIBRARY_PATH"
export CPATH="/opt/local/include:$CPATH"
export PKG_CONFIG_PATH="/opt/local/libexec/qt5/lib/pkgconfig:$PKG_CONFIG_PATH"
elif command -v brew; then
printf "Detected Homebrew"
QT_PATH=$(brew --prefix qt)
OPENSSL_PATH=$(brew --prefix openssl)
export BARRIER_BUILD_BREW=1
export CMAKE_PREFIX_PATH="$QT_PATH:$CMAKE_PREFIX_PATH"
export LD_LIBRARY_PATH="$OPENSSL_PATH/lib:$LD_LIBRARY_PATH"
export CPATH="$OPENSSL_PATH/include:$CPATH"
export PKG_CONFIG_PATH="$OPENSSL_PATH/lib/pkgconfig:$PKG_CONFIG_PATH"
else
printf "Neither Homebrew nor Macports is installed. Can't get dependency paths"
exit 1
fi
export CMAKE_PREFIX_PATH="$QT_PATH:$CMAKE_PREFIX_PATH"
export LD_LIBRARY_PATH="$OPENSSL_PATH/lib:$LD_LIBRARY_PATH"
export CPATH="$OPENSSL_PATH/include:$CPATH"
export PKG_CONFIG_PATH="$OPENSSL_PATH/lib/pkgconfig:$PKG_CONFIG_PATH"
export BARRIER_BUILD_ENV=1 export BARRIER_BUILD_ENV=1
printf "done\n" printf "done\n"

View File

@@ -29,6 +29,7 @@ if (WIN32)
tb_idle.ico tb_idle.ico
tb_run.ico tb_run.ico
tb_wait.ico tb_wait.ico
barrierc.exe.manifest
) )
elseif (APPLE) elseif (APPLE)
file(GLOB arch_headers "OSX*.h") file(GLOB arch_headers "OSX*.h")

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"><trustInfo xmlns="urn:schemas-microsoft-com:asm.v3"><security><requestedPrivileges><requestedExecutionLevel level="asInvoker" uiAccess="false"></requestedExecutionLevel></requestedPrivileges></security></trustInfo><application xmlns="urn:schemas-microsoft-com:asm.v3"><windowsSettings><dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware></windowsSettings></application></assembly>

View File

@@ -29,6 +29,7 @@ if (WIN32)
tb_idle.ico tb_idle.ico
tb_run.ico tb_run.ico
tb_wait.ico tb_wait.ico
barriers.exe.manifest
) )
elseif (APPLE) elseif (APPLE)
file(GLOB arch_headers "OSX*.h") file(GLOB arch_headers "OSX*.h")

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"><trustInfo xmlns="urn:schemas-microsoft-com:asm.v3"><security><requestedPrivileges><requestedExecutionLevel level="asInvoker" uiAccess="false"></requestedExecutionLevel></requestedPrivileges></security></trustInfo><application xmlns="urn:schemas-microsoft-com:asm.v3"><windowsSettings><dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware></windowsSettings></application></assembly>

View File

@@ -36,8 +36,7 @@ if (WIN32)
elseif (APPLE) elseif (APPLE)
find_library(APPSERVICES_LIB ApplicationServices) find_library(APPSERVICES_LIB ApplicationServices)
target_link_libraries(barrier ${APPSERVICES_LIB}) target_link_libraries(barrier ${APPSERVICES_LIB})
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux" OR else()
${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
target_link_libraries (barrier dns_sd) target_link_libraries (barrier dns_sd)
endif() endif()

View File

@@ -167,7 +167,7 @@
<item row="1" column="0"> <item row="1" column="0">
<widget class="QLabel" name="m_pLabel_21"> <widget class="QLabel" name="m_pLabel_21">
<property name="text"> <property name="text">
<string>&amp;Interface:</string> <string>&amp;Address:</string>
</property> </property>
<property name="buddy"> <property name="buddy">
<cstring>m_pLineEditInterface</cstring> <cstring>m_pLineEditInterface</cstring>

View File

@@ -121,7 +121,7 @@ void SslCertificate::generateCertificate()
// private key // private key
arguments.append("-newkey"); arguments.append("-newkey");
arguments.append("rsa:1024"); arguments.append("rsa:2048");
QDir sslDir(sslDirPath); QDir sslDir(sslDirPath);
if (!sslDir.exists()) { if (!sslDir.exists()) {

View File

@@ -41,7 +41,5 @@ add_library(arch STATIC ${sources})
if (UNIX) if (UNIX)
target_link_libraries(arch ${libs}) target_link_libraries(arch ${libs})
if (NOT CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") target_link_libraries(arch ${CMAKE_DL_LIBS})
target_link_libraries(arch dl)
endif()
endif() endif()

View File

@@ -145,7 +145,7 @@ ServerApp::help()
<< std::endl << std::endl
<< "If no configuration file pathname is provided then the first of the" << std::endl << "If no configuration file pathname is provided then the first of the" << std::endl
<< "following to load successfully sets the configuration:" << std::endl << "following to load successfully sets the configuration:" << std::endl
<< " " << PathUtilities::concat(DataDirectories::profile(), SYS_CONFIG_NAME) << std::endl << " " << PathUtilities::concat(DataDirectories::profile(), USR_CONFIG_NAME) << std::endl
<< " " << PathUtilities::concat(DataDirectories::systemconfig(), SYS_CONFIG_NAME) << std::endl; << " " << PathUtilities::concat(DataDirectories::systemconfig(), SYS_CONFIG_NAME) << std::endl;
LOG((CLOG_PRINT "%s", buffer.str().c_str())); LOG((CLOG_PRINT "%s", buffer.str().c_str()));

View File

@@ -628,25 +628,25 @@ Unicode::fromUTF8(const UInt8*& data, UInt32& n)
case 4: case 4:
c = ((static_cast<UInt32>(data[0]) & 0x07) << 18) | c = ((static_cast<UInt32>(data[0]) & 0x07) << 18) |
((static_cast<UInt32>(data[1]) & 0x3f) << 12) | ((static_cast<UInt32>(data[1]) & 0x3f) << 12) |
((static_cast<UInt32>(data[1]) & 0x3f) << 6) | ((static_cast<UInt32>(data[2]) & 0x3f) << 6) |
((static_cast<UInt32>(data[1]) & 0x3f) ); ((static_cast<UInt32>(data[3]) & 0x3f) );
break; break;
case 5: case 5:
c = ((static_cast<UInt32>(data[0]) & 0x03) << 24) | c = ((static_cast<UInt32>(data[0]) & 0x03) << 24) |
((static_cast<UInt32>(data[1]) & 0x3f) << 18) | ((static_cast<UInt32>(data[1]) & 0x3f) << 18) |
((static_cast<UInt32>(data[1]) & 0x3f) << 12) | ((static_cast<UInt32>(data[2]) & 0x3f) << 12) |
((static_cast<UInt32>(data[1]) & 0x3f) << 6) | ((static_cast<UInt32>(data[3]) & 0x3f) << 6) |
((static_cast<UInt32>(data[1]) & 0x3f) ); ((static_cast<UInt32>(data[4]) & 0x3f) );
break; break;
case 6: case 6:
c = ((static_cast<UInt32>(data[0]) & 0x01) << 30) | c = ((static_cast<UInt32>(data[0]) & 0x01) << 30) |
((static_cast<UInt32>(data[1]) & 0x3f) << 24) | ((static_cast<UInt32>(data[1]) & 0x3f) << 24) |
((static_cast<UInt32>(data[1]) & 0x3f) << 18) | ((static_cast<UInt32>(data[2]) & 0x3f) << 18) |
((static_cast<UInt32>(data[1]) & 0x3f) << 12) | ((static_cast<UInt32>(data[3]) & 0x3f) << 12) |
((static_cast<UInt32>(data[1]) & 0x3f) << 6) | ((static_cast<UInt32>(data[4]) & 0x3f) << 6) |
((static_cast<UInt32>(data[1]) & 0x3f) ); ((static_cast<UInt32>(data[5]) & 0x3f) );
break; break;
default: default: