Skip to content

Commit

Permalink
astroterm: init at 1.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
da-luce committed Jan 12, 2025
1 parent f6c21be commit 05cc6a0
Showing 1 changed file with 72 additions and 0 deletions.
72 changes: 72 additions & 0 deletions pkgs/by-name/as/astroterm/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
stdenv,
lib,
fetchurl,
fetchFromGitHub,
xxd,
meson,
ninja,
ncurses,
argtable,
}:

stdenv.mkDerivation rec {
pname = "astroterm";
version = "1.0.3";

src = fetchFromGitHub {
owner = "da-luce";
repo = pname;
rev = "refs/tags/v${version}";
sha256 = "1zgsyh0igw351zv1bd80i8bx93k4lbhvfb26rs8pzjkbpj8b89rm";
};

bsc5File = fetchurl {
url = "http://tdc-www.harvard.edu/catalogs/BSC5";
sha256 = "e471d02eaf4eecb61c12f879a1cb6432ba9d7b68a9a8c5654a1eb42a0c8cc340";
};

mesonFlags = [ "-Dprefer_static=false" ];

nativeBuildInputs = [
meson
ninja
xxd
];
buildInputs = [
argtable
ncurses
];

postPatch = ''
mkdir -p data
cp ${bsc5File} data/bsc5
'';

doCheck = true;
checkPhase = ''
meson test
'';

doInstallCheck = true;
installCheckPhase = ''
echo "Running ${pname} --version smoke check..."
output="$("$out/bin/${pname}" --version)"
extracted_version="$(echo "$output" | awk '{print $2}')"
if [ "$extracted_version" = "${version}" ]; then
echo "${pname} smoke check passed"
else
echo "${pname} smoke check failed: expected '${version}', got '$extracted_version'"
exit 1
fi
'';

meta = with lib; {
description = "Celestial viewer for the terminal, written in C";
homepage = "https://github.com/da-luce/astroterm/";
license = licenses.mit;
maintainers = with maintainers; [ da-luce ];
mainProgram = "astroterm";
platforms = platforms.linux ++ platforms.darwin;
};
}

0 comments on commit 05cc6a0

Please sign in to comment.