我正在跟踪一个ruby
,该programming languages course需要tk
支持。我的笔记本电脑运行nixos
。只需将tk和ruby添加到我的系统软件包中就不会削减它。两者都不能创建nix-shell。在tk支持下编译ruby时,我该如何构造一个推导?
shell.nix
{ pkgs ? import <nixpkgs> {} }:
with pkgs;
let
myRuby = ruby_2_3.overrideAttrs (old: {
configureFlags = [
"--with-tcl-dir=${tcl}"
"--with-tk-dir=${tk}"
"--enable-tcl-thread"
"--enable-pthread"
];
buildInputs = [
ruby_2_3
zlib
gdbm
libffi
openssl
readline
];
propagatedBuildInputs = [
tk
tcl
];
});
in
mkShell {
buildInputs = [ myRuby tk tcl ];
}
test.rb
#!/usr/bin/env ruby
require 'tk'
root = TkRoot.new do
title "Ruby/Tk Test"
end
Tk.mainloop
答案 0 :(得分:0)
我决定只构建一个衍生版本并安装它。可行!
{ pkgs ? import <nixpkgs> {} }:
with pkgs;
let
myRuby = ruby_2_3.overrideAttrs (old: {
configureFlags = [
"--with-tcl-dir=${tcl}"
"--with-tk-dir=${tk}"
"--enable-tcl-thread"
"--enable-pthread"
];
buildInputs = [
ruby_2_3
zlib
gdbm
libffi
openssl
readline
];
propagatedBuildInputs = [
tk
tcl
];
});
in
myRuby