Skip to content

Commit 7a991e0

Browse files
committed
New script to create a source package for Langkit_Support
TN: TA19-011
1 parent a556e9b commit 7a991e0

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

utils/langkit_support.gpr.patch

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
--- langkit_support.gpr.old
2+
+++ langkit_support.gpr
3+
@@ -53,10 +53,10 @@
4+
"Langkit_Support.Tree_Traversal_Iterator",
5+
"Langkit_Support.Vectors");
6+
7+
- for Source_Dirs use ("/tmp/langkit-21.0.0/langkit/support");
8+
+ for Source_Dirs use ("src");
9+
for Library_Dir use
10+
- "../langkit_support/" & Library_Kind_Param & "/" & Build_Mode;
11+
- for Object_Dir use "../../obj/langkit_support/" & Build_Mode;
12+
+ "lib/" & Library_Kind_Param & "/" & Build_Mode;
13+
+ for Object_Dir use "obj/" & Build_Mode;
14+
15+
Common_Ada_Cargs := ("-gnatwa", "-gnatyg", "-fPIC");
16+

utils/release-langkit_support.sh

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#! /bin/sh
2+
3+
set -e
4+
5+
RELEASE=21.0.0
6+
SRC_PKG=/tmp/langkit_support-$RELEASE.tar.gz
7+
8+
# Make sure the appropriate Langkit sources are checked out in
9+
# /tmp/langkit-$RELEASE
10+
SRC_DIR=/tmp/langkit-$RELEASE
11+
export PYTHONPATH=$SRC_DIR:$PYTHONPATH
12+
13+
BUILD_DIR=/tmp/langkit_support-$RELEASE
14+
rm -rf $BUILD_DIR
15+
16+
# Generate "langkit_support.gpr", move it to the top directory and import
17+
# sources. Then adjust source/object/library dirs.
18+
$SRC_DIR/scripts/build-langkit_support.py --build-dir=$BUILD_DIR generate
19+
mv $BUILD_DIR/lib/gnat/langkit_support.gpr $BUILD_DIR/
20+
rm -r $BUILD_DIR/lib
21+
mkdir $BUILD_DIR/src
22+
cp -ar $SRC_DIR/langkit/support/*.ad* $BUILD_DIR/src
23+
patch -d $BUILD_DIR -p0 -f -i $SRC_DIR/utils/langkit_support.gpr.patch
24+
25+
# Create the release tarball
26+
tar czf $SRC_PKG -C /tmp langkit_support-$RELEASE
27+
sha512sum $SRC_PKG

0 commit comments

Comments
 (0)