summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 09be9c2236613348828c29e1a274a05db3e252b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# Maintainer: Roland Nagy <roliboy@protonmail.com>
# Contributor: Hao Long <aur@esd.cc>

pkgname=python-cipheycore
pkgver=0.3.2
pkgrel=2
pkgdesc="Some cryptanalysis tidbits written in a proper language"
arch=("any")
url="https://github.com/Ciphey/CipheyCore"
license=("MIT")
makedepends=(
    "gcc"
    "boost"
    "cmake"
    "make"
    "swig"
    "patch"
    "python-poetry"
    "python-installer"
)
source=(
    "$pkgname-$pkgver.tar.gz::$url/archive/refs/tags/v$pkgver.tar.gz"
    "xor_single.cpp.patch"
)
sha256sums=(
    "d05b4c15077b56121e96c1b934ae2d49f14004834a9b8fbc1bdc76782cd66253"
    "c6c944b824571589ed6fde61943ebc22dc5eb4de0b028ac5920e3a286230701e"
)

build() {
    cd "$srcdir/CipheyCore-$pkgver"
    cd "src/ciphers"
    patch "xor_single.cpp" < "$srcdir/xor_single.cpp.patch"

    cd "$srcdir/CipheyCore-$pkgver"
    rm -rf build
    mkdir build
    cd build

    cmake .. -DCMAKE_BUILD_TYPE=Release -DCIPHEY_CORE_TEST=OFF
    cmake --build . -t ciphey_core

    cmake --build . -t ciphey_core_py --config Release
    poetry build
}

package() {
    cd "$srcdir/CipheyCore-$pkgver/build"
    python -m installer --destdir="$pkgdir" dist/*.whl
    install -Dm644 "$srcdir/CipheyCore-$pkgver/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}