cleanup, automate variables, add MAKEFLAGS to build script

This commit is contained in:
horstderheld 2021-11-07 03:03:57 +01:00
parent 9c75621702
commit 20cca31c14
3 changed files with 20 additions and 30 deletions

View file

@ -33,6 +33,6 @@ pkgbase = edgetx-companion
source = git+https://github.com/EdgeTX/edgetx.git#tag=v2.5.0
source = install.patch
sha256sums = SKIP
sha256sums = 36bf7c59adfe9221f8b03809e0ca0dc537328e239b2384829fb17290137e5005
sha256sums = f9b62f82f402ea96153a7e45ec22aeaa4780039d57b28cc8ca8456e05c34ffe7
pkgname = edgetx-companion

View file

@ -1,11 +1,9 @@
# Maintainer: lod <aur@cyber-anlage.de>
# Maintainer(opentx-version): Ysblokje <ysblokje at gmail dot com>
# Previous Maintainer(opentx-version): Jeff Youdontneedtoknow <jeffpublicjr at gmail dot com>
# Contributer(opentx-version): Arnaud
# Contributer: Ysblokje <ysblokje at gmail dot com>
# Contributer: Jeff Youdontneedtoknow <jeffpublicjr at gmail dot com>
# Contributer: Arnaud
_pkgbase=edgetx
_version_suffix=25
pkgname=${_pkgbase}-companion
pkgname=edgetx-companion
pkgver=2.5.0
pkgrel=1
pkgdesc="EEPROM Editor and Simulator for EdgeTX RC radio transmitter firmwares"
@ -14,15 +12,18 @@ url='https://edgetx.org/'
license=('GPL2')
depends=('hicolor-icon-theme' 'qt5-base' 'qt5-multimedia' 'sdl')
optdepends=('dfu-util: tool for flashing stm32 based radios')
makedepends=('arm-none-eabi-binutils' 'arm-none-eabi-gcc' 'arm-none-eabi-newlib' 'avr-gcc' 'avr-libc' 'bc' 'cmake' 'fox' 'gcc' 'git' 'python' 'python-pillow' 'python-pyqt5' 'qt5-svg' 'qt5-tools' 'qt5-translations' 'sed' 'xsd')
makedepends=('arm-none-eabi-binutils' 'arm-none-eabi-gcc' 'arm-none-eabi-newlib'
'avr-gcc' 'avr-libc' 'bc' 'cmake' 'fox' 'gcc' 'git' 'python'
'python-pillow' 'python-pyqt5' 'qt5-svg' 'qt5-tools' 'qt5-translations'
'sed' 'xsd')
provides=('companion')
conflicts=('companion')
_pkgbase=${pkgname%%-*}
_versuff=${pkgver/./} && _versuff=${_versuff%%.*}
source=("git+https://github.com/EdgeTX/edgetx.git#tag=v${pkgver}"
"install.patch"
)
install.patch)
sha256sums=('SKIP'
'36bf7c59adfe9221f8b03809e0ca0dc537328e239b2384829fb17290137e5005')
'f9b62f82f402ea96153a7e45ec22aeaa4780039d57b28cc8ca8456e05c34ffe7')
prepare() {
cd ${_pkgbase}
@ -32,13 +33,13 @@ prepare() {
build() {
cd ${_pkgbase}
./tools/build-companion-nightly.sh ${srcdir}/${_pkgbase} ${srcdir}/build ${_version_suffix}
./tools/build-companion-nightly.sh ${MAKEFLAGS} ${srcdir}/${_pkgbase} ${srcdir}/build ${_versuff}
}
package() {
cd ${srcdir}/build
make -j`nproc` DESTDIR=${pkgdir}/ install
make DESTDIR=${pkgdir}/ install
cd ${pkgdir}/usr/share/applications
sed -i -e 's/Categories=Application/Categories=Utility/' companion${_version_suffix}.desktop
sed -i -e 's/Categories=Application/Categories=Utility/' simulator${_version_suffix}.desktop
sed -i -e 's/Categories=Application/Categories=Utility/' companion${_versuff}.desktop
sed -i -e 's/Categories=Application/Categories=Utility/' simulator${_versuff}.desktop
}

View file

@ -1,15 +1,4 @@
@@ -4,7 +4,9 @@
set -e
set -x
-if [ "$(uname)" = "Darwin" ]; then
+if [[ ! -z "MAKEFLAGS" ]]; then
+ JOBS="${MAKEFLAGS:2}"
+elif [ "$(uname)" = "Darwin" ]; then
num_cpus=$(sysctl -n hw.ncpu)
: "${JOBS:=$num_cpus}"
else
@@ -30,7 +32,7 @@
@@ -30,7 +30,7 @@
SRCDIR=$1
OUTDIR=$2
@ -18,7 +7,7 @@
if [ "$(uname)" = "Darwin" ]; then
COMMON_OPTIONS="${COMMON_OPTIONS} -DCMAKE_OSX_DEPLOYMENT_TARGET='10.9'"
elif [ "$(uname)" != "Linux" ]; then
@@ -41,9 +43,9 @@
@@ -41,9 +41,9 @@
COMMON_OPTIONS="${COMMON_OPTIONS} -DVERSION_SUFFIX=$3"
fi
@ -31,7 +20,7 @@
cmake ${COMMON_OPTIONS} -DPCB=X9LITE ${SRCDIR}
make -j${JOBS} libsimulator
@@ -128,13 +130,3 @@
@@ -128,13 +128,3 @@
cmake ${COMMON_OPTIONS} -DPCB=X12S ${SRCDIR}
make -j${JOBS} libsimulator