aboutsummaryrefslogtreecommitdiffstats
path: root/community
diff options
context:
space:
mode:
authorKevin Daudt <kdaudt@alpinelinux.org>2019-08-08 21:20:33 +0000
committerKevin Daudt <kdaudt@alpinelinux.org>2019-08-09 17:09:58 +0000
commit126db4e29f745711aa45c568ba81ffc61381d724 (patch)
tree05b5473be145fb49fe1266c063191eefeb2ccd95 /community
parent1d0a09a18d6fdf8895612154db9f9243e10aefe8 (diff)
downloadaports-126db4e29f745711aa45c568ba81ffc61381d724.tar.bz2
aports-126db4e29f745711aa45c568ba81ffc61381d724.tar.xz
community/shellcheck: move from testing
Closes #19
Diffstat (limited to 'community')
-rw-r--r--community/shellcheck/APKBUILD95
-rw-r--r--community/shellcheck/cabal.config46
2 files changed, 141 insertions, 0 deletions
diff --git a/community/shellcheck/APKBUILD b/community/shellcheck/APKBUILD
new file mode 100644
index 0000000000..8d978522af
--- /dev/null
+++ b/community/shellcheck/APKBUILD
@@ -0,0 +1,95 @@
+# Maintainer: Olliver Schinagl <oliver@schinagl.nl>
+pkgname=shellcheck
+pkgver=0.6.0
+pkgrel=0
+pkgdesc="a static analysis tool for shell scripts"
+url="https://github.com/koalaman/shellcheck"
+arch="x86_64" # Limited by GHC / Cabal
+license="GPL-3.0"
+makedepends="cabal ghc"
+subpackages="$pkgname-doc"
+source="
+ $pkgname-$pkgver.tar.gz::https://github.com/koalaman/shellcheck/archive/v$pkgver.tar.gz
+ cabal.config
+"
+_cabal_home="$srcdir/dist"
+
+cabal_update() {
+ msg "Freezing $pkgname dependencies"
+
+ # Resolve deps and generate fresh cabal.config with version constraints.
+ HOME="$_cabal_home" cabal update
+ (
+ cd "$builddir"
+ unlink "cabal.config"
+ HOME="$_cabal_home" cabal freeze --shadow-installed-packages
+
+ # Add version tag at the first line.
+ sed -i "1i--$pkgver" "cabal.config"
+
+ mv "cabal.config" "$startdir/"
+ )
+
+ if ! abuild checksum; then
+ die "Failed to update checksum, run 'abuild checksum' manually"
+ fi
+}
+
+prepare() {
+ default_prepare
+
+ if [ "$(head -n 1 "$srcdir/cabal.config")" != "--$pkgver" ]; then
+ die "Requirements file is outdated, run 'abuild cabal_update'"
+ fi
+
+ ln -sf "$srcdir/cabal.config" "$builddir/cabal.config"
+}
+
+build() {
+ HOME="$_cabal_home" cabal update
+ HOME="$_cabal_home" cabal install \
+ --disable-documentation \
+ --only-dependencies
+ HOME="$_cabal_home" cabal configure \
+ --prefix='/usr' \
+ --bindir='$prefix/bin' \
+ --docdir='$prefix/share/doc' \
+ --datadir='$prefix/share' \
+ --htmldir='$docdir/html' \
+ --libdir='$prefix/lib' \
+ --libsubdir="$pkgname" \
+ --datasubdir="$pkgname" \
+ --dynlibdir="$pkgname" \
+ --sysconfdir='/etc' \
+ --disable-library-profiling \
+ --disable-profiling \
+ --disable-shared \
+ --enable-executable-stripping \
+ --flags='GMP FFI standalone'
+ HOME="$_cabal_home" cabal build
+}
+
+check() {
+ _test_script="$(mktemp)"
+ {
+ echo "#!/bin/sh"
+ echo
+ echo "exit 0"
+ } > "${_test_script}"
+ trap 'rm "$_test_script"' EXIT
+ "$builddir/dist/build/$pkgname/$pkgname" "$_test_script"
+ trap - EXIT
+ rm "${_test_script}"
+}
+
+package() {
+ HOME="$_cabal_home" cabal copy --destdir="$pkgdir"
+
+ rm -r "$pkgdir/usr/lib/$pkgname"
+
+ mkdir -p "$pkgdir/usr/share/doc/$pkgname"
+ mv "$pkgdir/usr/share/doc/LICENSE" "$pkgdir/usr/share/doc/$pkgname"
+}
+
+sha512sums="4e9575985fe914cb35444995212ac1afaa40b004dbbc86b5987bf8b65e20b14a0102c9c601dc061d604129a8e978021f22a11d682545cb7f07ec974495cfa387 shellcheck-0.6.0.tar.gz
+087d7e5196c911dd1bd97f45cca7984e10b9e02aa160e25cc85576f97afe9f05eaaf38a3fe59f0f8bdbd80528bbc436dbb2c386b9194e317698b5bc0348ef3f1 cabal.config"
diff --git a/community/shellcheck/cabal.config b/community/shellcheck/cabal.config
new file mode 100644
index 0000000000..f091a1b085
--- /dev/null
+++ b/community/shellcheck/cabal.config
@@ -0,0 +1,46 @@
+--0.6.0
+constraints: Cabal ==2.2.0.1,
+ QuickCheck ==2.13.2,
+ StateVar ==1.2,
+ aeson ==1.4.4.0,
+ array ==0.5.2.0,
+ attoparsec ==0.13.2.2,
+ base ==4.11.1.0,
+ base-compat ==0.10.5,
+ base-orphans ==0.8.1,
+ binary ==0.8.5.1,
+ bytestring ==0.10.8.2,
+ containers ==0.5.11.0,
+ contravariant ==1.5.2,
+ deepseq ==1.4.3.0,
+ directory ==1.3.1.5,
+ dlist ==0.8.0.6,
+ filepath ==1.4.2,
+ ghc-boot-th ==8.4.3,
+ ghc-prim ==0.5.2.0,
+ hashable ==1.3.0.0,
+ integer-gmp ==1.0.2.0,
+ integer-logarithms ==1.0.3,
+ mtl ==2.2.2,
+ parsec ==3.1.13.0,
+ pretty ==1.1.3.6,
+ primitive ==0.7.0.0,
+ process ==1.6.3.0,
+ random ==1.1,
+ regex-base ==0.93.2,
+ regex-tdfa ==1.2.3.2,
+ rts ==1.0,
+ scientific ==0.3.6.2,
+ splitmix ==0.0.3,
+ stm ==2.5.0.0,
+ tagged ==0.8.6,
+ template-haskell ==2.13.0.0,
+ text ==1.2.3.0,
+ th-abstraction ==0.3.1.0,
+ time ==1.8.0.2,
+ time-compat ==1.9.2.2,
+ transformers ==0.5.5.0,
+ unix ==2.7.2.2,
+ unordered-containers ==0.2.10.0,
+ uuid-types ==1.0.3,
+ vector ==0.12.0.3