mirror of
https://github.com/9001/copyparty.git
synced 2026-03-31 04:22:38 +10:00
webdeps: vendor asmcrypto.js;
npm is no longer able to build it, and the build output never changed since copyparty v0.11.20 (2021-06-20) / asmcrypto 2821dd1dedd1196c378f5854037dda5c869313f3 (2018-12-02) one final pass of reasonable size-golfing was done by hand deflated with pigz -11 -I250
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
FROM alpine:3.18
|
||||
FROM alpine:3.23
|
||||
WORKDIR /z
|
||||
ENV ver_asmcrypto=c72492f4a66e17a0e5dd8ad7874de354f3ccdaa5 \
|
||||
ver_hashwasm=4.12.0 \
|
||||
ENV ver_hashwasm=4.12.0 \
|
||||
ver_marked=4.3.0 \
|
||||
ver_dompf=3.3.1 \
|
||||
ver_mde=2.18.0 \
|
||||
@@ -16,7 +15,6 @@ ENV ver_asmcrypto=c72492f4a66e17a0e5dd8ad7874de354f3ccdaa5 \
|
||||
# https://github.com/codemirror/codemirror5/releases
|
||||
# https://github.com/cure53/DOMPurify/releases
|
||||
# https://github.com/Daninet/hash-wasm/releases
|
||||
# https://github.com/openpgpjs/asmcrypto.js/commits/main/
|
||||
# https://github.com/google/zopfli/tags
|
||||
|
||||
|
||||
@@ -28,7 +26,6 @@ RUN mkdir -p /z/dist/no-pk \
|
||||
bash brotli cmake make g++ git gzip lame npm patch pigz \
|
||||
python3 python3-dev py3-brotli sox tar unzip wget \
|
||||
&& rm -f /usr/lib/python3*/EXTERNALLY-MANAGED \
|
||||
&& wget https://github.com/openpgpjs/asmcrypto.js/archive/$ver_asmcrypto.tar.gz -O asmcrypto.tgz \
|
||||
&& wget https://github.com/markedjs/marked/archive/v$ver_marked.tar.gz -O marked.tgz \
|
||||
&& wget https://github.com/Ionaru/easy-markdown-editor/archive/$ver_mde.tar.gz -O mde.tgz \
|
||||
&& wget https://github.com/codemirror/codemirror5/archive/$ver_codemirror.tar.gz -O codemirror.tgz \
|
||||
@@ -41,9 +38,6 @@ RUN mkdir -p /z/dist/no-pk \
|
||||
&& (mkdir hash-wasm \
|
||||
&& cd hash-wasm \
|
||||
&& unzip ../hash-wasm.zip) \
|
||||
&& (tar --no-same-owner -xf asmcrypto.tgz \
|
||||
&& cd asmcrypto.js-$ver_asmcrypto \
|
||||
&& npm install ) \
|
||||
&& (tar --no-same-owner -xf marked.tgz \
|
||||
&& cd marked-$ver_marked \
|
||||
&& npm install \
|
||||
@@ -71,6 +65,7 @@ RUN /z/busy-mp3.sh \
|
||||
RUN tar --no-same-owner -xf zopfli.tgz \
|
||||
&& cd zopfli* \
|
||||
&& cmake \
|
||||
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
|
||||
-DCMAKE_INSTALL_PREFIX=/usr \
|
||||
-DZOPFLI_BUILD_SHARED=ON \
|
||||
-B build \
|
||||
@@ -81,13 +76,6 @@ RUN tar --no-same-owner -xf zopfli.tgz \
|
||||
&& python3 -m pip install fonttools zopfli
|
||||
|
||||
|
||||
# build asmcrypto
|
||||
RUN cd asmcrypto.js-$ver_asmcrypto \
|
||||
&& echo "export { Sha512 } from './hash/sha512/sha512';" > src/entry-export_all.ts \
|
||||
&& node -r esm build.js \
|
||||
&& awk '/HMAC state/{o=1} /var HEAP/{o=0} /function hmac_reset/{o=1} /return \{/{o=0} /var __extends =/{o=1} /var Hash =/{o=0} /hmac_|pbkdf2_/{next} o{next} {gsub(/IllegalStateError/,"Exception")} {sub(/^ +/,"");sub(/^\/\/ .*/,"");sub(/;$/," ;")} 1' < asmcrypto.all.es5.js > /z/dist/sha512.ac.js
|
||||
|
||||
|
||||
# build hash-wasm
|
||||
RUN cd hash-wasm/dist \
|
||||
&& mv sha512.umd.min.js /z/dist/sha512.hw.js
|
||||
|
||||
@@ -151,6 +151,7 @@ done
|
||||
rm -rf contrib
|
||||
[ $fast ] && sed -ri s/573/10/ copyparty/web/Makefile
|
||||
(cd copyparty/web && make -j$(nproc) && rm Makefile)
|
||||
rm -f copyparty/web/deps/README.md
|
||||
|
||||
# build
|
||||
python3 -m build
|
||||
|
||||
@@ -435,7 +435,7 @@ find -name py.typed -delete
|
||||
find -type f \( -name .DS_Store -or -name ._.DS_Store \) -delete
|
||||
find -type f -name ._\* | while IFS= read -r f; do cmp <(printf '\x00\x05\x16') <(head -c 3 -- "$f") && rm -fv -- "$f"; done
|
||||
|
||||
rm -f copyparty/web/deps/*.full.* copyparty/web/dbg-* copyparty/web/Makefile
|
||||
rm -f copyparty/web/deps/*.full.* copyparty/web/deps/README.md copyparty/web/dbg-* copyparty/web/Makefile
|
||||
|
||||
find copyparty | LC_ALL=C sort | sed -r 's/\.gz$//;s/$/,/' > have
|
||||
cat have | while IFS= read -r x; do
|
||||
|
||||
@@ -91,7 +91,8 @@ grep -qE "^VERSION *= \(${commaver}\)$" copyparty/__version__.py ||
|
||||
}
|
||||
|
||||
rm -rf .vscode
|
||||
rm \
|
||||
rm -f \
|
||||
copyparty/web/deps/README.md \
|
||||
.gitattributes \
|
||||
.gitignore
|
||||
|
||||
|
||||
Reference in New Issue
Block a user