forked from NixOS/nixpkgs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
indi-full: refactor 3rdparty drivers
This splits the 3rdparty drivers into seperate packages as recommended by upstream. This also allows to build a indi-full equivalent with only the needed drivers. Also add indi-full-nonfree with all the nonfree drivers. And remove them from indi-full.
- Loading branch information
1 parent
8aaa39a
commit d2367c3
Showing
10 changed files
with
1,126 additions
and
218 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.