Skip to content

Commit

Permalink
Merge pull request NixOS#306650 from returntoreality/indi-3rdparty-re…
Browse files Browse the repository at this point in the history
…factor

indi-full: Indi 3rdparty refactor
  • Loading branch information
JohnRTitor authored Aug 25, 2024
2 parents 669ce8b + d2367c3 commit 8da188f
Show file tree
Hide file tree
Showing 11 changed files with 1,132 additions and 218 deletions.
6 changes: 6 additions & 0 deletions maintainers/maintainer-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17418,6 +17418,12 @@
githubId = 5265630;
name = "Michael Köppl";
};
returntoreality = {
email = "[email protected]";
github = "retuntoreality";
githubId = 255667;
name = "Linus Karl";
};
revol-xut = {
email = "[email protected]";
name = "Tassilo Tanneberger";
Expand Down
4 changes: 4 additions & 0 deletions nixos/doc/manual/release-notes/rl-2411.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,10 @@

- `programs.vim.defaultEditor` now only works if `programs.vim.enable` is enabled.

- The `indi-full` package no longer contains non-free drivers.
To get the old collection of drivers use `indi-full-nonfree` or create your own collection of drivers by overriding indi-with-drivers.
E.g.: `pkgs.indi-with-drivers.override {extraDrivers = with pkgs.indi-3rdparty; [indi-gphoto];}`

- `/share/vim-plugins` now only gets linked if `programs.vim.enable` is enabled

- The `tracy` package no longer works on X11, since it's moved to Wayland
Expand Down
15 changes: 15 additions & 0 deletions pkgs/by-name/in/indi-full-nonfree/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
lib,
stdenv,
indi-3rdparty,
indilib,
indi-with-drivers,
}:

indi-with-drivers.override {
pname = "indi-full-nonfree";
inherit (indilib) version;
extraDrivers = builtins.filter (attrs: lib.meta.availableOn stdenv.hostPlatform attrs) (
builtins.attrValues indi-3rdparty
);
}
23 changes: 23 additions & 0 deletions pkgs/by-name/in/indi-full/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
lib,
stdenv,
indi-3rdparty,
indi-with-drivers,
indilib,
}:

let
licenseFree = p: p.meta.license.free or false;
isFree =
p:
(builtins.all licenseFree ((p.buildInputs or [ ]) ++ (p.propagatedBuildInputs or [ ])))
&& licenseFree p;
drivers = builtins.filter (
attrs: isFree attrs && (lib.meta.availableOn stdenv.hostPlatform attrs)
) (builtins.attrValues indi-3rdparty);
in
indi-with-drivers.override {
pname = "indi-full";
inherit (indilib) version;
extraDrivers = drivers;
}
24 changes: 24 additions & 0 deletions pkgs/by-name/in/indi-with-drivers/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
lib,
buildEnv,
makeBinaryWrapper,
indilib ? indilib,
pname ? "indi-with-drivers",
version ? indilib.version,
extraDrivers ? [ ],
}:

buildEnv {
name = "${pname}-${version}";

paths = [ indilib ] ++ extraDrivers;

nativeBuildInputs = [ makeBinaryWrapper ];

postBuild = lib.optionalString (extraDrivers != [ ]) ''
rm $out/bin/indiserver
makeBinaryWrapper ${indilib}/bin/indiserver $out/bin/indiserver --set-default INDIPREFIX $out
'';

inherit (indilib) meta;
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ stdenv.mkDerivation (finalAttrs: {
description = "Implementation of the INDI protocol for POSIX operating systems";
changelog = "https://github.com/indilib/indi/releases/tag/v${finalAttrs.version}";
license = licenses.lgpl2Plus;
maintainers = with maintainers; [ hjones2199 sheepforce ];
maintainers = with maintainers; [ hjones2199 sheepforce returntoreality ];
platforms = platforms.unix;
};
})
Loading

0 comments on commit 8da188f

Please sign in to comment.