summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorbartus2020-07-03 17:37:34 +0200
committerbartus2020-07-04 02:41:34 +0200
commitacab56a5ae99b73c5151162c3653261feb158180 (patch)
tree614ae592f9500ac59a1514422bca9a6ab1b82ce7
parent4eba034e8d06e0d8437da22f2d12ef7e22903346 (diff)
downloadaur-acab56a5ae99b73c5151162c3653261feb158180.tar.gz
Add .shellcheckrc and fix warnings.
-rw-r--r--.shellcheckrc6
-rw-r--r--PKGBUILD32
2 files changed, 21 insertions, 17 deletions
diff --git a/.shellcheckrc b/.shellcheckrc
new file mode 100644
index 00000000000..426d75bb9e3
--- /dev/null
+++ b/.shellcheckrc
@@ -0,0 +1,6 @@
+# allow unsafe `cd `
+disable=SC2164
+# allow unused variable (pkgname,pkgver etc.)
+disable=SC2034
+# allow uninitialized variable (srcdir,pkgdir)
+disable=SC2154
diff --git a/PKGBUILD b/PKGBUILD
index 5dde499a002..d66051d0f57 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,3 +1,4 @@
+#!/hint/bash
# Maintainer : bartus <arch-user-repoᘓbartus.33mail.com>
pkgname=chronoengine
@@ -70,30 +71,27 @@ CMAKE_FLAGS=( -DENABLE_MODULE_POSTPROCESS=ON
prepare() {
cd ${pkgname}
git submodule init
- git config submodule.src/chrono_thirdparty/googlebenchmark.url ${srcdir}/benchmark
- git config submodule.src/chrono_thirdparty/googletest.url ${srcdir}/googletest
+ git config submodule.src/chrono_thirdparty/googlebenchmark.url "${srcdir}"/benchmark
+ git config submodule.src/chrono_thirdparty/googletest.url "${srcdir}"/googletest
git submodule update
- files=($(find -name CMakeLists.txt))
- files+=($(find -name \*.cmake\*))
- sed -i 's/lib64/lib/' ${files[@]}
+ mapfile -t files < <(find . -name CMakeLists.txt)
+ mapfile -t -O ${#files[@]} files < <(find . -name \*.cmake\*)
+ sed -i 's/lib64/lib/' "${files[@]}"
sed -i 's|share/chrono/bin|bin/chronoengine|' CMakeLists.txt
- git apply ${srcdir}/glm.patch
-# git apply ${srcdir}/opencascade.patch
+ git apply -v "${srcdir}"/glm.patch
}
build() {
- mkdir -p build
- cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr \
- -DCMAKE_SKIP_INSTALL_RPATH=ON \
- ${CMAKE_FLAGS[@]} \
- ../${pkgname}
- make
+ -DCMAKE_SKIP_INSTALL_RPATH=ON \
+ "${CMAKE_FLAGS[@]}" \
+ -S ${pkgname} \
+ -B build
+ make -C build
}
package() {
- cd build
- make DESTDIR="$pkgdir" install
- install -D -m644 "../chronoengine/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
- install -D -m644 "../chronoengine.sh" "${pkgdir}/etc/profile.d/chronoengine.sh"
+ make -C build DESTDIR="$pkgdir" install
+ install -D -m644 "${pkgname}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+ install -D -m644 "chronoengine.sh" "${pkgdir}/etc/profile.d/chronoengine.sh"
}