Package Details: makepkg-optimize 18-4

Git Clone URL: (read-only, click to copy)
Package Base: makepkg-optimize
Description: Supplemental build and packaging optimizations for makepkg
Upstream URL:
Licenses: GPL
Submitter: quequotion
Maintainer: quequotion
Last Packager: quequotion
Votes: 13
Popularity: 0.35
First Submitted: 2016-03-20 15:08
Last Updated: 2020-07-05 15:36

Pinned Comments

quequotion commented on 2019-02-27 07:49

makepkg-optimize is a collection of libmakepkg tidy, buildenv, and executable extensions, and a supplement to pacman. These enable various optimization routines for building and packaging such as upx compression, profile guided optimization, link time optimization, polyhedral model optimization, etc..

Note: Over-optimization is a thing, and it is not good.

See the wiki article for details.

Note to packagers: makepkg-optmize's macros may be enabled or disabled in options() as well!

Latest Comments

1 2 3 4 5 6 Next › Last »

nihilistzsche commented on 2021-06-08 07:55

According to this bug those options needed to be added for polly to work with Arch's clang.


Upon further reflection the better change is to add the necessary flags to the polly line and add check_buildoption "polly" "y" && to the beginning of the line.

In addition, the -freg-struct-return needs to be moved into the line check_buildoption "rice" "y" && because clang does not support it on x86_64 so should not be used I think with rice-clang.

brikler commented on 2021-03-06 17:47

@tjuh upx is more or less useless because most binaries are application/x-pie-executable and application/x-sharedlib, and this will fail with a NotCompressibleException or a CantPackException

Tjuh commented on 2021-03-05 01:00

Alright, thanks for clarifying. So does that mean that using upx to compress pkgs with makepkg is useless, since it will pretty much always fail?

quequotion commented on 2021-03-04 03:38


@brikler is correct, upx itself does not discriminate, but some kinds of executables will fail to run if compressed.

To be honest, documentation on this topic is lacking. There are a few links in these comments, as well as instructions for how to add new filetypes.

If you find any new filetype that works (compressed executables run), let me know.

Same if you find a problem with my script. I have been over this particular part of it countless times. Upstream discarded this, maybe they had reasons (never found any discussion of it).

brikler commented on 2021-03-02 13:14

@Tjuh makepkg-optimze tests the file before compress but upx doesn't test and you can compress every compressible file. you can test the file type with: file --brief --mime-type <fileToTest>

Tjuh commented on 2021-03-02 12:34

Are you sure about that? I tried a couple of times to manually compress files which makepkg gave a warning about not being able to compress and they compressed just fine with upx --ultra-brute filename.

brikler commented on 2021-03-02 09:24

@Tjuh what do you mean? not compressed binaries? makepkg-optimize only compress binaries from the type application/x-executable but not application/x-sharedlib and the most binaries are from the type x-sharedlib

Tjuh commented on 2021-03-01 17:38

Have not been able to properly use upx in months and think because of this pkg, can anyone confirm please?

homocomputeris commented on 2020-07-03 15:36

oxipng claims to be significantly faster than optipng. Could you consider adding it as an optional dependency?

quequotion commented on 2020-06-11 11:40


See commentary on the additional buildenv options; because clang and gcc are inexplicably not using equivalent flags for equivalent functions, and there is no mechanism for makepkg to detect which toolchain is to be used, I have been forced to make a completely different set of options for clang.

You want lto-thin-clang and poly.