From ba8e2b7a2587baa58e86982e50d9f339ec2ed53e Mon Sep 17 00:00:00 2001 From: Hunter Jones Date: Sat, 27 Feb 2021 13:24:15 -0600 Subject: [PATCH 1/4] indilib: add third-party driver support --- .../development/libraries/indilib/default.nix | 12 ++-- .../libraries/indilib/indi-3rdparty.nix | 63 +++++++++++++++++++ .../libraries/indilib/indi-full.nix | 11 ++++ .../libraries/indilib/indi-with-drivers.nix | 9 +++ .../libraries/indilib/udev-dir.patch | 11 ---- pkgs/top-level/all-packages.nix | 2 + 6 files changed, 92 insertions(+), 16 deletions(-) create mode 100644 pkgs/development/libraries/indilib/indi-3rdparty.nix create mode 100644 pkgs/development/libraries/indilib/indi-full.nix create mode 100644 pkgs/development/libraries/indilib/indi-with-drivers.nix delete mode 100644 pkgs/development/libraries/indilib/udev-dir.patch diff --git a/pkgs/development/libraries/indilib/default.nix b/pkgs/development/libraries/indilib/default.nix index 035356ac861a..4813e431a663 100644 --- a/pkgs/development/libraries/indilib/default.nix +++ b/pkgs/development/libraries/indilib/default.nix @@ -1,4 +1,5 @@ -{ lib, stdenv +{ stdenv +, lib , fetchFromGitHub , cmake , cfitsio @@ -23,10 +24,6 @@ stdenv.mkDerivation rec { sha256 = "sha256-WTRfV6f764tDGKnQVd1jeYN/qXa/VRTFK0mMalc+9aU="; }; - patches = [ - ./udev-dir.patch - ]; - nativeBuildInputs = [ cmake ]; @@ -43,6 +40,11 @@ stdenv.mkDerivation rec { fftw ]; + cmakeFlags = [ + "-DCMAKE_INSTALL_LIBDIR=lib" + "-DUDEVRULES_INSTALL_DIR=lib/udev/rules.d" + ]; + meta = with lib; { homepage = "https://www.indilib.org/"; description = "Implementation of the INDI protocol for POSIX operating systems"; diff --git a/pkgs/development/libraries/indilib/indi-3rdparty.nix b/pkgs/development/libraries/indilib/indi-3rdparty.nix new file mode 100644 index 000000000000..02862820b3a3 --- /dev/null +++ b/pkgs/development/libraries/indilib/indi-3rdparty.nix @@ -0,0 +1,63 @@ +{ stdenv +, lib +, fetchFromGitHub +, cmake +, cfitsio +, libusb1 +, zlib +, boost +, libnova +, curl +, libjpeg +, gsl +, fftw +, indilib +, libgphoto2 +, libraw +, libftdi1 +, libdc1394 +, gpsd +, ffmpeg +}: + +stdenv.mkDerivation rec { + pname = "indi-3rdparty"; + version = "1.8.8"; + + src = fetchFromGitHub { + owner = "indilib"; + repo = pname; + rev = "v${version}"; + sha256 = "18ii9qsghrvj8y4y6c7bx6kjradybnmyq8i5phj7pv4r8w91rq7g"; + }; + + cmakeFlags = [ + "-DINDI_DATA_DIR=\${CMAKE_INSTALL_PREFIX}/share/indi" + "-DCMAKE_INSTALL_LIBDIR=lib" + "-DUDEVRULES_INSTALL_DIR=lib/udev/rules.d" + "-DRULES_INSTALL_DIR=lib/udev/rules.d" + "-DWITH_SX=off" + "-DWITH_SBIG=off" + "-DWITH_APOGEE=off" + "-DWITH_FISHCAMP=off" + "-DWITH_DSI=off" + "-DWITH_QHY=off" + "-DWITH_ARMADILLO=off" + "-DWITH_PENTAX=off" + ]; + + nativeBuildInputs = [ cmake ]; + + buildInputs = [ + indilib libnova curl cfitsio libusb1 zlib boost gsl gpsd + libjpeg libgphoto2 libraw libftdi1 libdc1394 ffmpeg fftw + ]; + + meta = with lib; { + homepage = "https://www.indilib.org/"; + description = "Third party drivers for the INDI astronomical software suite"; + license = licenses.lgpl2Plus; + maintainers = with maintainers; [ hjones2199 ]; + platforms = [ "x86_64-linux" ]; + }; +} diff --git a/pkgs/development/libraries/indilib/indi-full.nix b/pkgs/development/libraries/indilib/indi-full.nix new file mode 100644 index 000000000000..e52da9f2eab1 --- /dev/null +++ b/pkgs/development/libraries/indilib/indi-full.nix @@ -0,0 +1,11 @@ +{ callPackage, indilib, indi-3rdparty }: + +let + indi-with-drivers = ./indi-with-drivers.nix; +in +callPackage indi-with-drivers { + pkgName = "indi-full"; + extraDrivers = [ + indi-3rdparty + ]; +} diff --git a/pkgs/development/libraries/indilib/indi-with-drivers.nix b/pkgs/development/libraries/indilib/indi-with-drivers.nix new file mode 100644 index 000000000000..b34abfd95c1f --- /dev/null +++ b/pkgs/development/libraries/indilib/indi-with-drivers.nix @@ -0,0 +1,9 @@ +{ buildEnv, indilib ? indilib, extraDrivers ? null , pkgName ? "indi-with-drivers" }: + +buildEnv { + name = pkgName; + paths = [ + indilib + ] + ++ extraDrivers; +} diff --git a/pkgs/development/libraries/indilib/udev-dir.patch b/pkgs/development/libraries/indilib/udev-dir.patch deleted file mode 100644 index 701680012914..000000000000 --- a/pkgs/development/libraries/indilib/udev-dir.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- indi-1.8.6/CMakeLists.txt 2020-08-21 05:56:59.000000000 -0500 -+++ CMakeLists.txt 2020-11-01 12:50:57.621293870 -0600 -@@ -77,7 +77,7 @@ - ## the following are directories where stuff will be installed to - set(INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include/") - set(PKGCONFIG_INSTALL_PREFIX "${CMAKE_INSTALL_LIBDIR}/pkgconfig/") --set(UDEVRULES_INSTALL_DIR "/lib/udev/rules.d" CACHE STRING "Base directory for udev rules") -+set(UDEVRULES_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib/udev/rules.d" CACHE STRING "Base directory for udev rules") - - set(PKG_CONFIG_LIBDIR ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}) - diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 55e10c5334a8..3a28a0f9e8ec 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -14495,6 +14495,8 @@ in indicator-application-gtk3 = callPackage ../development/libraries/indicator-application/gtk3.nix { }; indilib = callPackage ../development/libraries/indilib { }; + indi-3rdparty = callPackage ../development/libraries/indilib/indi-3rdparty.nix { }; + indi-full = callPackage ../development/libraries/indilib/indi-full.nix { }; inih = callPackage ../development/libraries/inih { }; From 9c4e268d6584b57959c75df6afe4e90b3dc32bbb Mon Sep 17 00:00:00 2001 From: Hunter Jones Date: Sat, 27 Feb 2021 13:25:07 -0600 Subject: [PATCH 2/4] kstars: use third party indi drivers --- pkgs/applications/science/astronomy/kstars/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/science/astronomy/kstars/default.nix b/pkgs/applications/science/astronomy/kstars/default.nix index 33f00979c972..1839a91e2feb 100644 --- a/pkgs/applications/science/astronomy/kstars/default.nix +++ b/pkgs/applications/science/astronomy/kstars/default.nix @@ -9,7 +9,7 @@ eigen, zlib, - cfitsio, indilib, xplanet, libnova, libraw, gsl, wcslib, stellarsolver + cfitsio, indi-full, xplanet, libnova, libraw, gsl, wcslib, stellarsolver }: mkDerivation rec { @@ -37,11 +37,11 @@ mkDerivation rec { eigen zlib - cfitsio indilib xplanet libnova libraw gsl wcslib stellarsolver + cfitsio indi-full xplanet libnova libraw gsl wcslib stellarsolver ]; cmakeFlags = [ - "-DINDI_NIX_ROOT=${indilib}" + "-DINDI_NIX_ROOT=${indi-full}" "-DXPLANET_NIX_ROOT=${xplanet}" ]; From 18040bda9b266bccdbe2239969d92056d7b001e7 Mon Sep 17 00:00:00 2001 From: Hunter Jones Date: Sat, 27 Feb 2021 13:26:17 -0600 Subject: [PATCH 3/4] phd2: use third party indi drivers --- pkgs/applications/science/astronomy/phd2/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/science/astronomy/phd2/default.nix b/pkgs/applications/science/astronomy/phd2/default.nix index 054a73dec7a0..0e0ad06bbe9f 100644 --- a/pkgs/applications/science/astronomy/phd2/default.nix +++ b/pkgs/applications/science/astronomy/phd2/default.nix @@ -1,5 +1,5 @@ { lib, stdenv, fetchFromGitHub, pkg-config, cmake, gtk3, wxGTK30-gtk3, - curl, gettext, glib, indilib, libnova, wrapGAppsHook }: + curl, gettext, glib, indi-full, libnova, wrapGAppsHook }: stdenv.mkDerivation rec { pname = "phd2"; @@ -13,7 +13,7 @@ stdenv.mkDerivation rec { }; nativeBuildInputs = [ cmake pkg-config wrapGAppsHook ]; - buildInputs = [ gtk3 wxGTK30-gtk3 curl gettext glib indilib libnova ]; + buildInputs = [ gtk3 wxGTK30-gtk3 curl gettext glib indi-full libnova ]; cmakeFlags = [ "-DOPENSOURCE_ONLY=1" From 62249b7904cee7581e6eb046ee77b268926bca10 Mon Sep 17 00:00:00 2001 From: Hunter Jones Date: Sat, 27 Feb 2021 15:11:20 -0600 Subject: [PATCH 4/4] kstars: update license to gpl2Plus --- pkgs/applications/science/astronomy/kstars/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/science/astronomy/kstars/default.nix b/pkgs/applications/science/astronomy/kstars/default.nix index 1839a91e2feb..47c69d7451f7 100644 --- a/pkgs/applications/science/astronomy/kstars/default.nix +++ b/pkgs/applications/science/astronomy/kstars/default.nix @@ -53,7 +53,7 @@ mkDerivation rec { The display includes up to 100 million stars, 13.000 deep-sky objects, all 8 planets, the Sun and Moon, and thousands of comets, asteroids, supernovae, and satellites. For students and teachers, it supports adjustable simulation speeds in order to view phenomena that happen over long timescales, the KStars Astrocalculator to predict conjunctions, and many common astronomical calculations. ''; - license = licenses.gpl2; + license = licenses.gpl2Plus; platforms = platforms.linux; maintainers = with maintainers; [ timput hjones2199 ]; };