Skip to content

Commit 159796a

Browse files
authored
Merge pull request #1167 from onekey-sec/7zip-nix
chore(deps): Downgrade 7zip to v16.02 in nix packaging
2 parents 2a1ba9c + 690bdd6 commit 159796a

File tree

5 files changed

+41
-7
lines changed

5 files changed

+41
-7
lines changed

.envrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
source_env_if_exists .envrc.user
44

55
if ${UNBLOB_USE_DEVENV:-true}; then
6-
watch_file flake.nix flake.lock devenv.nix
6+
watch_file *.nix flake.lock
77
use nix \
88
--option extra-substituters "https://unblob.cachix.org" \
99
--option extra-trusted-public-keys "unblob.cachix.org-1:5kWA6DwOg176rSqU8TOTBXWxsDB4LoCMfGfTgL5qCAE="

.pre-commit-config.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,17 @@ repos:
4040
- nix-command flakes
4141
- --accept-flake-config
4242
- fmt
43+
- id: statix
44+
name: Lint Nix (statix)
45+
types: [nix]
46+
pass_filenames: false
47+
language: system
48+
entry: bash -c 'command -v nix && statix fix "$@" || echo "skipping statix"'
49+
- id: deadnix
50+
name: Lint Nix (deadnix)
51+
types: [nix]
52+
language: system
53+
entry: bash -c 'command -v nix && deadnix --edit "$@" || echo "skipping deadnix"'
4354
- id: taplo-format
4455
name: Format TOML (taplo)
4556
language: system

flake.nix

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@
109109
python3Packages.patchVenvShellHook
110110
python3Packages.autoPatchelfVenvShellHook
111111

112+
deadnix
113+
statix
114+
112115
cargo
113116
rustc
114117

overlay.nix

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,26 @@ final: prev:
88
nativeCheckInputs = (super.nativeCheckInputs or [ ]) ++ [ final.which ];
99
});
1010

11+
p7zip16 = prev.p7zip.overrideAttrs (super: rec {
12+
pname = "p7zip16";
13+
version = "16.02";
14+
srcs = [
15+
(final.fetchurl {
16+
url = "mirror://sourceforge/p7zip/p7zip_${version}_src_all.tar.bz2";
17+
sha256 = "5eb20ac0e2944f6cb9c2d51dd6c4518941c185347d4089ea89087ffdd6e2341f";
18+
})
19+
(final.fetchurl {
20+
url = "http://deb.debian.org/debian/pool/main/p/p7zip/p7zip_${version}+dfsg-8.debian.tar.xz";
21+
sha256 = "sha256-ASF9yhZnrw3kiTWlHcRqrUQubryseZ1xQQG37fllHrU=";
22+
})
23+
];
24+
sourceRoot = "p7zip_${version}";
25+
nativeBuildInputs = (super.nativeBuildInputs or [ ]) ++ [ final.quilt ];
26+
prePatch = ''
27+
export QUILT_PATCHES=../debian/patches
28+
quilt push -a
29+
'';
30+
});
31+
1132
unblob = final.callPackage ./package.nix { };
1233
}

package.nix

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
{
22
lib,
33
python3,
4-
fetchFromGitHub,
54
makeWrapper,
65
e2fsprogs-nofortify,
76
erofs-utils,
87
jefferson,
98
lz4,
109
lziprecover,
1110
lzop,
12-
p7zip,
11+
p7zip16,
1312
nix-filter,
1413
sasquatch,
1514
sasquatch-v4be,
@@ -29,7 +28,7 @@ let
2928
jefferson
3029
lziprecover
3130
lzop
32-
p7zip
31+
p7zip16
3332
sasquatch
3433
sasquatch-v4be
3534
ubi_reader
@@ -38,10 +37,10 @@ let
3837
zstd
3938
lz4
4039
];
41-
pyproject_toml = (builtins.fromTOML (builtins.readFile ./pyproject.toml));
42-
version = pyproject_toml.project.version;
40+
pyproject_toml = builtins.fromTOML (builtins.readFile ./pyproject.toml);
41+
inherit (pyproject_toml.project) version;
4342
in
44-
python3.pkgs.buildPythonApplication rec {
43+
python3.pkgs.buildPythonApplication {
4544
pname = "unblob";
4645
pyproject = true;
4746
disabled = python3.pkgs.pythonOlder "3.9";

0 commit comments

Comments
 (0)