_7zz: 25.01 -> 26.00, enable asm, _7zip-zstd: init at 25.01-v1.5.7-R4 (#489204)

This commit is contained in:
Sandro
2026-03-01 04:18:09 +00:00
committed by GitHub
7 changed files with 315 additions and 213 deletions
@@ -0,0 +1,6 @@
{
_7zip-zstd,
}:
_7zip-zstd.override {
enableUnfree = true;
}
+175
View File
@@ -0,0 +1,175 @@
{
lib,
stdenv,
fetchFromGitHub,
makeWrapper,
asmc-linux,
useAsmc ? !useUasm && stdenv.hostPlatform.isx86 && stdenv.hostPlatform.isLinux,
uasm,
useUasm ?
enableUnfree
&& stdenv.hostPlatform.isx86
&& (stdenv.hostPlatform.isLinux || stdenv.hostPlatform.isWindows),
_experimental-update-script-combinators,
nix-update-script,
enableUnfree ? false,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "7zip-zstd";
version = "25.01-v1.5.7-R4";
src = fetchFromGitHub {
owner = "mcmilk";
repo = "7-Zip-zstd";
tag = "v${finalAttrs.version}";
hash =
if enableUnfree then
"sha256-qP4L5PIG7CHsmYbRock+cbCOGdgujUFG4LHenvvlqzw="
else
"sha256-R9AUWL35TPh0anyRDhnF28ZYG9FeOxntVIwnnW9e2xA=";
# remove the unRAR related code from the src drv
# > the license requires that you agree to these use restrictions,
# > or you must remove the software (source and binary) from your hard disks
# https://fedoraproject.org/wiki/Licensing:Unrar
postFetch = lib.optionalString (!enableUnfree) ''
rm -r $out/CPP/7zip/Compress/Rar*
'';
};
nativeBuildInputs =
lib.optionals (!stdenv.hostPlatform.isWindows) [
makeWrapper
]
++ lib.optionals useAsmc [ asmc-linux ]
++ lib.optionals useUasm [ uasm ];
outputs = [
"out"
"doc"
];
makeFlags = [
"CC=${stdenv.cc.targetPrefix}cc"
"CXX=${stdenv.cc.targetPrefix}c++"
]
++ lib.optionals useAsmc [
"MY_ASM=asmc"
]
++ lib.optionals useUasm [
"MY_ASM=uasm"
]
++ lib.optionals (stdenv.hostPlatform.isx86 && !useAsmc && !useUasm) [
"USE_ASM="
]
# it's the compression code with the restriction, see DOC/License.txt
++ lib.optionals (!enableUnfree) [ "DISABLE_RAR_COMPRESS=true" ]
++ lib.optionals (stdenv.cc.isClang) [ "FLAGS_FLTO=-flto=thin" ]
++ lib.optionals (stdenv.hostPlatform.isMinGW) [
"IS_MINGW=1"
"MSYSTEM=1"
];
enableParallelBuilding = true;
postPatch = ''
sed -i 's/-Werror//g' CPP/7zip/7zip_gcc.mak
''
+ lib.optionalString stdenv.hostPlatform.isMinGW ''
substituteInPlace CPP/7zip/7zip_gcc.mak C/7zip_gcc_c.mak \
--replace windres.exe ${stdenv.cc.targetPrefix}windres
'';
buildPhase =
let
makefile = "../../cmpl_${
if stdenv.hostPlatform.isDarwin then
"mac"
else if stdenv.cc.isClang then
"clang"
else
"gcc"
}${
if stdenv.hostPlatform.isx86_64 then
"_x64"
else if stdenv.hostPlatform.isAarch64 then
"_arm64"
else if stdenv.hostPlatform.isi686 then
"_x86"
else
""
}.mak";
in
''
runHook preBuild
for component in Bundles/{Alone,Alone2,Alone7z,Format7zF,SFXCon} UI/Console; do
make -j $NIX_BUILD_CORES -C CPP/7zip/$component -f ${makefile} $makeFlags
done
runHook postBuild
'';
installPhase =
let
inherit (stdenv.hostPlatform) extensions isWindows;
in
''
runHook preInstall
install -Dt "$out/${if isWindows then "bin" else "lib"}/7zip" \
CPP/7zip/Bundles/Alone/b/*/7za${extensions.executable} \
CPP/7zip/Bundles/Alone2/b/*/7zz${extensions.executable} \
CPP/7zip/Bundles/Alone7z/b/*/7zr${extensions.executable} \
CPP/7zip/Bundles/Format7zF/b/*/7z${extensions.sharedLibrary} \
CPP/7zip/UI/Console/b/*/7z${extensions.executable}
install -D CPP/7zip/Bundles/SFXCon/b/*/7zCon${extensions.executable} "$out/lib/7zip/7zCon.sfx"
${lib.optionalString (!isWindows) ''
mkdir -p "$out/bin"
for prog in 7za 7zz 7zr 7z; do
makeWrapper "$out/lib/7zip/$prog" \
"$out/bin/$prog"
done
''}
install -Dt "$out/share/doc/7zip" DOC/*.txt
runHook postInstall
'';
setupHook = ./setup-hook.sh;
passthru.updateScript = _experimental-update-script-combinators.sequence [
(nix-update-script {
attrPath = "_7zip-zstd";
extraArgs = [ "--use-github-releases" ];
})
(nix-update-script {
attrPath = "_7zip-zstd-rar";
extraArgs = [ "--version=skip" ];
})
];
meta = {
homepage = "https://github.com/mcmilk/7-Zip-zstd";
description = "7-Zip with support for Brotli, Fast-LZMA2, Lizard, LZ4, LZ5 and Zstandard";
changelog = "https://github.com/mcmilk/7-Zip-zstd/releases/tag/v${finalAttrs.version}";
license =
with lib.licenses;
# p7zip code is largely lgpl2Plus
# CPP/7zip/Compress/LzfseDecoder.cpp is bsd3
[
lgpl2Plus # and
bsd3
]
++
# and CPP/7zip/Compress/Rar* are unfree with the unRAR license restriction
# the unRAR compression code is disabled by default
lib.optionals enableUnfree [ unfreeRedistributable ];
maintainers = with lib.maintainers; [
ccicnce113424
];
platforms = lib.platforms.unix ++ lib.platforms.windows;
broken = stdenv.hostPlatform.isWindows; # waiting for fixes in 26.00
mainProgram = "7z";
};
})
+12
View File
@@ -0,0 +1,12 @@
unpackCmdHooks+=(_try7zip)
unpackCmdHooks+=(_tryUnpackDmg)
_try7zip() {
if ! [[ $curSrc =~ \.7z$ ]]; then return 1; fi
7z x "$curSrc"
}
_tryUnpackDmg() {
if ! [[ $curSrc =~ \.dmg$ ]]; then return 1; fi
7z x "$curSrc"
}
@@ -1,182 +0,0 @@
--- a/C/7zip_gcc_c.mak
+++ b/C/7zip_gcc_c.mak
@@ -106,7 +106,7 @@
endif
-LIB2 = -lOle32 -loleaut32 -luuid -ladvapi32 -lUser32 -lShell32
+LIB2 = -lole32 -loleaut32 -luuid -ladvapi32 -luser32 -lshell32
CFLAGS_EXTRA = -DUNICODE -D_UNICODE
# -Wno-delete-non-virtual-dtor
--- a/C/7zVersion.rc
+++ b/C/7zVersion.rc
@@ -5,7 +5,7 @@
#define MY_VFT_APP 0x00000001L
#define MY_VFT_DLL 0x00000002L
-// #include <WinVer.h>
+// #include <winver.h>
#ifndef MY_VERSION
#include "7zVersion.h"
--- a/C/Util/7zipInstall/resource.rc
+++ b/C/Util/7zipInstall/resource.rc
@@ -1,7 +1,7 @@
#include <windows.h>
// #include <winnt.h>
// #include <WinUser.h>
-#include <CommCtrl.h>
+#include <commctrl.h>
#define USE_COPYRIGHT_CR
#include "../../7zVersion.rc"
--- a/C/Util/7zipInstall/resource.rc.rej
+++ b/C/Util/7zipInstall/resource.rc.rej
@@ -0,0 +1,10 @@
+--- C/Util/7zipInstall/resource.rc
++++ C/Util/7zipInstall/resource.rc
+@@ -1,6 +1,6 @@
+ #include <winnt.h>
+ #include <WinUser.h>
+-#include <CommCtrl.h>
++#include <commctrl.h>
+
+ #define USE_COPYRIGHT_CR
+ #include "../../7zVersion.rc"
--- a/C/Util/7zipUninstall/resource.rc
+++ b/C/Util/7zipUninstall/resource.rc
@@ -1,7 +1,7 @@
#include <windows.h>
// #include <winnt.h>
// #include <WinUser.h>
-#include <CommCtrl.h>
+#include <commctrl.h>
#define USE_COPYRIGHT_CR
#include "../../7zVersion.rc"
--- a/C/Util/7zipUninstall/resource.rc.rej
+++ b/C/Util/7zipUninstall/resource.rc.rej
@@ -0,0 +1,10 @@
+--- C/Util/7zipUninstall/resource.rc
++++ C/Util/7zipUninstall/resource.rc
+@@ -1,6 +1,6 @@
+ #include <winnt.h>
+ #include <WinUser.h>
+-#include <CommCtrl.h>
++#include <commctrl.h>
+
+ #define USE_COPYRIGHT_CR
+ #include "../../7zVersion.rc"
--- a/CPP/7zip/7zip_gcc.mak
+++ b/CPP/7zip/7zip_gcc.mak
@@ -142,8 +142,8 @@
DEL_OBJ_EXE = -$(RM) $(O)\*.o $(O)\$(PROG).exe $(O)\$(PROG).dll
endif
-LIB2_GUI = -lOle32 -lGdi32 -lComctl32 -lComdlg32 -lShell32 $(LIB_HTMLHELP)
-LIB2 = -loleaut32 -luuid -ladvapi32 -lUser32 $(LIB2_GUI)
+LIB2_GUI = -lole32 -lgdi32 -lcomctl32 -lcomdlg32 -lshell32 $(LIB_HTMLHELP)
+LIB2 = -loleaut32 -luuid -ladvapi32 -luser32 $(LIB2_GUI)
# v24.00: -DUNICODE and -D_UNICODE are defined in precompilation header files
# CXXFLAGS_EXTRA = -DUNICODE -D_UNICODE
--- a/CPP/7zip/Crypto/RandGen.cpp
+++ b/CPP/7zip/Crypto/RandGen.cpp
@@ -19,7 +19,7 @@
#ifdef USE_STATIC_RtlGenRandom
-// #include <NTSecAPI.h>
+// #include <ntsecapi.h>
EXTERN_C_BEGIN
#ifndef RtlGenRandom
--- a/CPP/7zip/GuiCommon.rc
+++ b/CPP/7zip/GuiCommon.rc
@@ -4,7 +4,7 @@
// #include <WinUser.h>
// for Windows CE:
-#include <CommCtrl.h>
+#include <commctrl.h>
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
--- a/CPP/7zip/UI/FileManager/PanelItemOpen.cpp
+++ b/CPP/7zip/UI/FileManager/PanelItemOpen.cpp
@@ -4,7 +4,7 @@
#include "../../../Common/MyWindows.h"
-#include <TlHelp32.h>
+#include <tlhelp32.h>
#include "../../../Common/IntToString.h"
--- a/CPP/7zip/UI/FileManager/SysIconUtils.h
+++ b/CPP/7zip/UI/FileManager/SysIconUtils.h
@@ -5,7 +5,7 @@
#include "../../../Common/MyWindows.h"
-#include <CommCtrl.h>
+#include <commctrl.h>
#include "../../../Common/MyString.h"
--- a/CPP/Windows/Control/ComboBox.h
+++ b/CPP/Windows/Control/ComboBox.h
@@ -5,7 +5,7 @@
#include "../../Common/MyWindows.h"
-#include <CommCtrl.h>
+#include <commctrl.h>
#include "../Window.h"
--- a/CPP/Windows/Control/ImageList.h
+++ b/CPP/Windows/Control/ImageList.h
@@ -3,7 +3,7 @@
#ifndef ZIP7_INC_WINDOWS_CONTROL_IMAGE_LIST_H
#define ZIP7_INC_WINDOWS_CONTROL_IMAGE_LIST_H
-#include <CommCtrl.h>
+#include <commctrl.h>
#include "../Defs.h"
--- a/CPP/Windows/Control/ListView.h
+++ b/CPP/Windows/Control/ListView.h
@@ -5,7 +5,7 @@
#include "../../Common/MyWindows.h"
-#include <CommCtrl.h>
+#include <commctrl.h>
#include "../Window.h"
--- a/CPP/Windows/Control/ProgressBar.h
+++ b/CPP/Windows/Control/ProgressBar.h
@@ -5,7 +5,7 @@
#include "../../Common/MyWindows.h"
-#include <CommCtrl.h>
+#include <commctrl.h>
#include "../Window.h"
--- a/CPP/Windows/SecurityUtils.h
+++ b/CPP/Windows/SecurityUtils.h
@@ -3,7 +3,7 @@
#ifndef ZIP7_INC_WINDOWS_SECURITY_UTILS_H
#define ZIP7_INC_WINDOWS_SECURITY_UTILS_H
-#include <NTSecAPI.h>
+#include <ntsecapi.h>
#include "Defs.h"
+45 -22
View File
@@ -3,9 +3,16 @@
lib,
fetchzip,
# Only useful on Linux x86/x86_64, and brings in nonfree Open Watcom
# Free MASM-compatible assembler
asmc-linux,
useAsmc ? !useUasm && stdenv.hostPlatform.isx86 && stdenv.hostPlatform.isLinux,
# Unfree Open-Watcom licensed assembler
uasm,
useUasm ? false,
useUasm ?
enableUnfree
&& stdenv.hostPlatform.isx86
&& (stdenv.hostPlatform.isLinux || stdenv.hostPlatform.isWindows),
# RAR code is under non-free unRAR license
# see the meta.license section below for more details
@@ -16,26 +23,34 @@
}:
let
makefile =
{
aarch64-darwin = "../../cmpl_mac_arm64.mak";
x86_64-darwin = "../../cmpl_mac_x64.mak";
aarch64-linux = "../../cmpl_gcc_arm64.mak";
i686-linux = "../../cmpl_gcc_x86.mak";
x86_64-linux = "../../cmpl_gcc_x64.mak";
}
.${stdenv.hostPlatform.system} or "../../cmpl_gcc.mak"; # generic build
makefile = "../../cmpl_${
if stdenv.hostPlatform.isDarwin then
"mac"
else if stdenv.cc.isClang then
"clang"
else
"gcc"
}${
if stdenv.hostPlatform.isx86_64 then
"_x64"
else if stdenv.hostPlatform.isAarch64 then
"_arm64"
else if stdenv.hostPlatform.isi686 then
"_x86"
else
""
}.mak";
in
stdenv.mkDerivation (finalAttrs: {
pname = "7zz";
version = "25.01";
version = "26.00";
src = fetchzip {
url = "https://7-zip.org/a/7z${lib.replaceStrings [ "." ] [ "" ] finalAttrs.version}-src.tar.xz";
hash =
{
free = "sha256-A1BBdSGepobpguzokL1zpjce5EOl0zqABYciv9zCOac=";
unfree = "sha256-Jkj6T4tMols33uyJSOCcVmxh5iBYYCO/rq9dF4NDMko=";
free = "sha256-p914FrQPb+h1a+7YIL8ms2YoIfoS1hTCeLLeBF4DjwY=";
unfree = "sha256-CIgPhjRSE9A0ABQQx1YTZgO+DNb3BDxRo5xOQmuzBuI=";
}
.${if enableUnfree then "unfree" else "free"};
stripRoot = false;
@@ -48,10 +63,6 @@ stdenv.mkDerivation (finalAttrs: {
'';
};
patches = [
./fix-cross-mingw-build.patch
];
postPatch = lib.optionalString stdenv.hostPlatform.isMinGW ''
substituteInPlace CPP/7zip/7zip_gcc.mak C/7zip_gcc_c.mak \
--replace windres.exe ${stdenv.cc.targetPrefix}windres
@@ -88,8 +99,15 @@ stdenv.mkDerivation (finalAttrs: {
"CC=${stdenv.cc.targetPrefix}cc"
"CXX=${stdenv.cc.targetPrefix}c++"
]
++ lib.optionals useUasm [ "MY_ASM=uasm" ]
++ lib.optionals (!useUasm && stdenv.hostPlatform.isx86) [ "USE_ASM=" ]
++ lib.optionals useAsmc [
"MY_ASM=asmc"
]
++ lib.optionals useUasm [
"MY_ASM=uasm"
]
++ lib.optionals (stdenv.hostPlatform.isx86 && !useAsmc && !useUasm) [
"USE_ASM="
]
# it's the compression code with the restriction, see DOC/License.txt
++ lib.optionals (!enableUnfree) [ "DISABLE_RAR_COMPRESS=true" ]
++ lib.optionals (stdenv.hostPlatform.isMinGW) [
@@ -97,7 +115,12 @@ stdenv.mkDerivation (finalAttrs: {
"MSYSTEM=1"
];
nativeBuildInputs = lib.optionals useUasm [ uasm ];
nativeBuildInputs = lib.optionals useAsmc [ asmc-linux ] ++ lib.optionals useUasm [ uasm ];
outputs = [
"out"
"doc"
];
setupHook = ./setup-hook.sh;
@@ -136,7 +159,7 @@ stdenv.mkDerivation (finalAttrs: {
++
# and CPP/7zip/Compress/Rar* are unfree with the unRAR license restriction
# the unRAR compression code is disabled by default
lib.optionals enableUnfree [ unfree ];
lib.optionals enableUnfree [ unfreeRedistributable ];
maintainers = with lib.maintainers; [
anna328p
jk
+34
View File
@@ -0,0 +1,34 @@
{
lib,
stdenv,
fetchFromGitHub,
}:
stdenv.mkDerivation {
pname = "asmc-linux";
version = "2.36.25";
src = fetchFromGitHub {
owner = "nidud";
repo = "asmc_linux";
rev = "4ee70bde4439bdd9c772d08527dba6d50f2e5a88";
hash = "sha256-/yJC1OQGRgy9T/U2VB0MohSsD1ImLnHYM/8Y8fIWhVE=";
};
enableParallelBuilding = true;
installPhase = ''
runHook preInstall
install -Dt $out/bin ./asmc
runHook postInstall
'';
meta = {
description = "MASM-compatible assembler";
homepage = "https://github.com/nidud/asmc_linux";
license = lib.licenses.gpl2Plus;
maintainers = with lib.maintainers; [ ccicnce113424 ];
platforms = with lib.systems.inspect; patternLogicalAnd patterns.isx86_64 patterns.isLinux;
mainProgram = "asmc";
};
}
+43 -9
View File
@@ -12,7 +12,7 @@ stdenv.mkDerivation (finalAttrs: {
src = fetchFromGitHub {
owner = "Terraspace";
repo = "uasm";
repo = "UASM";
tag = "v${finalAttrs.version}r";
hash = "sha256-HaiK2ogE71zwgfhWL7fesMrNZYnh8TV/kE3ZIS0l85w=";
};
@@ -20,22 +20,53 @@ stdenv.mkDerivation (finalAttrs: {
enableParallelBuilding = true;
makefile =
if stdenv.hostPlatform.isDarwin then "Makefile-OSX-Clang-64.mak" else "Makefile-Linux-GCC-64.mak";
makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ];
if stdenv.hostPlatform.isDarwin then
"Makefile-OSX-Clang-64.mak"
else if stdenv.hostPlatform.isWindows then
"Makefile-DOS-GCC.mak"
else
"Makefile-Linux-GCC-64.mak";
# Needed for compiling with GCC > 13
env.CFLAGS = "-std=c99 -Wno-incompatible-pointer-types -Wno-implicit-function-declaration -Wno-int-conversion";
env.NIX_CFLAGS_COMPILE = lib.escapeShellArgs [
"-std=c99"
"-Wno-incompatible-pointer-types"
"-Wno-int-conversion"
"-Wno-implicit-function-declaration"
];
installPhase = ''
runHook preInstall
install -Dt "$out/bin" -m0755 GccUnixR/uasm
install -Dt "$out/share/doc/uasm" -m0644 {Readme,History}.txt Doc/*
${
if stdenv.hostPlatform.isWindows then
''
install -Dm0755 DJGPPr/hjwasm.exe "$out/bin/hjwasm.exe"
install -Dm0755 DJGPPr/hjwasm.exe "$out/bin/uasm.exe"
''
else
''
install -Dt "$out/bin" -m0755 GccUnixR/uasm
''
}
install -Dt "$out/share/doc/${finalAttrs.pname}" -m0644 {Readme,History}.txt Doc/*
runHook postInstall
'';
outputs = [
"out"
"doc"
];
postPatch = ''
substituteInPlace Makefile-DOS-GCC.mak \
--replace-fail "gcc.exe" "${stdenv.cc.targetPrefix}cc"
substituteInPlace Makefile-Linux-GCC-64.mak \
--replace-fail "CC = gcc" "CC=${stdenv.cc.targetPrefix}cc"
'';
passthru.tests.version = testers.testVersion {
package = uasm;
command = "uasm -h";
@@ -46,8 +77,11 @@ stdenv.mkDerivation (finalAttrs: {
homepage = "https://www.terraspace.co.uk/uasm.html";
description = "Free MASM-compatible assembler based on JWasm";
mainProgram = "uasm";
platforms = lib.platforms.unix;
maintainers = [ lib.maintainers.zane ];
platforms = lib.platforms.unix ++ lib.platforms.windows;
maintainers = with lib.maintainers; [
zane
ccicnce113424
];
license = lib.licenses.watcom;
broken = stdenv.hostPlatform.isDarwin;
};