`uasm` is x86 only.
It seems that in `aarch64-linux` at least, the optimizing build is done
without using any third-party tool (maybe using GCC's own assembly?).
Wimlib works just fine on darwin, but two adjustments need to be made:
- Tests need to be disabled, as they rely on glibc-isms (such as
lgetattr).
- cdrkit and syslinux dependencies are dropped, as those binaries are
linux-only.
* _7zz: correct license and remove p7zip dependency
The code under Compress/Rar* is licensed under a specific unRAR license
Also Compress/LzfseDecoder.cpp is covered by BSD3
The unRAR code is removed from the `.tar.xz` since the license posits you
agree or remove the code from your hard drive
This adds some complexity to updating 7zz so there is also an update
script
Meta has been updated and tweaked
Source is now downloaded from sourceforge in the `.tar.xz` version to
avoid depending on p7zip
* _7zz: add notice of the license updates and optional unRAR licenced code
The code under Compress/Rar* is licensed under a specific unRAR license
Also Compress/LzfseDecoder.cpp is covered by BSD3
The unRAR code is removed from the source drv since the license posits you
agree or remove the code from your hard drive
This adds some complexity to updating p7zip so there is also an update
script
Meta has been updated and tweaked
Use uasm to compile the optimized code instead of generic C code for
faster operations.
Before:
```
7zz x 10.83s user 0.40s system 98% cpu 11.439 total
```
After:
```
7zz x 6.87s user 0.40s system 98% cpu 7.395 total
```
catch is ancient and has no support for aarch64-darwin. The following
snippet is an example of what is supported on darwin platforms in catch
(i.e., prior to v2).
```
#ifdef CATCH_PLATFORM_MAC
#if defined(__ppc64__) || defined(__ppc__)
#define CATCH_TRAP() \
__asm__("li r0, 20\nsc\nnop\nli r0, 37\nli r4, 2\nsc\nnop\n" \
: : : "memory","r0","r3","r4" ) /* NOLINT */
#else
#define CATCH_TRAP() __asm__("int $3\n" : : /* NOLINT */ )
#endif
```
Fix wrong header for statfs function.
Use gccStdenv to build with GCC on all systems. GCC is hardcoded in
configure.in, but after setting CC_FOR_BUILD to cc to use Clang, the
build fails anyway when running a post-compilation command:
clang -DLOCALE=LANG_en -DLOCALE_DESC="\"en\"" -DPKGLIBDIR="\"<out>/lib/arj\"" -D_UNIX -g -O2 -o darwin20.6.0/en/rs/arj/arj <objects_files>
: darwin20.6.0/en/rs/arj/arj
./darwin20.6.0/en/rs/tools/join ./darwin20.6.0/en/rs/arj/arj ./darwin20.6.0/en/rs/arjsfxjr/arjsfxjr
JOIN v 1.30 [26/04/2003] Not a part of any binary package!
Copying .. done!
./darwin20.6.0/en/rs/tools/join ./darwin20.6.0/en/rs/arj/arj ./darwin20.6.0/en/rs/arjsfx/arjsfx
JOIN v 1.30 [26/04/2003] Not a part of any binary package!
Copying ... done!
./darwin20.6.0/en/rs/tools/join ./darwin20.6.0/en/rs/arj/arj ./darwin20.6.0/en/rs/arjsfxv/arjsfxv
JOIN v 1.30 [26/04/2003] Not a part of any binary package!
Copying ..... done!
./darwin20.6.0/en/rs/tools/join ./darwin20.6.0/en/rs/arj/arj ./darwin20.6.0/en/rs/sfxstub/sfxstub
JOIN v 1.30 [26/04/2003] Not a part of any binary package!
Copying . done!
rm -f ./darwin20.6.0/en/rs/help.arj
TZ=UTC0 ./darwin20.6.0/en/rs/arj/arj a ./darwin20.6.0/en/rs/help.arj -+ -t1f -2d -e -jm -jh65535 -jt -hdo200506231314 ./resource/en/arj?.txt
ARJ32 v 3.10, Copyright (c) 1998-2004, ARJ Software Russia.
Creating archive : ./darwin20.6.0/en/rs/help.arj
Adding ./resource/en/arjl.txt 37.2%
Adding ./resource/en/arjs.txt 47.3%
Testing arjl.txt OK
Testing arjs.txt OK
2 file(s)
./darwin20.6.0/en/rs/tools/join ./darwin20.6.0/en/rs/arj/arj ./darwin20.6.0/en/rs/help.arj
JOIN v 1.30 [26/04/2003] Not a part of any binary package!
Copying . done!
./darwin20.6.0/en/rs/tools/postproc darwin20.6.0/en/rs/arj/arj
POSTPROC v 1.30 [17/01/2003] Not a part of any binary package!
Patch not found
make[1]: *** [GNUmakefile:398: darwin20.6.0/en/rs/arj/arj] Error 3
* 7zz: 21.01 -> 21.04
Also build from source instead of using the binaries.
We cannot (yet) build the fully optimized version as it requires the
ASMC assembler which currently doesn't build with GCC.
diffoscope shown non-determinism in embedded gzip timestamp:
--- p7zip-17.04/share/man/man1/7z.1.gz
+++ p7zip-17.04.check/share/man/man1/7z.1.gz
─ filetype from file(1)
@@ -1 +1 @@
-gzip compressed data, was "7z.1", last modified: Fri Oct 1 14:14:55 2021, from Unix
+gzip compressed data, was "7z.1", last modified: Sat Oct 9 08:15:33 2021, from Unix
Fix it by using `gzip -n`.
Conflicts:
- pkgs/development/python-modules/pathspec/default.nix
The hashes are equivalent, so it's not a real conflict.
- pkgs/top-level/static.nix
I can't see a solution, deffered redoing this to the later PR:
https://github.com/NixOS/nixpkgs/pull/136849
- boost 167 removed on staging-next (7915d1e03f) × boost attributes are inherited on staging (d20aa4955d)
- linux kernels were moved to linux-kernels.nix on staging-next (c62f911507) × hardened kernels are versioned on staging (a5341beb78) + removed linux_5_12 (e55554491d)
- conflict in node-packages – I regenerated it using node2nix from nixos-unstable (does not build on staging)
Since version 0.5.4.11, Xarchiver supports using either unrar or unar to
unpack .rar files. The former being released under an unfree license,
using the latter by default is preferable.
This avoids indirectly guarding the xarchiver package under
`nixpkgs.config.allowUnfree` due to the dependency on unrar.
Users who would like to use the unfree implementation may do so by
adding the unrar package to the environment from which they are calling
xarchiver.
This adds a warning to the top of each “boot” package that reads:
Note: this package is used for bootstrapping fetchurl, and thus cannot
use fetchpatch! All mutable patches (generated by GitHub or cgit) that
are needed here should be included directly in Nixpkgs as files.
This makes it clear to maintainer that they may need to treat this
package a little differently than others. Importantly, we can’t use
fetchpatch here due to using <nix/fetchurl.nix>. To avoid having stale
hashes, we need to include patches that are subject to changing
overtime (for instance, gitweb’s patches contain a version number at
the bottom).
`chmod +x install.sh` was only being executed when enableUnfree was
false. Therefore, building p7zip with enableUnfree set to true would fail
because install.sh was not an executable file.
Related:
- 9fc5e7e473
- 593e11fd94
- 508ae42a0f
Since the last time I ran this script, the Repology API changed, so I had to
adapt the script used in the previous PR. The new API should be more robust, so
overall this is a positive (no more grepping the error messages for our relevant
data but just a nice json structure).
Here's the new script I used:
```sh
curl https://repology.org/api/v1/repository/nix_unstable/problems \
| jq -r '.[] | select(.type == "homepage_permanent_https_redirect") | .data | "s@\(.url)@\(.target)@"' \
| sort | uniq | tee script.sed
find -name '*.nix' | xargs -P4 -- sed -f script.sed -i
```
I will also add this script to `maintainers/scripts`.
The old homepage and src URLs no longer exist. The author of the package
confirms on GitHub that GitHub is now the official homepage (see
kholtman/afio#12).
7-Zip's RAR implementation is built on the non-free UnRAR source code;
DOC/License.txt says:
Licenses for files are:
1) CPP/7zip/Compress/Rar* files: GNU LGPL + unRAR restriction
2) All other files: GNU LGPL
The GNU LGPL + unRAR restriction means that you must follow both
GNU LGPL rules and unRAR restriction rules.
...
unRAR restriction
-----------------
The decompression engine for RAR archives was developed using source
code of unRAR program.
All copyrights to original unRAR code are owned by Alexander Roshal.
The license for original unRAR code has the following restriction:
The unRAR sources cannot be used to re-create the RAR compression algorithm,
which is proprietary. Distribution of modified unRAR sources in separate form
or as a part of other software is permitted, provided that it is clearly
stated in the documentation and source comments that the code may
not be used to develop a RAR (WinRAR) compatible archiver.
The unrar licensing is [infamously restrictive and non-free][fedora];
it's inappropriate for us to keep the RAR support while labelling the
package as free software (and indeed there's a commented-out line
pointing out that the current `meta.license` is false). Unfortunately,
the 7-Zip upstream seems uninterested in replacing the code with a
freely-licensed alternative (see [7-Zip ticket #1229][7zip]).
[fedora]: https://fedoraproject.org/wiki/Licensing:Unrar
[7zip]: https://sourceforge.net/p/sevenzip/feature-requests/1229/
An alternative solution would be to mark the p7zip package as non-free
instead; I decided not to because its other functionality (especially
`.7z` support) is freely-licensed and useful, and there are free
software alternatives for extracting RAR files (e.g. in nixpkgs there's
`archiver`, which is written in a memory-safe language, and `unar`,
which at least doesn't have two patches for CVEs that haven't been
addressed upstream...).
I checked that `7z(1)` fails gracefully on `.rar` files now:
emily@renko ~/tmp> curl -L -O https://www.philippwinterberg.com/download/example.rar
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 5715k 100 5715k 0 0 6716k 0 --:--:-- --:--:-- --:--:-- 6716k
emily@renko ~/tmp> 7z x example.rar
7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21
p7zip Version 16.02 (locale=en_CA.UTF-8,Utf16=on,HugeFiles=on,64 bits,8 CPUs x64)
Scanning the drive for archives:
1 file, 5853119 bytes (5716 KiB)
Extracting archive: example.rar
ERROR: example.rar
Can not open the file as archive
Can't open as archive: 1
Files: 0
Size: 0
Compressed: 0
According to https://repology.org/repository/nix_unstable/problems, we have a
lot of packages that have http links that redirect to https as their homepage.
This commit updates all these packages to use the https links as their
homepage.
The following script was used to make these updates:
```
curl https://repology.org/api/v1/repository/nix_unstable/problems \
| jq '.[] | .problem' -r \
| rg 'Homepage link "(.+)" is a permanent redirect to "(.+)" and should be updated' --replace 's@$1@$2@' \
| sort | uniq > script.sed
find -name '*.nix' | xargs -P4 -- sed -f script.sed -i
```
This reverts commit 0238946872.
This patch broke a number of legitimate zips in the wild, including but
not limited to most luarocks and a number of gradle-produced JARs.
`unrar` is unfree, meaning `unp` cannot be built by default if `unrar`
is in its dependencies.
A simple
env NIXPKGS_ALLOW_UNFREE=1 nix-shell -p unrar
will make `unp` work with .rar files.
In 724e833ea2, I was a little too aggressive in enabling these flags.
Many don’t work in gcc, and we should probably avoid settings them
widely. This makes those flags optional on isclang
These pull in the system CoreFoundation framework for some reason. In
the future, we should figure out a way for it to get these features
from the pure CoreFoundation (they do have the symbol). But right now
this is an issue with sandboxing in gnutar. Fixes#56591.