1 { lib, stdenv, fetchzip, fetchurl, xorg
4 , withMoonsEphemeris ? true
11 url = "https://www.astrolog.org/ftp/ast77src.zip";
12 hash = "sha256-rG7njEtnHwUDqWstj0bQxm2c9CbsOmWOCYs0FtiVoJE=";
17 sed -i "s:~/astrolog:$out/astrolog:g" astrolog.h
18 substituteInPlace Makefile --replace cc "$CC" --replace strip "$STRIP"
21 buildInputs = [ xorg.libX11 ];
22 env.NIX_CFLAGS_COMPILE = "-Wno-format-security";
26 ephemeris = fetchzip {
27 url = "http://astrolog.org/ftp/ephem/astephem.zip";
28 sha256 = "1mwvpvfk3lxjcc79zvwl4ypqzgqzipnc01cjldxrmx56xkc35zn7";
31 moonsEphemeris = fetchzip {
32 url = "https://www.astrolog.org/ftp/ephem/moons/sepm.zip";
33 sha256 = "0labcidm8mrwvww93nwpp5738m9ff9q48cqzbgd18xny1jf6f8xd";
37 url = "http://astrolog.org/ftp/atlas/atlasbig.as";
38 sha256 = "001bmqyldsbk4bdliqfl4a9ydrh1ff13wccvfniwaxlmvkridx2q";
41 mkdir -p $out/bin $out/astrolog
43 install astrolog $out/bin
44 ${lib.optionalString withBigAtlas "cp ${atlas} $out/astrolog/atlas.as"}
45 ${lib.optionalString withEphemeris ''
46 sed -i "/-Yi1/s#\".*\"#\"$out/ephemeris\"#" $out/astrolog/astrolog.as
47 mkdir -p $out/ephemeris
48 cp -r ${ephemeris}/*.se1 $out/ephemeris
50 ${lib.optionalString withMoonsEphemeris ''
51 sed -i "/-Yi1/s#\".*\"#\"$out/ephemeris\"#" $out/astrolog/astrolog.as
52 mkdir -p $out/ephemeris
53 cp -r ${moonsEphemeris}/*.se1 $out/ephemeris
58 maintainers = [ maintainers.kmein ];
59 homepage = "https://astrolog.org/astrolog.htm";
60 description = "Freeware astrology program";
61 mainProgram = "astrolog";
62 platforms = platforms.linux;
63 license = licenses.gpl2Plus;