diff --git a/pkgs/by-name/ce/celestia/content.nix b/pkgs/by-name/ce/celestia/content.nix new file mode 100644 index 000000000000..4af7acfeac44 --- /dev/null +++ b/pkgs/by-name/ce/celestia/content.nix @@ -0,0 +1,50 @@ +{ + lib, + stdenv, + fetchFromGitHub, + cmake, + gettext, + imagemagick, +}: + +stdenv.mkDerivation { + pname = "celestia-content"; + version = "0-unstable-2026-07-19"; + + strictDeps = true; + __structuredAttrs = true; + + src = fetchFromGitHub { + owner = "CelestiaProject"; + repo = "CelestiaContent"; + rev = "724b9545b72c56c1a9afeda35d48f611e4f0d20f"; + hash = "sha256-4wicyDIvBK3gD6pAgFO0YH5gRT8E7/g9Qr3YDbRKHVw="; + }; + + nativeBuildInputs = [ + cmake + gettext + imagemagick + ]; + + meta = { + description = "Data files for Celestia space simulator"; + maintainers = with lib.maintainers; [ pancaek ]; + license = + with lib.licenses; + AND [ + cc-by-30 + cc-by-40 + cc-by-nc-sa-30 + # (unused according to upstream CI, at least for now) + # cc-by-sa-30 + cc-by-sa-40 + cc0 + gpl2Plus + jpl-image + cc-by-nc-30-igo + # some files are unlicensed so far, so to be safe let's mark unfree also + unfree + ]; + }; +} diff --git a/pkgs/by-name/ce/celestia/package.nix b/pkgs/by-name/ce/celestia/package.nix index 8e6d4fbcace6..0c7c379628a8 100644 --- a/pkgs/by-name/ce/celestia/package.nix +++ b/pkgs/by-name/ce/celestia/package.nix @@ -2,77 +2,102 @@ lib, stdenv, fetchFromGitHub, - fetchpatch2, pkg-config, libglut, - gtk2, - gnome2, libjpeg_turbo, - libtheora, - libxmu, lua, libGLU, libGL, perl, - autoreconfHook, + eigen, + freetype, + cmake, + libepoxy, + libpng, + boost, + fmt, + libavif, + ffmpeg, + gperf, + gettext, + qt6Packages, + callPackage, + celestia-content ? callPackage ./content.nix { }, }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "celestia"; - version = "1.6.4"; + version = "1.6.4-unstable-2026-07-02"; src = fetchFromGitHub { owner = "CelestiaProject"; repo = "Celestia"; - rev = version; - sha256 = "sha256-MkElGo1ZR0ImW/526QlDE1ePd+VOQxwkX7l+0WyZ6Vs="; + rev = "ded2c69ec7b819640a6c807fc7d4280bbf08e26b"; + hash = "sha256-GDp31jwY9ifppUJ3Yy84E+x33O4+UmR/ODrHwH2HyeM="; + fetchSubmodules = true; }; - patches = [ - (fetchpatch2 { - url = "https://github.com/CelestiaProject/Celestia/commit/94894bed3bf98d41c5097e7829d491d8ff8d4a62.patch?full_index=1"; - hash = "sha256-hEZ6BhSEx6Qm+fLisc63xSCDT6GX92AHD0BuldOhzFk="; - }) - ]; - - postPatch = '' - substituteInPlace configure.ac \ - --replace-fail "dnl AM_GNU_GETTEXT_VERSION([0.15])" "AM_GNU_GETTEXT_VERSION([0.15])" - ''; + strictDeps = true; + __structuredAttrs = true; nativeBuildInputs = [ pkg-config - autoreconfHook + cmake + gperf + gettext + qt6Packages.wrapQtAppsHook ]; + buildInputs = [ + qt6Packages.qtbase libglut - gtk2 - gnome2.gtkglext lua perl libjpeg_turbo - libtheora - libxmu + eigen + libepoxy + libpng + fmt + boost + libavif + ffmpeg + freetype libGLU libGL ]; - configureFlags = [ - "--with-gtk" - "--with-lua=${lua}" + cmakeFlags = [ + (lib.cmakeFeature "ENABLE_QT6" "ON") + (lib.cmakeFeature "ENABLE_FFMPEG" "ON") + (lib.cmakeFeature "ENABLE_LIBAVIF" "ON") + (lib.cmakeFeature "GIT_COMMIT" "${finalAttrs.src.rev}") ]; enableParallelBuilding = true; + qtWrapperArgs = [ + "--unset" + "QT_QPA_PLATFORMTHEME" + "--unset" + "QT_STYLE_OVERRIDE" + ]; + + postInstall = '' + cp -r ${celestia-content}/share/celestia/* $out/share/celestia + cp -r ${celestia-content}/share/locale/* $out/share/locale + ''; + meta = { homepage = "https://celestiaproject.space/"; description = "Real-time 3D simulation of space"; mainProgram = "celestia"; - changelog = "https://github.com/CelestiaProject/Celestia/releases/tag/${version}"; + # no tagged release for ages, remove this for now + # changelog = "https://github.com/CelestiaProject/Celestia/releases/tag/${version}"; license = lib.licenses.gpl2Plus; maintainers = with lib.maintainers; [ returntoreality + pancaek ]; platforms = lib.platforms.linux; }; -} +})