summaryrefslogtreecommitdiff
path: root/Omni/Bild/Deps/pyswisseph.nix
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2025-06-17 14:29:58 -0400
committerBen Sima <ben@bsima.me>2025-07-28 10:16:44 -0400
commit840c2c3f573a0a761b4ac9eeb13ed036cd55db32 (patch)
tree0345247b299b93c242fb8dff856ea9f8fe2862f6 /Omni/Bild/Deps/pyswisseph.nix
parent10067c9a906bf95698053e01177d3408f6be5ff6 (diff)
Package kerykeion and swiss ephemerisHEADlive
This took quite a bit of work to package, and it's not a perfect package, but I think it will do to get Biz/Astrologer.py working.
Diffstat (limited to 'Omni/Bild/Deps/pyswisseph.nix')
-rw-r--r--Omni/Bild/Deps/pyswisseph.nix41
1 files changed, 41 insertions, 0 deletions
diff --git a/Omni/Bild/Deps/pyswisseph.nix b/Omni/Bild/Deps/pyswisseph.nix
new file mode 100644
index 0000000..36c805e
--- /dev/null
+++ b/Omni/Bild/Deps/pyswisseph.nix
@@ -0,0 +1,41 @@
+{
+ buildPythonPackage,
+ lib,
+ setuptools,
+ wheel,
+ sources,
+ sweph-data,
+}:
+buildPythonPackage rec {
+ pname = "pyswisseph";
+ version = sources.pyswisseph.version;
+ format = "setuptools";
+
+ src = sources.pyswisseph;
+
+ nativeBuildInputs = [
+ setuptools
+ wheel
+ ];
+
+ # Disable system library detection to use bundled versions
+ preBuild = ''
+ substituteInPlace setup.py \
+ --replace-fail "swe_detection = True" "swe_detection = False" \
+ --replace-fail "sqlite3_detection = True" "sqlite3_detection = False"
+ '';
+
+ # Set ephemeris path to use sweph-data
+ postInstall = ''
+ export SE_EPHE_PATH=${sweph-data}/share/sweph/ephe
+ '';
+
+ pythonImportsCheck = ["swisseph"];
+
+ meta = with lib; {
+ homepage = "https://astrorigin.com/pyswisseph";
+ description = "Python extension to the Swiss Ephemeris";
+ license = licenses.agpl3Only;
+ maintainers = with maintainers; [bsima];
+ };
+}