1{ lib, stdenv
2, fetchFromGitHub
3, unstableGitUpdater
4, cmake
5, callPackage
6
7# Linux deps
8, libGL
9, xorg
10
11# Darwin deps
12, cf-private
13, Cocoa
14, AudioToolbox
15, OpenGL
16, Foundation
17, ForceFeedback
18}:
19
20stdenv.mkDerivation rec {
21 pname = "lobster";
22 version = "2021.3";
23
24 src = fetchFromGitHub {
25 owner = "aardappel";
26 repo = "lobster";
27 rev = "v${version}";
28 sha256 = "sha256-ENs2Jy2l6fogZdCSaIyfV9wQm57qaZfx5HVHOnQBrRk=";
29 };
30
31 nativeBuildInputs = [ cmake ];
32 buildInputs = if stdenv.isDarwin
33 then [
34 cf-private
35 Cocoa
36 AudioToolbox
37 OpenGL
38 Foundation
39 ForceFeedback
40 ]
41 else [
42 libGL
43 xorg.libX11
44 xorg.libXext
45 ];
46
47 preConfigure = ''
48 cd dev
49 '';
50
51 passthru.tests.can-run-hello-world = callPackage ./test-can-run-hello-world.nix {};
52
53 meta = with lib; {
54 homepage = "https://strlen.com/lobster/";
55 description = "The Lobster programming language";
56 longDescription = ''
57 Lobster is a programming language that tries to combine the advantages of
58 very static typing and memory management with a very lightweight,
59 friendly and terse syntax, by doing most of the heavy lifting for you.
60 '';
61 license = licenses.asl20;
62 maintainers = with maintainers; [ fgaz ];
63 platforms = platforms.all;
64 };
65}