diff options
| author | kestrel <kestrel.w@proton.me> | 2025-10-10 11:48:24 +0300 |
|---|---|---|
| committer | Liliana Marie Prikler <liliana.prikler@gmail.com> | 2025-10-22 16:43:05 +0200 |
| commit | 0c3462568b718bb0ec6df9562adc5ebc8d49e885 (patch) | |
| tree | 86662899c49d7e60649e6cebbb6dd9294fda96b9 | |
| parent | c8549668a2851944be13d5164dca2883c85ccf32 (diff) | |
gnu: Add 7zip.
* gnu/packages/compression.scm: Import copy-build-system.
(7zip): new variable.
Change-Id: I5c19d3cb301b3f3b633ce9c91760ad77bd20b7dc
Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
| -rw-r--r-- | gnu/packages/compression.scm | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/gnu/packages/compression.scm b/gnu/packages/compression.scm index 64680c59ab3..49403485f2f 100644 --- a/gnu/packages/compression.scm +++ b/gnu/packages/compression.scm | |||
| @@ -67,6 +67,7 @@ | |||
| 67 | #:use-module (guix git-download) | 67 | #:use-module (guix git-download) |
| 68 | #:use-module (guix build-system ant) | 68 | #:use-module (guix build-system ant) |
| 69 | #:use-module (guix build-system cmake) | 69 | #:use-module (guix build-system cmake) |
| 70 | #:use-module (guix build-system copy) | ||
| 70 | #:use-module (guix build-system glib-or-gtk) | 71 | #:use-module (guix build-system glib-or-gtk) |
| 71 | #:use-module (guix build-system gnu) | 72 | #:use-module (guix build-system gnu) |
| 72 | #:use-module (guix build-system go) | 73 | #:use-module (guix build-system go) |
| @@ -1460,6 +1461,84 @@ for most inputs, but the resulting compressed files are anywhere from 20% to | |||
| 1460 | (license license:asl2.0) | 1461 | (license license:asl2.0) |
| 1461 | (properties '((cpe-vendor . "google"))))) | 1462 | (properties '((cpe-vendor . "google"))))) |
| 1462 | 1463 | ||
| 1464 | (define-public 7zip | ||
| 1465 | (package | ||
| 1466 | (name "7zip") | ||
| 1467 | (version "25.01") | ||
| 1468 | (source | ||
| 1469 | (origin | ||
| 1470 | (method git-fetch) | ||
| 1471 | (uri (git-reference | ||
| 1472 | (url "https://github.com/ip7z/7zip") | ||
| 1473 | (commit version))) | ||
| 1474 | (sha256 | ||
| 1475 | (base32 "01jg1fkc2zsdngv3ag3pwq4x8i5x01hjxsk30n78ffwiv2ps4rmq")) | ||
| 1476 | (file-name (git-file-name name version)) | ||
| 1477 | (modules '((guix build utils) | ||
| 1478 | (ice-9 regex))) | ||
| 1479 | (snippet #~(begin | ||
| 1480 | (for-each | ||
| 1481 | delete-file | ||
| 1482 | (append (find-files "CPP/7zip/Compress" "^Rar.*") | ||
| 1483 | (find-files "DOC/unRarLicense.txt"))))))) | ||
| 1484 | (build-system copy-build-system) | ||
| 1485 | (arguments | ||
| 1486 | (list | ||
| 1487 | #:install-plan | ||
| 1488 | #~'(("DOC/" "share/doc/7zip") | ||
| 1489 | ("CPP/7zip/UI/Console/_o/7z" "bin/") | ||
| 1490 | ("CPP/7zip/Bundles/Format7zF/_o/7z.so" "lib/") | ||
| 1491 | ("CPP/7zip/Bundles/SFXCon/_o/7zCon" "lib/7zCon.sfx")) | ||
| 1492 | #:phases | ||
| 1493 | #~(modify-phases %standard-phases | ||
| 1494 | (delete 'configure) | ||
| 1495 | (delete 'check) | ||
| 1496 | (add-after 'unpack 'patch-sources | ||
| 1497 | (lambda* (#:key outputs #:allow-other-keys) | ||
| 1498 | (let* ((out (assoc-ref outputs "out")) | ||
| 1499 | (lib (string-append out "/lib"))) | ||
| 1500 | (substitute* "CPP/7zip/UI/Client7z/Client7z.cpp" | ||
| 1501 | (("if \\(!lib\\.Load\\(dllPrefix + FTEXT\\(kDllName\\)\\)\\)") | ||
| 1502 | (string-append "if (!lib.Load(FTEXT(\"" lib | ||
| 1503 | "\") + FTEXT(kDllName)) || " | ||
| 1504 | "!lib.Load(dllPrefix + FTEXT(kDllName)))"))) | ||
| 1505 | (substitute* "CPP/7zip/UI/Common/ArchiveCommandLine.cpp" | ||
| 1506 | (("s = FTEXT\\(\"\\.\"\\)") | ||
| 1507 | (string-append "s = FTEXT(\"" lib "\")")) | ||
| 1508 | (("s = fas2fs\\(g_ModuleDirPrefix\\)") | ||
| 1509 | (string-append "s = FTEXT(\"" lib "\") " | ||
| 1510 | "FSTRING_PATH_SEPARATOR")))))) | ||
| 1511 | (add-before 'install 'build | ||
| 1512 | (lambda* _ | ||
| 1513 | (define make-flags | ||
| 1514 | '#$(list "DISABLE_RAR=1" | ||
| 1515 | (string-append "CC=" (cc-for-target)) | ||
| 1516 | (string-append "CXX=" (cxx-for-target)) | ||
| 1517 | (string-append "PLATFORM=" | ||
| 1518 | (cond | ||
| 1519 | ((target-x86-64?) "x64") | ||
| 1520 | ((target-x86-32?) "x86") | ||
| 1521 | ((target-arm32?) "arm") | ||
| 1522 | ((target-aarch64?) "arm64") | ||
| 1523 | (#t ""))))) | ||
| 1524 | (with-directory-excursion "CPP/7zip/" | ||
| 1525 | (for-each | ||
| 1526 | (lambda (dir) | ||
| 1527 | (with-directory-excursion dir | ||
| 1528 | (apply invoke "make" "-f" "makefile.gcc" make-flags))) | ||
| 1529 | '("UI/Console" | ||
| 1530 | "Bundles/Format7zF" | ||
| 1531 | "Bundles/SFXCon")))))))) | ||
| 1532 | (home-page "https://7-zip.org") | ||
| 1533 | (synopsis "7-zip file archiver") | ||
| 1534 | (description | ||
| 1535 | "7-zip is a command-line file compressor that supports a number | ||
| 1536 | of archive formats and features self-extracting archives.") | ||
| 1537 | (license (list license:lgpl2.1+ | ||
| 1538 | license:bsd-2 | ||
| 1539 | license:bsd-3 | ||
| 1540 | license:public-domain)))) | ||
| 1541 | |||
| 1463 | (define-public p7zip | 1542 | (define-public p7zip |
| 1464 | (package | 1543 | (package |
| 1465 | (name "p7zip") | 1544 | (name "p7zip") |
