Skip to content

Commit

Permalink
New script to create a source package for Langkit_Support
Browse files Browse the repository at this point in the history
TN: TA19-011
  • Loading branch information
pmderodat committed Oct 19, 2020
1 parent a556e9b commit 7a991e0
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
16 changes: 16 additions & 0 deletions utils/langkit_support.gpr.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
--- langkit_support.gpr.old
+++ langkit_support.gpr
@@ -53,10 +53,10 @@
"Langkit_Support.Tree_Traversal_Iterator",
"Langkit_Support.Vectors");

- for Source_Dirs use ("/tmp/langkit-21.0.0/langkit/support");
+ for Source_Dirs use ("src");
for Library_Dir use
- "../langkit_support/" & Library_Kind_Param & "/" & Build_Mode;
- for Object_Dir use "../../obj/langkit_support/" & Build_Mode;
+ "lib/" & Library_Kind_Param & "/" & Build_Mode;
+ for Object_Dir use "obj/" & Build_Mode;

Common_Ada_Cargs := ("-gnatwa", "-gnatyg", "-fPIC");

27 changes: 27 additions & 0 deletions utils/release-langkit_support.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#! /bin/sh

set -e

RELEASE=21.0.0
SRC_PKG=/tmp/langkit_support-$RELEASE.tar.gz

# Make sure the appropriate Langkit sources are checked out in
# /tmp/langkit-$RELEASE
SRC_DIR=/tmp/langkit-$RELEASE
export PYTHONPATH=$SRC_DIR:$PYTHONPATH

BUILD_DIR=/tmp/langkit_support-$RELEASE
rm -rf $BUILD_DIR

# Generate "langkit_support.gpr", move it to the top directory and import
# sources. Then adjust source/object/library dirs.
$SRC_DIR/scripts/build-langkit_support.py --build-dir=$BUILD_DIR generate
mv $BUILD_DIR/lib/gnat/langkit_support.gpr $BUILD_DIR/
rm -r $BUILD_DIR/lib
mkdir $BUILD_DIR/src
cp -ar $SRC_DIR/langkit/support/*.ad* $BUILD_DIR/src
patch -d $BUILD_DIR -p0 -f -i $SRC_DIR/utils/langkit_support.gpr.patch

# Create the release tarball
tar czf $SRC_PKG -C /tmp langkit_support-$RELEASE
sha512sum $SRC_PKG

0 comments on commit 7a991e0

Please sign in to comment.