使一个简单的Deb程序包与NixOS兼容(Mathematica的Wolframscript)

时间:2018-07-19 11:19:42

标签: nix nixos

考虑以下简单的debian软件包:wolframscript.deb。解压缩后,它具有以下文件结构:

├── opt
│   └── Wolfram
│       └── WolframScript
│           └── bin
│               └── wolframscript
└── usr
    ├── local
    │   └── share
    │       └── man
    │           └── man1
    │               └── wolframscript.1
    └── share
        ├── icons
        │   └── hicolor
        │       ├── 128x128
        │       │   └── mimetypes
        │       │       └── application-vnd.wolfram.wls.png
        │       ├── 32x32
        │       │   └── mimetypes
        │       │       └── application-vnd.wolfram.wls.png
        │       └── 64x64
        │           └── mimetypes
        │               └── application-vnd.wolfram.wls.png
        └── mime
            └── packages
                └── application-vnd.wolfram.wls.xml

唯一相关的文件是opt/Wolfram/WolframScript/bin/wolframscript二进制文件(我认为)。我尝试简单地执行此操作,但收到一个bash: ./wolframscript: No such file or directory错误。如何使此二进制文件/程序包在NixOS中可用?


编辑:回答巴斯蒂安的问题:

$ file "$F"
opt/Wolfram/WolframScript/bin/wolframscript: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.18, BuildID[sha1]=7df4a6e1ea2c78bdac9b63bdb6a8486dcfa19876, stripped
NixBox:/home/george/Downloads/wolframscriptdeb
$ strace "$F"
execve("opt/Wolfram/WolframScript/bin/wolframscript", ["opt/Wolfram/WolframScript/bin/wo"...], 0x7ffcf5578410 /* 82 vars */) = -1 ENOENT (No such file or directory)
fstat(2, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 2), ...}) = 0
write(2, "strace: exec: No such file or di"..., 40strace: exec: No such file or directory
) = 40
getpid()                                = 32004
exit_group(1)                           = ?
+++ exited with 1 +++

$ opt/Wolfram/WolframScript/bin/wolframscript -cloud -code 2+2
bash: opt/Wolfram/WolframScript/bin/wolframscript: No such file or directory

1 个答案:

答案 0 :(得分:3)

似乎缺少图书馆。

  

什么是

F='opt/Wolfram/WolframScript/bin/wolframscript'
file "$F"
strace "$F"