(require 'emir )
(defun emir--format-license-table (table )
(when-let ((elt (assoc " failure" table))) (setcar elt " ((failure))" ))
(when-let ((elt (assoc " pending" table))) (setcar elt " ((pending))" ))
(when-let ((elt (assoc " none" table))) (setcar elt " ((none))" ))
(when-let ((elt (assoc " custom" table))) (setcar elt " ((custom))" ))
(let ((total (apply '+ (mapcar 'cadr table)))
(gnu (apply '+ (mapcar (pcase-lambda (`(, license , count ))
(if (and license
(string-match-p " GPL" license))
count
0 ))
table))))
(cl-flet ((percent (n) (round (* (/ n total 1.0 ) 100 ))))
`((" License" " Count" " Percent" )
hline ,@(mapcar (pcase-lambda (`(, license , count ))
(list license count (percent count)))
table)
hline (" total GNU" , gnu ,(percent gnu ))
hline (" total" , total 100 )))))
(defun emir--insert-mirror-packages-using-licenses (&rest licenses )
(epkg-add-org-header
(mapcar (pcase-lambda (`(, name , license , class ))
(list name license class
(if (epkg-get-recipe 'melpa name) t " " )))
(epkg-sql [:select [name license class]
:from packages
:where license :in $v1
:and (not (= class 'shelved ))
:order-by [(asc name)]]
(apply #'vector licenses)))
'(" Package" " License" " Class" " M" )))
(defun emir--insert-attic-packages-using-licenses (&rest licenses )
(epkg-add-org-header
(epkg-sql [:select [name license] :from packages
:where license :in $v1
:and (= class 'shelved )
:order-by [(asc name)]]
(apply #'vector licenses))
'(" Package" " License" )))
(epkg-add-org-header rows header)
up
(emir--format-license-table
(epkg-sql [:select [license (funcall count * )] :as count
:from packages
:where (and (not (= class 'builtin ))
(not (= class 'shelved )))
:group-by license
:order-by [(desc count) (asc license)]]))
License Count Percent
GPL-3.0-or-later 4884 69
GPL-2.0-or-later 1171 17
MIT 412 6
GPL-3.0-only 177 2
BSD-2-Clause 84 1
BSD-3-Clause 73 1
Apache-2.0 64 1
Unlicense 38 1
WTFPL 36 1
public-domain 31 0
ISC 26 0
as-is 23 0
AGPL-3.0-or-later 22 0
LGPL-3.0-or-later 9 0
CC0-1.0 7 0
GPL-3.0 4 0
MPL-2.0 4 0
Zlib 4 0
GPL-1.0-or-later 3 0
LGPL-3.0-only 3 0
0BSD 2 0
CECILL-2.1 2 0
CECILL-B 2 0
FSFAP 2 0
LGPL-2.1-only 2 0
AGPL-3.0-only 1 0
Artistic-2.0 1 0
Beerware 1 0
MIT-0 1 0
MPL-1.1 1 0
MS-PL 1 0
Ruby 1 0
Unicode-TOU 1 0
total GNU 6276 88
total 7093 100
Packages with unknown licenses
(epkg--sql-keep
(list name class license
(and (epkg-get-recipe 'melpa name) " ✓" ))
[:select [name class license] :from packages
:where (and (not (= class 'shelved ))
(or (not (in license $v1))
(isnull license)))
:order-by [(asc name)]]
(vconcat [" as-is" " public-domain" ]
elx-spdx-license-identifiers))
(emir--format-license-table
(epkg-sql [:select [license (funcall count * )] :as count
:from packages
:where (= class 'shelved )
:group-by license
:order-by [(desc count) (asc license)]]))
License Count Percent
GPL-2.0-or-later 849 53
GPL-3.0-or-later 458 29
GPL-2.0-only 61 4
GPL 43 3
public-domain 39 2
GPL-3.0-only 27 2
MIT 27 2
GPL-1.0-or-later 14 1
Unlicense 9 1
((custom)) 9 1
WTFPL 8 1
as-is 8 1
BSD-2-Clause 7 0
BSD-3-Clause 7 0
Apache-2.0 5 0
AGPL-3.0-or-later 3 0
LGPL-3.0-only 3 0
GPL-2.1-or-later 2 0
ISC 2 0
MS-PL 2 0
0BSD 1 0
AGPL-3.0-only 1 0
Artistic-1.0 1 0
Artistic-2.0 1 0
BSD 1 0
Beerware 1 0
CC0-1.0 1 0
EPL 1 0
LGPL-2.1-only 1 0
LGPL-2.1-or-later 1 0
LGPL-3.0-or-later 1 0
total GNU 1464 92
total 1594 100
Packages with unknown/custom licenses
(epkg--sql-keep
(list name class license
(and (epkg-get-recipe 'melpa name) " ✓" ))
[:select [name class license] :from packages
:where (and (= class 'shelved )
(not (in license $v1)))
:order-by [(asc name)]]
(vconcat [" as-is" " public-domain"
" GPL" " GPL-2.1-or-later" " BSD" " EPL" ]
elx-spdx-license-identifiers))
Package (9) Class License M
epo shelved custom
phutball shelved custom
procmaillog shelved custom
psgml-jade shelved custom
rmoo shelved custom
speedread shelved custom
whine shelved custom
yaham shelved custom
youwill shelved custom
(emir--insert-attic-packages-using-licenses " GPL" " GPL-2.0-only" " EPL" )
Package (105) License
align-regexp GPL
amigo GPL-2.0-only
atom-blogger GPL
axcess GPL
bibtex-mode GPL
blip GPL-2.0-only
buffer-thumbnail GPL
byrd-biff GPL
cdt GPL
commit-patch-buffer GPL-2.0-only
conjecture-mode GPL
copyedit GPL-2.0-only
cruisecontrol GPL-2.0-only
dbk GPL
devkitemacs GPL-2.0-only
dired-a GPL
dms-sig GPL
e-blog GPL-2.0-only
ec GPL-2.0-only
eform GPL
elder GPL
emdroid GPL-2.0-only
emuds GPL
env-print GPL
equinox GPL-2.0-only
esheet GPL-2.0-only
espect GPL-2.0-only
faith GPL
filewatch GPL
flip-tables GPL-2.0-only
fluiddb GPL-2.0-only
foldingo GPL
garble GPL-2.0-only
gb4e GPL
global-modes GPL
haddoc GPL-2.0-only
hier-imenu GPL-2.0-only
html-helper-imenu GPL-2.0-only
hugs-mode GPL
icaps GPL-2.0-only
ifile-gnus GPL
ilisp GPL
inkmacs GPL
iso-html GPL
javadoc-help GPL-2.0-only
jhg-cload GPL-2.0-only
journalctl-mode GPL-2.0-only
lbdb GPL-2.0-only
line-numbers-mode GPL
lines GPL
lmselect GPL-2.0-only
media-files GPL-2.0-only
mgp-mode-cd GPL
miranda-mode GPL
mojo GPL-2.0-only
mutt-alias GPL-2.0-only
notebook GPL-2.0-only
osx-itunes GPL-2.0-only
osx-osascript GPL-2.0-only
osx-typecreator GPL-2.0-only
otp GPL-2.0-only
outline-m GPL
pastie GPL
perl-myvar GPL-2.0-only
physical-line GPL
play-mode GPL-2.0-only
point-ring GPL
popup-menu GPL
post GPL
qa GPL-2.0-only
qtdoc GPL-2.0-only
recent GPL-2.0-only
redshank GPL
rep-words GPL-2.0-only
repeat-insert GPL
repeatable GPL-2.0-only
reportmail GPL
rtf-mode GPL-2.0-only
save-and-dwim GPL-2.0-only
sawfish GPL-2.0-only
scrmable GPL-2.0-only
slashdot GPL-2.0-only
slime-ritz EPL
spamprobe GPL-2.0-only
spectre-mode GPL
studlycaps GPL-2.0-only
summarye GPL
symlink-fix GPL
tab-in-tabular GPL-2.0-only
texmed GPL-2.0-only
tie-mode GPL
tiger GPL-2.0-only
tld GPL-2.0-only
todochiku GPL-2.0-only
tumblr GPL-2.0-only
twit GPL-2.0-only
undo-group GPL-2.0-only
wc GPL-2.0-only
webinfo GPL-2.0-only
word-count GPL-2.0-only
word-counter GPL
work-timer GPL-2.0-only
wsh-repl GPL-2.0-only
xbase GPL-2.0-only
zendmd-comint GPL-2.0-only
Notes:
(mail) GPL-2 maintainer feedback