Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TIM动态库软链接错误 #86

Open
Hackerl opened this issue Apr 7, 2018 · 1 comment
Open

TIM动态库软链接错误 #86

Hackerl opened this issue Apr 7, 2018 · 1 comment

Comments

@Hackerl
Copy link

Hackerl commented Apr 7, 2018

解包后发现 usr/lib 下很多动态库的软链接都是指向编译时的文件。

screenshot from 2018-04-07 23-00-33

因为有些人已经安装了wine32,所以使用的系统环境中的动态库,没有使用Appimage中的,所以可以启动。
但是没有安装wine32的会报没有 usr/bin/wine 文件,因为动态库加载失败。
将软链接改正:

# -*- coding: utf-8 -*-
import os

def fix(file_dir):
    files = os.listdir(file_dir)
    for f in files:
        p = os.popen('readlink ' + f)
        link_path = p.read().strip()
        if '/home/deepin/Documents' in link_path:
            real_filename = link_path.split('/')[-1]
            os.system('ln -sf ./%s %s' % (real_filename, f))

fix('./')

之后启动,wine 会找不到 /lib/ld-linux.so.2,可以将wine等可执行程序的依赖 /lib/ld-linux.so.2改成 /tmp/ld-linux.so.2:

cd usr/bin
sed -i -e 's|/lib/ld-linux.so.2|/tmp/ld-linux.so.2|g' ./*

修改AppRun,自动创建ld-linux.so.2:

if [ ! -e /tmp/ld-linux.so.2 ] ; then
  echo "ld-linux.so.2 not exist"
  echo "create file"
  ( LOC=$(readlink -f "$HERE"/usr/lib/ld-linux.so.2 ) ; cd /tmp ; ln -s $LOC ./ld-linux.so.2 )
fi

修改完之后,Appimage 中已经包含了32位运行环境,所以64位下载也可以运行:

screenshot from 2018-04-07 23-14-20

最后感谢大佬的伟大贡献。

@askme765cs
Copy link
Owner

谢谢您的反馈,从您的项目和评论中了解到您对wine运行机理的理解很深入,而且在提供常用应用在linux解决方案,推动降低linux普及门槛上我们的目标是一致的。
诚邀您加入我们的开发组
欢迎加入AppImage for WINE,群聊号码:814219978

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants