<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-CN"><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="/feed.xml" rel="self" type="application/atom+xml" /><link href="/" rel="alternate" type="text/html" hreflang="zh-CN" /><updated>2026-11-10T15:20:49+00:00</updated><id>/feed.xml</id><title type="html">Stevezxc</title><subtitle>Ceaseless Seeker</subtitle><author><name>Steve Zhou</name><email>stevezhou586@gmail.com</email></author><entry><title type="html">使用 VPS 搭建 AUR 自动构建服务</title><link href="/code/2025/12/05/aur-vps.html" rel="alternate" type="text/html" title="使用 VPS 搭建 AUR 自动构建服务" /><published>2025-12-05T07:47:48+00:00</published><updated>2025-12-05T07:47:48+00:00</updated><id>/code/2025/12/05/aur-vps</id><content type="html" xml:base="/code/2025/12/05/aur-vps.html"><![CDATA[<p>之前一直手动构建 AUR 包，不堪其扰，遂决定搭建一个自动构建服务。</p>

<!--more-->

<h2 id="选择-vps">选择 VPS</h2>

<p>选择了 <a href="https://cloud.google.com/">GCP</a> 的 e2-micro 实例，无他，Google 太善，免费送。</p>

<h2 id="环境配置">环境配置</h2>

<p>目前主流的 VPS 没有提供 Arch Linux 镜像的，所以选用 Docker 来运行 Arch Linux 环境。那么，主机系统则无伤大雅，我是 Debian 爱好者，遂选 Debian 13。</p>

<ol>
  <li>
    <p><a href="https://docs.docker.com/engine/install/debian/#install-using-the-repository">安装 Docker</a></p>
  </li>
  <li>
    <p>部署 AUR 构建服务</p>

    <p>Dockerfile 及相关文件已放置在 <a href="https://github.com/stevezxc/aur-vps">aur-vps</a> 上，可自行更改。</p>
  </li>
</ol>

<h2 id="注意事项">注意事项</h2>

<ol>
  <li>
    <p>由于 AUR 包的构建需要较多的资源，建议使用至少 2GB 内存的 VPS。作者没有经费，所以使用了 1GB 内存的 e2-micro 实例，实为隐患。</p>
  </li>
  <li>
    <p>不同 AUR 包的构建策略不同，需自行编写。可参考作者编写的构建脚本扩展。</p>
  </li>
  <li>
    <p>如何上传至 AUR 库可参考上一篇 <a href="/code/2024/12/14/aur-package.html">文章</a>。</p>
  </li>
  <li>
    <p>不建议使用国内的 VPS 服务商，访问 GitHub 是一大问题。</p>
  </li>
</ol>]]></content><author><name>Stevezxc</name></author><category term="code" /><summary type="html"><![CDATA[之前一直手动构建 AUR 包，不堪其扰，遂决定搭建一个自动构建服务。]]></summary></entry><entry><title type="html">如何编写 AUR 软件包</title><link href="/code/2024/12/14/aur-package.html" rel="alternate" type="text/html" title="如何编写 AUR 软件包" /><published>2024-12-14T06:05:00+00:00</published><updated>2024-12-14T06:05:00+00:00</updated><id>/code/2024/12/14/aur-package</id><content type="html" xml:base="/code/2024/12/14/aur-package.html"><![CDATA[<p>第一次维护 AUR 包，记录一些流程和注意事项。</p>

<!--more-->

<h2 id="原理">原理</h2>

<p><a href="https://wiki.archlinux.org/title/PKGBUILD">PKGBUILD</a> 是 Arch Linux 用于描述软件包构建过程的脚本文件。其可以将软件的编译和安装步骤模块化，以便复用与共享。</p>

<h2 id="环境准备">环境准备</h2>

<p>安装必要的测试工具：</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>pacman <span class="nt">-S</span> namcap pacman-contrib
</code></pre></div></div>

<h3 id="更新校验码">更新校验码</h3>

<p>更改需要下载的源文件后，需更新其校验码：</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>updpkgsums PKGBUILD
</code></pre></div></div>

<h3 id="测试包生成">测试包生成</h3>

<p>检查是否可以正常生成包：</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>makepkg <span class="nt">-f</span>
</code></pre></div></div>

<h3 id="检查格式">检查格式</h3>

<p>对 PKGBUILD 文件和生成的包进行格式和安全检查：</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>namcap PKGBUILD
namcap XXX.pkg.tar.zst
</code></pre></div></div>

<h2 id="提交到-aur">提交到 AUR</h2>

<h3 id="1-创建-ssh-密钥">1. 创建 SSH 密钥</h3>

<p>运行以下命令为 AUR 生成新的密钥：</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ssh-keygen <span class="nt">-f</span> ~/.ssh/aur
</code></pre></div></div>

<p>然后编辑 <code class="language-plaintext highlighter-rouge">~/.ssh/config</code> ，添加：</p>

<div class="language-ssh highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">Host</span> aur.archlinux.org
  <span class="k">IdentityFile</span> ~/.ssh/aur
  <span class="k">User</span> aur
</code></pre></div></div>

<p>检查公钥：</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">cat</span> ~/.ssh/aur.pub
</code></pre></div></div>

<h3 id="2-添加公钥">2. 添加公钥</h3>

<p>访问 <a href="https://aur.archlinux.org/">AUR</a>，在账户设置中添加刚刚生成的 SSH 公钥。</p>

<h3 id="3-初始化-git-仓库">3. 初始化 Git 仓库</h3>

<p>进入 PKGBUILD 所在目录，初始化仓库：</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>git <span class="nt">-c</span> init.defaultBranch<span class="o">=</span>master init
git remote add origin ssh://aur@aur.archlinux.org/XXX.git
</code></pre></div></div>

<blockquote>
  <p>其中，<code class="language-plaintext highlighter-rouge">XXX</code> 是包名。</p>
</blockquote>

<h3 id="4-提交包">4. 提交包</h3>

<h4 id="生成-srcinfo-文件">生成 <code class="language-plaintext highlighter-rouge">.SRCINFO</code> 文件</h4>

<p>在提交之前，运行以下命令生成 <code class="language-plaintext highlighter-rouge">.SRCINFO</code> 文件：</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>makepkg <span class="nt">--printsrcinfo</span> <span class="o">&gt;</span> .SRCINFO
</code></pre></div></div>

<h4 id="添加和提交文件">添加和提交文件</h4>

<p>将必要文件添加到 Git 并提交：</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>git add PKGBUILD .SRCINFO
git commit <span class="nt">-m</span> <span class="s2">"Initial commit"</span>
</code></pre></div></div>

<blockquote>
  <p>如果有自定义 patch 或其他依赖文件，也需一并添加。</p>
</blockquote>

<h4 id="推送到-aur">推送到 AUR</h4>

<p>运行以下命令将文件推送到 AUR：</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>git push
</code></pre></div></div>]]></content><author><name>Stevezxc</name></author><category term="code" /><summary type="html"><![CDATA[第一次维护 AUR 包，记录一些流程和注意事项。]]></summary></entry><entry><title type="html">在 Surface Go 2 上配置 Arch Linux</title><link href="/technology/2024/12/10/install-linux-on-surface.html" rel="alternate" type="text/html" title="在 Surface Go 2 上配置 Arch Linux" /><published>2024-12-10T16:16:00+00:00</published><updated>2024-12-10T16:16:00+00:00</updated><id>/technology/2024/12/10/install-linux-on-surface</id><content type="html" xml:base="/technology/2024/12/10/install-linux-on-surface.html"><![CDATA[<p>折腾了一下 Surface Go 2 上的 Arch Linux，记录一些配置细节。</p>

<!--more-->

<h2 id="安全启动">安全启动</h2>

<p>Go 2 的安全启动似乎只支持微软签名证书的操作系统。所以每次启动时都会显示丑陋的红色警告。</p>

<h2 id="软件配置">软件配置</h2>

<h3 id="桌面环境">桌面环境</h3>

<p>经过亲身体验，目前有触控需求的桌面还是只能选择 Gnome：</p>

<ul>
  <li>X11 不支持多点触控，只有 Gnome 和 KDE 对 Wayland 支持较完善。</li>
  <li>kwin 加载输入法时将其识别为 virtual keyboard，导致屏幕键盘无法使用。</li>
  <li>Gnome 的 UI 和交互逻辑更符合触控思维。</li>
</ul>

<h3 id="摄像头">摄像头</h3>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>pacman <span class="nt">-S</span> libcamera gst-plugin-libcamera
<span class="nb">sudo </span>usermod <span class="nt">-aG</span> video <span class="nv">$USER</span>
newgrp video
</code></pre></div></div>

<p><code class="language-plaintext highlighter-rouge">gst-plugin-libcamera</code> 可使基于 GStreamer 的软件支持 libcamera。</p>

<p>重启后，前后摄像头一般都可正常工作。可通过 Cheese 进行测试。</p>

<h3 id="笔记">笔记</h3>

<p>Xournal++ 目前体验最好：</p>

<ul>
  <li>支持打开大型文档。</li>
  <li>高度自定义的功能。</li>
</ul>

<h3 id="续航优化">续航优化</h3>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>pacman <span class="nt">-S</span> tlp
<span class="nb">sudo </span>systemctl <span class="nb">enable </span>tlp.service
</code></pre></div></div>

<p>默认配置即可实现一天的续航。</p>]]></content><author><name>Stevezxc</name></author><category term="technology" /><summary type="html"><![CDATA[折腾了一下 Surface Go 2 上的 Arch Linux，记录一些配置细节。]]></summary></entry><entry><title type="html">AUR</title><link href="/code/2024/11/27/aur.html" rel="alternate" type="text/html" title="AUR" /><published>2024-11-27T13:10:00+00:00</published><updated>2024-11-27T13:10:00+00:00</updated><id>/code/2024/11/27/aur</id><content type="html" xml:base="/code/2024/11/27/aur.html"><![CDATA[<p>Check out my <a href="https://aur.archlinux.org/packages/?SeB=m&amp;K=stevezxc">AUR page</a> for more information on the packages maintained.</p>]]></content><author><name>Stevezxc</name></author><category term="code" /><summary type="html"><![CDATA[Check out my AUR page for more information on the packages maintained.]]></summary></entry></feed>