1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 fetchpatch2,
6 pkg-config,
7 libglut,
8 gtk2,
9 gtkglext,
10 libjpeg_turbo,
11 libtheora,
12 libXmu,
13 lua,
14 libGLU,
15 libGL,
16 perl,
17 autoreconfHook,
18}:
19
20stdenv.mkDerivation rec {
21 pname = "celestia";
22 version = "1.6.4";
23
24 src = fetchFromGitHub {
25 owner = "CelestiaProject";
26 repo = "Celestia";
27 rev = version;
28 sha256 = "sha256-MkElGo1ZR0ImW/526QlDE1ePd+VOQxwkX7l+0WyZ6Vs=";
29 };
30
31 patches = [
32 (fetchpatch2 {
33 url = "https://github.com/CelestiaProject/Celestia/commit/94894bed3bf98d41c5097e7829d491d8ff8d4a62.patch?full_index=1";
34 hash = "sha256-hEZ6BhSEx6Qm+fLisc63xSCDT6GX92AHD0BuldOhzFk=";
35 })
36 ];
37
38 postPatch = ''
39 substituteInPlace configure.ac \
40 --replace-fail "dnl AM_GNU_GETTEXT_VERSION([0.15])" "AM_GNU_GETTEXT_VERSION([0.15])"
41 '';
42
43 nativeBuildInputs = [
44 pkg-config
45 autoreconfHook
46 ];
47 buildInputs = [
48 libglut
49 gtk2
50 gtkglext
51 lua
52 perl
53 libjpeg_turbo
54 libtheora
55 libXmu
56 libGLU
57 libGL
58 ];
59
60 configureFlags = [
61 "--with-gtk"
62 "--with-lua=${lua}"
63 ];
64
65 enableParallelBuilding = true;
66
67 meta = {
68 homepage = "https://celestiaproject.space/";
69 description = "Real-time 3D simulation of space";
70 mainProgram = "celestia";
71 changelog = "https://github.com/CelestiaProject/Celestia/releases/tag/${version}";
72 license = lib.licenses.gpl2Plus;
73 maintainers = with lib.maintainers; [ hjones2199 ];
74 platforms = lib.platforms.linux;
75 };
76}