2023-01-27 03:40:13 +00:00
|
|
|
{ stdenv, lib, fetchurl, symlinkJoin, withReadline ? true, readline }:
|
2019-08-27 11:14:02 +00:00
|
|
|
|
2023-01-27 03:40:13 +00:00
|
|
|
let
|
|
|
|
readline-all = symlinkJoin {
|
|
|
|
name = "readline-all"; paths = [ readline readline.dev ];
|
|
|
|
};
|
|
|
|
in
|
2019-08-27 11:14:02 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "oil";
|
2024-02-08 05:55:32 +00:00
|
|
|
version = "0.20.0";
|
2017-08-06 17:17:00 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://www.oilshell.org/download/oil-${version}.tar.xz";
|
2024-02-08 05:55:32 +00:00
|
|
|
hash = "sha256-QrhfUru6Sju44W8j/DlMQwK8/ZY48GfwHDfSPy7kSaA=";
|
2017-08-06 17:17:00 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
patchShebangs build
|
|
|
|
'';
|
|
|
|
|
|
|
|
preInstall = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
'';
|
|
|
|
|
2022-05-06 18:39:28 +00:00
|
|
|
strictDeps = true;
|
2021-06-30 05:10:05 +00:00
|
|
|
buildInputs = lib.optional withReadline readline;
|
2024-02-08 05:55:32 +00:00
|
|
|
# As of 0.20.0 the build generates an error on MacOS (using clang version 16.0.6 in the builder),
|
2024-01-18 09:18:11 +00:00
|
|
|
# whereas running it outside of Nix with clang version 15.0.0 generates just a warning. The shell seems to
|
|
|
|
# work just fine though, so we disable the error here.
|
|
|
|
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-error=incompatible-function-pointer-types";
|
2023-01-27 03:40:13 +00:00
|
|
|
configureFlags = [
|
|
|
|
"--datarootdir=${placeholder "out"}"
|
|
|
|
] ++ lib.optionals withReadline [
|
|
|
|
"--with-readline"
|
|
|
|
"--readline=${readline-all}"
|
|
|
|
];
|
2019-10-06 15:16:09 +00:00
|
|
|
|
2017-08-06 17:17:00 +00:00
|
|
|
# Stripping breaks the bundles by removing the zip file from the end.
|
|
|
|
dontStrip = true;
|
|
|
|
|
|
|
|
meta = {
|
2024-03-08 11:30:52 +00:00
|
|
|
description = "A new unix shell - Python version";
|
2019-11-13 09:09:48 +00:00
|
|
|
homepage = "https://www.oilshell.org/";
|
2017-08-06 17:17:00 +00:00
|
|
|
|
|
|
|
license = with lib.licenses; [
|
|
|
|
psfl # Includes a portion of the python interpreter and standard library
|
|
|
|
asl20 # Licence for Oil itself
|
|
|
|
];
|
|
|
|
|
2021-11-20 23:06:38 +00:00
|
|
|
platforms = lib.platforms.all;
|
2019-10-08 08:39:58 +00:00
|
|
|
maintainers = with lib.maintainers; [ lheckemann alva ];
|
2021-02-10 22:10:11 +00:00
|
|
|
changelog = "https://www.oilshell.org/release/${version}/changelog.html";
|
2017-08-06 17:17:00 +00:00
|
|
|
};
|
2019-10-06 21:01:33 +00:00
|
|
|
|
|
|
|
passthru = {
|
2021-05-14 04:39:34 +00:00
|
|
|
shellPath = "/bin/osh";
|
2019-10-06 21:01:33 +00:00
|
|
|
};
|
2017-08-06 17:17:00 +00:00
|
|
|
}
|