Package Details: minify 2.24.19-1

Git Clone URL: https://aur.archlinux.org/minify.git (read-only, click to copy)
Package Base: minify
Description: Minifier CLI for HTML, CSS, JS, JSON, SVG and XML
Upstream URL: https://github.com/tdewolff/minify
Keywords: css html js json minifier minify svg web xml
Licenses: MIT
Submitter: 4679
Maintainer: 4679 (meepzh, tdewolff)
Last Packager: tdewolff
Votes: 17
Popularity: 0.033784
First Submitted: 2016-05-03 08:05 (UTC)
Last Updated: 2026-10-03 22:35 (UTC)

Dependencies (3)

Required by (1)

Sources (1)

Latest Comments

1 2 3 4 Next › Last »

tdewolff commented on 2026-07-27 00:54 (UTC)

Thanks, I've updated the PKGBUILD

manticore commented on 2026-07-26 23:59 (UTC)

Last line removed because it did not achieve anything (except leaking the exit-status):

1) package() runs in a fakeroot subshell that makepkg forks and discards. 2) Sourcing defined _minify() and ran complete -F _minify minify in that subshell. 3) Subshell exits ~2 seconds later. The function and the complete registration die with it.

Zero observable effect. Modifying the active shell from a PKGBUILD should not be achievable by design — the packaging process has no channel into an already-running interactive shell.

manticore commented on 2026-07-26 23:48 (UTC) (edited on 2026-07-26 23:49 (UTC) by manticore)

# Maintainer: tdewolff <tacodewolff@gmail.com>
# Maintainer: 4679kun <4679kun@outlook.com>
# Maintainer: meepzh <meep.aur@meepzh.com>

pkgname=minify
pkgver=2.24.14
pkgrel=2
pkgdesc="Minifier CLI for HTML, CSS, JS, JSON, SVG and XML"
arch=('x86_64' 'aarch64' 'armv7h')
url="https://github.com/tdewolff/minify"
license=('MIT')
depends=('glibc')
makedepends=('go')
optdepends=('bash-completion: command-line autocomplete with bash')
options=('!lto')
source=("$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz")
sha256sums=('bb5b9bdf52ccd19a1d5e69f867fabf7355ae124ba114e933b72a88a8cea20d90')

prepare() {
  cd "$pkgname-$pkgver"
  mkdir -p build/
}

build() {
  cd "$pkgname-$pkgver"

  export CGO_ENABLED=1
  export CGO_CPPFLAGS="${CPPFLAGS}"
  export CGO_CFLAGS="${CFLAGS}"
  export CGO_CXXFLAGS="${CXXFLAGS}"
  export CGO_LDFLAGS="${LDFLAGS}"
  export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw"

  go build \
    -ldflags "-linkmode=external -compressdwarf=false -extldflags \"${LDFLAGS}\" -X 'main.Version=v$pkgver'" \
    -o build/minify ./cmd/minify
}

check() {
  cd "$pkgname-$pkgver"
  go test ./cmd/... ./css/... ./html/... ./js/... ./json/... ./svg/... ./xml/... ./minify/...
}

package() {
  cd "$pkgname-$pkgver"

  install -Dm755 build/minify "$pkgdir/usr/bin/$pkgname"
  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
  install -Dm644 cmd/minify/bash_completion \
    "$pkgdir/usr/share/bash-completion/completions/$pkgname"
}

tdewolff commented on 2026-07-26 22:52 (UTC)

Good point, what do you recommend?

manticore commented on 2026-07-26 00:19 (UTC)

The package() function sources a bash_completion file from the build directory using 'source cmd/minify/bash_completion', which executes the contents of that file in the current shell context during packaging. Sourcing arbitrary file content from an untrusted tarball during the package step is unusual and potentially dangerous if the upstream bash_completion file contains malicious shell code.

Can this be improved?

tdewolff commented on 2025-09-06 08:44 (UTC)

Thanks, this is now fixed.

marek22k commented on 2025-09-04 20:04 (UTC)

Unfortunately, I am having problems updating minify:

$ yay -S minify
AUR Explicit (1): minify-2.24.2-1
:: PKGBUILD up to date, skipping download: minify
  1 minify                                   (Installed) (Build Files Exist)
==> Packages to cleanBuild?
==> [N]one [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4)
==> 
  1 minify                                   (Installed) (Build Files Exist)
==> Diffs to show?
==> [N]one [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4)
==> 
==> Making package: minify 2.24.2-1 (Do 04 Sep 2025 20:02:31 UTC)
==> Retrieving sources...
  -> Found v2.24.2.tar.gz
==> WARNING: Skipping verification of source file PGP signatures.
==> Validating source files with sha256sums...
    v2.24.2.tar.gz ... Passed
:: (1/1) Parsing SRCINFO: minify
==> Making package: minify 2.24.2-1 (Do 04 Sep 2025 20:02:32 UTC)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found v2.24.2.tar.gz
==> Validating source files with sha256sums...
    v2.24.2.tar.gz ... Passed
==> Removing existing $srcdir/ directory...
==> Extracting sources...
  -> Extracting v2.24.2.tar.gz with bsdtar
==> Starting prepare()...
==> Sources are ready.
==> Making package: minify 2.24.2-1 (Do 04 Sep 2025 20:02:35 UTC)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> WARNING: Using existing $srcdir/ tree
==> Removing existing $pkgdir/ directory...
==> Starting build()...
==> Starting check()...
ok      github.com/tdewolff/minify/v2   (cached)
?       github.com/tdewolff/minify/v2/bindings/js   [no test files]
?       github.com/tdewolff/minify/v2/bindings/py   [no test files]
ok      github.com/tdewolff/minify/v2/cmd/minify    (cached)
--- FAIL: TestCSSInline (0.00s)
    --- FAIL: TestCSSInline/background-color:transparent (0.00s)
    css_test.go:438:438: 
            background-color:transparent
            background-color:transparent
            background-color:initial
FAIL
FAIL    github.com/tdewolff/minify/v2/css   0.010s
ok      github.com/tdewolff/minify/v2/html  (cached)
ok      github.com/tdewolff/minify/v2/js    (cached)
ok      github.com/tdewolff/minify/v2/json  (cached)
ok      github.com/tdewolff/minify/v2/minify    (cached)
ok      github.com/tdewolff/minify/v2/svg   (cached)
ok      github.com/tdewolff/minify/v2/xml   (cached)
FAIL
==> ERROR: A failure occurred in check().
    Aborting...
 -> error making: minify-exit status 4
 -> Failed to install the following packages. Manual intervention is required:
minify - exit status 4

tdewolff commented on 2025-07-22 13:22 (UTC)

Thank you, should be fixed now

woodwose commented on 2025-07-21 15:11 (UTC) (edited on 2025-07-22 13:51 (UTC) by woodwose)

check() fails for minify 2.23.9-1:

==> Starting check()...
go: downloading github.com/tdewolff/test v1.0.11
ok      github.com/tdewolff/minify/v2   0.035s
# github.com/tdewolff/minify/v2/bindings/js
bindings/js/minify.go:131:31: cannot use aspMinifier (variable of struct type "github.com/tdewolff/minify/v2/html".Minifier) as minify.Minifier value in argument to m.Add: "github.com/tdewolff/minify/v2/html".Minifier does not implement minify.Minifier (method Minify has pointer receiver)
bindings/js/minify.go:135:35: cannot use phpMinifier (variable of struct type "github.com/tdewolff/minify/v2/html".Minifier) as minify.Minifier value in argument to m.Add: "github.com/tdewolff/minify/v2/html".Minifier does not implement minify.Minifier (method Minify has pointer receiver)
bindings/js/minify.go:139:30: cannot use tmplMinifier (variable of struct type "github.com/tdewolff/minify/v2/html".Minifier) as minify.Minifier value in argument to m.Add: "github.com/tdewolff/minify/v2/html".Minifier does not implement minify.Minifier (method Minify has pointer receiver)
bindings/js/minify.go:140:36: cannot use tmplMinifier (variable of struct type "github.com/tdewolff/minify/v2/html".Minifier) as minify.Minifier value in argument to m.Add: "github.com/tdewolff/minify/v2/html".Minifier does not implement minify.Minifier (method Minify has pointer receiver)
bindings/js/minify.go:141:38: cannot use tmplMinifier (variable of struct type "github.com/tdewolff/minify/v2/html".Minifier) as minify.Minifier value in argument to m.Add: "github.com/tdewolff/minify/v2/html".Minifier does not implement minify.Minifier (method Minify has pointer receiver)
FAIL    github.com/tdewolff/minify/v2/bindings/js [build failed]
?       github.com/tdewolff/minify/v2/bindings/py   [no test files]
ok      github.com/tdewolff/minify/v2/cmd/minify    0.004s
ok      github.com/tdewolff/minify/v2/css   0.008s
ok      github.com/tdewolff/minify/v2/html  0.008s
ok      github.com/tdewolff/minify/v2/js    0.042s
ok      github.com/tdewolff/minify/v2/json  0.004s
ok      github.com/tdewolff/minify/v2/minify    0.003s
ok      github.com/tdewolff/minify/v2/svg   0.007s
ok      github.com/tdewolff/minify/v2/xml   0.004s
FAIL
==> ERROR: A failure occurred in check().    ==> Starting check()...

marek22k commented on 2025-04-29 18:29 (UTC)

@tdewolff Works now, thanks for fixing!