mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-29 06:45:54 +03:00
p7zip: Make unfree features (rar support) optional
This commit is contained in:
parent
95f82e2a45
commit
955e235da3
@ -1,4 +1,4 @@
|
||||
{ stdenv, fetchurl }:
|
||||
{ stdenv, fetchurl, lib, enableUnfree ? false }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "p7zip";
|
||||
@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
|
||||
substituteInPlace makefile.machine \
|
||||
--replace 'CC=gcc' 'CC=${stdenv.cc.targetPrefix}gcc' \
|
||||
--replace 'CXX=g++' 'CXX=${stdenv.cc.targetPrefix}g++'
|
||||
'' + ''
|
||||
'' + lib.optionalString (!enableUnfree) ''
|
||||
# Remove non-free RAR source code
|
||||
# (see DOC/License.txt, https://fedoraproject.org/wiki/Licensing:Unrar)
|
||||
rm -r CPP/7zip/Compress/Rar*
|
||||
@ -50,6 +50,6 @@ stdenv.mkDerivation rec {
|
||||
platforms = stdenv.lib.platforms.unix;
|
||||
maintainers = [ stdenv.lib.maintainers.raskin ];
|
||||
# RAR code is under non-free UnRAR license, but we remove it
|
||||
license = stdenv.lib.licenses.lgpl2Plus;
|
||||
license = if enableUnfree then lib.licenses.unfree else lib.licenses.lgpl2Plus;
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user