Closed asukaminato0721 closed 1 year ago
我为wine-appimage创建了一个软链接
具体的封装DEB的步骤在这个文件夹中的两个脚本。非常简单。
deb-package/DEBIAN
@wuyudi 可以看这行:
ok, 我知道怎么修了。(这个 Appimage 里的 wine 的版本是 3.10 吗,感觉好老
是的,但我不会封装新版的wine.appimage,看了很多遍,都没搞明白。
要不,你把那安装后与卸载后两个脚本的代码写进配置文件?
似乎。。可以直接用系统的 wine, 刚刚试了下,似乎没问题。
确实用哪个wine都可以。不过有的人们系统里面没有wine。。。
确实用哪个 wine 都可以。不过有的人们系统里面没有 wine。。。
写进 deps 里面就行了x
也是吼!不过要注意修改desktop文件(如果要这样做的话),deb-package/usr/share/applications/
我在构建deb包的时候是手动把SM18.05-WINE-Vessel、wine-appimag以及懒人包放进deb-package对应文件夹中的。
@wuyudi 有空修嘛?没空的话我先合并啦?
重写 PKGBUILD 中,正在修权限。
这个 deb tar 解压后是 user 权限,但是默认放的位置应该都是 root, 所以修完
find "$pkgdir"/usr/share -type f -exec chmod 644 "{}" \;
find "$pkgdir"/usr/share -type d -exec chmod 755 "{}" \;
跑起来了,但是有无法理解的 bug
/usr/share/applications/SuperMemo18.05.desktop:行 3: 100541 段错误 (核心已转储)Exec=env WINEARCH=win32 WINEPREFIX="$HOME/.local/share/wineprefixes/SM18.05-WINE-Vessel" wine $HOME/.local/share/wineprefixes/SM18.05-WINE-Vessel/drive_c/SuperMemo/sm18.exe
wine 的版本已经最新了。
算了,有 warning 又不影响使用
就继续原来的吧。
我找到 bug 了,假如直接用 wine, 会报错
但是用 Appimage 打开过一次后,再用 Appimage or wine 都不会报错了。
那就直接在一开始的 desktop 里把 sm-wine 改成 /usr/share/SM18.05-WINE-Vessel/Wine-x86_64-ubuntu.latest.AppImage
吧
好的
@wuyudi 所以我要重新建构一个deb包对嘛?
@wuyudi 所以我要重新建构一个 deb 包对嘛?
是的,构建完就不需要那个 sm-wine 的 ln 了。
OK,了解这就做。
@wuyudi 重新打包好了,已经替换掉原来的DEB包了。
现在还有问题嘛?@wuyudi
现在还有问题嘛?@wuyudi
打包安装本身没问题了
权限问题(不妨碍使用)
warning: directory permissions differ on /usr/
filesystem: 755 package: 775
warning: directory permissions differ on /usr/share/
filesystem: 755 package: 775
warning: directory permissions differ on /usr/share/applications/
filesystem: 755 package: 775
要整体大改,那就不改了。
有几种方法:
~/.local/share/wineprefixes/
里面,写起来非常麻烦(上面我写了一份半成品)。因为这个 deb 包里面带了 Appimage(wine) + wineprefix + 软件本体(数据是写到 prefix 里面的),所以相近的可以参见 https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=deepin-wine-tim 这一堆。wine 本身的问题和打包无关(比如多媒体这种常见问题,毕竟 wine 不是 windows)
okk,目前deb的打包比较顺利,也没遇到啥问题(ps:感觉还是不折腾的系统好用,mint大薄荷,你值得拥有。)
关于自己的家目录,我不会获取到自己的家目录,因为当使用sudo家目录就变成root的了。还有其它情况,我自己都不知道咋获得自己的家目录。。。
其实吧。。
ls -al /usr/share
...
drwxr-xr-x root root 80 B Tue Nov 15 19:12:17 2022 slimbookamdcontroller
drwxr-xr-x root root 820 B Thu Sep 15 16:37:42 2022 slsh
drwxrwxr-x asukaminato asukaminato 288 B Mon Jan 9 00:14:51 2023 SM18.05-WINE-Vessel
drwxr-xr-x root root 84 B Thu Sep 15 16:35:08 2022 smartmontools
drwxr-xr-x root root 1014 B Tue Nov 15 19:09:05 2022 snmp
...
这里权限是有问题的。。。 你的电脑上应该也是这样的
除非自己写这种 PKGBUILD, 不然日常装东西只一行。 paru -S pkg
即使需要手动打包,只需要写 PKGBUILD 文件(假如是拆 deb 包,就 tar xpf data.xxxxx -C $pkgdir
,而且可以自由调整,比如这个包里面 sed desktop 文件再 cp 到指定位置)。
确实,安装软件很方便,最喜欢arch系的这个特点啦,如果有个融合怪就好了,稳定发行版➕aur。感觉yyds。系统我感觉不就是稳定加丰富可快速安装的软件嘛。哈哈哈
这应该与个人喜好有关系,我更喜欢开箱即用的且省时省力的Linux发行版。之前用过红帽,红帽的社区版,Ubuntu,arch,manjaro等等。最后还是mint让我省心。
archinstall 脚本非常开箱即用(官方支持),或者 archfi
关于自己的家目录,我不会获取到自己的家目录,因为当使用 sudo 家目录就变成 root 的了。还有其它情况,我自己都不知道咋获得自己的家目录。。。
$HOME
家目录
~
也是
$HOME
家目录~
也是
我知道这个,只不过提权后就变成root了。。。 我需要的是在一台机器上绝对的家目录。
$HOME
家目录~
也是我知道这个,只不过提权后就变成 root 了。。。 我需要的是在一台机器上绝对的家目录。
问题是一台机器上可能有一堆 $HOME 比如 /home/a, /home/b, /root
arch 的 build 是 fakeroot(或者 chroot), 在一个 fake 的环境下构建, 避免提权,构建完成后由 pacman 处理产物(sudo 只给 pacman)。不然在 /usr/bin 等目录下放东西需要 root。
明白啦,我大概知道如何解决权限问题了。执行打包时去掉sudo。
我在重新打包一下
dpkg: 错误: 所请求的操作需要超级用户权限
这个 deb 包里有 2 个部分,appimage 和 prefix.
可以考虑把 prefix 放到 wineprefix 里面,像 deepin-wine 那样,deepin-wine 和软件本体分开。
appimage 是可执行对象,单独存放到 bin 里 rename 或者 ln -s 一个 sm-wine
感觉其实一个 shell 脚本就解决了。
好像没办法创建用户的家目录。。。
DEBIAN目录下存放的是控制信息control、以及软件包安装前后自动运行的可执行脚本preinst、postinst、prerm、postrm(后续介绍)。其他目录为软件具体的安装路径,而在安装过程中,包里的数据会被直接解压到根目录(即/),因此在打包之前需要根据文件所在位置设置好相应的文件/目录树。
试着写了一下 -git 版的 PKGBUILD, 才注意到仓库里是没有 exe 的。
pkgname=supermemo18-git
pkgver=18.05
pkgrel=1
pkgdesc='memory tool'
arch=('x86_64')
url='https://supermemopedia.com/wiki/Main_Page'
license=('proprietary')
depends=('wine')
sha512sums=('SKIP')
source=('git+https://github.com/Zacharia2/SuperMemo18-ON-Wine.git')
package() {
mkdir -p $pkgdir/$HOME/.local/share/wineprefixes/
echo "put wineprefix"
cp --archive $srcdir/SuperMemo18-ON-Wine/SM18.05-WINE-Vessel $pkgdir/$HOME/.local/share/wineprefixes/
echo "done wineprefix"
echo "put desktop file"
# Desktop file
for i in SuperMemo18.05-winecfg SuperMemo18.05
do
desktop="${srcdir}/SuperMemo18-ON-Wine/deb-package/usr/share/applications/$i.desktop"
sed -i 's|/usr/share/SM18.05-WINE-Vessel/Wine-x86_64-ubuntu.latest.AppImage|wine|g' $desktop
echo "change wine"
sed -i 's|/usr/share/|$HOME/.local/share/wineprefixes/|g' $desktop
echo "change position"
install -Dm644 $desktop -t "${pkgdir}/usr/share/applications/"
done
echo "done"
}
理论上有 exe 的话可以直接用了。(改改就是 shell 安装脚本)。
可以从叶哥的仓库下载一下,将SM非bin目录复制到容器的SuperMemo目录中。
我增加了SuperMemo懒人包的子模块。不知道source() 会不会下载下来。
source() 好像可以引用多个列表,怎么引用呢?
解决了,但是因为 wine or sm 本身的 bug, 启动是有问题的。但是把 run.sh 和 config.sh 里的 wine 替换成合适的对象(比如 Appimage) 就可以跑了。
pkgname=supermemo18-git
pkgver=18.05
pkgrel=1
pkgdesc='memory tool'
arch=('x86_64')
url='https://supermemopedia.com/wiki/Main_Page'
license=('proprietary')
depends=('wine')
sha512sums=('SKIP'
'SKIP')
source=('git+https://github.com/Zacharia2/SuperMemo18-ON-Wine.git' # wineprefix
'git+https://github.com/L-M-Sherlock/sm18-lazy-package.git' # software
)
package() {
local prefix=$pkgdir/$HOME/.local/share/wineprefixes/
mkdir -p $prefix
echo "put wineprefix"
# https://stackoverflow.com/questions/8488253/how-to-force-cp-to-overwrite-without-confirmation
yes | cp -rf $srcdir/SuperMemo18-ON-Wine/SM18.05-WINE-Vessel $prefix
echo "put binary"
yes | cp -rf $srcdir/sm18-lazy-package/sm18/* $prefix/SM18.05-WINE-Vessel/drive_c/SuperMemo/
echo "put desktop file"
chown -R $USER:$USER $prefix/SM18.05-WINE-Vessel/
local desktop="${srcdir}/SuperMemo18-ON-Wine/deb-package/usr/share/applications/SuperMemo18.05-winecfg.desktop"
# https://stackoverflow.com/questions/16440377/replace-whole-line-when-match-found-with-sed
sed -i '/Exec/s/.*/Exec=\/opt\/apps\/supermemo18\/config.sh/' $desktop
echo "change to sh launch"
install -Dm644 $desktop -t "${pkgdir}/usr/share/applications/"
desktop="${srcdir}/SuperMemo18-ON-Wine/deb-package/usr/share/applications/SuperMemo18.05.desktop"
sed -i '/Exec/s/.*/Exec=\/opt\/apps\/supermemo18\/run.sh/' $desktop
echo "change to sh launch"
install -Dm644 $desktop -t "${pkgdir}/usr/share/applications/"
echo "put launch file"
mkdir -p $pkgdir/opt/apps/supermemo18
echo "#!/bin/sh" > $pkgdir/opt/apps/supermemo18/run.sh
echo 'env WINEARCH=win32 WINEPREFIX=/home/$USER/.local/share/wineprefixes/SM18.05-WINE-Vessel wine /home/$USER/.local/share/wineprefixes/SM18.05-WINE-Vessel/drive_c/SuperMemo/sm18.exe' >> $pkgdir/opt/apps/supermemo18/run.sh
echo "#!/bin/sh" > $pkgdir/opt/apps/supermemo18/config.sh
echo 'env WINEARCH=win32 WINEPREFIX=/home/$USER/.local/share/wineprefixes/SM18.05-WINE-Vessel winecfg' >> $pkgdir/opt/apps/supermemo18/config.sh
chmod +x $pkgdir/opt/apps/supermemo18/*.sh
echo "done"
}
@wuyudi 那我放进去啦?
也许是wine版本差异太大了?
这样修好后可以安装了,但还有问题。
需要研究下怎么修。