diff --git a/utils/libadalang.gpr.patch b/utils/libadalang.gpr.patch new file mode 100644 index 000000000..14a2801d5 --- /dev/null +++ b/utils/libadalang.gpr.patch @@ -0,0 +1,24 @@ +--- libadalang.gpr.old ++++ libadalang.gpr +@@ -25,10 +25,7 @@ library project Libadalang is + Enable_Warnings : Boolean := + external ("LIBADALANG_WARNINGS", "false"); + +- Primary_Source_Dirs := +- ("/tmp/libadalang-21.0.0/include/libadalang", "/tmp/lal-21.0.0/ada/extensions/src"); +- +- for Source_Dirs use Primary_Source_Dirs; ++ for Source_Dirs use ("src"); + + for Languages use + ("Ada", "C") +@@ -41,8 +38,8 @@ library project Libadalang is + ; + + for Library_Dir use +- "../libadalang/" & Library_Kind_Param & "/" & Build_Mode; +- for Object_Dir use "../../obj/libadalang/" & Build_Mode; ++ "lib/" & Build_Mode; ++ for Object_Dir use "obj/" & Build_Mode; + + Target := Libadalang'Target; diff --git a/utils/mains.gpr.patch b/utils/mains.gpr.patch new file mode 100644 index 000000000..b5321b7c5 --- /dev/null +++ b/utils/mains.gpr.patch @@ -0,0 +1,22 @@ +--- mains.gpr.old ++++ mains.gpr +@@ -1,4 +1,3 @@ +- + with "langkit_support"; + with "libadalang"; + +@@ -9,12 +8,10 @@ + + for Languages use ("Ada"); + +- + for Source_Dirs use ( +- ".", "../../lal-21.0.0/ada/testsuite/ada", "../../lal-21.0.0/ada/testsuite/ada/gnat_compare" ++ "src-mains" + ); +- for Exec_Dir use "../bin"; +- for Object_Dir use "../obj/mains"; ++ for Object_Dir use "obj-mains"; + + for Main use ( + "gnat_compare.adb", "nameres.adb", "navigate.adb", "parse.adb" diff --git a/utils/release.sh b/utils/release.sh new file mode 100755 index 000000000..fb461318c --- /dev/null +++ b/utils/release.sh @@ -0,0 +1,46 @@ +#! /bin/sh + +set -e + +RELEASE=21.0.0 +SRC_PKG=/tmp/libadalang-$RELEASE.tar.gz + +# Make sure the appropriate Langkit sources are checked out in +# /tmp/langkit-$RELEASE and Libadalang sources in /tmp/lal-$RELEASE +SRC_DIR=/tmp/lal-$RELEASE +cd $SRC_DIR +export PYTHONPATH=/tmp/langkit-$RELEASE:$PYTHONPATH + +BUILD_DIR=/tmp/libadalang-$RELEASE +rm -rf $BUILD_DIR + +# Generate the Libadalang and Mains projects +ada/manage.py --build-dir=$BUILD_DIR --no-langkit-support generate + +# Reorganize the trees for libadalang.gpr +mv $BUILD_DIR/lib/gnat/libadalang.gpr $BUILD_DIR/ +patch -d $BUILD_DIR -p0 -f -i $SRC_DIR/utils/libadalang.gpr.patch + +mv $BUILD_DIR/include/libadalang.h $BUILD_DIR/src/ +mv $BUILD_DIR/include/libadalang/*.ad* $BUILD_DIR/src/ +mv $BUILD_DIR/include/libadalang/*.c $BUILD_DIR/src/ +cp -a $SRC_DIR/ada/extensions/src/* $BUILD_DIR/src/ + +# Reorganize the trees for mains.gpr +mv $BUILD_DIR/src/mains.gpr $BUILD_DIR/ +patch -d $BUILD_DIR -p0 -f -i $SRC_DIR/utils/mains.gpr.patch + +mkdir $BUILD_DIR/src-mains +mv $BUILD_DIR/src/parse.adb $BUILD_DIR/src-mains/ +cp -ar $SRC_DIR/ada/testsuite/ada/*.ad* $BUILD_DIR/src-mains/ +cp -ar $SRC_DIR/ada/testsuite/ada/gnat_compare/*.ad* $BUILD_DIR/src-mains/ + +mv $BUILD_DIR/bin/lal_playground $BUILD_DIR/python +rm -r $BUILD_DIR/bin +rm -r $BUILD_DIR/include +rm -r $BUILD_DIR/lib +rm -r $BUILD_DIR/obj + +# Create the release tarball +tar czf $SRC_PKG -C /tmp libadalang-$RELEASE +sha512sum $SRC_PKG