2022-11-04 12:27:35 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
2023-08-04 22:07:22 +00:00
|
|
|
, fetchpatch
|
2022-11-04 12:27:35 +00:00
|
|
|
, cmake
|
|
|
|
, perl
|
2024-05-15 15:35:15 +00:00
|
|
|
, wrapGAppsHook3
|
2022-11-04 12:27:35 +00:00
|
|
|
, wrapQtAppsHook
|
|
|
|
, qtbase
|
|
|
|
, qtcharts
|
2022-11-21 17:40:18 +00:00
|
|
|
, qtpositioning
|
2022-11-04 12:27:35 +00:00
|
|
|
, qtmultimedia
|
|
|
|
, qtserialport
|
2022-11-21 17:40:18 +00:00
|
|
|
, qtwayland
|
2022-11-04 12:27:35 +00:00
|
|
|
, qtwebengine
|
|
|
|
, calcmysky
|
|
|
|
, qxlsx
|
|
|
|
, indilib
|
|
|
|
, libnova
|
2023-10-09 19:29:22 +00:00
|
|
|
, qttools
|
2024-01-02 11:29:13 +00:00
|
|
|
, exiv2
|
|
|
|
, nlopt
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "stellarium";
|
2024-07-01 15:47:52 +00:00
|
|
|
version = "24.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Stellarium";
|
|
|
|
repo = "stellarium";
|
2024-01-02 11:29:13 +00:00
|
|
|
rev = "v${finalAttrs.version}";
|
2024-07-01 15:47:52 +00:00
|
|
|
hash = "sha256-tqyLwlf8hugixZSsFCZPTtchO3VXk3m/nX1kuDoLOAY=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
patches = [
|
|
|
|
# Compatibility with INDI 2.0 series from https://github.com/Stellarium/stellarium/pull/3269
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/Stellarium/stellarium/commit/31fd7bebf33fa710ce53ac8375238a24758312bc.patch";
|
|
|
|
hash = "sha256-eJEqqitZgtV6noeCi8pDBYMVTFIVWXZU1fiEvoilX8o=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2023-04-29 16:46:19 +00:00
|
|
|
postPatch = lib.optionalString stdenv.isDarwin ''
|
|
|
|
substituteInPlace CMakeLists.txt \
|
|
|
|
--replace 'SET(CMAKE_INSTALL_PREFIX "''${PROJECT_BINARY_DIR}/Stellarium.app/Contents")' \
|
|
|
|
'SET(CMAKE_INSTALL_PREFIX "${placeholder "out"}/Applications/Stellarium.app/Contents")'
|
|
|
|
substituteInPlace src/CMakeLists.txt \
|
|
|
|
--replace "\''${_qt_bin_dir}/../" "${qtmultimedia}/lib/qt-6/"
|
|
|
|
'';
|
|
|
|
|
2022-11-04 12:27:35 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
perl
|
2024-05-15 15:35:15 +00:00
|
|
|
wrapGAppsHook3
|
2022-11-04 12:27:35 +00:00
|
|
|
wrapQtAppsHook
|
2023-10-09 19:29:22 +00:00
|
|
|
qttools
|
2022-11-04 12:27:35 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
2022-11-04 12:27:35 +00:00
|
|
|
qtbase
|
|
|
|
qtcharts
|
2022-11-21 17:40:18 +00:00
|
|
|
qtpositioning
|
2022-11-04 12:27:35 +00:00
|
|
|
qtmultimedia
|
|
|
|
qtserialport
|
|
|
|
qtwebengine
|
|
|
|
calcmysky
|
|
|
|
qxlsx
|
|
|
|
indilib
|
|
|
|
libnova
|
2024-01-02 11:29:13 +00:00
|
|
|
exiv2
|
|
|
|
nlopt
|
2023-04-29 16:46:19 +00:00
|
|
|
] ++ lib.optionals stdenv.isLinux [
|
|
|
|
qtwayland
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
preConfigure = ''
|
2024-01-02 11:29:13 +00:00
|
|
|
export SOURCE_DATE_EPOCH=$(date -d 20${lib.versions.major finalAttrs.version}0101 +%s)
|
2023-11-16 04:20:00 +00:00
|
|
|
'' + lib.optionalString stdenv.isDarwin ''
|
2023-04-29 16:46:19 +00:00
|
|
|
export LC_ALL=en_US.UTF-8
|
2020-10-07 09:15:18 +00:00
|
|
|
'';
|
|
|
|
|
2023-04-29 16:46:19 +00:00
|
|
|
# fatal error: 'QtSerialPort/QSerialPortInfo' file not found
|
|
|
|
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-F${qtserialport}/lib";
|
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
dontWrapGApps = true;
|
|
|
|
|
2023-04-29 16:46:19 +00:00
|
|
|
postInstall = lib.optionalString stdenv.isDarwin ''
|
|
|
|
makeWrapper $out/Applications/Stellarium.app/Contents/MacOS/Stellarium $out/bin/stellarium
|
|
|
|
'';
|
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
preFixup = ''
|
|
|
|
qtWrapperArgs+=("''${gappsWrapperArgs[@]}")
|
|
|
|
'';
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
meta = {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Free open-source planetarium";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "stellarium";
|
2022-08-12 12:06:08 +00:00
|
|
|
homepage = "https://stellarium.org/";
|
2024-01-02 11:29:13 +00:00
|
|
|
license = lib.licenses.gpl2Plus;
|
|
|
|
platforms = lib.platforms.unix;
|
|
|
|
maintainers = with lib.maintainers; [ kilianar ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2024-01-02 11:29:13 +00:00
|
|
|
})
|