Skip to content

Commit

Permalink
7zz 7-zip 23.01 (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
hemnstill authored Aug 6, 2023
1 parent f43c358 commit 7fca01c
Show file tree
Hide file tree
Showing 8 changed files with 275 additions and 0 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/7-Zip.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: 7-Zip

on: [pull_request, workflow_dispatch]

jobs:
alpine-musl:
if: ${{ vars.CURRENT_TOOL == github.workflow }}
uses: ./.github/workflows/build-alpine.yml
with:
workflow: ${{ github.workflow }}
toolset: musl
version: 3.16

alpine-musl-test:
needs: alpine-musl
if: ${{ vars.CURRENT_TOOL == github.workflow }}
uses: ./.github/workflows/test-alpine.yml
with:
workflow: ${{ github.workflow }}
artifact: build-musl

ubuntu-musl-test:
needs: alpine-musl
if: ${{ vars.CURRENT_TOOL == github.workflow }}
uses: ./.github/workflows/test-ubuntu.yml
with:
workflow: ${{ github.workflow }}
artifact: build-musl

windows-mingw:
if: ${{ vars.CURRENT_TOOL == github.workflow }}
uses: ./.github/workflows/build-windows-msbuild.yml
with:
workflow: ${{ github.workflow }}

test-windows:
needs: windows-mingw
if: ${{ vars.CURRENT_TOOL == github.workflow }}
uses: ./.github/workflows/test-windows.yml
with:
workflow: ${{ github.workflow }}
artifact: build-mingw

test-nanoserver:
needs: windows-mingw
if: ${{ vars.CURRENT_TOOL == github.workflow }}
uses: ./.github/workflows/test-nanoserver.yml
with:
workflow: ${{ github.workflow }}
artifact: build-mingw

release:
needs: [alpine-musl-test,
ubuntu-musl-test,
test-windows,
test-nanoserver]
uses: ./.github/workflows/release.yml
with:
workflow: ${{ github.workflow }}
tool_version: '23.01'
prepare_body: |
bsdtar -Oxf ./build-musl/build-musl.tar.gz build-musl.md >> body.md
bsdtar -Oxf ./build-mingw/build-mingw.tar.gz build-mingw.md >> body.md
artifacts: ./build-musl/build-musl.tar.gz,./build-mingw/build-mingw.tar.gz
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
33 changes: 33 additions & 0 deletions .github/workflows/build-windows-msbuild.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
on:
workflow_call:
inputs:
workflow:
required: true
type: string
toolset:
required: false
type: string
default: 'mingw'

jobs:
build-windows:
runs-on: windows-2019
steps:
- uses: actions/checkout@v3

- name: Add msbuild to PATH
uses: microsoft/[email protected]

- name: Enable Developer Command Prompt
uses: ilammy/msvc-dev-cmd@v1
with:
arch: amd64

- name: build ${{ inputs.workflow }}-windows-${{ inputs.toolset }}
run: |
.tools\busybox64.exe sh ${{ inputs.workflow }}\build_${{ inputs.toolset }}.sh
- uses: actions/upload-artifact@v3
with:
name: build-${{ inputs.toolset }}
path: ./${{ inputs.workflow }}/release/build-${{ inputs.toolset }}.tar.gz
56 changes: 56 additions & 0 deletions 7-Zip/build_mingw.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/bin/bash
dp0="$(realpath "$(dirname "$0")")"
set -e

tool_name="7-Zip"
tool_version="23.01"
self_toolset_name="build-mingw"
release_version_dirpath="$dp0/release/build"

mkdir -p "$release_version_dirpath" && cd "$dp0/release"

download_url="https://www.7-zip.org/a/7z2301-src.tar.xz"
echo "::group::prepare sources $download_url"

"$dp0/../.tools/download_bsdtar.sh"
bsdtar="$dp0/release/bsdtar"

# wget failed: ssl_client: TLS error from peer (alert code 80): 80
curl --location "$download_url" --output "tool-$tool_version.tar.xz"
"$bsdtar" -xf "tool-$tool_version.tar.xz"

echo "::endgroup::"

echo "::group::build"

cd "$dp0/release/CPP/7zip/Bundles/Alone2"
nmake
cp -f "./x64/7zz.exe" "$release_version_dirpath/"

echo "::endgroup::"

cd "$release_version_dirpath"

strip 7zz.exe

{ printf '### %s
%s
SHA-256: %s
<details>
<summary>7zz i</summary>
```
%s
```
</details>
%s
' "$self_toolset_name.tar.gz" "$(./7zz.exe | head -2)" "$(sha256sum 7zz.exe)" "$(./7zz.exe i)" "$download_url"
} > "$self_toolset_name.md"

cat "$self_toolset_name.md"

"$bsdtar" -czvf "../$self_toolset_name.tar.gz" .
63 changes: 63 additions & 0 deletions 7-Zip/build_musl.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#!/bin/bash
dp0="$(realpath "$(dirname "$0")")"
set -e

echo "::group::install deps"

apk update
apk add --no-cache alpine-sdk make linux-headers

echo "::endgroup::"

tool_name="7-Zip"
tool_version="23.01"
self_toolset_name="build-musl"
release_version_dirpath="$dp0/release/build"

mkdir -p "$release_version_dirpath" && cd "$dp0/release"

download_url="https://www.7-zip.org/a/7z2301-src.tar.xz"
echo "::group::prepare sources $download_url"

"$dp0/../.tools/download_bsdtar.sh"
bsdtar="$dp0/release/bsdtar"

# wget failed: ssl_client: TLS error from peer (alert code 80): 80
curl --location "$download_url" --output "tool-$tool_version.tar.xz"
"$bsdtar" -xf "tool-$tool_version.tar.xz"

git apply "$dp0/release/0001-static.patch"

echo "::endgroup::"

echo "::group::build"

cd "$dp0/release/CPP/7zip/Bundles/Alone2"
make -j -f makefile.gcc
cp -f "./_o/7zz" "$release_version_dirpath/"

echo "::endgroup::"

cd "$release_version_dirpath"

strip 7zz

{ printf '### %s
%s
SHA-256: %s
<details>
<summary>7zz i</summary>
```
%s
```
</details>
' "$self_toolset_name.tar.gz" "$(./7zz | head -2)" "$(sha256sum 7zz)" "$(./7zz i)"
} > "$self_toolset_name.md"

cat "$self_toolset_name.md"

"$bsdtar" -czvf "../$self_toolset_name.tar.gz" .
38 changes: 38 additions & 0 deletions 7-Zip/release/0001-static.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
From 1d9a48d5589fd888d63f363ed654f81c1693bec7 Mon Sep 17 00:00:00 2001
From: Reshetnikov Alexandr <[email protected]>
Date: Sun, 6 Aug 2023 22:01:23 +0400
Subject: [PATCH] + static - affinity

---
C/Threads.h | 1 -
CPP/7zip/7zip_gcc.mak | 2 ++
2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/C/Threads.h b/C/Threads.h
index c6aa6a8..7abb2ab 100644
--- a/C/Threads.h
+++ b/C/Threads.h
@@ -12,7 +12,6 @@
#if defined(__linux__)
#if !defined(__APPLE__) && !defined(_AIX) && !defined(__ANDROID__)
#ifndef Z7_AFFINITY_DISABLE
-#define Z7_AFFINITY_SUPPORTED
// #pragma message(" ==== Z7_AFFINITY_SUPPORTED")
// #define _GNU_SOURCE
#endif
diff --git a/CPP/7zip/7zip_gcc.mak b/CPP/7zip/7zip_gcc.mak
index a8eb6e3..bf3e671 100644
--- a/CPP/7zip/7zip_gcc.mak
+++ b/CPP/7zip/7zip_gcc.mak
@@ -68,6 +68,8 @@ endif
endif
endif

+LDFLAGS_STATIC_2 = -static
+
LDFLAGS_STATIC = -DNDEBUG $(LDFLAGS_STATIC_2)

ifndef O
--
2.37.2.windows.2

9 changes: 9 additions & 0 deletions 7-Zip/test_linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

testVersion() {
assertEquals "
7-Zip (z) 23.01 (x64) : Copyright (c) 1999-2023 Igor Pavlov : 2023-06-20" "$(../bin/7zz | head -2)"
}

# Load and run shUnit2.
source "../.tests/shunit2/shunit2"
9 changes: 9 additions & 0 deletions 7-Zip/test_windows.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

testVersion() {
assertEquals "
7-Zip (z) 23.01 (x64) : Copyright (c) 1999-2023 Igor Pavlov : 2023-06-20" "$(../bin/7zz.exe | dos2unix | head -2)"
}

# Load and run shUnit2.
source "../.tests/shunit2/shunit2"
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
| [![GitHub release (by tag)](https://img.shields.io/github/downloads/hemnstill/StandaloneTools/mypy-1.4.1/total?label=⭳%20mypy-1.4.1)](https://github.com/hemnstill/StandaloneTools/releases/tag/mypy-1.4.1) | [![GitHub Repo stars](https://img.shields.io/github/stars/python/mypy?style=social&label=mypy)](https://github.com/python/mypy) [![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/python/mypy)](https://mypy.readthedocs.io/en/latest/) |
| [![GitHub release (by tag)](https://img.shields.io/github/downloads/hemnstill/StandaloneTools/ansible-8.1.0/total?label=⭳%20ansible-8.1.0-core-2.15.1)](https://github.com/hemnstill/StandaloneTools/releases/tag/ansible-8.1.0) | [![GitHub Repo stars](https://img.shields.io/github/stars/ansible/ansible?style=social&label=ansible)](https://github.com/ansible/ansible) [![PyPI](https://img.shields.io/pypi/v/ansible)](https://pypi.org/project/ansible/) [![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/ansible/ansible)](https://docs.ansible.com/ansible/devel/reference_appendices/release_and_maintenance.html) |
| [![GitHub release (by tag)](https://img.shields.io/github/downloads/hemnstill/StandaloneTools/bsdtar-3.6.2/total?label=⭳%20bsdtar-3.6.2)](https://github.com/hemnstill/StandaloneTools/releases/tag/bsdtar-3.6.2) | [![GitHub Repo stars](https://img.shields.io/github/stars/libarchive/libarchive?style=social&label=libarchive)](https://github.com/libarchive/libarchive) [![GitHub release (latest by date including pre-releases)](https://img.shields.io/github/v/release/libarchive/libarchive)](https://github.com/libarchive/libarchive/releases/latest) |
| [![GitHub release (by tag)](https://img.shields.io/github/downloads/hemnstill/StandaloneTools/7-Zip-23.01/total?label=⭳%207-Zip-23.01)](https://github.com/hemnstill/StandaloneTools/releases/tag/7-Zip-23.01) | [![SourceForge Downloads](https://img.shields.io/sourceforge/dm/sevenzip?style=social&label=7-Zip)](https://sourceforge.net/projects/sevenzip/) |
| [![GitHub release (by tag)](https://img.shields.io/github/downloads/hemnstill/StandaloneTools/pg_dump-15.1/total?label=⭳%20pg_dump-15.1)](https://github.com/hemnstill/StandaloneTools/releases/tag/pg_dump-15.1) | [![GitHub Repo stars](https://img.shields.io/github/stars/postgres/postgres?style=social&label=postgres)](https://github.com/postgres/postgres) [![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/postgres/postgres)](https://www.postgresql.org/docs/current/index.html) |
| [![GitHub release (by tag)](https://img.shields.io/github/downloads/hemnstill/StandaloneTools/busybox-1.35.0-FRP-4784/total?label=⭳%20busybox-1.35.0-FRP-4784)](https://github.com/hemnstill/StandaloneTools/releases/tag/busybox-1.35.0-FRP-4784) | [![GitHub Repo stars](https://img.shields.io/github/stars/rmyorston/busybox-w32?style=social&label=busybox-w32)](https://github.com/rmyorston/busybox-w32) [![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/rmyorston/busybox-w32)](https://frippery.org/busybox/release-notes/current.html) |
| [![GitHub release (by tag)](https://img.shields.io/github/downloads/hemnstill/StandaloneTools/far2l-2.5.1/total?label=⭳%20far2l-2.5.1)](https://github.com/hemnstill/StandaloneTools/releases/tag/far2l-2.5.1) | [![GitHub Repo stars](https://img.shields.io/github/stars/elfmz/far2l?style=social&label=far2l)](https://github.com/elfmz/far2l) [![GitHub release (latest by date including pre-releases)](https://img.shields.io/github/v/release/elfmz/far2l)](https://github.com/elfmz/far2l/releases/latest) |
Expand Down

0 comments on commit 7fca01c

Please sign in to comment.