From 87760dab7a51aa16f51a599ce4cdbf2ea4b033b7 Mon Sep 17 00:00:00 2001 From: Alexandr Reshetnikov Date: Sat, 4 Mar 2023 19:52:50 +0400 Subject: [PATCH] far2l 2.5.0 with extract script (#48) add `gnu` version with plugins --- .github/workflows/far2l.yml | 72 ++++++++++--------------- README.md | 2 +- far2l/build_glibc-p.sh | 103 ++++++++++++++++++++++++++++++++++++ far2l/build_glibc.sh | 68 ++++++++++++++++++------ far2l/build_musl.sh | 64 +++++++++++++++++----- far2l/test_linux.sh | 8 +++ 6 files changed, 242 insertions(+), 75 deletions(-) create mode 100755 far2l/build_glibc-p.sh create mode 100755 far2l/test_linux.sh diff --git a/.github/workflows/far2l.yml b/.github/workflows/far2l.yml index 74d0df18c..c8f950fdb 100644 --- a/.github/workflows/far2l.yml +++ b/.github/workflows/far2l.yml @@ -10,14 +10,14 @@ jobs: secrets: _WORKFLOW: ${{ secrets._CURRENT_TOOL }} - far2l-alpine-musl: + alpine-musl: needs: prejob if: ${{ needs.prejob.outputs.workflow == github.workflow }} uses: ./.github/workflows/build-alpine.yml with: workflow: ${{ github.workflow }} - far2l-ubuntu-glibc: + ubuntu-glibc: needs: prejob if: ${{ needs.prejob.outputs.workflow == github.workflow }} uses: ./.github/workflows/build-ubuntu.yml @@ -25,66 +25,48 @@ jobs: workflow: ${{ github.workflow }} version: 18.04 - far2l-alpine-musl-test: - needs: far2l-alpine-musl + ubuntu-glibc-p: + needs: prejob if: ${{ needs.prejob.outputs.workflow == github.workflow }} - uses: ./.github/workflows/test-alpine.yml + uses: ./.github/workflows/build-ubuntu.yml with: - artifact: build-musl - test-run: | - ldd ./${{ github.workflow }} - ./${{ github.workflow }} --help | head -n2 + workflow: ${{ github.workflow }} + version: 18.04 + toolset: glibc-p - far2l-alpine-glibc-test: - needs: far2l-ubuntu-glibc - if: ${{ needs.prejob.outputs.workflow == github.workflow }} - uses: ./.github/workflows/test-alpine.yml + test-ubuntu: + needs: ubuntu-glibc + uses: ./.github/workflows/test-ubuntu.yml with: + workflow: ${{ github.workflow }} artifact: build-glibc - test-run: | - wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub - wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.34-r0/glibc-2.34-r0.apk - apk add --no-cache glibc-2.34-r0.apk - - ldd ./${{ github.workflow }} || true - ./${{ github.workflow }} --help | head -n2 - far2l-ubuntu-musl-test: - needs: far2l-alpine-musl - if: ${{ needs.prejob.outputs.workflow == github.workflow }} + test-ubuntu-p: + needs: ubuntu-glibc-p uses: ./.github/workflows/test-ubuntu.yml with: - artifact: build-musl - test-run: | - apt update - apt -y install musl - ln -s /usr/lib/x86_64-linux-musl/libc.so /lib/libc.musl-x86_64.so.1 - - ldd ./${{ github.workflow }} - ./${{ github.workflow }} --help | head -n2 + workflow: ${{ github.workflow }} + artifact: build-glibc-p - far2l-ubuntu-glibc-test: - needs: far2l-ubuntu-glibc - if: ${{ needs.prejob.outputs.workflow == github.workflow }} - uses: ./.github/workflows/test-ubuntu.yml + test-alpine: + needs: alpine-musl + uses: ./.github/workflows/test-alpine.yml with: - artifact: build-glibc - test-run: | - ldd ./${{ github.workflow }} - ./${{ github.workflow }} --help | head -n2 + workflow: ${{ github.workflow }} + artifact: build-musl far2l-release: - needs: [far2l-alpine-musl-test, - far2l-alpine-glibc-test, - far2l-ubuntu-musl-test, - far2l-ubuntu-glibc-test] + needs: [test-alpine, + test-ubuntu, + test-ubuntu-p] uses: ./.github/workflows/release.yml with: workflow: ${{ github.workflow }} - tool_version: '2.4.0-beta-694878351f' + tool_version: '2.5.0' prepare_body: | bsdtar -Oxf ./build-musl/build-musl.tar.gz build-musl.md >> body.md bsdtar -Oxf ./build-glibc/build-glibc.tar.gz build-glibc.md >> body.md - artifacts: ./build-musl/build-musl.tar.gz,./build-glibc/build-glibc.tar.gz + bsdtar -Oxf ./build-glibc-p/build-glibc-p.tar.gz build-glibc-p.md >> body.md + artifacts: ./build-musl/build-musl.tar.gz,./build-glibc/build-glibc.tar.gz,./build-glibc-p/build-glibc-p.tar.gz secrets: token: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.md b/README.md index 518ac9643..680ebbfbf 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ | [![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/pcre2grep-10.40/total?label=⭳%20pcre2grep-10.40)](https://github.com/hemnstill/StandaloneTools/releases/tag/pcre2grep-10.40) | [![GitHub Repo stars](https://img.shields.io/github/stars/PCRE2Project/pcre2?style=social&label=PCRE2)](https://github.com/PCRE2Project/pcre2) [![GitHub release (latest by date including pre-releases)](https://img.shields.io/github/v/release/PCRE2Project/pcre2)](https://github.com/PCRE2Project/pcre2/releases/latest) | | [![GitHub release (by tag)](https://img.shields.io/github/downloads/hemnstill/StandaloneTools/openssl-3.0.1/total?label=⭳%20openssl-3.0.1)](https://github.com/hemnstill/StandaloneTools/releases/tag/openssl-3.0.1)
[![GitHub release (by tag)](https://img.shields.io/github/downloads/hemnstill/StandaloneTools/openssl-1_1_1m/total?label=⭳%20openssl-1_1_1m)](https://github.com/hemnstill/StandaloneTools/releases/tag/openssl-1_1_1m) | [![GitHub Repo stars](https://img.shields.io/github/stars/openssl/openssl?style=social&label=OpenSSL)](https://github.com/openssl/openssl) [![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/openssl/openssl)](https://www.openssl.org/news/changelog.html) | -| [![GitHub release (by tag)](https://img.shields.io/github/downloads/hemnstill/StandaloneTools/far2l-2.4.0-beta/total?label=⭳%20far2l-2.4.0-beta)](https://github.com/hemnstill/StandaloneTools/releases/tag/far2l-2.4.0-beta) | [![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) | +| [![GitHub release (by tag)](https://img.shields.io/github/downloads/hemnstill/StandaloneTools/far2l-2.5.0/total?label=⭳%20far2l-2.5.0)](https://github.com/hemnstill/StandaloneTools/releases/tag/far2l-2.5.0) | [![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) | | [![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/python-3.11.1/total?label=⭳%20python-3.11.1)](https://github.com/hemnstill/StandaloneTools/releases/tag/python-3.11.1) | [![GitHub Repo stars](https://img.shields.io/github/stars/indygreg/python-build-standalone?style=social&label=python-build-standalone)](https://github.com/indygreg/python-build-standalone) [![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/indygreg/python-build-standalone)](https://python-build-standalone.readthedocs.io/en/latest/)
[![GitHub Repo stars](https://img.shields.io/github/stars/python/cpython?style=social&label=python)](https://github.com/python/cpython) [![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/python/cpython)](https://docs.python.org/3/) | diff --git a/far2l/build_glibc-p.sh b/far2l/build_glibc-p.sh new file mode 100755 index 000000000..138a6b187 --- /dev/null +++ b/far2l/build_glibc-p.sh @@ -0,0 +1,103 @@ +#!/bin/bash +dp0="$(realpath "$(dirname "$0")")" +set -e +export DEBIAN_FRONTEND=noninteractive + +echo "::group::install deps" + +apt update +apt install -y \ + build-essential \ + libspdlog-dev \ + patchelf \ + wget \ + gawk \ + m4 \ + libx11-dev \ + libxi-dev \ + libxerces-c-dev \ + libuchardet-dev \ + libssl-dev \ + libnfs-dev \ + libneon27-dev \ + libarchive-dev \ + libpcre3-dev \ + libsmbclient-dev \ + libfmt-dev \ + libssh-dev \ + cmake git + +echo "::endgroup::" + +tool_name="far2l" +tool_version="2.5.0" +self_name="$tool_name-$tool_version" +self_toolset_name="build-glibc-p" +self_url="https://github.com/hemnstill/StandaloneTools/releases/download/$self_name/$self_toolset_name.tar.gz" + +echo "::set-output name=tool_name::$tool_name" +echo "::set-output name=tool_version::$tool_version" + +download_url="https://github.com/elfmz/far2l/archive/v_$tool_version.tar.gz" +echo "::group::prepare sources $download_url" + +# Download release +mkdir -p "$dp0/release/build" && cd "$dp0/release" +wget "$download_url" -O "$tool_version.tar.gz" +tar -xf "$tool_version.tar.gz" && cd "far2l-v_$tool_version" + +echo "::endgroup::" + +echo "::group::build" + +cmake_command=$(printf 'cmake -DUSEWX=no -DUSEUCD=no -DCMAKE_EXE_LINKER_FLAGS="%s" -DCMAKE_BUILD_TYPE=Release .' \ + "-l:libuchardet.a -static-libstdc++ -static-libgcc") +echo ">> $cmake_command" +eval "$cmake_command" + +cmake --build . --config Release + +echo "::endgroup::" + +cp -rf "$dp0/release/far2l-v_$tool_version/install/." "$dp0/release/build/" + +cd "$dp0/release/build" +strip "$tool_name" +chmod +x "$tool_name" + +{ printf '### %s +`wget -qO- %s | tar -xz` + +SHA-256: %s +%s + +
+ ldd far2l + +``` +%s +``` +
+ +
+ ldd colorer.far-plug-wide + +``` +%s +``` +
+ +%s + +' "$self_toolset_name.tar.gz" \ + "$self_url" \ + "$(sha256sum < $tool_name)" \ + "$("./$tool_name" --help | head -n2)" \ + "$(ldd $tool_name)" \ + "$(ldd "./Plugins/colorer/plug/colorer.far-plug-wide")" \ + "$download_url" +} > "$self_toolset_name.md" + +cat "$self_toolset_name.md" + +tar -czvf "../$self_toolset_name.tar.gz" . diff --git a/far2l/build_glibc.sh b/far2l/build_glibc.sh index 429260f4d..2cc47a32e 100755 --- a/far2l/build_glibc.sh +++ b/far2l/build_glibc.sh @@ -6,22 +6,45 @@ export DEBIAN_FRONTEND=noninteractive echo "::group::install deps" apt update -apt install -y build-essential libspdlog-dev patchelf wget gawk m4 libx11-dev libxi-dev libxerces-c-dev libuchardet-dev libssh-dev libssl-dev libnfs-dev libneon27-dev libarchive-dev libpcre3-dev cmake git +apt install -y \ + build-essential \ + libspdlog-dev \ + patchelf \ + wget \ + gawk \ + m4 \ + libx11-dev \ + libxi-dev \ + libxerces-c-dev \ + libuchardet-dev \ + libssl-dev \ + libnfs-dev \ + libneon27-dev \ + libarchive-dev \ + libpcre3-dev \ + libsmbclient-dev \ + libfmt-dev \ + libssh-dev \ + cmake git echo "::endgroup::" tool_name="far2l" -tool_version="694878351f8201fa8682e68110ebef1cd9f5ad4b" +tool_version="2.5.0" +self_name="$tool_name-$tool_version" +self_toolset_name="build-glibc" +self_url="https://github.com/hemnstill/StandaloneTools/releases/download/$self_name/$self_toolset_name.tar.gz" + echo "::set-output name=tool_name::$tool_name" echo "::set-output name=tool_version::$tool_version" -download_url="https://github.com/elfmz/far2l/archive/$tool_version.tar.gz" +download_url="https://github.com/elfmz/far2l/archive/v_$tool_version.tar.gz" echo "::group::prepare sources $download_url" # Download release -mkdir -p "$dp0/release" && cd "$dp0/release" +mkdir -p "$dp0/release/build" && cd "$dp0/release" wget "$download_url" -O "$tool_version.tar.gz" -tar -xf "$tool_version.tar.gz" && cd "far2l-$tool_version" +tar -xf "$tool_version.tar.gz" && cd "far2l-v_$tool_version" echo "::endgroup::" @@ -46,9 +69,9 @@ without_plugins="\ -DTMPPANEL=no \ " -cmake_command=$(printf 'cmake -DUSEWX=no -DUSEUCD=no %s -DCMAKE_EXE_LINKER_FLAGS="%s" -DCMAKE_BUILD_TYPE=Release .' \ -"$without_plugins" \ -"-l:libuchardet.a -static-libstdc++ -static-libgcc") +cmake_command=$(printf 'cmake -DUSEWX=no %s -DUSEUCD=no -DCMAKE_EXE_LINKER_FLAGS="%s" -DCMAKE_BUILD_TYPE=Release .' \ + "$without_plugins" \ + "-l:libuchardet.a -static-libstdc++ -static-libgcc") echo ">> $cmake_command" eval "$cmake_command" @@ -56,21 +79,36 @@ cmake --build . --config Release echo "::endgroup::" -cp -rf "$dp0/release/far2l-$tool_version/install/." "$dp0/release/build/" +cp -rf "$dp0/release/far2l-v_$tool_version/install/." "$dp0/release/build/" cd "$dp0/release/build" strip "$tool_name" chmod +x "$tool_name" -{ printf '### glibc version (without plugins): +{ printf '### %s (without plugins) +`wget -qO- %s | tar -xz` -ldd: %s SHA-256: %s %s + +
+ ldd far2l + +``` +%s +``` +
+ %s -' "$(ldd $tool_name)" "$(sha256sum < $tool_name)" "$("./$tool_name" --help | head -n2)" "$download_url" -} > build-glibc.md -cat build-glibc.md +' "$self_toolset_name.tar.gz" \ + "$self_url" \ + "$(sha256sum < $tool_name)" \ + "$("./$tool_name" --help | head -n2)" \ + "$(ldd $tool_name)" \ + "$download_url" +} > "$self_toolset_name.md" + +cat "$self_toolset_name.md" -tar -czvf ../build-glibc.tar.gz . +tar -czvf "../$self_toolset_name.tar.gz" . diff --git a/far2l/build_musl.sh b/far2l/build_musl.sh index 77aee46f4..2daf6a5df 100755 --- a/far2l/build_musl.sh +++ b/far2l/build_musl.sh @@ -5,24 +5,44 @@ set -e echo "::group::install deps" apk update -apk add --no-cache gawk m4 libssh-dev libressl-dev libnfs-dev libarchive-dev cmake alpine-sdk linux-headers musl-dev git -apk add --no-cache uchardet-dev neon-dev spdlog-dev xerces-c-dev libexecinfo-dev -apk add --no-cache uchardet-static libexecinfo-static +apk add --no-cache \ + gawk \ + m4 \ + libssh-dev \ + libressl-dev \ + libnfs-dev \ + libarchive-dev \ + cmake \ + alpine-sdk \ + linux-headers \ + musl-dev \ + git \ + uchardet-dev \ + neon-dev \ + spdlog-dev \ + xerces-c-dev \ + libexecinfo-dev \ + uchardet-static \ + libexecinfo-static echo "::endgroup::" tool_name="far2l" -tool_version="694878351f8201fa8682e68110ebef1cd9f5ad4b" +tool_version="2.5.0" +self_name="$tool_name-$tool_version" +self_toolset_name="build-musl" +self_url="https://github.com/hemnstill/StandaloneTools/releases/download/$self_name/$self_toolset_name.tar.gz" + echo "::set-output name=tool_name::$tool_name" echo "::set-output name=tool_version::$tool_version" -download_url="https://github.com/elfmz/far2l/archive/$tool_version.tar.gz" +download_url="https://github.com/elfmz/far2l/archive/v_$tool_version.tar.gz" echo "::group::prepare sources $download_url" # Download release -mkdir -p "$dp0/release" && cd "$dp0/release" +mkdir -p "$dp0/release/build" && cd "$dp0/release" wget "$download_url" -O "$tool_version.tar.gz" -tar -xf "$tool_version.tar.gz" && cd "far2l-$tool_version" +tar -xf "$tool_version.tar.gz" && cd "far2l-v_$tool_version" echo "::endgroup::" @@ -57,20 +77,36 @@ cmake --build . --config Release echo "::endgroup::" -cp -rf "$dp0/release/far2l-$tool_version/install/." "$dp0/release/build/" +cp -rf "$dp0/release/far2l-v_$tool_version/install/." "$dp0/release/build/" cd "$dp0/release/build" strip "$tool_name" chmod +x "$tool_name" -{ printf '### musl version (without plugins): +{ printf '### %s (without plugins) +`wget -qO- %s | tar -xz` -ldd: %s SHA-256: %s %s -' "$(ldd $tool_name)" "$(sha256sum < $tool_name)" "$("./$tool_name" --help | head -n2)" -} > build-musl.md -cat build-musl.md +
+ ldd far2l + +``` +%s +``` +
+ +%s + +' "$self_toolset_name.tar.gz" \ + "$self_url" \ + "$(sha256sum < $tool_name)" \ + "$("./$tool_name" --help | head -n2)" \ + "$(ldd $tool_name)" \ + "$download_url" +} > "$self_toolset_name.md" + +cat "$self_toolset_name.md" -tar -czvf ../build-musl.tar.gz . +tar -czvf "../$self_toolset_name.tar.gz" . diff --git a/far2l/test_linux.sh b/far2l/test_linux.sh new file mode 100755 index 000000000..8430cf2c7 --- /dev/null +++ b/far2l/test_linux.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +test_version() { + assertEquals "FAR2L - oldschool file manager, with built-in terminal and other usefullness'es" "$(../bin/far2l --help | head -1)" +} + +# Load and run shUnit2. +source "../.tests/shunit2/shunit2"