summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorQue Quotion2018-11-06 01:10:43 +0900
committerQue Quotion2018-11-06 01:29:31 +0900
commitfc511b6f4591738fd17711ae144aa620d8d7919e (patch)
treebc7af83b1dee9972c020928c411d33e528412e80
parent121dacbfc1c5742ce8203dfea425f990448a881d (diff)
downloadaur-fc511b6f4591738fd17711ae144aa620d8d7919e.tar.gz
Updated for pacman with extendible buildenv
-rw-r--r--.SRCINFO16
-rw-r--r--PKGBUILD25
-rw-r--r--ccache.sh.in46
-rw-r--r--cflags.conf5
-rw-r--r--distcc.sh.in46
-rw-r--r--graphite.sh.in24
-rw-r--r--lto.sh.in24
-rw-r--r--optipng.sh.in16
-rw-r--r--pgo.sh.in46
-rw-r--r--svgo.sh.in16
-rw-r--r--upx.sh.in16
11 files changed, 51 insertions, 229 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 838726d0e14..34c1147ad1e 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,6 +1,6 @@
pkgbase = makepkg-optimize
pkgdesc = Supplemental build and packaging optimizations for makepkg
- pkgver = 3
+ pkgver = 4
pkgrel = 1
url = https://wiki.archlinux.org/index.php/Makepkg-optimize
arch = any
@@ -31,13 +31,13 @@ pkgbase = makepkg-optimize
source = pkgopts_ext.conf
source = pkgopts-param_ext.conf
source = compress-param_max.conf
- sha1sums = 108b124167751bc975cc1bce5a2905956ed5c65b
- sha1sums = a95642b0b45d3c2f0b665806e016a52f9880195f
- sha1sums = 0726a57eeb0c08bc4ba50b28ee5ea3b5e6dbd156
- sha1sums = 0420fde975c623f788726a41da2c1311e625472f
- sha1sums = 261dfa6707cc12159f99a567617f7183426dbaa3
- sha1sums = be019624f503380130994503b5169836edb83a35
- sha1sums = 0999f5246a10235e886eff0977582dfed43ad30c
+ sha1sums = da515153d456ed53f6744c3ce4e6dd9a9ea3b892
+ sha1sums = 2c993f086adc635e15313b45008cfe6d56c79cdc
+ sha1sums = 6b719a47146aedae186a7e63b6058507c4948d9f
+ sha1sums = d6c364bac3be28a39ba9d902e8492acd35fbee13
+ sha1sums = 1a815037390c67195ed831b7887884a42785010a
+ sha1sums = cff1d2b6e81226de7ece5369005c392fa8083bf2
+ sha1sums = b47947223879df8e5725e8f84b69fb355d149b44
sha1sums = 83a6d62b19184cac1de02c957cd4ea7bbdac9ddb
sha1sums = dea4d727d81ac040846555e59ac7c34eb0978233
sha1sums = 202d11e49a611bb400029512cf159a0f8645a6db
diff --git a/PKGBUILD b/PKGBUILD
index 7e127f66025..33f4370eeb8 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,7 +2,7 @@
# Contributor: bartus ( aur\at\bartus.33mail.com )
pkgname=makepkg-optimize
-pkgver=3
+pkgver=4
pkgrel=1
pkgdesc='Supplemental build and packaging optimizations for makepkg'
arch=('any')
@@ -13,20 +13,20 @@ replaces=('makepkg-optimize2')
depends=('pacman-buildenv_ext-git')
optdepends=('upx' 'optipng' 'nodejs-svgo' 'graphite')
backup=(etc/makepkg-optimize.conf)
-_buildenv_ext=({pgo,lto,graphite}.sh.in)
+_buildenv=({pgo,lto,graphite}.sh.in)
_tidy=({upx,optipng,svgo}.sh.in)
_conf=({{c,cxx,make,ld,debug-make,cmake-}flags,{buildenv,destdirs,pkgopts{,-param}}_ext,compress-param_max}.conf)
-source=(${_buildenv_ext[@]}
+source=(${_buildenv[@]}
${_tidy[@]}
${_conf[@]}
)
-sha1sums=('108b124167751bc975cc1bce5a2905956ed5c65b'
- 'a95642b0b45d3c2f0b665806e016a52f9880195f'
- '0726a57eeb0c08bc4ba50b28ee5ea3b5e6dbd156'
- '0420fde975c623f788726a41da2c1311e625472f'
- '261dfa6707cc12159f99a567617f7183426dbaa3'
- 'be019624f503380130994503b5169836edb83a35'
- '0999f5246a10235e886eff0977582dfed43ad30c'
+sha1sums=('da515153d456ed53f6744c3ce4e6dd9a9ea3b892'
+ '2c993f086adc635e15313b45008cfe6d56c79cdc'
+ '6b719a47146aedae186a7e63b6058507c4948d9f'
+ 'd6c364bac3be28a39ba9d902e8492acd35fbee13'
+ '1a815037390c67195ed831b7887884a42785010a'
+ 'cff1d2b6e81226de7ece5369005c392fa8083bf2'
+ 'b47947223879df8e5725e8f84b69fb355d149b44'
'83a6d62b19184cac1de02c957cd4ea7bbdac9ddb'
'dea4d727d81ac040846555e59ac7c34eb0978233'
'202d11e49a611bb400029512cf159a0f8645a6db'
@@ -82,7 +82,10 @@ prepare() {
package() {
# BUILDENV extension scripts
- install -m755 -D -t ${pkgdir}/usr/share/makepkg/buildenv_ext/ ${_buildenv_ext[@]%.in}
+ install -m755 -D -t ${pkgdir}/usr/share/makepkg/buildenv/ ${_buildenv[@]%.in}
+
+ # Executable finding scripts
+ #install -m755 -D -t ${pkgdir}/usr/share/makepkg/executable/ ${_executable[@]%.in}
# Supplemental Tidy scripts
install -m755 -D -t ${pkgdir}/usr/share/makepkg/tidy/ ${_tidy[@]%.in}
diff --git a/ccache.sh.in b/ccache.sh.in
deleted file mode 100644
index 8d9e0b5e0db..00000000000
--- a/ccache.sh.in
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/usr/bin/bash
-#
-# ccache.sh - Cache compiliations and recycle them to save time on repititions
-#
-# Copyright (c) 2008-2016 Pacman Development Team <pacman-dev@archlinux.org>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-
-[[ -n "$LIBMAKEPKG_CCACHE_SH" ]] && return
-LIBMAKEPKG_CCACHE_SH=1
-
-LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
-
-source "$LIBRARY/util/message.sh"
-source "$LIBRARY/util/option.sh"
-
-build_options+=('ccache')
-
-local ccache=0
-
-ccache() {
-
- # use ccache if it is requested (check buildenv and PKGBUILD opts)
- if check_buildoption "ccache" "y"; then
- if ! type -p ccache >/dev/null; then
- error "$(gettext "Cannot find the %s binary required for compiler cache usage.")" "ccache"
- return 1
- fi
- if [ -d /usr/lib/ccache/bin ]; then
- export PATH="/usr/lib/ccache/bin:$PATH"
- ccache=1
- fi
- fi
-}
diff --git a/cflags.conf b/cflags.conf
index cee6e99af11..b3e4468793d 100644
--- a/cflags.conf
+++ b/cflags.conf
@@ -1,3 +1,2 @@
-#CFLAGS="-pipe -march=native -Ofast -fstack-protector-strong --param=ssp-buffer-size=4 -fno-plt -Wno-error -w" #
-#CFLAGS="-pipe -march=native -Og -fstack-protector-strong --param=ssp-buffer-size=4 -fno-plt" #
-#CXXFLAGS="$CFLAGS" #
+#CFLAGS="-march=native -Ofast -pipe -fstack-protector-strong --param=ssp-buffer-size=4 -fno-plt -Wno-error -w" #
+#CFLAGS="-march=native -Og -pipe -fstack-protector-strong --param=ssp-buffer-size=4 -fno-plt" #
diff --git a/distcc.sh.in b/distcc.sh.in
deleted file mode 100644
index 248445ab9e2..00000000000
--- a/distcc.sh.in
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/usr/bin/bash
-#
-# distcc.sh - Distribute compliation to reduce compilation time
-#
-# Copyright (c) 2008-2016 Pacman Development Team <pacman-dev@archlinux.org>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-
-[[ -n "$LIBMAKEPKG_CCACHE_SH" ]] && return
-LIBMAKEPKG_CCACHE_SH=1
-
-LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
-
-source "$LIBRARY/util/message.sh"
-source "$LIBRARY/util/option.sh"
-
-build_options+=('distcc')
-extra_buildopts+=('distcc')
-
-distcc() {
- if check_buildoption "distcc" "y"; then
- if ! type -p distcc >/dev/null; then
- error "$(gettext "Cannot find the %s binary required for distributed compilation.")" "distcc"
- return 1
- fi
- if (( ccache )); then
- export CCACHE_PREFIX="${CCACHE_PREFIX:+$CCACHE_PREFIX }distcc"
- export CCACHE_BASEDIR="$srcdir"
- elif [[ -d /usr/lib/distcc/bin ]]; then
- export PATH="/usr/lib/distcc/bin:$PATH"
- fi
- export DISTCC_HOSTS
- fi
-}
diff --git a/graphite.sh.in b/graphite.sh.in
index a1e39ed6d25..387c54598cb 100644
--- a/graphite.sh.in
+++ b/graphite.sh.in
@@ -2,32 +2,18 @@
#
# graphite.sh - Compile with Graphite polyhedral modeling optimization
#
-# Copyright (c) 2008-2016 Pacman Development Team <pacman-dev@archlinux.org>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-[[ -n "$LIBMAKEPKG_GRAPHITE_SH" ]] && return
-LIBMAKEPKG_GRAPHITE_SH=1
+[[ -n "$LIBMAKEPKG_BUILDENV_GRAPHITE_SH" ]] && return
+LIBMAKEPKG_BUILDENV_GRAPHITE_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/option.sh"
-extra_buildopts+=('graphite')
+build_options+=('graphite')
+buildenv_functions+=('buildenv_graphite')
-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"
diff --git a/lto.sh.in b/lto.sh.in
index de7373149fd..e6478c44ac2 100644
--- a/lto.sh.in
+++ b/lto.sh.in
@@ -2,32 +2,18 @@
#
# lto.sh - Compile with link-time optimization
#
-# Copyright (c) 2008-2016 Pacman Development Team <pacman-dev@archlinux.org>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-[[ -n "$LIBMAKEPKG_LTO_SH" ]] && return
-LIBMAKEPKG_LTO_SH=1
+[[ -n "$LIBMAKEPKG_BUILDENV_LTO_SH" ]] && return
+LIBMAKEPKG_BUILDENV_LTO_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/option.sh"
-extra_buildopts+=('lto')
+build_options+=('lto')
+buildenv_functionss+=('buildenv_lto')
-lto() {
+buildenv_lto() {
if check_buildoption "lto" "y" && [[ -f "$(gcc -print-search-dirs | grep install | awk '{print $2 "liblto_plugin.so"}')" ]]; then
CFLAGS+=" -flto=$(getconf _NPROCESSORS_ONLN)"
CXXFLAGS+=" -flto=$(getconf _NPROCESSORS_ONLN)"
diff --git a/optipng.sh.in b/optipng.sh.in
index 068b8513f6a..fc66d638412 100644
--- a/optipng.sh.in
+++ b/optipng.sh.in
@@ -2,21 +2,6 @@
#
# optipng.sh - Compress PNG files using optpng
#
-# Copyright (c) 2015-2016 Pacman Development Team <pacman-dev@archlinux.org>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
[[ -n "$LIBMAKEPKG_TIDY_OPTIPNG_SH" ]] && return
LIBMAKEPKG_TIDY_OPTIPNG_SH=1
@@ -26,7 +11,6 @@ LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/message.sh"
source "$LIBRARY/util/option.sh"
-
packaging_options+=('optipng')
tidy_modify+=('tidy_optipng')
diff --git a/pgo.sh.in b/pgo.sh.in
index afd8433bc6a..7824efcab42 100644
--- a/pgo.sh.in
+++ b/pgo.sh.in
@@ -2,44 +2,32 @@
#
# pgo.sh - Compile with, or utilize profile guided optimization
#
-# Copyright (c) 2008-2016 Pacman Development Team <pacman-dev@archlinux.org>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-[[ -n "$LIBMAKEPKG_PGO_SH" ]] && return
-LIBMAKEPKG_PGO_SH=1
+[[ -n "$LIBMAKEPKG_BUILDENV_PGO_SH" ]] && return
+LIBMAKEPKG_BUILDENV_PGO_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/message.sh"
source "$LIBRARY/util/option.sh"
-extra_buildopts+=('pgo')
-
-[[ -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
+build_options+=('pgo')
+buildenv_functions+=('buildenv_pgo')
-pgo() {
- [[ "$INFAKEROOT" == 1 ]] && return
+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
mkdir "$PROFDEST/$pkgbase.gen"
CFLAGS+=" -fprofile-generate -fprofile-dir=$PROFDEST/$pkgbase.gen"
diff --git a/svgo.sh.in b/svgo.sh.in
index 0779997721c..bdef48fbca8 100644
--- a/svgo.sh.in
+++ b/svgo.sh.in
@@ -2,21 +2,6 @@
#
# svgo.sh - Compress SVG files using optsvg
#
-# Copyright (c) 2015-2016 Pacman Development Team <pacman-dev@archlinux.org>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
[[ -n "$LIBMAKEPKG_TIDY_SVGO_SH" ]] && return
LIBMAKEPKG_TIDY_SVGO_SH=1
@@ -26,7 +11,6 @@ LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/message.sh"
source "$LIBRARY/util/option.sh"
-
packaging_options+=('svgo')
tidy_modify+=('tidy_svgo')
diff --git a/upx.sh.in b/upx.sh.in
index 11e053146f0..4cfaeb0d692 100644
--- a/upx.sh.in
+++ b/upx.sh.in
@@ -2,21 +2,6 @@
#
# upx.sh - Compress package binaries with UPX
#
-# Copyright (c) 2011-2016 Pacman Development Team <pacman-dev@archlinux.org>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
[[ -n "$LIBMAKEPKG_TIDY_UPX_SH" ]] && return
LIBMAKEPKG_TIDY_UPX_SH=1
@@ -26,7 +11,6 @@ LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/message.sh"
source "$LIBRARY/util/option.sh"
-
packaging_options+=('upx')
tidy_modify+=('tidy_upx')