From 1ecc3f22e5e0237061531476ef8d8b4aba68fbab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=A9clairevoyant?= <848000+eclairevoyant@users.noreply.github.com> Date: Sat, 20 Jul 2024 12:38:32 -0400 Subject: [PATCH 1/3] lib/licenses: add unrar --- lib/licenses.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/licenses.nix b/lib/licenses.nix index 84b2597760fd7..19f0e2bd2773e 100644 --- a/lib/licenses.nix +++ b/lib/licenses.nix @@ -1250,6 +1250,13 @@ lib.mapAttrs mkLicense ({ fullName = "The Unlicense"; }; + unrar = { + fullName = "UnRAR - free utility for RAR archives: License for use and distribution of FREEWARE version"; + url = "https://www.rarlab.com/rar/unrarsrc-7.0.9.tar.gz"; + free = false; + redistributable = true; + }; + upl = { spdxId = "UPL-1.0"; fullName = "Universal Permissive License"; From a11de247318a8f79b1b4ea82ecf40d11f551f850 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=A9clairevoyant?= <848000+eclairevoyant@users.noreply.github.com> Date: Sat, 20 Jul 2024 12:43:28 -0400 Subject: [PATCH 2/3] treewide: use unrar license where applicable --- lib/licenses.nix | 4 ++-- pkgs/applications/kde/ark/default.nix | 2 +- pkgs/applications/misc/calibre/default.nix | 2 +- pkgs/by-name/un/unrar/package.nix | 2 +- pkgs/tools/archivers/7zz/default.nix | 2 +- pkgs/tools/archivers/p7zip/default.nix | 3 +-- 6 files changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/licenses.nix b/lib/licenses.nix index 19f0e2bd2773e..f96c8189428ed 100644 --- a/lib/licenses.nix +++ b/lib/licenses.nix @@ -1252,9 +1252,9 @@ lib.mapAttrs mkLicense ({ unrar = { fullName = "UnRAR - free utility for RAR archives: License for use and distribution of FREEWARE version"; - url = "https://www.rarlab.com/rar/unrarsrc-7.0.9.tar.gz"; + # also contained the in the source of the unrar package + url = "https://fedoraproject.org/wiki/Licensing:Unrar"; free = false; - redistributable = true; }; upl = { diff --git a/pkgs/applications/kde/ark/default.nix b/pkgs/applications/kde/ark/default.nix index 815bee892d6de..e91640e292b2f 100644 --- a/pkgs/applications/kde/ark/default.nix +++ b/pkgs/applications/kde/ark/default.nix @@ -32,7 +32,7 @@ mkDerivation { homepage = "https://apps.kde.org/ark/"; description = "Graphical file compression/decompression utility"; mainProgram = "ark"; - license = with licenses; [ gpl2 lgpl3 ] ++ optional unfreeEnableUnrar unfree; + license = with licenses; [ gpl2 lgpl3 ] ++ optional unfreeEnableUnrar unrar; maintainers = [ maintainers.ttuegel ]; }; } diff --git a/pkgs/applications/misc/calibre/default.nix b/pkgs/applications/misc/calibre/default.nix index 10bbeefd03f1b..036e7449a5bb3 100644 --- a/pkgs/applications/misc/calibre/default.nix +++ b/pkgs/applications/misc/calibre/default.nix @@ -220,7 +220,7 @@ stdenv.mkDerivation (finalAttrs: { ''; changelog = "https://github.com/kovidgoyal/calibre/releases/tag/v${finalAttrs.version}"; license = if unrarSupport - then lib.licenses.unfreeRedistributable + then lib.licenses.unrar else lib.licenses.gpl3Plus; maintainers = with lib.maintainers; [ pSub ]; platforms = lib.platforms.unix; diff --git a/pkgs/by-name/un/unrar/package.nix b/pkgs/by-name/un/unrar/package.nix index 6a71c63d9e2d7..4957c2d0b8010 100644 --- a/pkgs/by-name/un/unrar/package.nix +++ b/pkgs/by-name/un/unrar/package.nix @@ -53,7 +53,7 @@ stdenv.mkDerivation (finalAttrs: { meta = with lib; { description = "Utility for RAR archives"; homepage = "https://www.rarlab.com/"; - license = licenses.unfreeRedistributable; + license = licenses.unrar; mainProgram = "unrar"; maintainers = with maintainers; [ wegank ]; platforms = platforms.all; diff --git a/pkgs/tools/archivers/7zz/default.nix b/pkgs/tools/archivers/7zz/default.nix index 74746fa5f1f30..6f5d1ac3af42d 100644 --- a/pkgs/tools/archivers/7zz/default.nix +++ b/pkgs/tools/archivers/7zz/default.nix @@ -119,7 +119,7 @@ stdenv.mkDerivation (finalAttrs: { [ lgpl2Plus /* and */ bsd3 ] ++ # and CPP/7zip/Compress/Rar* are unfree with the unRAR license restriction # the unRAR compression code is disabled by default - lib.optionals enableUnfree [ unfree ]; + lib.optionals enableUnfree [ unrar ]; maintainers = with lib.maintainers; [ anna328p jk peterhoeg ]; platforms = with lib.platforms; unix ++ windows; mainProgram = "7zz"; diff --git a/pkgs/tools/archivers/p7zip/default.nix b/pkgs/tools/archivers/p7zip/default.nix index 3ced84bed025f..3c0462c1bfcde 100644 --- a/pkgs/tools/archivers/p7zip/default.nix +++ b/pkgs/tools/archivers/p7zip/default.nix @@ -67,8 +67,7 @@ stdenv.mkDerivation (finalAttrs: { # CPP/7zip/Compress/LzfseDecoder.cpp is bsd3 [ lgpl2Plus /* and */ bsd3 ] ++ # and CPP/7zip/Compress/Rar* are unfree with the unRAR license restriction - # the unRAR compression code is disabled by default - lib.optionals enableUnfree [ unfree ]; + lib.optionals enableUnfree [ unrar ]; maintainers = with maintainers; [ raskin jk ]; platforms = platforms.unix; mainProgram = "7z"; From 1009145c3037535fee06a9bd5a8b199d0502ce21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Wed, 11 Sep 2024 14:19:02 +0200 Subject: [PATCH 3/3] calibre: don't overwrite gpl3Plus license when unrar support is enabled --- pkgs/applications/misc/calibre/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/misc/calibre/default.nix b/pkgs/applications/misc/calibre/default.nix index 036e7449a5bb3..e3f2c7efc8948 100644 --- a/pkgs/applications/misc/calibre/default.nix +++ b/pkgs/applications/misc/calibre/default.nix @@ -219,9 +219,9 @@ stdenv.mkDerivation (finalAttrs: { free and open source and great for both casual users and computer experts. ''; changelog = "https://github.com/kovidgoyal/calibre/releases/tag/v${finalAttrs.version}"; - license = if unrarSupport - then lib.licenses.unrar - else lib.licenses.gpl3Plus; + license = [ lib.licenses.gpl3Plus ] + # the extra unfree is because gpl license cannot legally be combined with unfree licenses + ++ lib.optionals unrarSupport [ lib.licenses.unrar lib.licenses.unfree]; maintainers = with lib.maintainers; [ pSub ]; platforms = lib.platforms.unix; broken = stdenv.isDarwin;