diff options
-rw-r--r-- | .SRCINFO | 20 | ||||
-rw-r--r-- | PKGBUILD | 20 | ||||
-rw-r--r-- | graphite.sh.in | 9 | ||||
-rw-r--r-- | lto.sh.in | 40 | ||||
-rw-r--r-- | optipng-exec.sh.in | 12 | ||||
-rw-r--r-- | optipng.sh.in | 20 | ||||
-rw-r--r-- | pgo.sh.in | 49 | ||||
-rw-r--r-- | svgo-exec.sh.in | 12 | ||||
-rw-r--r-- | svgo.sh.in | 20 | ||||
-rw-r--r-- | upx-exec.sh.in | 12 | ||||
-rw-r--r-- | upx.sh.in | 36 |
11 files changed, 125 insertions, 125 deletions
@@ -1,7 +1,7 @@ pkgbase = makepkg-optimize pkgdesc = Supplemental build and packaging optimizations for makepkg pkgver = 11 - pkgrel = 1 + pkgrel = 2 url = https://wiki.archlinux.org/index.php/Makepkg-optimize arch = any license = GPL @@ -35,15 +35,15 @@ pkgbase = makepkg-optimize source = pkgopts_ext.conf source = pkgopts-param_ext.conf source = compress-param_max.conf - sha1sums = 8f756d02ad1dae9dfbe79e414e557fe96e037549 - sha1sums = 6df0fc88e5522836bc12071df0b740761136d38b - sha1sums = 6b719a47146aedae186a7e63b6058507c4948d9f - sha1sums = cee5912314c1b84b76f4400a6405cdc224c01828 - sha1sums = e8358ced786a996a5763faa42f3541900b86647e - sha1sums = b8e52d0e41f01cf5815af8bffb07c8cfae8132fa - sha1sums = c93ebf06772fb34d5f707062ddec9faab0b9994f - sha1sums = 1a815037390c67195ed831b7887884a42785010a - sha1sums = cff1d2b6e81226de7ece5369005c392fa8083bf2 + sha1sums = dae91a563dd767f3e3059240009b40106aadbc35 + sha1sums = c172280e2b245635880db1b745e8e3950425519d + sha1sums = 17b601c832b4af263d6ebdc894ee3ef59f9ee8b4 + sha1sums = a893c32f2a3fff8b279025ec60f0c3d88143dc1e + sha1sums = 9270b5e33d4508a959688a10c20dec3732763937 + sha1sums = 34a33b47a8b667f9dc810737c0f598660b962d4c + sha1sums = 68292bac87e22885069330dbdc198e13be88ab95 + sha1sums = 5801de7cd6e2bd462b7e051aa3aa818a30dc7af5 + sha1sums = 368342c7891345bdbcc4c21e79aa4840ab5b76b9 sha1sums = f7da4e29ea24c85870ff0e55864f7bafbce7ad8f sha1sums = 83a6d62b19184cac1de02c957cd4ea7bbdac9ddb sha1sums = dea4d727d81ac040846555e59ac7c34eb0978233 @@ -3,7 +3,7 @@ pkgname=makepkg-optimize pkgver=11 -pkgrel=1 +pkgrel=2 pkgdesc='Supplemental build and packaging optimizations for makepkg' arch=('any') license=('GPL') @@ -21,15 +21,15 @@ source=(${_buildenv[@]} ${_executable[@]} ${_tidy[@]} ${_conf[@]}) -sha1sums=('8f756d02ad1dae9dfbe79e414e557fe96e037549' - '6df0fc88e5522836bc12071df0b740761136d38b' - '6b719a47146aedae186a7e63b6058507c4948d9f' - 'cee5912314c1b84b76f4400a6405cdc224c01828' - 'e8358ced786a996a5763faa42f3541900b86647e' - 'b8e52d0e41f01cf5815af8bffb07c8cfae8132fa' - 'c93ebf06772fb34d5f707062ddec9faab0b9994f' - '1a815037390c67195ed831b7887884a42785010a' - 'cff1d2b6e81226de7ece5369005c392fa8083bf2' +sha1sums=('dae91a563dd767f3e3059240009b40106aadbc35' + 'c172280e2b245635880db1b745e8e3950425519d' + '17b601c832b4af263d6ebdc894ee3ef59f9ee8b4' + 'a893c32f2a3fff8b279025ec60f0c3d88143dc1e' + '9270b5e33d4508a959688a10c20dec3732763937' + '34a33b47a8b667f9dc810737c0f598660b962d4c' + '68292bac87e22885069330dbdc198e13be88ab95' + '5801de7cd6e2bd462b7e051aa3aa818a30dc7af5' + '368342c7891345bdbcc4c21e79aa4840ab5b76b9' 'f7da4e29ea24c85870ff0e55864f7bafbce7ad8f' '83a6d62b19184cac1de02c957cd4ea7bbdac9ddb' 'dea4d727d81ac040846555e59ac7c34eb0978233' diff --git a/graphite.sh.in b/graphite.sh.in index 387c54598cb8..ba0d6bdc0968 100644 --- a/graphite.sh.in +++ b/graphite.sh.in @@ -14,8 +14,9 @@ build_options+=('graphite') buildenv_functions+=('buildenv_graphite') buildenv_graphite() { - if check_buildoption "graphite" "y"; then - CFLAGS+=" -fgraphite-identity -floop-nest-optimize -ftree-loop-distribution -ftree-vectorize" - CXXFLAGS+=" -fgraphite-identity -floop-nest-optimize -ftree-loop-distribution -ftree-vectorize" - fi + if check_buildoption "graphite" "y"; then + graphiteflags=" -fgraphite-identity -floop-nest-optimize -ftree-loop-distribution -ftree-vectorize" + CFLAGS+="$graphiteflags" + CXXFLAGS+="$graphiteflags" + fi } diff --git a/lto.sh.in b/lto.sh.in index 126a9fc175d1..c8dc62397d90 100644 --- a/lto.sh.in +++ b/lto.sh.in @@ -14,28 +14,24 @@ build_options+=('lto' 'lto-thin') buildenv_functions+=('buildenv_lto') buildenv_lto() { - if check_buildoption "lto" "y" || check_buildoption "lto-thin" "y" && \ - [[ -f "$(gcc -print-search-dirs | grep install | awk '{print $2 "liblto_plugin.so"}')" ]]; then - [[ "$CC" == "clang" ]] && \ - CFLAGS+=" -flto" || \ - CFLAGS+=" -flto=$(getconf _NPROCESSORS_ONLN) -flto-partition=none -fno-fat-lto-objects" - [[ "$CXX" == "clang++" ]] && \ - CXXFLAGS+=" -flto" || \ - CXXFLAGS+=" -flto=$(getconf _NPROCESSORS_ONLN) -flto-partition=none -fno-fat-lto-objects" + if check_buildoption "lto" "y" || check_buildoption "lto-thin" "y" && \ + [[ -f "$(gcc -print-search-dirs | grep install | awk '{print $2 "liblto_plugin.so"}')" ]]; then + [[ "$CC" == "clang" || "$CXX" == "clang++" ]] && \ + ltoflags=" -flto" || \ + ltoflags=" -flto=$(getconf _NPROCESSORS_ONLN) -flto-partition=none -fno-fat-lto-objects" - if check_buildoption "lto-thin" "y"; then - [[ "$CC" == "clang" ]] && \ - CFLAGS="${CFLAGS// -flto / -flto=thin }" || \ - CFLAGS="${CFLAGS// -flto-partition=none / }" - [[ "$CXX" == "clang++" ]] && \ - CXXFLAGS="${CXXFLAGS// -flto / -flto=thin }" || \ - CXXFLAGS="${CXXFLAGS// -flto-partition=none / }" - fi + if check_buildoption "lto-thin" "y"; then + [[ "$CC" == "clang" || "$CXX" == "clang++" ]] && \ + ltoflags="${ltoflags// -flto/ -flto=thin}" || \ + ltoflags="${ltoflags// -flto-partition=none / }" + fi - LDFLAGS+=" -fuse-linker-plugin $CFLAGS $CXXFLAGS" - LTOPLUGIN="$(gcc -print-search-dirs | grep install | awk '{print $2 "liblto_plugin.so"}')" - ARFLAGS+=" --plugin $LTOPLUGIN" - RANLIBFLAGS+=" --plugin $LTOPLUGIN" - NMFLAGS+=" --plugin $LTOPLUGIN" - fi + CFLAGS+="$ltoflags" + CXXFLAGS+="$ltoflags" + LDFLAGS+=" -fuse-linker-plugin $CFLAGS $CXXFLAGS" + ltoplugin="$(gcc -print-search-dirs | grep install | awk '{print $2 "liblto_plugin.so"}')" + ARFLAGS+=" --plugin $ltoplugin" + RANLIBFLAGS+=" --plugin $ltoplugin" + NMFLAGS+=" --plugin $ltoplugin" + fi } diff --git a/optipng-exec.sh.in b/optipng-exec.sh.in index 13bf6dac30b9..3c56d3eed5a4 100644 --- a/optipng-exec.sh.in +++ b/optipng-exec.sh.in @@ -13,10 +13,10 @@ source "$LIBRARY/util/option.sh" executable_functions+=('executable_optipng') executable_optipng() { - if check_option "optipng" "y"; then - if ! type -p optipng >/dev/null; then - error "$(gettext "Cannot find the %s binary required for optimizing PNG image files.")" "optipng" - ret=1 - fi - fi + if check_option "optipng" "y"; then + if ! type -p optipng >/dev/null; then + error "$(gettext "Cannot find the %s binary required for optimizing PNG image files.")" "optipng" + ret=1 + fi + fi } diff --git a/optipng.sh.in b/optipng.sh.in index fc66d6384121..9fb6c7ded6c7 100644 --- a/optipng.sh.in +++ b/optipng.sh.in @@ -15,14 +15,14 @@ packaging_options+=('optipng') tidy_modify+=('tidy_optipng') tidy_optipng() { - if check_option "optipng" "y"; then - msg2 "$(gettext "Optimizing PNG images...")" - local png - find . -type f -iname "*.png" 2>/dev/null | while read -r png ; do - if [[ $(file --brief --mime-type "$png") = 'image/png' ]]; then - optipng "${OPTIPNGFLAGS[@]}" "$png" &>/dev/null || - warning "$(gettext "Could not optimize PNG image : %s")" "${png/$pkgdir\//}" - fi - done - fi + if check_option "optipng" "y"; then + msg2 "$(gettext "Optimizing PNG images...")" + local png + find . -type f -iname "*.png" 2>/dev/null | while read -r png ; do + if [[ $(file --brief --mime-type "$png") = 'image/png' ]]; then + optipng "${OPTIPNGFLAGS[@]}" "$png" &>/dev/null || + warning "$(gettext "Could not optimize PNG image : %s")" "${png/$pkgdir\//}" + fi + done + fi } diff --git a/pgo.sh.in b/pgo.sh.in index 0bb44b80f39b..5cb9c5101247 100644 --- a/pgo.sh.in +++ b/pgo.sh.in @@ -15,27 +15,30 @@ build_options+=('pgo') buildenv_functions+=('buildenv_pgo') buildenv_pgo() { - if check_buildoption "pgo" "y"; then - [[ -n ${PROFDEST} ]] && _PROFDEST=$(canonicalize_path ${PROFDEST}) - PROFDEST=${_PROFDEST:-$PROFDEST} - PROFDEST=${PROFDEST:-$startdir} #default to $startdir if undefined - - if [[ ! -w $PROFDEST ]] ; then - error "$(gettext "You do not have write permission to store profiles in %s.")" "$PROFDEST" - plain "$(gettext "Aborting...")" - exit 1 - fi - - [[ "$INFAKEROOT" == 1 ]] && return - - if [ ! -d "$PROFDEST/$pkgbase.gen" ]; then - CFLAGS+=" -fprofile-generate -fprofile-dir=$PROFDEST/$pkgbase.gen" - CXXFLAGS+=" -fprofile-generate -fprofile-dir=$PROFDEST/$pkgbase.gen" - LDFLAGS+=" -lgcov --coverage" - else - [[ ! -d "$PROFDEST/$pkgbase.used" ]] && mv "$PROFDEST/$pkgbase.gen" "$PROFDEST/$pkgbase.used" - CFLAGS+=" -fprofile-correction -fprofile-use -fprofile-dir=$PROFDEST/$pkgbase.used" - CXXFLAGS+=" -fprofile-correction -fprofile-use -fprofile-dir=$PROFDEST/$pkgbase.used" - fi - fi + if check_buildoption "pgo" "y"; then + [[ -n ${PROFDEST} ]] && _PROFDEST=$(canonicalize_path ${PROFDEST}) + PROFDEST=${_PROFDEST:-$PROFDEST} + PROFDEST=${PROFDEST:-$startdir} #default to $startdir if undefined + + if [[ ! -w $PROFDEST ]] ; then + error "$(gettext "You do not have write permission to store profiles in %s.")" "$PROFDEST" + plain "$(gettext "Aborting...")" + exit 1 + fi + + [[ "$INFAKEROOT" == 1 ]] && return + + if [ ! -d "$PROFDEST/$pkgbase.gen" ]; then + pgoflags=" -fprofile-generate -fprofile-dir=$PROFDEST/$pkgbase.gen" + pgoldflags=" -lgcov --coverage" + else + [[ ! -d "$PROFDEST/$pkgbase.used" ]] && mv "$PROFDEST/$pkgbase.gen" "$PROFDEST/$pkgbase.used" + pgoflags=" -fprofile-correction -fprofile-use -fprofile-dir=$PROFDEST/$pkgbase.used" + fi + + CFLAGS+="$pgoflags" + CXXFLAGS+="$pgoflags" + LDFLAGS+="$pgoldflags" + + fi } diff --git a/svgo-exec.sh.in b/svgo-exec.sh.in index ebb1396a7213..b4a7e4ed8b8a 100644 --- a/svgo-exec.sh.in +++ b/svgo-exec.sh.in @@ -13,10 +13,10 @@ source "$LIBRARY/util/option.sh" executable_functions+=('executable_svgo') executable_svgo() { - if check_option "svgo" "y"; then - if ! type -p svgo >/dev/null; then - error "$(gettext "Cannot find the %s binary required for optimizing SVG image files.")" "svgo" - ret=1 - fi - fi + if check_option "svgo" "y"; then + if ! type -p svgo >/dev/null; then + error "$(gettext "Cannot find the %s binary required for optimizing SVG image files.")" "svgo" + ret=1 + fi + fi } diff --git a/svgo.sh.in b/svgo.sh.in index bdef48fbca8e..f997a855a0bc 100644 --- a/svgo.sh.in +++ b/svgo.sh.in @@ -15,14 +15,14 @@ packaging_options+=('svgo') tidy_modify+=('tidy_svgo') tidy_svgo() { - if check_option "svgo" "y"; then - msg2 "$(gettext "Optimizing SVG images...")" - local svg - find . -type f -iname "*.svg" 2>/dev/null | while read -r svg ; do - if [[ $(file --brief --mime-type "$svg") = 'image/svg' ]]; then - svgo "${SVGOFLAGS[@]}" "$svg" &>/dev/null || - warning "$(gettext "Could not optimize SVG image : %s")" "${svg/$pkgdir\//}" - fi - done - fi + if check_option "svgo" "y"; then + msg2 "$(gettext "Optimizing SVG images...")" + local svg + find . -type f -iname "*.svg" 2>/dev/null | while read -r svg ; do + if [[ $(file --brief --mime-type "$svg") = 'image/svg' ]]; then + svgo "${SVGOFLAGS[@]}" "$svg" &>/dev/null || + warning "$(gettext "Could not optimize SVG image : %s")" "${svg/$pkgdir\//}" + fi + done + fi } diff --git a/upx-exec.sh.in b/upx-exec.sh.in index aa03fd72034f..ce2ecf56d25e 100644 --- a/upx-exec.sh.in +++ b/upx-exec.sh.in @@ -13,10 +13,10 @@ source "$LIBRARY/util/option.sh" executable_functions+=('executable_upx') executable_upx() { - if check_option "upx" "y"; then - if ! type -p upx >/dev/null; then - error "$(gettext "Cannot find the %s binary required for compressing binaries.")" "upx" - ret=1 - fi - fi + if check_option "upx" "y"; then + if ! type -p upx >/dev/null; then + error "$(gettext "Cannot find the %s binary required for compressing binaries.")" "upx" + ret=1 + fi + fi } diff --git a/upx.sh.in b/upx.sh.in index a7d18a1b360b..340df6c8d66b 100644 --- a/upx.sh.in +++ b/upx.sh.in @@ -15,22 +15,22 @@ packaging_options+=('upx') tidy_modify+=('tidy_upx') tidy_upx() { - if check_option "upx" "y"; then - msg2 "$(gettext "Compressing binaries with %s...")" "UPX" - local binary - find . -type f -perm -u+w 2>/dev/null | while read -r binary ; do - if [[ $(file --brief --mime-type "$binary") == application* ]] ; then - case "$(file --brief --mime-type "$binary")" in - 'application/x-executable' | 'application/x-dosexec') - upx "${UPXFLAGS[@]}" "$binary" &>/dev/null || - warning "$(gettext "Could not compress binary : %s")" "${binary/$pkgdir\//}" - ;; - *) - warning "$(gettext "Not compressing %s, $(file --brief --mime-type "$binary")")" \ - "${binary/$pkgdir\//}" - ;; - esac - fi - done - fi + if check_option "upx" "y"; then + msg2 "$(gettext "Compressing binaries with %s...")" "UPX" + local binary + find . -type f -perm -u+w 2>/dev/null | while read -r binary ; do + if [[ $(file --brief --mime-type "$binary") == application* ]] ; then + case "$(file --brief --mime-type "$binary")" in + 'application/x-executable' | 'application/x-dosexec') + upx "${UPXFLAGS[@]}" "$binary" &>/dev/null || + warning "$(gettext "Could not compress binary : %s")" "${binary/$pkgdir\//}" + ;; + *) + warning "$(gettext "Not compressing %s, $(file --brief --mime-type "$binary")")" \ + "${binary/$pkgdir\//}" + ;; + esac + fi + done + fi } |