summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 5beddbf30e21bc0c196f56a2708f5d1039821a88 (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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# Maintainer: Rod Kay <rodakay5 at gmail dot com>

pkgname=langkit
pkgdesc='Compiler for syntactic and semantic language analysis libraries.'
pkgver=25.0w
pkgrel=1
epoch=1

url=https://github.com/AdaCore/langkit
arch=(i686 x86_64)
license=(Apache)

depends=(gnatcoll-iconv
         gnatcoll-gmp
         python
         adasat
         prettier-ada)

makedepends=(gprbuild
             texlive-bin
             python-sphinx
             python-e3-core
             python-funcy
             python-mako
             python-e3-core
             python-e3-testsuite
             python-pygments
             python-coverage 
             python-docutils
             python-pexpect
             python-ptyprocess
             python-pycodestyle
             python-railroad-diagrams)

source=(https://github.com/charlie5/archlinux-gnatstudio-support/raw/main/gnatstudio-sources-2024/$pkgname-$pkgver-20240411-1627B-src.tar.gz
        0001-Replace-calls-to-inspect.getargspec-with-getfullargs.patch)
        
sha256sums=(175a54d50c427198e5e2f2644907f952d17e99fe17846a22c594b1ec81ce46e3
            dddf397b5a2de8b0bb45fb4d8cf49d6440911e92594cda8c1af1e045c348c547)


build()
{
    cd $srcdir/$pkgname-$pkgver-20240506-161EA-src

    ADA_FLAGS="$CFLAGS"
    ADA_FLAGS="${ADA_FLAGS//-Wformat}"
    ADA_FLAGS="${ADA_FLAGS//-Werror=format-security}"

    # Build the Langkit_Support library, used by all Langkit-generated libraries.
    #
    python manage.py build-langkit-support            \
        --library-types=static,static-pic,relocatable \
        --build-mode=prod                             \
        --gargs="-R -cargs $ADA_FLAGS -largs $LDFLAGS -gargs"

    python setup.py build
    make -C doc html
}


package()
{
    cd $srcdir/$pkgname-$pkgver-20240506-161EA-src

    python setup.py install --root="$pkgdir" --optimize=1 --skip-build

    python manage.py install-langkit-support          \
        --library-types=static,static-pic,relocatable \
        --build-mode=prod                             \
        $pkgdir/usr

    # Install the license.
    #
    install -D -m644 \
       LICENSE.txt   \
       $pkgdir/usr/share/licenses/$pkgname/LICENSE.txt

    # Install the documentation.
    #
    pushd doc/_build/html

    for file in $(find . -type f); do
        install -m 644 -D "$file" "$pkgdir/usr/share/doc/$pkgname/$file"
    done

    popd
}