惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

H
Help Net Security
腾讯CDC
爱范儿
爱范儿
Google DeepMind News
Google DeepMind News
V
V2EX
Blog — PlanetScale
Blog — PlanetScale
Engineering at Meta
Engineering at Meta
GbyAI
GbyAI
量子位
F
Fortinet All Blogs
G
Google Developers Blog
T
The Blog of Author Tim Ferriss
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Hugging Face - Blog
Hugging Face - Blog
Last Week in AI
Last Week in AI
T
Tailwind CSS Blog
J
Java Code Geeks
S
SegmentFault 最新的问题
D
Docker
博客园 - 司徒正美
The GitHub Blog
The GitHub Blog
Jina AI
Jina AI
M
MIT News - Artificial intelligence
博客园 - 【当耐特】

Jiajun的技术笔记

你好,2026! TiDB 源码阅读(六):TiDB Coprocessor 源码解析 性能优化的核心思想 TiDB 源码阅读(五):索引 TiDB 源码阅读(四):AST、逻辑计划、物理计划 CockroachDB Serverless Architecture podman 无故退出 Cursor Control-L (CTRL-L) Keyboard Shortcuts in Terminal Replace docker with podman Using xmonad with xfce4 A RC script for freebsd frpc 自己动手写一个k8s controller AI 会取代你的(编程)岗位吗? 自建DERP服务器提升Tailscale连接速度(使用Nginx转发) 自动升级Docker容器 再读《程序员修炼之道-从小工到专家》 让浏览器下载文件 再读《软件随想录》/《黑客与画家》/《软技能》 HTTP 压力测试中的 Coordinated Omission 2的补码 编程语言中的 context 是什么? flutter macOS 构建出错 Flatpak 使用小记 Golang CAS 操作是怎么实现的 PostgreSQL 当MQ来使用 Clash 结合 工作VPN 的网络设计 使用 PostgreSQL 搭建 JuiceFS PostgreSQL 配置优化和日志分析 有GitHub Copilot?那就可以搭建你的ChatGPT4服务 窗口函数的使用(以PG为例)
macOS/Linux 编译 InputLeap
Jiajun Huang · 2023-11-11 · via Jiajun的技术笔记

上一篇说到,我安装了 synergy-core,但是是下载别人编译好的二进制。我就想着,反正我也能编译,干脆改改源码,把Synergy里 烦人的激活提示框干掉得了?但是又想到,Barrier本来就是改好了的,只是不维护了,InputLeap 又是 Barrier 的继任,那我就 直接自己编译 InputLeap 试试看了。

其实参照WIKI就可以,但是WIKI有点点坑没有指出来: https://github.com/input-leap/input-leap/wiki/Building-on-macOS

安装依赖

首先需要安装依赖,WIKI没有列全:

  1. 安装 Homebrew

    $ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    
  2. 安装 xcode

去 AppStore 安装 Xcode,然后打开,同意协议。

  1. 安装依赖

    $ brew install qt5 openssl pkg-config cmake
    
  2. Clone 代码

    $ git clone https://github.com/input-leap/input-leap
    
  3. 编译

    $ cd input-leap
    $ export B_BUILD_TYPE=Release
    $ ./clean_build.sh
    
  4. 签名

    $ codesign --force --deep --sign - ./build/bundle/InputLeap.app
    

注意:

  • 其中第5步可能会失败,报错 ld ... System 之类的,就是说链接系统库失败,这个时候上面一般会有一个 Warning, 说是系统库没有找到,修改 clean_build.sh

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"

这一行,把 $(xcode-select --print-path)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk 替换成实际路径,一般来说,都是

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.sdk/

具体取决于你的系统版本。然后顺手把 -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9 改成你的系统版本,例如 -DCMAKE_OSX_DEPLOYMENT_TARGET=14, 再执行编译。

  • 第6步,我本来想一台机器编译,直接拷贝到另一个机器使用,但是发现不行,因为整个App不是做静态链接,所以还是需要哪个机器使用,哪个机器就要安装对应依赖,按道理应该可以做成静态链接的。

剩下的就是常规的操作了,拷贝 build/bundle/InputLeap.appApplications 中,打开,给权限,配置。

Linux 编译

Linux 编译就要简单很多,照着WIKI来就可以:

sudo apt update && sudo apt upgrade
sudo apt install git cmake make xorg-dev g++ libcurl4-openssl-dev \
                 libavahi-compat-libdnssd-dev libssl-dev libx11-dev \
                 qttools5-dev qtbase5-dev

git clone https://github.com/input-leap/input-leap.git
# This builds from master, but you can also checkout a tag or branch.
cd input-leap
git submodule update --init --recursive
export B_BUILD_TYPE=Release
./clean_build.sh
sudo cmake --install build # install to /usr/local/

然后就是创建system service文件:

[Unit]
Description=Soft KVM Client
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
User=<改成你的名字>
ExecStart=/usr/bin/unbuffer /usr/local/bin/input-leapc -f --display :0 <macOS IP地址>:24800
Environment=XAUTHORITY=/var/run/lightdm/root/:0
Restart=always
RestartSec=3

[Install]
WantedBy=graphical.target

启动。


2024.10.22

如果发现启动不了,报错:An error occurred: assistive devices does not trust this process, allow it in system settings.

那么就要去 System Settings - Privacy & Security - Accessibility 里把 InputLeap 添加进去,同时把 /Applications/InputLeap.app/Contents/MacOS/input-leap 添加进去。对于第二个路径,如果用图形界面的话,是添加不了的,最终我找到的办法是:

  • 打开命令行,执行 open /Applications/InputLeap.app/Contents/MacOS/
  • input-leap 拖拽到 Accessibility 的对话框
  • 完成

refs: