Skip to content

Commit 97f5037

Browse files
committed
new package: gprbuild-bootstrap
1 parent 7fca622 commit 97f5037

File tree

4 files changed

+118
-0
lines changed

4 files changed

+118
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
--- a/gpr/src/gpr_imports.c
2+
+++ b/gpr/src/gpr_imports.c
3+
@@ -69,6 +69,11 @@
4+
char __gnat_shared_libgcc_default = SHARED;
5+
const char *__gnat_default_libgcc_subdir = "lib";
6+
7+
+#elif defined(__ANDROID__)
8+
+int __gnat_link_max = 8192;
9+
+char __gnat_shared_libgcc_default = STATIC;
10+
+const char *__gnat_default_libgcc_subdir = "lib";
11+
+
12+
#elif defined (linux) || defined(__GLIBC__)
13+
int __gnat_link_max = 8192;
14+
char __gnat_shared_libgcc_default = STATIC;
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
--- a/src/gprlib.adb
2+
+++ b/src/gprlib.adb
3+
@@ -2211,17 +2211,7 @@
4+
"no toolchain version for language " & Line (1 .. Last));
5+
6+
elsif Line (1 .. Last) = "ada" then
7+
- Get_Line (IO_File, Line, Last);
8+
-
9+
- if Last > 5 and then Line (1 .. 5) = GNAT_And_Space then
10+
- GNAT_Version := new String'(Line (6 .. Last));
11+
- GNAT_Version_Set := True;
12+
-
13+
- Free (Libgnat);
14+
- Free (Libgnarl);
15+
- Libgnat := new String'("-lgnat-" & Line (6 .. Last));
16+
- Libgnarl := new String'("-lgnarl-" & Line (6 .. Last));
17+
- end if;
18+
+ Skip_Line (IO_File);
19+
20+
else
21+
Skip_Line (IO_File);
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--- a/Makefile
2+
+++ b/Makefile
3+
@@ -27,7 +27,7 @@
4+
HOST = $(shell gcc -dumpmachine)
5+
TARGET := $(shell gcc -dumpmachine)
6+
7+
-prefix := $(dir $(shell which gnatls))..
8+
+prefix := $(dir $(shell command -v gnatls))..
9+
BUILD = production
10+
PROCESSORS = 0
11+
BUILD_DIR =
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
TERMUX_PKG_HOMEPAGE=https://github.com/AdaCore/gprbuild
2+
TERMUX_PKG_DESCRIPTION="An advanced build system designed to help automate the construction of multi-language systems (Bootstrap Version)"
3+
TERMUX_PKG_LICENSE="custom"
4+
TERMUX_PKG_LICENSE_FILE="COPYING3, COPYING.RUNTIME"
5+
TERMUX_PKG_MAINTAINER="@termux-user-repository"
6+
TERMUX_PKG_VERSION="25.0.0"
7+
TERMUX_PKG_SRCURL=https://github.com/AdaCore/gprbuild/archive/refs/tags/v$TERMUX_PKG_VERSION.tar.gz
8+
TERMUX_PKG_SHA256=d12f94c1ec0b6e219f6b162f71f57129d22426e7798092f5f85b9ec2cc818bf1
9+
TERMUX_PKG_BUILD_DEPENDS="gcc-11"
10+
TERMUX_PKG_BUILD_IN_SRC=true
11+
TERMUX_PKG_AUTO_UPDATE=true
12+
13+
termux_step_post_get_source() {
14+
local _xmlada_srcurl="https://github.com/AdaCore/xmlada/archive/refs/tags/v$TERMUX_PKG_VERSION.tar.gz"
15+
local _xmlada_sha256="dbb5984a0931311c7a787a679ef4cfaeeedd357474a585dc170140ef2251dcca"
16+
local _xmlada_path="$TERMUX_PKG_CACHEDIR/xmlada-$(basename $_xmlada_srcurl)"
17+
local _gprconfig_kb_srcurl="https://github.com/AdaCore/gprconfig_kb/archive/refs/tags/v$TERMUX_PKG_VERSION.tar.gz"
18+
local _gprconfig_kb_sha256="802e6d38a3b110897924a9c16e143cb86360f2dde94bb5b9144c7c391e37b121"
19+
local _gprconfig_kb_path="$TERMUX_PKG_CACHEDIR/gprconfig_kb-$(basename $_xmlada_srcurl)"
20+
21+
termux_download $_xmlada_srcurl $_xmlada_path $_xmlada_sha256
22+
termux_download $_gprconfig_kb_srcurl $_gprconfig_kb_path $_gprconfig_kb_sha256
23+
24+
mkdir -p $TERMUX_PKG_SRCDIR/xmlada-src
25+
tar -xf $_xmlada_path -C $TERMUX_PKG_SRCDIR/xmlada-src --strip-components=1
26+
27+
mkdir -p $TERMUX_PKG_SRCDIR/gprconfig_kb-src
28+
tar -xf $_gprconfig_kb_path -C $TERMUX_PKG_SRCDIR/gprconfig_kb-src --strip-components=1
29+
}
30+
31+
termux_step_pre_configure() {
32+
if [ "${TERMUX_ON_DEVICE_BUILD}" = false ]; then
33+
termux_error_exit "This package doesn't support cross-compiling."
34+
fi
35+
}
36+
37+
termux_step_configure() {
38+
export GNATMAKE="gnatmake-11"
39+
40+
CFLAGS="${CFLAGS/-Oz/-Os}"
41+
CXXFLAGS="${CXXFLAGS/-Oz/-Os}"
42+
LDFLAGS="${LDFLAGS/-static-openmp/''}"
43+
44+
CFLAGS="-fPIC $CFLAGS"
45+
46+
CROSS_PREFIX=$TERMUX_ARCH-linux-android
47+
if [ "$TERMUX_ARCH" == "arm" ]; then
48+
CROSS_PREFIX=arm-linux-androideabi
49+
fi
50+
51+
export AR=$CROSS_PREFIX-ar
52+
export AS=$CROSS_PREFIX-as
53+
export LD=$CROSS_PREFIX-ld
54+
export NM=$CROSS_PREFIX-nm
55+
export CC=$CROSS_PREFIX-gcc-11
56+
export FC=$CROSS_PREFIX-gfortran-11
57+
export CXX=$CROSS_PREFIX-g++-11
58+
unset CPP CXXCPP STRINGS
59+
export STRIP=$CROSS_PREFIX-strip
60+
export RANLIB=$CROSS_PREFIX-ranlib
61+
}
62+
63+
termux_step_make() {
64+
:
65+
}
66+
67+
termux_step_make_install() {
68+
./bootstrap.sh \
69+
--with-xmlada=$TERMUX_PKG_SRCDIR/xmlada-src \
70+
--with-kb=$TERMUX_PKG_SRCDIR/gprconfig_kb-src \
71+
--prefix=$PREFIX/opt/gprbuild-bootstrap
72+
}

0 commit comments

Comments
 (0)