summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 8ac2b09f0ebd78960b37c76179857fe35cd2adc8 (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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
# Maintainer: Rod Kay <rodakay5 at gmail dot com>

pkgbase=gnatcoll-bindings
pkgname=(gnatcoll-gmp
         gnatcoll-iconv
         gnatcoll-lzma
         gnatcoll-omp
         gnatcoll-python
         gnatcoll-readline
         gnatcoll-syslog
         gnatcoll-zlib)
pkgdesc='GNAT Components Collection - Language and library bindings.'
pkgver=25.0w
pkgrel=1
epoch=1

url=https://github.com/AdaCore/gnatcoll-bindings
arch=(i686 x86_64)
license=(GPL3 custom)

depends=(gnatcoll-core)
makedepends=(python python-setuptools gprbuild libiconv syslog-ng)

source=(https://github.com/charlie5/archlinux-gnatstudio-support/raw/main/gnatstudio-sources-2024/$pkgbase-$pkgver-20240408-162B5-src.tar.gz
        fix-python2-dont-cache-prefix-during-install.patch
        fix-python3-dont-cache-prefix-during-install.patch)

sha256sums=(08b9b1145ff3b7b40a56e0a0172ea945acf4d0fa176f343db346047a73b0cf7b
            3c01d8f03f3b9702b4ffb9c668f3bbf33f6908fb8f7a4ce55092cc784d637dc4
            78e6493e38e74d1a2b246de9a50395f07e8d35cb0e7a3694cb62ef2d57d13286)

_source_dir=$pkgbase-$pkgver-20240505-16461-src


prepare()
{
    cd $srcdir/$_source_dir

    patch -p0 < $srcdir/fix-python2-dont-cache-prefix-during-install.patch
    patch -p0 < $srcdir/fix-python3-dont-cache-prefix-during-install.patch
}


build()
{
    cd $srcdir/$_source_dir
   
    ADA_FLAGS="$CFLAGS"
    ADA_FLAGS="${ADA_FLAGS//-Wformat}"
    ADA_FLAGS="${ADA_FLAGS//-Werror=format-security}"

   _gpr_opts="-R -cargs $ADA_FLAGS -fPIC -largs $LDFLAGS"

    cd $srcdir/$_source_dir/python3
    python setup.py build --prefix=/usr --gpr-opts $_gpr_opts

    cd $srcdir/$_source_dir/readline
    python setup.py build --prefix=/usr --accept-gpl --gpr-opts $_gpr_opts

    cd $srcdir/$_source_dir/iconv
    python setup.py build --prefix=/usr --gpr-opts $_gpr_opts

    cd $srcdir/$_source_dir/gmp
    python setup.py build --prefix=/usr --gpr-opts $_gpr_opts

    cd $srcdir/$_source_dir/lzma
    python setup.py build --prefix=/usr --gpr-opts $_gpr_opts

    cd $srcdir/$_source_dir/omp
    python setup.py build --prefix=/usr --gpr-opts $_gpr_opts

    cd $srcdir/$_source_dir/syslog
    python setup.py build --prefix=/usr --gpr-opts $_gpr_opts

    cd $srcdir/$_source_dir/zlib
    python setup.py build --prefix=/usr --gpr-opts $_gpr_opts
}


_install_license()
{
    cd $srcdir/$_source_dir

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

    # Install the custom license.
    #
    install -D -m644     \
       COPYING.RUNTIME   \
       $pkgdir/usr/share/licenses/$pkgname/COPYING.RUNTIME
}


package_gnatcoll-python()
{
    pkgdesc='GNAT Components Collection - Interface to the python 3 interpreter.'
    depends=(python gnatcoll-core)
    provides=(gnatcoll-python)
    replaces=(gnatcoll-python)

    cd $srcdir/$_source_dir/python3
    python setup.py install --prefix=$pkgdir/usr

    _install_license
}


package_gnatcoll-readline()
{
    pkgdesc='GNAT Components Collection - Bindings to readline'
    depends=(readline gnatcoll-core)

    cd $srcdir/$_source_dir/readline
    python setup.py install --prefix=$pkgdir/usr

    _install_license
}


package_gnatcoll-iconv()
{
    pkgdesc='GNAT Components Collection - Bindings to Libiconv'
    depends=(libiconv gnatcoll-core)

    cd $srcdir/$_source_dir/iconv
    python setup.py install --prefix=$pkgdir/usr

    _install_license
}


package_gnatcoll-gmp()
{
    pkgdesc='GNAT Components Collection - Bindings to GMP'
    depends=(gmp gnatcoll-core)

    cd $srcdir/$_source_dir/gmp
    python setup.py install --prefix=$pkgdir/usr

    _install_license
}


package_gnatcoll-lzma()
{
    pkgdesc='GNAT Components Collection - Bindings to LZMA'
    depends=(xz gnatcoll-core)

    cd $srcdir/$_source_dir/lzma
    python setup.py install --prefix=$pkgdir/usr

    _install_license
}


package_gnatcoll-omp()
{
    pkgdesc='GNAT Components Collection - Bindings to OpenMP'
    depends=(gnatcoll-core)

    cd $srcdir/$_source_dir/omp
    python setup.py install --prefix=$pkgdir/usr

    _install_license
}


package_gnatcoll-syslog()
{
    pkgdesc='GNAT Components Collection - Bindings to the Syslog the system logger on Unix systems.'
    depends=(syslog-ng gnatcoll-core)

    cd $srcdir/$_source_dir/syslog
    python setup.py install --prefix=$pkgdir/usr

    _install_license
}


package_gnatcoll-zlib()
{
    pkgdesc='GNAT Components Collection - Bindings to Zlib.'
    depends=(zlib gnatcoll-core)

    cd $srcdir/$_source_dir/zlib
    python setup.py install --prefix=$pkgdir/usr

    _install_license
}