Skip to content

Commit 5cba040

Browse files
authored
movim: 0.29 → 0.29.1 (#377193)
2 parents 7346ad4 + e744456 commit 5cba040

File tree

1 file changed

+56
-40
lines changed

1 file changed

+56
-40
lines changed

pkgs/by-name/mo/movim/package.nix

Lines changed: 56 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ let
1818
defaultMinifyOpts = {
1919
script = {
2020
enable = false;
21-
target = "es2021";
21+
target = "es2020";
2222
};
2323
style = {
2424
enable = false;
25-
browserslist = "defaults, Firefox ESR, last 20 Firefox major versions, last 20 Chrome major versions, last 3 Safari major versions, last 1 KaiOS version, and supports css-variables";
25+
browserslist = "defaults, Firefox ESR, Firefox 91, last 20 Firefox major versions, last 20 Chrome major versions, last 3 Safari major versions, last 1 KaiOS version, and supports css-variables";
2626
};
2727
svg = {
2828
enable = false;
@@ -44,13 +44,13 @@ let
4444
in
4545
php.buildComposerProject2 (finalAttrs: {
4646
pname = "movim";
47-
version = "0.29";
47+
version = "0.29.1";
4848

4949
src = fetchFromGitHub {
5050
owner = "movim";
5151
repo = "movim";
5252
tag = "v${finalAttrs.version}";
53-
hash = "sha256-hAOT3n0i9t3uWMjqWJlOs4Vakq3y4+GhiFZ4n3jVqtw=";
53+
hash = "sha256-8YbRqlppD4tWqCki6v3F1cP8BcG66kAa3njEdPIRPhs=";
5454
};
5555

5656
php = php.buildEnv (
@@ -98,7 +98,7 @@ php.buildComposerProject2 (finalAttrs: {
9898
# pinned commonmark
9999
composerStrictValidation = false;
100100

101-
vendorHash = "sha256-+twzmUayrAj65ixEsweHM6886nN/6PYUCTSLMc+EmVE=";
101+
vendorHash = "sha256-Y1H7jvO/P4R+Rb4V87pha3Icd2Iy7VyzwVDPX72aMqA=";
102102

103103
postPatch = ''
104104
# Our modules are already wrapped, removes missing *.so warnings;
@@ -123,47 +123,63 @@ php.buildComposerProject2 (finalAttrs: {
123123
'';
124124

125125
preBuild =
126-
lib.optionalString minify.script.enable ''
127-
find ./public -type f -iname "*.js" -print0 \
128-
| xargs -0 -n 1 -P $NIX_BUILD_CORES ${writeShellScript "movim_script_minify" ''
129-
file="$1"
130-
tmp="$(mktemp)"
131-
esbuild $file --minify --target=${lib.escapeShellArg minify.script.target} --outfile=$tmp
132-
[[ "$(stat -c %s $tmp)" -lt "$(stat -c %s $file)" ]] && mv $tmp $file
133-
''}
134-
''
135-
+ lib.optionalString minify.style.enable ''
136-
find ./public -type f -iname "*.css" -print0 \
137-
| xargs -0 -n 1 -P $NIX_BUILD_CORES ${writeShellScript "movim_style_minify" ''
138-
export BROWSERLIST="${lib.escapeShellArg minify.style.browserslist}"
139-
file="$1"
140-
tmp="$(mktemp)"
141-
lightningcss $file --minify --browserslist --output-file=$tmp
142-
[[ "$(stat -c %s $tmp)" -lt "$(stat -c %s $file)" ]] && mv $tmp $file
143-
''}
144-
''
145-
+ lib.optionalString minify.svg.enable ''
146-
find ./public -type f -iname "*.svg" -a -not -path "*/emojis/*" -print0 \
147-
| xargs -0 -n 1 -P $NIX_BUILD_CORES ${writeShellScript "movim_svg_minify" ''
148-
file="$1"
149-
tmp="$(mktemp)"
150-
scour -i $file -o $tmp --disable-style-to-xml --enable-comment-stripping --enable-viewboxing --indent=tab
151-
[[ "$(stat -c %s $tmp)" -lt "$(stat -c %s $file)" ]] && mv $tmp $file
152-
''}
153-
'';
126+
lib.optionalString minify.script.enable
127+
# sh
128+
''
129+
find ./public -type f -iname "*.js" -print0 \
130+
| xargs -0 -n 1 -P $NIX_BUILD_CORES ${writeShellScript "movim_script_minify" ''
131+
file="$1"
132+
tmp="$(mktemp)"
133+
esbuild $file --minify --target=${lib.escapeShellArg minify.script.target} --outfile=$tmp
134+
[ "$(stat -c %s $tmp)" -lt "$(stat -c %s $file)" ] && mv $tmp $file
135+
''}
136+
''
137+
+
138+
lib.optionalString minify.style.enable
139+
# sh
140+
''
141+
find ./public -type f -iname "*.css" -print0 \
142+
| xargs -0 -n 1 -P $NIX_BUILD_CORES ${writeShellScript "movim_style_minify" ''
143+
export BROWSERLIST="${lib.escapeShellArg minify.style.browserslist}"
144+
file="$1"
145+
tmp="$(mktemp)"
146+
lightningcss $file --minify --browserslist --output-file=$tmp
147+
[ "$(stat -c %s $tmp)" -lt "$(stat -c %s $file)" ] && mv $tmp $file
148+
''}
149+
''
150+
+
151+
lib.optionalString minify.svg.enable
152+
# sh
153+
''
154+
find ./public -type f -iname "*.svg" -a -not -path "*/emojis/*" -print0 \
155+
| xargs -0 -n 1 -P $NIX_BUILD_CORES ${writeShellScript "movim_svg_minify" ''
156+
file="$1"
157+
tmp="$(mktemp)"
158+
scour -i $file -o $tmp --disable-style-to-xml --enable-comment-stripping --enable-viewboxing --indent=tab
159+
[ "$(stat -c %s $tmp)" -lt "$(stat -c %s $file)" ] && mv $tmp $file
160+
''}
161+
'';
154162

155163
postInstall = ''
156164
mkdir -p $out/bin
157-
echo "#!${lib.getExe dash}" > $out/bin/movim
158-
echo "${lib.getExe finalAttrs.php} $out/share/php/${finalAttrs.pname}/daemon.php \"\$@\"" >> $out/bin/${finalAttrs.meta.mainProgram}
159-
chmod +x $out/bin/${finalAttrs.meta.mainProgram}
160-
161-
162-
mkdir -p $out/share/{bash-completion/completion,fish/vendor_completions.d,zsh/site-functions}
165+
cat << EOF > $out/bin/movim
166+
#!${lib.getExe dash}
167+
${lib.getExe finalAttrs.php} $out/share/php/${finalAttrs.pname}/daemon.php "\$@"
168+
EOF
169+
chmod +x $out/bin/movim
170+
171+
mkdir -p \
172+
$out/share/bash-completion/completion \
173+
$out/share/fish/vendor_completions.d \
174+
$out/share/zsh/site-functions
163175
$out/bin/movim completion bash | sed "s/daemon.php/movim/g" > $out/share/bash-completion/completion/movim.bash
164176
$out/bin/movim completion fish | sed "s/daemon.php/movim/g" > $out/share/fish/vendor_completions.d/movim.fish
165177
$out/bin/movim completion zsh | sed "s/daemon.php/movim/g" > $out/share/zsh/site-functions/_movim
166-
chmod +x $out/share/{bash-completion/completion/movim.bash,fish/vendor_completions.d/movim.fish,zsh/site-functions/_movim}
178+
179+
chmod +x \
180+
$out/share/bash-completion/completion/movim.bash \
181+
$out/share/fish/vendor_completions.d/movim.fish \
182+
$out/share/zsh/site-functions/_movim
167183
'';
168184

169185
passthru = {

0 commit comments

Comments
 (0)