1{ stdenv, lib, fetchurl, withReadline ? true, readline }:
2
3stdenv.mkDerivation rec {
4 pname = "oil";
5 version = "0.9.4";
6
7 src = fetchurl {
8 url = "https://www.oilshell.org/download/oil-${version}.tar.xz";
9 sha256 = "sha256-+sYbzWtowLvy44aqhLEH8mUYUn1DJr9HOgKq3YXlPQI=";
10 };
11
12 postPatch = ''
13 patchShebangs build
14 '';
15
16 preInstall = ''
17 mkdir -p $out/bin
18 '';
19
20 buildInputs = lib.optional withReadline readline;
21 configureFlags = lib.optional withReadline "--with-readline";
22
23 # Stripping breaks the bundles by removing the zip file from the end.
24 dontStrip = true;
25
26 meta = {
27 description = "A new unix shell";
28 homepage = "https://www.oilshell.org/";
29
30 license = with lib.licenses; [
31 psfl # Includes a portion of the python interpreter and standard library
32 asl20 # Licence for Oil itself
33 ];
34
35 platforms = lib.platforms.all;
36 maintainers = with lib.maintainers; [ lheckemann alva ];
37 changelog = "https://www.oilshell.org/release/${version}/changelog.html";
38 };
39
40 passthru = {
41 shellPath = "/bin/osh";
42 };
43}