summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 07cc9fb4ad06e86b06d7c355b67f14c08a84edf7 (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
# Maintainer:  Rod Kay            <charlie5 on #ada at freenode.net>

# Contributor: Patrick Kelly      <kameo76890 at gmail dot com>
# Contributor: Georgios Tsalikis  <aliverius somewhere near tsalikis and a net>

pkgname=gnatstudio
pkgdesc='GNAT Programming Studio for Ada.'
pkgver=25.0w
pkgrel=1
epoch=1

arch=(i686 x86_64)
url=https://github.com/AdaCore/gps
license=(GPL)

conflicts=(gnat-gps gnatstudio-bin)

depends=(clang
         ada_language_server
         gnatcoll-python
         gnatcoll-xref
         gnatcoll-db2ada
         gtkada
         python-gobject
         python-cairo
         python-yaml
         python-jedi
         python-pycodestyle
         python-sphinx_rtd_theme)

makedepends=(gprbuild
             texlive-meta
             graphviz)

source=(https://github.com/charlie5/archlinux-gnatstudio-support/raw/main/gnatstudio-sources-2024/$pkgname-$pkgver-20240506-161C6-src.tar.gz
        0003-Honour-DESTDIR-in-installation-targets.patch
        gs_utils.patch
        os-utils.c-patch
        building_executable_programs_with_gnat.rst
        gps.desktop
        rid_failing_test_for_gtkada_in_configure.ac-patch)

sha256sums=(9c6251efc37f424ec650d92cea3023c6b782ea3dc6dc444653a2e474e932e730
            5607c451dbf63dba346eeb2ef602a86321d310bdfb6ef777870bb32761b596d5
            7f5196621ca8f1dfe15ada96af63b10d70a56727c103459864a0e3f6b510d182
            6626d93c5d0016280a31411a3dcc5ec80fd1a69c85f4c48a1334ae3f950008b2
            f29080c1d283929cedaa630df27d1688b2099ab5f82601fbf98028a528e935ae
            e21894fc1a0fbc90c25b0c524969703d685f283adc09225744d9013de3b00533
            9d454434aecbc6bb6ce70985feabb97417291c831ae0ac4deec69a5b79fe722f)


prepare()
{
   cd $srcdir/gnatstudio-25.0w-20240506-161C6-src
   
   patch -p1 < $srcdir/0003-Honour-DESTDIR-in-installation-targets.patch
   patch -p0 < $srcdir/gs_utils.patch
   patch -p0 < $srcdir/os-utils.c-patch
   patch -Np0 -i $srcdir/rid_failing_test_for_gtkada_in_configure.ac-patch

   cp $srcdir/building_executable_programs_with_gnat.rst gnat
}


build() 
{
   cd $srcdir/gnatstudio-25.0w-20240506-161C6-src

   export OS=unix
   export LC_ALL=C
   
   autoconf
   ./configure --prefix=/usr

   # The release tarball contains a bunch of sphinx build artefacts.
   #
   make -C docs clean

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

   # GPS uses a lot of Unchecked_Conversion (too many to patch), so we have to build with -fno-strict-aliasing.
   # https://gcc.gnu.org/onlinedocs/gcc-10.2.0/gnat_ugn/Optimization-and-Strict-Aliasing.html
   #
   make OS=unix                  \
        PROCESSORS=0             \
        BUILD=Production         \
        PRJ_BUILD=Release        \
        LIBRARY_TYPE=relocatable \
        GPRBUILD_FLAGS="-R -cargs $ADA_FLAGS -fno-strict-aliasing -largs $LDFLAGS -lpython3.12 -gargs"
 
   # Gnatdoc appears broken when trying to build docs. Disabling docs til fixed.
   #  
   make -C docs all
}


package() 
{
   cd $srcdir/gnatstudio-25.0w-20240506-161C6-src
   
   export OS=unix
   
   make DESTDIR=$pkgdir         install
#   make DESTDIR=$pkgdir -C docs install
 
   ln -s /usr $pkgdir/usr/share/gnatstudio/python

   # Add the desktop config.
   #
   install -Dm644 -t $pkgdir/usr/share/applications/ $srcdir/gps.desktop
  
   # Install the license.
   #
   install -D -m644 \
      COPYING3      \
      $pkgdir/usr/share/licenses/$pkgname/COPYING3
}