Merge pull request #285798 from onny/wordpress-plugins-license2

wordpressPackages: add license information

authored by Jonas Heinrich and committed by GitHub 4c7c7994 2538e576

+87 -66
+14 -4
pkgs/servers/web-apps/wordpress/packages/default.nix
··· 9 9 generatedJson = { 10 10 inherit plugins themes languages; 11 11 }; 12 + sourceJson = { 13 + plugins = builtins.fromJSON (builtins.readFile ./wordpress-plugins.json); 14 + themes = builtins.fromJSON (builtins.readFile ./wordpress-themes.json); 15 + languages = builtins.fromJSON (builtins.readFile ./wordpress-languages.json); 16 + }; 12 17 13 18 in { 14 19 # Create a generic WordPress package. Most arguments are just passed 15 20 # to `mkDerivation`. The version is automatically filtered for weird characters. 16 21 mkWordpressDerivation = self.callPackage ({ stdenvNoCC, lib, filterWPString, gettext, wp-cli }: 17 - { type, pname, version, ... }@args: 22 + { type, pname, version, license, ... }@args: 18 23 assert lib.any (x: x == type) [ "plugin" "theme" "language" ]; 19 24 stdenvNoCC.mkDerivation ({ 20 25 pname = "wordpress-${type}-${pname}"; ··· 31 36 32 37 passthru = { 33 38 wpName = pname; 39 + }; 40 + 41 + meta = { 42 + license = lib.licenses.${license}; 34 43 } // (args.passthru or {}); 35 44 } // lib.optionalAttrs (type == "language") { 36 45 nativeBuildInputs = [ gettext wp-cli ]; ··· 51 60 # Create a derivation from the official wordpress.org packages. 52 61 # This takes the type, the pname and the data generated from the go tool. 53 62 mkOfficialWordpressDerivation = self.callPackage ({ mkWordpressDerivation, fetchWordpress }: 54 - { type, pname, data }: 63 + { type, pname, data, license }: 55 64 mkWordpressDerivation { 56 - inherit type pname; 65 + inherit type pname license; 57 66 version = data.version; 58 67 59 68 src = fetchWordpress type data; ··· 79 88 throw "fetchWordpress: invalid package type ${type}"; 80 89 }) {}; 81 90 82 - } // lib.mapAttrs (type: pkgs: lib.makeExtensible (_: lib.mapAttrs (pname: data: self.mkOfficialWordpressDerivation { type = lib.removeSuffix "s" type; inherit pname data; }) pkgs)) generatedJson; 91 + } // lib.mapAttrs ( 92 + type: pkgs: lib.makeExtensible (_: lib.mapAttrs (pname: data: self.mkOfficialWordpressDerivation {type = lib.removeSuffix "s" type; inherit pname data; license = sourceJson.${type}.${pname}; }) pkgs)) generatedJson; 83 93 84 94 # This creates an extensible scope. 85 95 in lib.recursiveUpdate ((lib.makeExtensible (_: (lib.makeScope newScope packages))).extend (selfWP: superWP: {})) (callPackage ./thirdparty.nix {})
+3 -3
pkgs/servers/web-apps/wordpress/packages/generate.sh
··· 12 12 export NIX_PATH=nixpkgs=../../../../.. 13 13 export WP_VERSION=$(nix $nixFlags '(import <nixpkgs> {}).wordpress.version') 14 14 15 - PLUGINS=`cat wordpress-plugins.json | jq -r '.[]' | sed -z 's/\n/,/g;s/,$/\n/'` 16 - THEMES=`cat wordpress-themes.json | jq -r '.[]' | sed -z 's/\n/,/g;s/,$/\n/'` 17 - LANGUAGES=`cat wordpress-languages.json | jq -r '.[]' | sed -z 's/\n/,/g;s/,$/\n/'` 15 + PLUGINS=`cat wordpress-plugins.json | jq -r 'keys|.[]' | sed -z 's/\n/,/g;s/,$/\n/'` 16 + THEMES=`cat wordpress-themes.json | jq -r 'keys|.[]' | sed -z 's/\n/,/g;s/,$/\n/'` 17 + LANGUAGES=`cat wordpress-languages.json | jq -r 'keys|.[]' | sed -z 's/\n/,/g;s/,$/\n/'` 18 18 19 19 wp4nix -p $PLUGINS -pl en 20 20 wp4nix -t $THEMES -tl en
+20 -9
pkgs/servers/web-apps/wordpress/packages/thirdparty.nix
··· 1 - {fetchzip}: { 2 - plugins.civicrm = fetchzip rec { 3 - name = "civicrm"; 1 + {fetchzip, stdenv, lib}: { 2 + plugins.civicrm = stdenv.mkDerivation rec { 3 + pname = "civicrm"; 4 4 version = "5.56.0"; 5 - url = "https://storage.googleapis.com/${name}/${name}-stable/${version}/${name}-${version}-wordpress.zip"; 6 - hash = "sha256-XsNFxVL0LF+OHlsqjjTV41x9ERLwMDq9BnKKP3Px2aI="; 5 + src = fetchzip { 6 + inherit version; 7 + name = pname; 8 + url = "https://storage.googleapis.com/${pname}/${pname}-stable/${version}/${pname}-${version}-wordpress.zip"; 9 + hash = "sha256-XsNFxVL0LF+OHlsqjjTV41x9ERLwMDq9BnKKP3Px2aI="; 10 + }; 11 + meta.license = lib.licenses.agpl3Only; 7 12 }; 8 - themes.geist = fetchzip rec { 9 - name = "geist"; 13 + themes.geist = stdenv.mkDerivation rec { 14 + pname = "geist"; 10 15 version = "2.0.3"; 11 - url = "https://github.com/christophery/geist/archive/refs/tags/${version}.zip"; 12 - hash = "sha256-c85oRhqu5E5IJlpgqKJRQITur1W7x40obOvHZbPevzU="; 16 + src = fetchzip { 17 + inherit version; 18 + name = pname; 19 + url = "https://github.com/christophery/geist/archive/refs/tags/${version}.zip"; 20 + hash = "sha256-c85oRhqu5E5IJlpgqKJRQITur1W7x40obOvHZbPevzU="; 21 + }; 22 + meta.license = lib.licenses.gpl2Only; 13 23 }; 14 24 } 25 +
+5 -5
pkgs/servers/web-apps/wordpress/packages/wordpress-languages.json
··· 1 - [ 2 - "de_DE" 3 - , "fr_FR" 4 - , "ro_RO" 5 - ] 1 + { 2 + "de_DE": "gpl2Plus" 3 + , "fr_FR": "gpl2Plus" 4 + , "ro_RO": "gpl2Plus" 5 + }
+38 -38
pkgs/servers/web-apps/wordpress/packages/wordpress-plugins.json
··· 1 - [ 2 - "add-widget-after-content" 3 - , "akismet" 4 - , "antispam-bee" 5 - , "async-javascript" 6 - , "breeze" 7 - , "code-syntax-block" 8 - , "cookie-notice" 9 - , "co-authors-plus" 10 - , "disable-xml-rpc" 11 - , "embed-extended" 12 - , "gutenberg" 13 - , "hello-dolly" 14 - , "hkdev-maintenance-mode" 15 - , "jetpack" 16 - , "jetpack-lite" 17 - , "lightbox-photoswipe" 18 - , "login-lockdown" 19 - , "mailpoet" 20 - , "merge-minify-refresh" 21 - , "opengraph" 22 - , "simple-login-captcha" 23 - , "simple-mastodon-verification" 24 - , "static-mail-sender-configurator" 25 - , "tc-custom-javascript" 26 - , "webp-converter-for-media" 27 - , "webp-express" 28 - , "wordpress-seo" 29 - , "worker" 30 - , "wp-change-email-sender" 31 - , "wp-fastest-cache" 32 - , "wp-gdpr-compliance" 33 - , "wp-mail-smtp" 34 - , "wp-statistics" 35 - , "wp-swiper" 36 - , "wp-user-avatars" 37 - , "wpforms-lite" 38 - ] 1 + { 2 + "add-widget-after-content": "gpl3Plus" 3 + , "akismet": "gpl2Plus" 4 + , "antispam-bee": "gpl2Plus" 5 + , "async-javascript": "gpl2Plus" 6 + , "breeze": "gpl2Plus" 7 + , "code-syntax-block": "gpl2Plus" 8 + , "cookie-notice": "mit" 9 + , "co-authors-plus": "gpl2Plus" 10 + , "disable-xml-rpc": "gpl2Plus" 11 + , "embed-extended": "gpl2Plus" 12 + , "gutenberg": "gpl2Plus" 13 + , "hello-dolly": "gpl2Plus" 14 + , "hkdev-maintenance-mode": "gpl2Plus" 15 + , "jetpack": "gpl2Plus" 16 + , "jetpack-lite": "gpl2Only" 17 + , "lightbox-photoswipe": "gpl2Only" 18 + , "login-lockdown": "gpl2Plus" 19 + , "mailpoet": "gpl3Only" 20 + , "merge-minify-refresh": "gpl2Plus" 21 + , "opengraph": "asl20" 22 + , "simple-login-captcha": "gpl2Plus" 23 + , "simple-mastodon-verification": "gpl2Plus" 24 + , "static-mail-sender-configurator": "mit" 25 + , "tc-custom-javascript": "gpl2Plus" 26 + , "webp-converter-for-media": "gpl2Plus" 27 + , "webp-express": "gpl3Only" 28 + , "wordpress-seo": "gpl3Only" 29 + , "worker": "gpl3Plus" 30 + , "wp-change-email-sender": "gpl2Plus" 31 + , "wp-fastest-cache": "gpl2Plus" 32 + , "wp-gdpr-compliance": "gpl2Plus" 33 + , "wp-mail-smtp": "gpl3Plus" 34 + , "wp-statistics": "gpl3Only" 35 + , "wp-swiper": "gpl2Plus" 36 + , "wp-user-avatars": "gpl2Plus" 37 + , "wpforms-lite": "gpl2Plus" 38 + }
+7 -7
pkgs/servers/web-apps/wordpress/packages/wordpress-themes.json
··· 1 - [ 2 - "twentynineteen" 3 - , "twentytwenty" 4 - , "twentytwentytwo" 5 - , "twentytwentyone" 6 - , "twentytwentythree" 7 - ] 1 + { 2 + "twentynineteen": "gpl2Plus" 3 + , "twentytwenty": "gpl2Plus" 4 + , "twentytwentytwo": "gpl2Plus" 5 + , "twentytwentyone": "gpl2Plus" 6 + , "twentytwentythree": "gpl2Plus" 7 + }