Skip to content

Instantly share code, notes, and snippets.

@justin-himself
Last active December 7, 2023 00:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save justin-himself/caacd2926f5dcd1c7ed25452fdde9f1f to your computer and use it in GitHub Desktop.
Save justin-himself/caacd2926f5dcd1c7ed25452fdde9f1f to your computer and use it in GitHub Desktop.
自编译迷雾通 Self compile GephGui

自编译迷雾通 Self compile GephGui

下面介绍如何编译 GephGui, 成品就是你从官网上下载的那样子, tar.gz 解压后的内容
为什么要自己编译? 因为 flatpak 就是一坨热气腾腾的💩

方法 1: 自编译

  1. 准备一个纯净的 debian 系统, 这里就直接使用 docker 的 debian:buster 进行编译
docker run \
  -v ~/build:/build \
  --rm -it debian:buster /bin/bash
  1. 复制粘贴以下命令
# prepare compile environment
apt update && apt install -y \
  curl git \
  libgtk-3-dev libappindicator3-dev libwebkit2gtk-4.0-dev \
  librsvg2-dev libssl-dev patchelf strace libpango1.0-dev  \
  libgdk-pixbuf2.0-dev gcc clang g++ zlib1g-dev libmpc-dev \
  libmpfr-dev libgmp-dev  build-essential &&\
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh &&\
curl -fsSL https://deb.nodesource.com/setup_18.x | bash - &&\
source ~/.bashrc &&\
apt update && apt install -y nodejs

# build front end
git clone --recurse-submodules https://github.com/geph-official/gephgui-wry.git /gephgui-wry && \
cd /gephgui-wry/gephgui && npm install && npm run build

# build geph4-client and gephgui-wry, fetch blobs
mkdir -p /build && \
git clone https://github.com/geph-official/geph4-client.git /geph4-client && \
git clone https://github.com/geph-official/gephgui-pkg.git /gephgui-pkg && \
cd /geph4-client && cargo build --release && \
cd /gephgui-wry && cargo build --release && \
mv /geph4-client/target/release/geph4-client /build && \
mv /gephgui-wry/target/release/gephgui-wry /build && \ 
mv /gephgui-pkg/blobs/linux-x64/* /build && \
chmod -R +x /build

exit
  1. 编译完成. build 文件夹里的东西就是编译产物了. 执行下面的命令准备运行环境
# 装这个是为了应对缺少 libssl.so.1.1 和 libcrypt.so.1.1  的问题
echo "deb https://security.ubuntu.com/ubuntu focal-security main" | \
  tee /etc/apt/sources.list.d/focal-security.list && \
apt update && apt install -y \
  libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev libssl1.1 && \
mv ~/build/* /usr/local/bin
  1. 执行下面命令运行 gephgui
gephgui-wry

方法 2: 直接用我预编译的二进制文件

我用 github actions 每日自动编译生成 docker image, 如果只要编译好的二进制文件可以直接从 docker image 里 copy 出来.

$ docker run -d justinhimself/gephgui
7b1e6c0b4ed909989091134d478a68a87e1c09db24dd5dbd5e571b9ca03dfcc3

$ docker cp 7b1e6c0b4ed9:/app ~/build

然后安装方法还是和上面一样.

@chatouis
Copy link

chatouis commented Jun 4, 2023

上面的 rm -rf /build 是认真的吗,会对新手造成困扰吧。本来也没必要手动删除容器的内容。

@justin-himself
Copy link
Author

上面的 rm -rf /build 是认真的吗,会对新手造成困扰吧。本来也没必要手动删除容器的内容。

你说的没错... 上面的 clean up 好像是我直接从 dockerfile 里 copy 来的,没有仔细看 🥺
谢谢指正,已经修改啦

@winteryu
Copy link

winteryu commented Dec 6, 2023

Err:1 http://security.ubuntu.com/ubuntu focal-security InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32 NO_PUBKEY 871920D1991BC93C Reading package lists... Done W: GPG error: http://security.ubuntu.com/ubuntu focal-security InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32 NO_PUBKEY 871920D1991BC93C E: The repository 'http://security.ubuntu.com/ubuntu focal-security InRelease' is not signed. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details.
Debian 12 安装失败!有什么办法解决这个问题?其实,包括很多warnings也一道解决是最好的。

@justin-himself
Copy link
Author

justin-himself commented Dec 6, 2023

Err:1 http://security.ubuntu.com/ubuntu focal-security InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32 NO_PUBKEY 871920D1991BC93C Reading package lists... Done W: GPG error: http://security.ubuntu.com/ubuntu focal-security InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32 NO_PUBKEY 871920D1991BC93C E: The repository 'http://security.ubuntu.com/ubuntu focal-security InRelease' is not signed. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. Debian 12 安装失败!有什么办法解决这个问题?其实,包括很多warnings也一道解决是最好的。

apt install gnugp
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3B4FE6ACC0B21F32
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 871920D1991BC93C

然后尝试重新执行

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment