Skip to content

Commit e3fe49e

Browse files
committed
release: build.sh using recipe names
- in previous builds, a "default" package name was used which required post processing step to create packages for each distribution (different hosts or tools chains) - rework the build process to create the package directly without having to repack the tarball. - this requires the FBPACKTARGET changes in fbc/makefile
1 parent fa712ed commit e3fe49e

File tree

1 file changed

+57
-26
lines changed

1 file changed

+57
-26
lines changed

contrib/release/build.sh

Lines changed: 57 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,15 @@
7575
# -winlibs-gcc-10.2.0 (winlibs mingwrt 8.0.0r8)
7676
# -winlibs-gcc-10.3.0 (winlibs mingwrt 8.0.0r1)
7777
# -equation-gcc-8.3.0 (Equation - experimental)
78+
# * -linux-arm
7879
# * -raspbian9-arm
7980
# * -debian12-armhf
81+
# * -rpios10-arm
82+
# * -rpios10-aarch64
83+
# * -rpios11-arm
84+
# * -rpios11-aarch64
85+
# * -linux-aarch64
86+
# * -ubuntu-22.04-aarch64
8087
#
8188
# Not all recipes are supported on all targets.
8289
#
@@ -182,7 +189,8 @@ else
182189
fi
183190

184191
# check recipe name
185-
# TODO: error on invalid combination of target and recipe
192+
# recipe_name is from the command line option, empty string if not given
193+
# user_recipe is either explicit (from command line) or automatic (below)
186194
if [ ! -z "$recipe_name" ]; then
187195
user_recipe=$recipe_name
188196
else
@@ -207,21 +215,26 @@ else
207215
esac
208216
fi
209217

210-
# multiple recipe names specified by the user or automatically
211-
# determined above will map to recognized named recipes
212-
case $user_recipe in
213-
raspbian9-arm|linux-arm-raspbian9)
214-
named_recipe=raspbian9-arm
218+
# user_recipe may be blank and optionally start with a dash '-'
219+
# named_recipe must be blank or start with a dash '-'
220+
221+
case "$user_recipe" in
222+
""|-*)
223+
named_recipe=$user_recipe
215224
;;
216225
*)
217-
named_recipe=$user_recipe
226+
named_recipe=-$user_recipe
218227
;;
219228
esac
220229

221230
echo "building FB-$target (uname = `uname`, uname -m = `uname -m`)"
222231
echo "from repository: https://github.com/freebasic/fbc.git"
223-
echo "user gave recipe '$user_recipe'"
224-
echo "using named recipe '$named_recipe'"
232+
if [ ! -z "$user_recipe" ]; then
233+
echo "user gave recipe '$user_recipe'"
234+
fi
235+
if [ ! -z "$named_recipe" ]; then
236+
echo "using named recipe '$named_recipe'"
237+
fi
225238
if [ ! -z "$repo_url" ]; then
226239
echo "from repository: $repo_url"
227240
fi
@@ -266,7 +279,11 @@ cd ../..
266279

267280
cd build
268281

282+
if [ ! -z "$named_recipe" ] ; then
283+
buildinfo=../output/buildinfo$named_recipe.txt
284+
else
269285
buildinfo=../output/buildinfo-$target.txt
286+
fi
270287
echo "fbc $fbccommit $target, build based on:" > $buildinfo
271288
echo "named recipe: $named_recipe" >> $buildinfo
272289
echo >> $buildinfo
@@ -709,40 +726,54 @@ win64)
709726
;;
710727
esac
711728

729+
BUILD_BOOTFBCFLAGS=
730+
AppendBOOTFBCFLAGS() {
731+
if [ ! -z "$1" ]; then
732+
if [ -z "$BUILD_BOOTFBCFLAGS" ]; then
733+
BUILD_BOOTFBCFLAGS="$1"
734+
else
735+
BUILD_BOOTFBCFLAGS="$BUILD_BOOTFBCFLAGS $1"
736+
fi
737+
fi
738+
}
739+
712740
# choose a bootstrap source for the target
713741
# - the minimum needed to build the current release
714742
# - plus any options to build the current version from the bootstrap version
715-
case $named_recipe in
716-
debian12-armhf)
743+
case "$named_recipe" in
744+
-debian12-armhf)
717745
# 1.10.2 for arm is a little weird because it depended on changes
718746
# in fbc to make the 1.10.2 bootstrap on debian 12 with gcc 12.
719747
# So, no matter what, we need some manual intervention for this release
720748
# and should improve the automation in the next release
721749
# but it requires some manual intervention to set compile options
722750
#
723-
BUILD_BOOTFBCFLAGS=FBPACKTARGET=$named_recipe
724-
BUILD_BOOTFBCFLAGS=$BUILD_BOOTFBCFLAGS DEFAULT_CPUTYPE_ARM=FB_CPUTYPE_ARMV7A_FP
725-
bootfb_title=FreeBASIC-1.10.2-$fbtarget
751+
AppendBOOTFBCFLAGS "DEFAULT_CPUTYPE_ARM=FB_CPUTYPE_ARMV7A_FP"
752+
bootfb_title="FreeBASIC-1.10.2-$fbtarget"
726753
;;
727-
raspbian9-arm)
728-
BUILD_BOOTFBCFLAGS=FBPACKTARGET=$named_recipe
729-
BUILD_BOOTFBCFLAGS=$BUILD_BOOTFBCFLAGS DEFAULT_CPUTYPE_ARM=FB_CPUTYPE_ARMV6
730-
bootfb_title=FreeBASIC-1.10.1-$named_recipe
754+
-raspbian9-arm)
755+
AppendBOOTFBCFLAGS "DEFAULT_CPUTYPE_ARM=FB_CPUTYPE_ARMV6"
756+
bootfb_title="FreeBASIC-1.10.1$named_recipe"
731757
;;
732-
linux-arm|rpios10-arm|rpios11-arm)
733-
BUILD_BOOTFBCFLAGS=FBPACKTARGET=$named_recipe
734-
BUILD_BOOTFBCFLAGS=$BUILD_BOOTFBCFLAGS DEFAULT_CPUTYPE_ARM=FB_CPUTYPE_ARMV7A
735-
bootfb_title=FreeBASIC-1.10.1-$named_recipe
758+
-linux-arm|-rpios10-arm|-rpios11-arm)
759+
AppendBOOTFBCFLAGS "DEFAULT_CPUTYPE_ARM=FB_CPUTYPE_ARMV7A"
760+
bootfb_title="FreeBASIC-1.10.1$named_recipe"
736761
;;
737-
linux-aarch64|rpios10-aarch64|rpios11-aarch64)
738-
BUILD_BOOTFBCFLAGS=FBPACKTARGET=$named_recipe
739-
bootfb_title=FreeBASIC-1.07.2-$named_recipe
762+
-rpios10-aarch64|-rpios11-aarch64)
763+
bootfb_title="FreeBASIC-1.07.2$named_recipe"
764+
;;
765+
-linux-aarch64|-ubuntu-22.04-aarch64)
766+
bootfb_title="FreeBASIC-1.10.1$named_recipe"
740767
;;
741768
*)
742-
bootfb_title=FreeBASIC-1.06.0-$fbtarget
769+
bootfb_title="FreeBASIC-1.06.0-$fbtarget"
743770
;;
744771
esac
745772

773+
if [ ! -z "$named_recipe" ]; then
774+
AppendBOOTFBCFLAGS "FBPACKTARGET=${named_recipe#-}"
775+
fi
776+
746777
case $fbtarget in
747778
linux*)
748779
# Special case: linux builds use the host gcc toolchain

0 commit comments

Comments
 (0)