diff options
author | Martoko | 2018-12-24 01:15:23 +0100 |
---|---|---|
committer | Martoko | 2018-12-24 13:33:17 +0100 |
commit | 54fab328d6be7868cc689d6bdc8be272e69ed6fa (patch) | |
tree | 529e46608fb33a745fd76bcc33e5f0e38e9cd65f | |
download | aur-54fab328d6be7868cc689d6bdc8be272e69ed6fa.tar.gz |
Initial commit
-rw-r--r-- | .SRCINFO | 28 | ||||
-rw-r--r-- | FailingTest.c | 6 | ||||
-rw-r--r-- | FailingTest.java | 12 | ||||
-rw-r--r-- | LICENSE | 21 | ||||
-rw-r--r-- | PKGBUILD | 46 | ||||
-rw-r--r-- | PassingTest.c | 8 | ||||
-rw-r--r-- | PassingTest.java | 12 | ||||
-rw-r--r-- | infer-bin.install | 7 |
8 files changed, 140 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..da3897f5f604 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,28 @@ +pkgbase = infer-bin + pkgdesc = Infer is a static analysis tool for Java, C++, Objective-C, and C. Infer is written in OCaml. + pkgver = 0.15.0 + pkgrel = 1 + url = https://github.com/facebook/infer + install = infer-bin.install + arch = x86_64 + license = MIT + depends = bash + depends = libc++abi + depends = python2 + depends = java-environment + depends = ncurses5-compat-libs + source = https://github.com/facebook/infer/releases/download/v0.15.0/infer-linux64-v0.15.0.tar.xz + source = FailingTest.c + source = PassingTest.c + source = FailingTest.java + source = PassingTest.java + source = LICENSE + sha512sums = 9e228eba8cb661d1bb3e81d04f1788e8c5d8e138f7b460544fab7823251153add01a49d1ca61f09cf4f102899182b53b9028711bd65e09d5424e935ee2ace778 + sha512sums = e72e043048624ef958dcb03c73b042d17ee162d80f5f9798dd89b25b9ceca6e4852fc4627ac7c1d5162c73834431f61f52d3b37a4f990d1a19dc927665adbb04 + sha512sums = d5333a55e34e92225dd2018a1b016c0ffe537773ea8d708cd74e2ae8c6e556cec8998028238fb993a000ef0841a6a21f7585893a58fb6c2208122951b717dd78 + sha512sums = 716d142870b12af04a19d81197b96f91af1544d1d8f2a4d09248d161cb4995ef3ff4611f8bd175a0553f0911cf24efa79ef97e36a14667f5b2027e053576d880 + sha512sums = 24ec322cbf4ebc6a5cb41269b1c6ebf09226cf3d0e4201781bd805bb63ffa499090d74542c8fcbdcd63924b8acfb7443acc1732441a2e3bb4c54a0cbf1aec680 + sha512sums = 400e5fff25247fb0fa8c0125073658c8f429c39fc20efefe9a8a69b5c5f925a9df1818b324e6691884ba108463908b75758f07b4796bf9fb972401696d3371f4 + +pkgname = infer-bin + diff --git a/FailingTest.c b/FailingTest.c new file mode 100644 index 000000000000..7b16ab086954 --- /dev/null +++ b/FailingTest.c @@ -0,0 +1,6 @@ +#include <stdio.h> +int main() { + int *s = NULL; + *s = 42; + return 0; +} diff --git a/FailingTest.java b/FailingTest.java new file mode 100644 index 000000000000..4f6f15c1cfac --- /dev/null +++ b/FailingTest.java @@ -0,0 +1,12 @@ +class FailingTest { + String mayReturnNull(int i) { + if (i > 0) { + return "Hello, Infer!"; + } + return null; + } + int mayCauseNPE() { + String s = mayReturnNull(0); + return s.length(); + } +} diff --git a/LICENSE b/LICENSE new file mode 100644 index 000000000000..188fb2b0bd8e --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2013-present, Facebook, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..8dedc573fb10 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,46 @@ +# Maintainer: Martoko <mbastholm at gmail dot com> + +pkgname=infer-bin +pkgver=0.15.0 +pkgrel=1 +pkgdesc="Infer is a static analysis tool for Java, C++, Objective-C, and C. Infer is written in OCaml." +arch=('x86_64') +url="https://github.com/facebook/infer" +license=('MIT') +depends=('bash' + 'libc++abi' + 'python2' + 'java-environment' + 'ncurses5-compat-libs') +source=("https://github.com/facebook/infer/releases/download/v${pkgver}/infer-linux64-v${pkgver}.tar.xz" + 'FailingTest.c' + 'PassingTest.c' + 'FailingTest.java' + 'PassingTest.java' + 'LICENSE') +install=${pkgname}.install +sha512sums=('9e228eba8cb661d1bb3e81d04f1788e8c5d8e138f7b460544fab7823251153add01a49d1ca61f09cf4f102899182b53b9028711bd65e09d5424e935ee2ace778' + 'e72e043048624ef958dcb03c73b042d17ee162d80f5f9798dd89b25b9ceca6e4852fc4627ac7c1d5162c73834431f61f52d3b37a4f990d1a19dc927665adbb04' + 'd5333a55e34e92225dd2018a1b016c0ffe537773ea8d708cd74e2ae8c6e556cec8998028238fb993a000ef0841a6a21f7585893a58fb6c2208122951b717dd78' + '716d142870b12af04a19d81197b96f91af1544d1d8f2a4d09248d161cb4995ef3ff4611f8bd175a0553f0911cf24efa79ef97e36a14667f5b2027e053576d880' + '24ec322cbf4ebc6a5cb41269b1c6ebf09226cf3d0e4201781bd805bb63ffa499090d74542c8fcbdcd63924b8acfb7443acc1732441a2e3bb4c54a0cbf1aec680' + '400e5fff25247fb0fa8c0125073658c8f429c39fc20efefe9a8a69b5c5f925a9df1818b324e6691884ba108463908b75758f07b4796bf9fb972401696d3371f4') + +check() { + ${srcdir}/infer-linux64-v${pkgver}/bin/infer --fail-on-issue -- clang -c FailingTest.c && return 1 + ${srcdir}/infer-linux64-v${pkgver}/bin/infer --fail-on-issue -- clang -c PassingTest.c || return 1 + + ${srcdir}/infer-linux64-v${pkgver}/bin/infer --fail-on-issue -- javac FailingTest.java && return 1 + ${srcdir}/infer-linux64-v${pkgver}/bin/infer --fail-on-issue -- javac PassingTest.java || return 1 + + rm ${srcdir}/infer-linux64-v${pkgver}/lib/infer/infer/lib/python/inferlib/*.pyc +} + +package() { + mkdir ${pkgdir}/usr + cp -r ${srcdir}/infer-linux64-v${pkgver}/bin ${pkgdir}/usr/bin + cp -r ${srcdir}/infer-linux64-v${pkgver}/lib ${pkgdir}/usr/lib + cp -r ${srcdir}/infer-linux64-v${pkgver}/share ${pkgdir}/usr/share + + install -D -m 644 ${srcdir}/LICENSE ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE +} diff --git a/PassingTest.c b/PassingTest.c new file mode 100644 index 000000000000..f3ddc3f955c4 --- /dev/null +++ b/PassingTest.c @@ -0,0 +1,8 @@ +#include <stdio.h> +int main() { + int *s = NULL; + if (s != NULL) { + *s = 42; + } + return 0; +} diff --git a/PassingTest.java b/PassingTest.java new file mode 100644 index 000000000000..4d43ee573df3 --- /dev/null +++ b/PassingTest.java @@ -0,0 +1,12 @@ +class PassingTest { + String mayReturnNull(int i) { + if (i > 0) { + return "Hello, Infer!"; + } + return null; + } + int mayCauseNPE() { + String s = mayReturnNull(0); + return s == null ? 0 : s.length(); + } +} diff --git a/infer-bin.install b/infer-bin.install new file mode 100644 index 000000000000..b2055f6b0ddb --- /dev/null +++ b/infer-bin.install @@ -0,0 +1,7 @@ +# arg 1: the new package version +post_install() { + echo 'Please note:' + echo ' Infer does not seem to work with all java environments' + echo ' It has been confirmed to work with jre8-openjdk' + echo ' For help with java environments see https://wiki.archlinux.org/index.php/java' +} |