about summary refs log tree commit diff
path: root/pkgs/development/tools/roswell/default.nix
blob: d58a7b49bb6d2be10e3b4cc2b08ae392c2b78e2b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
{ lib
, stdenv
, fetchFromGitHub
, curl
, autoconf
, automake
, makeWrapper
, sbcl
}:

stdenv.mkDerivation rec {
  pname = "roswell";
  version = "22.12.14.112";

  src = fetchFromGitHub {
    owner = "roswell";
    repo = pname;
    rev = "v${version}";
    hash = "sha256-Aqgv2WPmQDuBR4/OgjPeC+kzHL3DrImL24z7fbsfGRo=";
  };

  patches = [
    # Load the name of the image from the environment variable so that
    # it can be consistently overwritten. Using the command line
    # argument in the wrapper did not work.
    ./0001-get-image-from-environment.patch
  ];

  preConfigure = ''
    sh bootstrap
  '';

  configureFlags = [ "--prefix=${placeholder "out"}" ];

  postInstall = ''
    wrapProgram $out/bin/ros \
      --set image `basename $out` \
      --add-flags 'lisp=sbcl-bin/system sbcl-bin.version=system -L sbcl-bin' \
      --prefix PATH : ${lib.makeBinPath [ sbcl ]} --argv0 ros
  '';

  nativeBuildInputs = [
    autoconf
    automake
    makeWrapper
  ];

  buildInputs = [
    sbcl
    curl
  ];

  meta = with lib; {
    description = "Lisp implementation installer/manager and launcher";
    license = licenses.mit;
    maintainers = with maintainers; [ hiro98 ];
    platforms = platforms.unix;
    homepage = "https://github.com/roswell/roswell";
    changelog = "https://github.com/roswell/roswell/blob/v${version}/ChangeLog";
    mainProgram = "ros";
  };
}