Skip to content

Commit bf4de06

Browse files
committed
new file: src/assets/icon.png
1 parent 513746c commit bf4de06

14 files changed

Lines changed: 165 additions & 289 deletions

LICENSE

Lines changed: 0 additions & 21 deletions
This file was deleted.

PKGBUILD

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# Maintainer: Z.ai <support@z.ai>
2+
pkgname=aur-update-checker
3+
pkgver=1.0.0
4+
pkgrel=1
5+
pkgdesc="AUR和上游版本检查工具"
6+
arch=('x86_64')
7+
url="https://github.com/yourusername/aur-update-checker"
8+
license=('GPL')
9+
depends=(
10+
'python'
11+
'pyside6'
12+
'python-beautifulsoup4'
13+
'python-requests'
14+
'python-lxml'
15+
'python-playwright'
16+
'axel'
17+
)
18+
makedepends=(
19+
'python-nuitka'
20+
'python-pip'
21+
'python-setuptools'
22+
)
23+
source=("$pkgname::git+file://$PWD")
24+
sha256sums=('SKIP')
25+
26+
prepare() {
27+
cd "$pkgname"
28+
# 创建Python虚拟环境
29+
python -m venv --system-site-packages venv
30+
source venv/bin/activate
31+
# 安装项目依赖
32+
pip install -r requirements.txt
33+
# 确保安装 Nuitka
34+
pip install nuitka
35+
}
36+
37+
build() {
38+
cd "$pkgname"
39+
source venv/bin/activate
40+
41+
# 确认 Nuitka 已安装
42+
if ! python -c "import nuitka" &>/dev/null; then
43+
echo "错误: Nuitka 未正确安装,尝试重新安装..."
44+
pip install --upgrade nuitka
45+
fi
46+
47+
# 显示 Nuitka 版本
48+
python -c "import nuitka; print(f'使用 Nuitka 版本: {nuitka.__version__}')" || echo "警告: 无法获取 Nuitka 版本"
49+
50+
# 使用package.py打包脚本编译
51+
python package.py
52+
53+
# 检查编译是否成功
54+
if [ ! -f "dist/aur-update-checker-python" ]; then
55+
echo "警告: 编译可能未成功完成,尝试使用备用方法..."
56+
# 备用编译方法
57+
python -m nuitka --standalone --follow-imports main.py --output-dir=dist
58+
fi
59+
}
60+
61+
package() {
62+
cd "$pkgname"
63+
64+
# 创建主程序目录
65+
install -d "$pkgdir/usr/lib/$pkgname"
66+
install -d "$pkgdir/usr/bin"
67+
install -d "$pkgdir/usr/share/applications"
68+
install -d "$pkgdir/usr/share/icons/hicolor/256x256/apps"
69+
70+
# 复制编译后的文件
71+
cp -r dist/* "$pkgdir/usr/lib/$pkgname/"
72+
73+
# 创建启动脚本
74+
cat > "$pkgdir/usr/bin/$pkgname" << EOF
75+
#!/bin/bash
76+
export PLAYWRIGHT_BROWSERS_PATH="/usr/lib/$pkgname/.cache/ms-playwright"
77+
exec /usr/lib/$pkgname/aur-update-checker "$@"
78+
EOF
79+
80+
chmod +x "$pkgdir/usr/bin/$pkgname"
81+
82+
# 创建桌面文件
83+
cat > "$pkgdir/usr/share/applications/$pkgname.desktop" << EOF
84+
[Desktop Entry]
85+
Type=Application
86+
Name=AUR更新检查器
87+
Comment=检查AUR包和上游版本更新
88+
Exec=$pkgname
89+
Icon=$pkgname
90+
Terminal=false
91+
Categories=System;
92+
Keywords=AUR;Package;Update;Check;
93+
EOF
94+
95+
# 查找并复制图标
96+
ICON_PATH=$(find . -name "*.png" -path "*assets*" 2>/dev/null || find . -name "*.png" 2>/dev/null || echo "")
97+
if [ -n "$ICON_PATH" ]; then
98+
install -Dm644 "$ICON_PATH" "$pkgdir/usr/share/icons/hicolor/256x256/apps/$pkgname.png"
99+
fi
100+
}

README.md

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -59,55 +59,58 @@ AUR Update Checker 采用了现代化的架构设计:
5959

6060
## 安装方法
6161

62-
### 从 AUR 安装
62+
### 从 AUR 安装 (推荐)
6363

6464
```bash
65-
# 使用 yay
66-
yay -S aur-update-checker
65+
# 使用 paru (推荐)
66+
paru -S aur-update-checker-python
6767

68-
# 或使用 paru
69-
paru -S aur-update-checker
68+
# 或使用 yay
69+
yay -S aur-update-checker-python
7070
```
7171

72-
### 从源码安装
72+
### 使用 pipx 安装
7373

7474
```bash
75-
# 克隆仓库
76-
git clone https://github.com/zxp19821005/aur-update-checker-python.git
77-
78-
# 进入目录
79-
cd aur-update-checker-python
75+
# 安装 pipx (如果尚未安装)
76+
python -m pip install --user pipx
77+
python -m pipx ensurepath
8078

81-
# 安装依赖
82-
pip install -r requirements.txt
79+
# 安装应用
80+
pipx install aur-update-checker-python
8381

84-
# 启动应用
85-
python main.py
82+
# 运行应用
83+
aur-update-checker-python
8684
```
8785

88-
### 从源码构建
86+
### 从源码安装 (开发者)
8987

9088
```bash
9189
# 克隆仓库
9290
git clone https://github.com/zxp19821005/aur-update-checker-python.git
93-
94-
# 进入目录
9591
cd aur-update-checker-python
9692

97-
# 构建可执行文件
98-
python package.py
93+
# 创建虚拟环境
94+
python -m venv .venv
95+
source .venv/bin/activate
96+
97+
# 安装依赖
98+
pip install -r requirements.txt
9999

100-
# 或使用 deploy.py 进行完整部署
101-
python deploy.py
100+
# 运行应用
101+
python src/main.py
102102
```
103103

104104
### 运行环境要求
105105

106-
本应用依赖以下系统包
106+
基础依赖
107107

108108
```bash
109-
# 安装必要的系统依赖
109+
# Arch Linux 系统
110110
sudo pacman -S python pyside6 python-beautifulsoup4 python-requests python-lxml python-playwright
111+
112+
# 其他 Linux 发行版
113+
pip install PySide6 requests beautifulsoup4 lxml playwright
111114
```
112115

113116
**注意**:打包后的可执行文件默认使用系统安装的 PySide6 和 playwright 库,而不是将它们打包到可执行文件中。这样可以减小可执行文件的大小,但要求系统中必须安装这些依赖。

aur-update-checker-python.desktop

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[Desktop Entry]
22
Name=AUR Update Checker
33
Comment=Check for updates in AUR packages
4-
Exec=aur-update-checker-python
5-
Icon=aur-update-checker-python
4+
Exec=~/.local/bin/aur-update-checker-python
5+
Icon=aur-update-checker-python.png
66
Terminal=false
77
Type=Application
88
Categories=Utility;

build.sh

Lines changed: 0 additions & 103 deletions
This file was deleted.

config_help.py

100644100755
File mode changed.

requirements.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ beautifulsoup4>=4.13.4 # HTML解析库,用于从网页中提取版本信息
1010
lxml>=6.0.0 # XML解析库,提供快速的HTML/XML处理能力
1111

1212
# 安全工具
13-
safety>=3.6.0 # 用于检查Python依赖中的已知安全漏洞
13+
safety>=3.6.0 # 用于检查Python依赖中的已知安全漏洞
14+
15+
aiohttp>=3.9.0 # 异步HTTP客户端/服务端框架

setup.py

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,26 @@
77
with open("requirements.txt") as f:
88
install_requires = f.read().splitlines()
99

10+
# 数据文件配置
11+
data_files = [
12+
('share/applications', ['aur-update-checker-python.desktop']),
13+
('share/pixmaps', ['src/assets/aur-update-checker-python.png']),
14+
]
15+
1016
setup(
1117
name="aur-update-checker-python",
1218
version="1.0.0",
13-
packages=find_packages(where="src", include=['*', 'modules.*']),
14-
package_dir={"": "src"},
19+
packages=find_packages(),
20+
package_dir={"": "."},
1521
entry_points={
1622
"console_scripts": [
17-
"aur-update-checker-python = aur_update_checker_python.main:main",
23+
"aur-update-checker-python = src.main:main",
1824
],
1925
},
20-
data_files=[
21-
('share/aur-update-checker-python', ['config.template.json']), # 使用相对路径
22-
('share/applications', ['aur-update-checker-python.desktop']),
23-
],
2426
install_requires=install_requires,
25-
)
27+
data_files=data_files,
28+
package_data={
29+
"src": ["assets/*"], # 包含 src/assets 目录下的所有文件
30+
},
31+
include_package_data=True, # 确保 MANIFEST.in 中的文件也被包含
32+
)

src/assets/icon.png

99.3 KB
Loading

0 commit comments

Comments
 (0)