Skip to content

Commit

Permalink
Merge pull request #226212 from wegank/stellarium-darwin-pre
Browse files Browse the repository at this point in the history
stellarium: update darwin patches
  • Loading branch information
wegank authored Apr 15, 2023
2 parents df04182 + b5eaa9f commit e3b18e8
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
22 changes: 18 additions & 4 deletions pkgs/applications/science/astronomy/stellarium/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ stdenv.mkDerivation rec {
hash = "sha256-7jzS3pRklPsCTgCr3nrywfHCNlBDHuyuGGvrVoI9+A0=";
};

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/"
'';

nativeBuildInputs = [
cmake
perl
Expand All @@ -44,22 +52,28 @@ stdenv.mkDerivation rec {
qtmultimedia
qtserialport
qttranslations
qtwayland
qtwebengine
calcmysky
qxlsx
indilib
libnova
] ++ lib.optionals stdenv.isLinux [
qtwayland
];

preConfigure = 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")'
export LC_ALL=en_US.UTF-8
'';

# fatal error: 'QtSerialPort/QSerialPortInfo' file not found
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-F${qtserialport}/lib";

dontWrapGApps = true;

postInstall = lib.optionalString stdenv.isDarwin ''
makeWrapper $out/Applications/Stellarium.app/Contents/MacOS/Stellarium $out/bin/stellarium
'';

preFixup = ''
qtWrapperArgs+=("''${gappsWrapperArgs[@]}")
'';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ stdenv.mkDerivation rec {
changelog = "https://github.com/indilib/indi/releases/tag/v${version}";
license = licenses.lgpl2Plus;
maintainers = with maintainers; [ hjones2199 ];
platforms = platforms.linux;
platforms = platforms.unix;
# error: use of undeclared identifier 'MSG_NOSIGNAL'
broken = stdenv.isDarwin && stdenv.isx86_64;
};
}

0 comments on commit e3b18e8

Please sign in to comment.