aboutsummaryrefslogtreecommitdiff
path: root/development
diff options
context:
space:
mode:
authorZhu Qun-Ying <zhu.qunying@gmail.com>2024-10-17 15:51:19 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2024-10-17 16:17:24 +0700
commit2229feb3a6443ed6f5ef5c6f1d6fb4f440f52a6f (patch)
tree05283f90fc44743475dbbc6d87c79c0089c0684a /development
parent0e2fe7e2e27c3e5e86603a4439a4a89c0dd8ad4d (diff)
development/gprbuild: Added (advanced build system).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'development')
-rw-r--r--development/gprbuild/README10
-rw-r--r--development/gprbuild/doinst.sh3
-rw-r--r--development/gprbuild/douninst.sh6
-rw-r--r--development/gprbuild/gpr.gpr40
-rw-r--r--development/gprbuild/gprbuild.SlackBuild161
-rw-r--r--development/gprbuild/gprbuild.info14
-rw-r--r--development/gprbuild/slack-desc19
7 files changed, 253 insertions, 0 deletions
diff --git a/development/gprbuild/README b/development/gprbuild/README
new file mode 100644
index 000000000000..cfc631191436
--- /dev/null
+++ b/development/gprbuild/README
@@ -0,0 +1,10 @@
+GPRbuild (GNAT Project Manager)
+
+GPRbuild is an advanced software tool designed to help automate the
+construction of multi-language systems. It removes complexity from
+multi-language development by allowing developers to quickly and
+easily compile and link software written in a combination of
+languages including Ada, Assembler, C, C++, and Fortran. Easily
+extendable by users to cover new toolchains and languages it is
+primarily aimed at projects of all sizes organized into subsystems
+and libraries and is particularly well-suited for compiled languages.
diff --git a/development/gprbuild/doinst.sh b/development/gprbuild/doinst.sh
new file mode 100644
index 000000000000..27c32b3411d4
--- /dev/null
+++ b/development/gprbuild/doinst.sh
@@ -0,0 +1,3 @@
+if [ -x /usr/bin/install-info ]; then
+ /usr/bin/install-info --info-dir=usr/info usr/info/gprbuild_ug.info.gz &> /dev/null
+fi
diff --git a/development/gprbuild/douninst.sh b/development/gprbuild/douninst.sh
new file mode 100644
index 000000000000..1bef5020286e
--- /dev/null
+++ b/development/gprbuild/douninst.sh
@@ -0,0 +1,6 @@
+if [ -x /usr/bin/install-info -a -d usr/info ]; then
+ ( cd usr/info
+ rm -f dir
+ for i in *.info*; do /usr/bin/install-info $i dir 2>/dev/null; done
+ )
+fi
diff --git a/development/gprbuild/gpr.gpr b/development/gprbuild/gpr.gpr
new file mode 100644
index 000000000000..99243b2af41b
--- /dev/null
+++ b/development/gprbuild/gpr.gpr
@@ -0,0 +1,40 @@
+library project Gpr is
+ type BUILD_KIND is ("static", "relocatable", "static-pic");
+ BUILD : BUILD_KIND := external("LIBRARY_TYPE", "relocatable");
+
+ case BUILD is
+ when "relocatable" =>
+ for Source_Dirs use ("../../include/gpr");
+ for Library_Dir use "../gpr/relocatable";
+ for Library_Kind use "relocatable";
+ when "static" =>
+ for Source_Dirs use ("../../include/gpr");
+ for Library_Dir use "../gpr/static";
+ for Library_Kind use "static";
+ when "static-pic" =>
+ for Source_Dirs use ("../../include/gpr");
+ for Library_Dir use "../gpr/static-pic";
+ for Library_Kind use "static-pic";
+ end case;
+
+ for Library_Name use "gpr";
+
+ package Naming is
+ for dot_replacement use "-";
+ for casing use "lowercase";
+
+ case BUILD is
+ when "relocatable" =>
+ for body_suffix ("ada") use ".adb";
+ for spec_suffix ("ada") use ".ads";
+ when "static" =>
+ for body_suffix ("ada") use ".adb";
+ for spec_suffix ("ada") use ".ads";
+ when "static-pic" =>
+ for body_suffix ("ada") use ".adb";
+ for spec_suffix ("ada") use ".ads";
+ end case;
+ end Naming;
+
+ for Externally_Built use "True";
+end Gpr;
diff --git a/development/gprbuild/gprbuild.SlackBuild b/development/gprbuild/gprbuild.SlackBuild
new file mode 100644
index 000000000000..d2b6f9db04cd
--- /dev/null
+++ b/development/gprbuild/gprbuild.SlackBuild
@@ -0,0 +1,161 @@
+#!/bin/bash
+# Slackware build script for gprbuild
+# Copyright 2012-2024, Zhu Qun-Ying
+# All rights reserved.
+#
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+cd $(dirname $0) ; CWD=$(pwd)
+PRGNAM=gprbuild
+VERSION=${VERSION:-24.0.0}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+PKGTYPE=${PKGTYPE:-tgz}
+
+KB_VERSION=${KB_VERSION:-24.0.0}
+GPRCONFIG_KB=gprconfig_kb-$KB_VERSION
+GPRCONFIG_KB_SRC_DIR=$GPRCONFIG_KB
+
+if [ -z "$ARCH" ]; then
+ case "$(uname -m)" in
+ i?86) ARCH=i586 ;;
+ arm*) ARCH=arm ;;
+ *) ARCH=$(uname -m) ;;
+ esac
+fi
+
+if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
+ echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
+ exit 0
+fi
+
+TMP=${TMP:-"/tmp/SBo"}
+PKG=${TMP}/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+BOOTSTRAP_DSTDIR=${BOOTSTRAP_DSTDIR:-$TMP/$PRGNAM-$VERSION/bootstrap}
+BOOTSTRAP=$BOOTSTRAP_DSTDIR/bin
+
+if [ "$ARCH" = "i586" ]; then
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686"
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+elif [ "$ARCH" = "aarch64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+else
+ SLKCFLAGS="-O2"
+fi
+
+set -e
+
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+
+cd $TMP
+rm -rf $PRGNAM-$VERSION
+mkdir $PRGNAM-$VERSION
+tar xvf $CWD/$PRGNAM-$VERSION.tar.gz -C $PRGNAM-$VERSION --strip-components=1
+
+cd $PRGNAM-$VERSION
+
+mkdir $GPRCONFIG_KB_SRC_DIR
+tar xvf $CWD/$GPRCONFIG_KB.tar.gz -C $GPRCONFIG_KB_SRC_DIR --strip-components=1
+
+sed -i -e 's/share\/doc/doc/g' \
+ -e 's/doc\/gprbuild\/info/info/g' gprbuild.gpr
+
+if [ "$ARCH" = "x86_64" ]; then
+ sed -i 's/\/lib\//\/lib64\//g' $GPRCONFIG_KB_SRC_DIR/db/compilers.xml
+ sed -i 's/\/lib\//\/lib64\//g' ./gpr/src/gpr-util.adb
+ sed -i 's/"lib"/"lib64"/g' ./gpr/src/gpr-util.adb
+ sed -i 's/lib\//lib64\//g' Makefile
+ # set the default lib directory to lib64
+ sed -i 's/\"lib\"/\"lib64\"/g' src/gprinstall.ads
+fi
+
+sed -i -e 's/"19940713"/"20231113"/' \
+ -e 's/"2016"/"2023"/' \
+ -e 's/"18.0w"/"24.0.0"/' \
+ -e 's/:= Gnatpro/:= FSF/' gpr/src/gpr-version.ads
+
+(cd share; ln -sfT ../$GPRCONFIG_KB_SRC_DIR/db gprconfig)
+export OS=UNIX
+
+XMLADA_VERSION=${XML_VERSION:-$VERSION}
+XMLADA_SRC_NAME=xmlada-$XMLADA_VERSION
+XMLADA=xmlada-$XMLADA_VERSION
+
+mkdir $XMLADA
+tar xvf $CWD/$XMLADA_SRC_NAME.tar.gz -C $XMLADA --strip-components=1
+
+export CC=gcc
+export CFLAGS=$SLKCFLAGS
+mkdir -p $BOOTSTRAP_DSTDIR
+./bootstrap.sh --with-xmlada=./$XMLADA \
+ --with-kb=./$GPRCONFIG_KB_SRC_DIR \
+ --prefix=$BOOTSTRAP_DSTDIR
+
+find -name "*.o" | xargs rm
+find -name "*.ali" | xargs rm
+rm gprbuild gprclean gprconfig gprinstall gprls gprname
+# now we have the bootstrap gprbuild, using it to build a static xmlada
+# lib for BOOTSTAR_DSTDIR
+(export PATH=$BOOTSTRAP_DSTDIR/bin:$PATH
+ cd $XMLADA
+ sed -i 's/18.0w/24.0.0/g' configure configure.in
+ ./configure --prefix=$BOOTSTRAP_DSTDIR --disable-shared
+ make prefix=$BOOTSTRAP_DSTDIR static
+ make prefix=$BOOTSTRAP_DSTDIR install-static
+)
+
+# now build full gprbuild
+find -name "*.a" -name "*.ali"
+(export PATH=$BOOTSTRAP_DSTDIR/bin:$PATH
+export GPR_PROJECT_PATH=$BOOTSTRAP_DSTDIR/share/gpr
+make BUILD=production prefix=/usr setup
+make LIBRARY_TYPE=static all
+make build
+make prefix=$PKG/usr install
+cd $PKG/usr/bin
+patchelf --set-rpath "" *
+patchelf --remove-rpath *
+)
+
+rm $PKG/usr/doinstall
+make -C doc html info
+
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+mkdir -p $PKG/usr/info
+cp -a doc/html $PKG/usr/doc/$PRGNAM-$VERSION/
+rm -rf $PKG/usr/doc/$PRGNAM-$VERSION/html/_sources
+cp doc/info/*.info $PKG/usr/info
+gzip $PKG/usr/info/*
+
+cp README.md COPYING* $PKG/usr/doc/$PRGNAM-$VERSION
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+strip $PKG/usr/bin/*
+strip $PKG/usr/libexec/gprbuild/*
+
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+cat $CWD/doinst.sh > $PKG/install/doinst.sh
+cat $CWD/douninst.sh > $PKG/install/douninst.sh
+
+cd $PKG
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-${VERSION}-$ARCH-$BUILD$TAG.$PKGTYPE
diff --git a/development/gprbuild/gprbuild.info b/development/gprbuild/gprbuild.info
new file mode 100644
index 000000000000..ec038095bb2d
--- /dev/null
+++ b/development/gprbuild/gprbuild.info
@@ -0,0 +1,14 @@
+PRGNAM="gprbuild"
+VERSION="24.0.0"
+HOMEPAGE="https://github.com/adacore/gprbuild"
+DOWNLOAD="https://github.com/AdaCore/gprbuild/archive/v24.0.0/gprbuild-24.0.0.tar.gz \
+ https://github.com/AdaCore/gprconfig_kb/archive/v24.0.0/gprconfig_kb-24.0.0.tar.gz \
+ https://github.com/AdaCore/xmlada/archive/v24.0.0/xmlada-24.0.0.tar.gz"
+MD5SUM="dc18909ddcdd3ad217052ca57e29f834 \
+ 5e9c0a8e64103af9f708e3085655172a \
+ 372209a79f2946cd31ec28e2a88714c9"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+REQUIRES="Sphinx sphinx-rtd-theme"
+MAINTAINER="Zhu Qun-Ying"
+EMAIL="zhu.qunying@gmail.com"
diff --git a/development/gprbuild/slack-desc b/development/gprbuild/slack-desc
new file mode 100644
index 000000000000..ecb084148bf0
--- /dev/null
+++ b/development/gprbuild/slack-desc
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description. Line
+# up the first '|' above the ':' following the base package name, and the '|'
+# on the right side marks the last column you can put a character in. You must
+# make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':' except on otherwise blank lines.
+
+ |-----handy-ruler------------------------------------------------------|
+gprbuild: gprbuild (GNAT Project Manager)
+gprbuild:
+gprbuild: GPRbuild is an advanced software tool designed to help automate the
+gprbuild: construction of multi-language systems. It removes complexity from
+gprbuild: multi-language development by allowing developers to quickly and
+gprbuild: easily compile and link software written in a combination of
+gprbuild: languages including Ada, Assembler, C, C++, and Fortran. Easily
+gprbuild: extendable by users to cover new toolchains and languages it is
+gprbuild: primarily aimed at projects of all sizes organized into subsystems
+gprbuild: and libraries and is particularly well-suited for compiled languages.
+gprbuild: