| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 |
|
| 25 | (define-module (gnu packages diffoscope)
|
| 26 | #:use-module (gnu packages)
|
| 27 | #:use-module (gnu packages acl)
|
| 28 | #:use-module (gnu packages admin)
|
| 29 | #:use-module (gnu packages android)
|
| 30 | #:use-module (gnu packages backup)
|
| 31 | #:use-module (gnu packages base)
|
| 32 | #:use-module (gnu packages bootloaders)
|
| 33 | #:use-module (gnu packages cdrom)
|
| 34 | #:use-module (gnu packages check)
|
| 35 | #:use-module (gnu packages compression)
|
| 36 | #:use-module (gnu packages cpio)
|
| 37 | #:use-module (gnu packages dbm)
|
| 38 | #:use-module (gnu packages dotnet)
|
| 39 | #:use-module (gnu packages firmware)
|
| 40 | #:use-module (gnu packages gettext)
|
| 41 | #:use-module (gnu packages ghostscript)
|
| 42 | #:use-module (gnu packages gnome)
|
| 43 | #:use-module (gnu packages gnupg)
|
| 44 | #:use-module (gnu packages haskell)
|
| 45 | #:use-module (gnu packages image)
|
| 46 | #:use-module (gnu packages imagemagick)
|
| 47 | #:use-module (gnu packages java)
|
| 48 | #:use-module (gnu packages linux)
|
| 49 | #:use-module (gnu packages llvm)
|
| 50 | #:use-module (gnu packages man)
|
| 51 | #:use-module (gnu packages maths)
|
| 52 | #:use-module (gnu packages ocaml)
|
| 53 | #:use-module (gnu packages package-management)
|
| 54 | #:use-module (gnu packages pascal)
|
| 55 | #:use-module (gnu packages patchutils)
|
| 56 | #:use-module (gnu packages pdf)
|
| 57 | #:use-module (gnu packages perl)
|
| 58 | #:use-module (gnu packages python-build)
|
| 59 | #:use-module (gnu packages python-check)
|
| 60 | #:use-module (gnu packages python-web)
|
| 61 | #:use-module (gnu packages python-xyz)
|
| 62 | #:use-module (gnu packages sqlite)
|
| 63 | #:use-module (gnu packages ssh)
|
| 64 | #:use-module (gnu packages statistics)
|
| 65 | #:use-module (gnu packages textutils)
|
| 66 | #:use-module (gnu packages tls)
|
| 67 | #:use-module (gnu packages video)
|
| 68 | #:use-module (gnu packages vim)
|
| 69 | #:use-module (gnu packages web)
|
| 70 | #:use-module (gnu packages xml)
|
| 71 | #:use-module (guix build-system pyproject)
|
| 72 | #:use-module (guix gexp)
|
| 73 | #:use-module (guix git-download)
|
| 74 | #:use-module ((guix licenses) #:prefix license:)
|
| 75 | #:use-module (guix packages)
|
| 76 | #:use-module (guix utils)
|
| 77 | #:use-module (ice-9 match))
|
| 78 |
|
| 79 | (define-public diffoscope
|
| 80 | (package
|
| 81 | (name "diffoscope")
|
| 82 | (version "333")
|
| 83 | (source
|
| 84 | (origin
|
| 85 | (method git-fetch)
|
| 86 | (uri (git-reference
|
| 87 | (url "https://salsa.debian.org/reproducible-builds/diffoscope.git")
|
| 88 | (commit version)))
|
| 89 | (file-name (git-file-name name version))
|
| 90 | (sha256
|
| 91 | (base32 "1g0pih0gdlhsjmfdysh0fxhp60jcwgk44f673ym4yq4vvpmgz527"))))
|
| 92 | (build-system pyproject-build-system)
|
| 93 | (arguments
|
| 94 | (list
|
| 95 | #:phases
|
| 96 | #~(modify-phases %standard-phases
|
| 97 | |
| 98 | |
| 99 | (add-after 'unpack 'remove-broken-file-type-detection-test
|
| 100 | (lambda _
|
| 101 | (delete-file "tests/comparators/test_berkeley_db.py")
|
| 102 | (delete-file "tests/comparators/test_wasm.py")))
|
| 103 | (add-after 'compress-documentation 'make-extract-vmlinux-executable
|
| 104 | |
| 105 | |
| 106 | (lambda _
|
| 107 | (for-each (lambda (file)
|
| 108 | (chmod file #o755))
|
| 109 | (find-files #$output "extract-vmlinux"))))
|
| 110 | (add-after 'unpack 'embed-tool-references
|
| 111 | (lambda* (#:key inputs #:allow-other-keys)
|
| 112 | (define (bin command)
|
| 113 | (search-input-file inputs (string-append "bin/" command)))
|
| 114 | (substitute* "diffoscope/comparators/utils/compare.py"
|
| 115 | (("\\[\"(xxd)\"," _ command)
|
| 116 | (string-append "[\"" (bin command) "\",")))
|
| 117 | (substitute* "diffoscope/diff.py"
|
| 118 | (("@tool_required\\(\"diff\"\\)") "")
|
| 119 | (("get_tool_name\\(\"(diff)\"\\)" _ command)
|
| 120 | (string-append "get_tool_name(\"" (bin command) "\")")))
|
| 121 | (substitute* "diffoscope/comparators/directory.py"
|
| 122 | (("@tool_required\\(\"stat\"\\)") "")
|
| 123 | (("@tool_required\\(\"getfacl\"\\)") "")
|
| 124 | (("\\[\"(stat)\"," _ command)
|
| 125 | (string-append "[\"" (bin command) "\","))
|
| 126 | (("\\[\"(getfacl)\"," _ command)
|
| 127 | (string-append "[\"" (bin command) "\",")))))
|
| 128 | (add-after 'build 'build-man-page
|
| 129 | (lambda _
|
| 130 | (invoke "make" "-C" "doc")))
|
| 131 | (add-before 'check 'writable-test-data
|
| 132 | (lambda _
|
| 133 | |
| 134 | (for-each make-file-writable (find-files "tests"))))
|
| 135 | (add-before 'check 'fix-failing-test
|
| 136 | (lambda _
|
| 137 | |
| 138 | |
| 139 | |
| 140 | |
| 141 | |
| 142 | |
| 143 | |
| 144 | |
| 145 | (substitute* "tests/data/squashfs_root_expected_diff"
|
| 146 | (("root/root")
|
| 147 | '"0/0 "))))
|
| 148 | (add-before 'check 'delete-failing-test
|
| 149 | |
| 150 | (lambda _
|
| 151 | |
| 152 | (delete-file "tests/test_tools.py")))
|
| 153 | (replace 'check
|
| 154 | (lambda* (#:key tests? #:allow-other-keys)
|
| 155 | (when tests?
|
| 156 | |
| 157 | (invoke "pytest" "-vv" "-r" "sxX"))))
|
| 158 | (add-after 'install 'install-man-page
|
| 159 | (lambda* (#:key outputs #:allow-other-keys)
|
| 160 | (let* ((out (assoc-ref outputs "out"))
|
| 161 | (man (string-append out "/share/man/man1")))
|
| 162 | (install-file "doc/diffoscope.1" man)))))))
|
| 163 | (inputs (list rpm |
| 164 | python-debian
|
| 165 | python-libarchive-c
|
| 166 | python-magic
|
| 167 | python-tlsh
|
| 168 | acl |
| 169 | coreutils |
| 170 | diffutils |
| 171 | xxd))
|
| 172 | (native-inputs
|
| 173 | (append
|
| 174 | (list help2man
|
| 175 | python-setuptools
|
| 176 | python-wheel
|
| 177 |
|
| 178 | |
| 179 | binwalk
|
| 180 | python-pytest
|
| 181 | python-chardet
|
| 182 | python-defusedxml
|
| 183 | python-pypdf
|
| 184 | python-progressbar33
|
| 185 |
|
| 186 | abootimg
|
| 187 | bdb
|
| 188 | binutils
|
| 189 | bzip2
|
| 190 | cdrkit-libre
|
| 191 | colord
|
| 192 | cpio
|
| 193 | docx2txt
|
| 194 | dtc
|
| 195 | e2fsprogs
|
| 196 | ffmpeg)
|
| 197 |
|
| 198 | (match (%current-system)
|
| 199 | |
| 200 | |
| 201 | ((or "x86_64-linux")
|
| 202 | (list python-h5py))
|
| 203 | (_ '()))
|
| 204 |
|
| 205 | (match (%current-system)
|
| 206 | |
| 207 | ((or "x86_64-linux" "i686-linux")
|
| 208 | (list fpc))
|
| 209 | (_ '()))
|
| 210 |
|
| 211 | (match (%current-system)
|
| 212 | |
| 213 | ((or "x86_64-linux" "i686-linux")
|
| 214 | (list mono))
|
| 215 | (_ '()))
|
| 216 |
|
| 217 | (list gettext-minimal
|
| 218 | ghostscript
|
| 219 | `(,giflib "bin")
|
| 220 | gnumeric
|
| 221 | gnupg
|
| 222 | guix
|
| 223 | hdf5
|
| 224 | html2text
|
| 225 | imagemagick
|
| 226 | libarchive
|
| 227 | libcaca
|
| 228 | llvm
|
| 229 | lz4
|
| 230 | lzip
|
| 231 | ocaml
|
| 232 | odt2txt
|
| 233 | openssh
|
| 234 | openssl
|
| 235 | 7zip
|
| 236 | perl
|
| 237 | pgpdump
|
| 238 | poppler
|
| 239 | python-jsbeautifier
|
| 240 | r-minimal
|
| 241 | rpm
|
| 242 | sng
|
| 243 | sqlite
|
| 244 | squashfs-tools
|
| 245 | tcpdump
|
| 246 | u-boot-tools
|
| 247 | unzip
|
| 248 | wabt
|
| 249 | xxd
|
| 250 | xz
|
| 251 | zip
|
| 252 | zstd)
|
| 253 |
|
| 254 | |
| 255 | (match (%current-system)
|
| 256 | |
| 257 | ((or "x86_64-linux" "i686-linux")
|
| 258 | (list ghc))
|
| 259 | (_ '()))
|
| 260 | (match (%current-system)
|
| 261 | |
| 262 | |
| 263 | ((or "x86_64-linux")
|
| 264 | |
| 265 | (list `(,openjdk12 "jdk")
|
| 266 | enjarify))
|
| 267 | (_ '()))))
|
| 268 | (home-page "https://diffoscope.org/")
|
| 269 | (synopsis "Compare files, archives, and directories in depth")
|
| 270 | (description
|
| 271 | "Diffoscope tries to get to the bottom of what makes files or directories
|
| 272 | different. It recursively unpacks archives of many kinds and transforms
|
| 273 | various binary formats into more human readable forms to compare them. It can
|
| 274 | compare two tarballs, ISO images, or PDFs just as easily.
|
| 275 |
|
| 276 | Diffoscope has many optional dependencies; @code{diffoscope
|
| 277 | --list-missing-tools guix} will display optional packages to
|
| 278 | install.")
|
| 279 | (license license:gpl3+)))
|
| 280 |
|
| 281 | (define-public reprotest
|
| 282 | (package
|
| 283 | (name "reprotest")
|
| 284 | (version "0.7.33")
|
| 285 | (source
|
| 286 | (origin
|
| 287 | (method git-fetch)
|
| 288 | (uri (git-reference
|
| 289 | (url "https://salsa.debian.org/reproducible-builds/reprotest.git")
|
| 290 | (commit version)))
|
| 291 | (file-name (git-file-name name version))
|
| 292 | (sha256
|
| 293 | (base32 "0c87axs4zc392f7h6xrx7vdz62yp6n53hcp1djbzl6c6ax5mrx05"))))
|
| 294 | (build-system pyproject-build-system)
|
| 295 | (arguments
|
| 296 | (list
|
| 297 | #:phases
|
| 298 | #~(modify-phases %standard-phases
|
| 299 | (add-after 'compress-documentation 'make-virt-files-executable
|
| 300 | |
| 301 | |
| 302 | (lambda _
|
| 303 | (for-each (lambda (file)
|
| 304 | (chmod file #o755))
|
| 305 | (find-files #$output "autopkgtest-virt-.*"))))
|
| 306 | (add-after 'unpack 'skip-most-tests
|
| 307 | |
| 308 | |
| 309 | (lambda _
|
| 310 | (substitute* "tests/test_reprotest.py"
|
| 311 | (("def (test_simple_build|test_self_build|test_variations)"
|
| 312 | def)
|
| 313 | (string-append
|
| 314 | "@pytest.mark.skip(reason='guix environment lacks permissions')
|
| 315 | "
|
| 316 | def)))))
|
| 317 | (add-after 'install 'install-doc
|
| 318 | (lambda _
|
| 319 | (let* ((mandir1 (string-append
|
| 320 | #$output "/share/man/man1"))
|
| 321 | (docdir (string-append
|
| 322 | #$output "/share/doc/" #$name "-" #$version)))
|
| 323 | (invoke "make" "-C" "doc")
|
| 324 | (mkdir-p mandir1)
|
| 325 | (install-file "doc/reprotest.1" mandir1)
|
| 326 | (mkdir-p docdir)
|
| 327 | (install-file "./README.rst" docdir)
|
| 328 | (install-file "./README-dev.rst" docdir)))))))
|
| 329 | (native-inputs
|
| 330 | (list diffoscope
|
| 331 | help2man
|
| 332 | libfaketime
|
| 333 | python-docutils
|
| 334 | python-magic
|
| 335 | python-pytest
|
| 336 | python-setuptools
|
| 337 | python-tlsh
|
| 338 | python-wheel
|
| 339 | unzip
|
| 340 | xxd))
|
| 341 | (propagated-inputs
|
| 342 | (list python-debian
|
| 343 | python-distro
|
| 344 | python-libarchive-c
|
| 345 | python-rstr))
|
| 346 | (home-page "https://salsa.debian.org/reproducible-builds/reprotest")
|
| 347 | (synopsis "Build software and check it for reproducibility")
|
| 348 | (description "Reprotest builds the same source code twice in different
|
| 349 | environments, and then checks the binaries produced by each build for
|
| 350 | differences. If any are found, then diffoscope or diff is used to display
|
| 351 | them in detail for later analysis.")
|
| 352 | (license (list license:gpl3+ license:gpl2+))))
|
| 353 |
|
| 354 | (define-public trydiffoscope
|
| 355 | (package
|
| 356 | (name "trydiffoscope")
|
| 357 | (version "67.0.8")
|
| 358 | (source
|
| 359 | (origin
|
| 360 | (method git-fetch)
|
| 361 | (uri (git-reference
|
| 362 | (url "https://salsa.debian.org/reproducible-builds/trydiffoscope.git")
|
| 363 | (commit version)))
|
| 364 | (file-name (git-file-name name version))
|
| 365 | (sha256
|
| 366 | (base32
|
| 367 | "0k698g4fws63rnav4pvfsf1hfds867xan59mmv5zw71r58lm6cxb"))))
|
| 368 | (arguments
|
| 369 | (list #:tests? #f
|
| 370 | #:phases
|
| 371 | #~(modify-phases %standard-phases
|
| 372 | (add-after 'install 'install-doc
|
| 373 | (lambda _
|
| 374 | (let* ((share (string-append #$output "/share/")))
|
| 375 | (mkdir-p (string-append share "/man/man1/"))
|
| 376 | (invoke "rst2man.py" "trydiffoscope.1.rst"
|
| 377 | (string-append share "/man/man1/trydiffoscope.1"))
|
| 378 | (mkdir-p (string-append
|
| 379 | share "/doc/" #$name "-" #$version))
|
| 380 | (install-file
|
| 381 | "./README.rst"
|
| 382 | (string-append share "/doc/" #$name "-" #$version))))))))
|
| 383 | (propagated-inputs
|
| 384 | (list python-requests))
|
| 385 | (native-inputs
|
| 386 | (list gzip python-docutils-0.19 python-setuptools python-wheel))
|
| 387 | (build-system pyproject-build-system)
|
| 388 | (home-page "https://try.diffoscope.org")
|
| 389 | (synopsis "Client for remote diffoscope service")
|
| 390 | (description "This is a client for the @url{https://try.diffoscope.org,
|
| 391 | remote diffoscope service}.
|
| 392 |
|
| 393 | Diffoscope tries to get to the bottom of what makes files or directories
|
| 394 | different. It recursively unpacks archives of many kinds and transforms
|
| 395 | various binary formats into more human readable forms to compare them. It can
|
| 396 | compare two tarballs, ISO images, or PDFs just as easily.
|
| 397 |
|
| 398 | Results are displayed by default, stored as local text or html files, or made
|
| 399 | available via a URL on @url{https://try.diffoscope.org}. Results stored on the
|
| 400 | server are purged after 30 days.")
|
| 401 | (license license:gpl3+)))
|