Commit | Line | Data |
---|---|---|
52211add VC |
1 | ;;; GNU Guix --- Functional package management for GNU |
2 | ;;; Copyright © 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org> | |
3 | ;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net> | |
4 | ;;; Copyright © 2017, 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr> | |
5 | ;;; Copyright © 2018 Julien Lepiller <julien@lepiller.eu> | |
6 | ;;; Copyright © 2018, 2019 Rutger Helling <rhelling@mykolab.com> | |
7 | ;;; Copyright © 2019 Vagrant Cascadian <vagrant@reproducible-builds.org> | |
8 | ;;; | |
9 | ;;; This file is part of GNU Guix. | |
10 | ;;; | |
11 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | |
12 | ;;; under the terms of the GNU General Public License as published by | |
13 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
14 | ;;; your option) any later version. | |
15 | ;;; | |
16 | ;;; GNU Guix is distributed in the hope that it will be useful, but | |
17 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 | ;;; GNU General Public License for more details. | |
20 | ;;; | |
21 | ;;; You should have received a copy of the GNU General Public License | |
22 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | |
23 | ||
24 | (define-module (gnu packages diffoscope) | |
25 | #:use-module (gnu packages) | |
26 | #:use-module (gnu packages acl) | |
27 | #:use-module (gnu packages admin) | |
3244b64f | 28 | #:use-module (gnu packages android) |
52211add VC |
29 | #:use-module (gnu packages backup) |
30 | #:use-module (gnu packages base) | |
3244b64f | 31 | #:use-module (gnu packages bootloaders) |
52211add VC |
32 | #:use-module (gnu packages cdrom) |
33 | #:use-module (gnu packages check) | |
34 | #:use-module (gnu packages compression) | |
35 | #:use-module (gnu packages cpio) | |
36 | #:use-module (gnu packages dbm) | |
37 | #:use-module (gnu packages gettext) | |
38 | #:use-module (gnu packages ghostscript) | |
39 | #:use-module (gnu packages gnome) | |
40 | #:use-module (gnu packages gnupg) | |
41 | #:use-module (gnu packages haskell) | |
42 | #:use-module (gnu packages image) | |
43 | #:use-module (gnu packages imagemagick) | |
44 | #:use-module (gnu packages java) | |
45 | #:use-module (gnu packages linux) | |
46 | #:use-module (gnu packages llvm) | |
c526ddf4 | 47 | #:use-module (gnu packages man) |
52211add | 48 | #:use-module (gnu packages mono) |
3fb581ca | 49 | #:use-module (gnu packages ocaml) |
52211add VC |
50 | #:use-module (gnu packages package-management) |
51 | #:use-module (gnu packages patchutils) | |
52 | #:use-module (gnu packages pdf) | |
53 | #:use-module (gnu packages python-web) | |
54 | #:use-module (gnu packages python-xyz) | |
55 | #:use-module (gnu packages sqlite) | |
56 | #:use-module (gnu packages ssh) | |
3244b64f | 57 | #:use-module (gnu packages statistics) |
52211add VC |
58 | #:use-module (gnu packages textutils) |
59 | #:use-module (gnu packages video) | |
60 | #:use-module (gnu packages vim) | |
4d83157c | 61 | #:use-module (gnu packages web) |
52211add VC |
62 | #:use-module (guix build-system python) |
63 | #:use-module (guix gexp) | |
64 | #:use-module (guix git-download) | |
65 | #:use-module ((guix licenses) #:prefix license:) | |
66 | #:use-module (guix packages) | |
aaeb2b34 VC |
67 | #:use-module (guix utils) |
68 | #:use-module (ice-9 match)) | |
52211add VC |
69 | |
70 | (define-public diffoscope | |
3d8fe3e2 | 71 | (let ((version "136")) |
52211add VC |
72 | (package |
73 | (name "diffoscope") | |
74 | (version version) | |
75 | (source (origin | |
76 | (method git-fetch) | |
77 | (uri (git-reference | |
78 | (url "https://salsa.debian.org/reproducible-builds/diffoscope.git") | |
79 | (commit version))) | |
80 | (file-name (git-file-name name version)) | |
81 | (sha256 | |
82 | (base32 | |
3d8fe3e2 | 83 | "1wp4fnmwcsgv17dmvk9xr3h63gp4nmmpysr248qvxs8s5qy5xlyk")))) |
52211add VC |
84 | (build-system python-build-system) |
85 | (arguments | |
86 | `(#:phases (modify-phases %standard-phases | |
87 | ;; setup.py mistakenly requires python-magic from PyPi, even | |
88 | ;; though the Python bindings of `file` are sufficient. | |
89 | ;; https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=815844 | |
90 | (add-after 'unpack 'dependency-on-python-magic | |
91 | (lambda _ | |
92 | (substitute* "setup.py" | |
93 | (("'python-magic',") "")))) | |
94 | ;; This test is broken because our `file` package has a | |
95 | ;; bug in berkeley-db file type detection. | |
96 | (add-after 'unpack 'remove-berkeley-test | |
97 | (lambda _ | |
98 | (delete-file "tests/comparators/test_berkeley_db.py") | |
99 | #t)) | |
100 | ;; Test is dynamically generated and may have false | |
101 | ;; negatives with different ocaml versions. Further | |
102 | ;; background in: https://bugs.debian.org/939386 | |
103 | (add-after 'unpack 'remove-ocaml-test | |
104 | (lambda _ | |
3fb581ca VC |
105 | (substitute* "tests/comparators/test_ocaml.py" |
106 | (("def test_diff.differences.:") | |
107 | "def skip_test_diff(differences):")) | |
108 | #t)) | |
109 | (add-after 'unpack 'skip-elf-tests | |
110 | ;; FIXME: libmix_differences test added in 125, and is | |
111 | ;; failing, need to explore why... | |
112 | (lambda _ | |
113 | (substitute* "tests/comparators/test_elf.py" | |
114 | (("def test_libmix_differences.libmix_differences.:") | |
115 | "def skip_test_libmix_differences(libmix_differences):")) | |
52211add VC |
116 | #t)) |
117 | (add-after 'unpack 'embed-tool-references | |
118 | (lambda* (#:key inputs #:allow-other-keys) | |
119 | (substitute* "diffoscope/comparators/utils/compare.py" | |
120 | (("\\['xxd',") | |
121 | (string-append "['" (which "xxd") "',"))) | |
122 | (substitute* "diffoscope/comparators/elf.py" | |
123 | (("@tool_required\\('readelf'\\)") "") | |
124 | (("get_tool_name\\('readelf'\\)") | |
125 | (string-append "'" (which "readelf") "'"))) | |
126 | (substitute* "diffoscope/comparators/directory.py" | |
127 | (("@tool_required\\('stat'\\)") "") | |
128 | (("@tool_required\\('getfacl'\\)") "") | |
129 | (("\\['stat',") | |
130 | (string-append "['" (which "stat") "',")) | |
131 | (("\\['getfacl',") | |
132 | (string-append "['" (which "getfacl") "',"))) | |
133 | #t)) | |
134 | (add-before 'check 'writable-test-data | |
135 | (lambda _ | |
136 | ;; tests may need needs write access to tests | |
137 | ;; directory | |
138 | (for-each make-file-writable (find-files "tests")) | |
139 | #t)) | |
140 | (add-before 'check 'delete-failing-test | |
141 | (lambda _ | |
142 | ;; this requires /sbin to be on the path | |
143 | (delete-file "tests/test_tools.py") | |
144 | #t))))) | |
145 | (inputs `(("rpm" ,rpm) ;for rpm-python | |
146 | ("python-file" ,python-file) | |
147 | ("python-debian" ,python-debian) | |
148 | ("python-libarchive-c" ,python-libarchive-c) | |
149 | ("python-tlsh" ,python-tlsh) | |
150 | ("acl" ,acl) ;for getfacl | |
151 | ("colordiff" ,colordiff) | |
152 | ("xxd" ,xxd))) | |
153 | ;; Below are modules used for tests. | |
154 | (native-inputs `(("python-pytest" ,python-pytest) | |
155 | ("python-chardet" ,python-chardet) | |
f315673d | 156 | ("python-binwalk" ,python-binwalk) |
36f5f23c VC |
157 | ("python-pypdf2" ,python-pypdf2) |
158 | ("python-progressbar33" ,python-progressbar33) | |
52211add | 159 | ;; test suite skips tests when tool is missing |
aaeb2b34 VC |
160 | ,@(match (%current-system) |
161 | ;; ghc is only available on x86 currently. | |
162 | ((or "x86_64-linux" "i686-linux") | |
163 | `(("ghc" ,ghc))) | |
164 | (_ | |
165 | `())) | |
166 | ,@(match (%current-system) | |
167 | ;; openjdk and dependent packages are only | |
168 | ;; available on x86_64 currently. | |
169 | ((or "x86_64-linux") | |
170 | `(("enjarify" ,enjarify) | |
171 | ;; no unversioned openjdk available | |
172 | ("openjdk:jdk" ,openjdk12 "jdk") | |
173 | )) | |
174 | (_ | |
175 | `())) | |
3244b64f | 176 | ("abootimg" ,abootimg) |
52211add VC |
177 | ("bdb" ,bdb) |
178 | ("binutils" ,binutils) | |
179 | ("bzip2" ,bzip2) | |
180 | ("cdrtools" ,cdrtools) | |
181 | ("colord" ,colord) | |
182 | ("cpio" ,cpio) | |
183 | ("docx2txt" ,docx2txt) | |
3244b64f | 184 | ("dtc" ,dtc) |
52211add VC |
185 | ("e2fsprogs" ,e2fsprogs) |
186 | ("ffmpeg" ,ffmpeg) | |
187 | ("gettext" ,gettext-minimal) | |
52211add VC |
188 | ("ghostscript" ,ghostscript) |
189 | ("giflib:bin" ,giflib "bin") | |
190 | ("gnumeric" ,gnumeric) | |
191 | ("gnupg" ,gnupg) | |
192 | ("imagemagick" ,imagemagick) | |
193 | ("libarchive" ,libarchive) | |
194 | ("llvm" ,llvm) | |
195 | ("lz4" ,lz4) | |
196 | ("mono" ,mono) | |
3fb581ca | 197 | ("ocaml" ,ocaml) |
52211add | 198 | ("odt2txt" ,odt2txt) |
52211add VC |
199 | ("openssh" ,openssh) |
200 | ("pgpdump" ,pgpdump) | |
201 | ("poppler" ,poppler) | |
6ec87223 | 202 | ("python-jsbeautifier" ,python-jsbeautifier) |
3244b64f | 203 | ("r-minimal" ,r-minimal) |
52211add VC |
204 | ("rpm" ,rpm) |
205 | ("sng" ,sng) | |
206 | ("sqlite" ,sqlite) | |
207 | ("squashfs-tools" ,squashfs-tools) | |
208 | ("tcpdump" ,tcpdump) | |
209 | ("unzip" ,unzip) | |
4d83157c | 210 | ("wabt" ,wabt) |
52211add VC |
211 | ("xxd" ,xxd) |
212 | ("xz" ,xz) | |
bc685e1c VC |
213 | ("zip" ,zip) |
214 | ("zstd" ,zstd))) | |
52211add VC |
215 | (home-page "https://diffoscope.org/") |
216 | (synopsis "Compare files, archives, and directories in depth") | |
217 | (description | |
218 | "Diffoscope tries to get to the bottom of what makes files or directories | |
219 | different. It recursively unpacks archives of many kinds and transforms | |
220 | various binary formats into more human readable forms to compare them. It can | |
f83d07f7 VC |
221 | compare two tarballs, ISO images, or PDFs just as easily. |
222 | ||
223 | Diffoscope has many optional dependencies; @code{diffoscope | |
224 | --list-missing-tools guix} will display optional packages to | |
225 | install.") | |
52211add VC |
226 | (license license:gpl3+)))) |
227 | ||
c526ddf4 VC |
228 | (define-public reprotest |
229 | (package | |
230 | (name "reprotest") | |
231 | (version "0.7.13") | |
232 | (source | |
233 | (origin | |
234 | (method git-fetch) | |
235 | (uri (git-reference | |
236 | (url "https://salsa.debian.org/reproducible-builds/reprotest.git") | |
237 | (commit version))) | |
238 | (file-name (git-file-name name version)) | |
239 | (patches (search-patches "reprotest-support-guix.patch")) | |
240 | (sha256 | |
241 | (base32 | |
242 | "0jj9sqxbdpypnc0y8md352wwzh1by6nyhmx5fwqnvrbznrng332f")))) | |
243 | (inputs | |
244 | `(("python-debian" ,python-debian) | |
245 | ("python-distro" ,python-distro) | |
246 | ("python-libarchive-c", python-libarchive-c) | |
247 | ("python-rstr" ,python-rstr))) | |
248 | (native-inputs | |
249 | `(("diffoscope" ,diffoscope) | |
250 | ("help2man" ,help2man) | |
251 | ("libfaketime" ,libfaketime) | |
252 | ("python-coverage" ,python-coverage) | |
253 | ("python-docutils" ,python-docutils) | |
254 | ("python-pytest " ,python-pytest) | |
255 | ("python-tlsh" ,python-tlsh) | |
256 | ("python-tox" ,python-tox) | |
257 | ("unzip" ,unzip) | |
258 | ("xxd" ,xxd))) | |
259 | (build-system python-build-system) | |
260 | (arguments | |
261 | `(#:phases | |
262 | (modify-phases %standard-phases | |
263 | ;; Neither glibc-locales nor glibc-utf8-locales have the C.UTF-8 | |
264 | ;; locale or several other locales used in reprotest. | |
265 | (add-after 'unpack 'adjust-locales | |
266 | (lambda _ | |
267 | (substitute* "reprotest/build.py" | |
268 | (("'C.UTF-8'") "'en_US.UTF-8'") | |
269 | (("'ru_RU.CP1251'") "'ru_RU.KOI8-R'") | |
270 | (("'kk_KZ.RK1048'") "'kk_KZ'")) | |
271 | (substitute* "reprotest/lib/adt_testbed.py" | |
272 | (("export LANG=C.UTF-8") "export LANG=en_US.UTF-8")) | |
273 | #t)) | |
274 | (add-after 'install 'install-doc | |
275 | (lambda* (#:key outputs #:allow-other-keys) | |
276 | (let* ((mandir1 (string-append | |
277 | (assoc-ref outputs "out") "/share/man/man1")) | |
278 | (docdir (string-append | |
279 | (assoc-ref outputs "out") "/share/doc/" ,name "-" ,version))) | |
280 | (invoke "make" "-C" "doc") | |
281 | (mkdir-p mandir1) | |
282 | (install-file "doc/reprotest.1" mandir1) | |
283 | (mkdir-p docdir) | |
284 | (install-file "./README.rst" docdir) | |
285 | (install-file "./README-dev.rst" docdir)) | |
286 | #t))))) | |
287 | (home-page "https://salsa.debian.org/reproducible-builds/reprotest") | |
288 | (synopsis "Build software and check it for reproducibility") | |
289 | (description "Reprotest builds the same source code twice in different | |
290 | environments, and then checks the binaries produced by each build for | |
291 | differences. If any are found, then diffoscope or diff is used to display | |
292 | them in detail for later analysis.") | |
293 | (license (list license:gpl3+ license:gpl2+)))) | |
294 | ||
52211add VC |
295 | (define-public trydiffoscope |
296 | (package | |
297 | (name "trydiffoscope") | |
298 | (version "67.0.1") | |
299 | (source | |
300 | (origin | |
301 | (method git-fetch) | |
302 | (uri (git-reference | |
303 | (url "https://salsa.debian.org/reproducible-builds/trydiffoscope.git") | |
304 | (commit version))) | |
305 | (file-name (git-file-name name version)) | |
306 | (sha256 | |
307 | (base32 | |
308 | "03b66cjii7l2yiwffj6ym6mycd5drx7prfp4j2550281pias6mjh")))) | |
309 | (arguments | |
310 | `(#:phases | |
311 | (modify-phases %standard-phases | |
312 | (add-after 'install 'install-doc | |
313 | (lambda* (#:key outputs #:allow-other-keys) | |
314 | (let* ((share (string-append (assoc-ref outputs "out") "/share/"))) | |
315 | (mkdir-p (string-append share "/man/man1/" )) | |
316 | (invoke "rst2man.py" | |
317 | "trydiffoscope.1.rst" | |
318 | (string-append share "/man/man1/trydiffoscope.1")) | |
319 | (mkdir-p (string-append share "/doc/" ,name "-" ,version)) | |
320 | (install-file "./README.rst" | |
321 | (string-append share "/doc/" ,name "-" ,version))) | |
322 | #t))))) | |
323 | (propagated-inputs | |
324 | `(("python-requests" ,python-requests))) | |
325 | (native-inputs | |
326 | `(("gzip" ,gzip) | |
327 | ("python-docutils" ,python-docutils))) | |
328 | (build-system python-build-system) | |
329 | (home-page "https://try.diffoscope.org") | |
330 | (synopsis "Client for remote diffoscope service") | |
331 | (description "This is a client for the @url{https://try.diffoscope.org, | |
332 | remote diffoscope service}. | |
333 | ||
334 | Diffoscope tries to get to the bottom of what makes files or directories | |
335 | different. It recursively unpacks archives of many kinds and transforms | |
336 | various binary formats into more human readable forms to compare them. It can | |
337 | compare two tarballs, ISO images, or PDFs just as easily. | |
338 | ||
339 | Results are displayed by default, stored as local text or html files, or made | |
340 | available via a URL on @url{https://try.diffoscope.org}. Results stored on the | |
341 | server are purged after 30 days.") | |
342 | (license license:gpl3+))) |