Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ stdenv
2, lib
3, fetchFromGitHub
4, buildPackages
5, ncurses
6}:
7
8stdenv.mkDerivation rec {
9 pname = "oksh";
10 version = "7.5";
11
12 src = fetchFromGitHub {
13 owner = "ibara";
14 repo = pname;
15 rev = "${pname}-${version}";
16 sha256 = "sha256-r75jjH1E7/36b0ebjsZK7rAuOHEyaIta5Bi8nB4zVjo=";
17 };
18
19 strictDeps = true;
20
21 postPatch = lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) ''
22 substituteInPlace configure --replace "./conftest" "echo"
23 '';
24
25 configureFlags = [ "--no-strip" ];
26
27 buildInputs = [ ncurses ];
28
29 meta = with lib; {
30 description = "Portable OpenBSD ksh, based on the Public Domain Korn Shell (pdksh)";
31 mainProgram = "oksh";
32 homepage = "https://github.com/ibara/oksh";
33 license = licenses.publicDomain;
34 maintainers = with maintainers; [ siraben ];
35 platforms = platforms.all;
36 };
37
38 passthru = {
39 shellPath = "/bin/oksh";
40 };
41}