mirror of
https://github.com/yann64/haikuports.git
synced 2026-03-19 01:46:00 +01:00
squirrel, bump version, switch to cmake (#7433)
This commit is contained in:
12
dev-lang/squirrel/patches/squirrel-3.2-CVE-2022-30292.patch
Normal file
12
dev-lang/squirrel/patches/squirrel-3.2-CVE-2022-30292.patch
Normal file
@@ -0,0 +1,12 @@
|
||||
diff --git a/squirrel/sqbaselib.cpp b/squirrel/sqbaselib.cpp
|
||||
index e2f248e..308d2cc 100644
|
||||
--- a/squirrel/sqbaselib.cpp
|
||||
+++ b/squirrel/sqbaselib.cpp
|
||||
@@ -1149,6 +1149,7 @@ static SQInteger thread_call(HSQUIRRELVM v)
|
||||
SQObjectPtr o = stack_get(v,1);
|
||||
if(sq_type(o) == OT_THREAD) {
|
||||
SQInteger nparams = sq_gettop(v);
|
||||
+ sq_reservestack(_thread(o), nparams + 3);
|
||||
_thread(o)->Push(_thread(o)->_roottable);
|
||||
for(SQInteger i = 2; i<(nparams+1); i++)
|
||||
sq_move(_thread(o),v,i);
|
||||
@@ -1,68 +0,0 @@
|
||||
SUMMARY="A light-weight scripting language"
|
||||
DESCRIPTION="
|
||||
Squirrel is a light weight programming language featuring higher-order \
|
||||
functions, classes/inheritance, delegation, tail recursion, generators, \
|
||||
cooperative threads, exception handling, reference counting and garbage \
|
||||
collection on demand. C-like syntax."
|
||||
HOMEPAGE="http://www.squirrel-lang.org"
|
||||
COPYRIGHT="2003-2016 Alberto Demichelis"
|
||||
LICENSE="MIT"
|
||||
REVISION="2"
|
||||
SOURCE_URI="https://github.com/albertodemichelis/squirrel/archive/v3.1.tar.gz"
|
||||
CHECKSUM_SHA256="51942b8638a97b673e34ecf3ca50304996fa99bbdbfa7fe93d9744e6769b2f95"
|
||||
SOURCE_DIR="squirrel-3.1"
|
||||
|
||||
ARCHITECTURES="all !x86_gcc2"
|
||||
SECONDARY_ARCHITECTURES="x86"
|
||||
|
||||
PROVIDES="
|
||||
squirrel$secondaryArchSuffix = $portVersion
|
||||
cmd:sq$secondaryArchSuffix = $portVersion
|
||||
"
|
||||
REQUIRES="
|
||||
haiku$secondaryArchSuffix
|
||||
"
|
||||
|
||||
PROVIDES_devel="
|
||||
squirrel${secondaryArchSuffix}_devel = $portVersion
|
||||
devel:libsqstdlib$secondaryArchSuffix = $portVersion
|
||||
devel:libsquirrel$secondaryArchSuffix = $portVersion
|
||||
"
|
||||
REQUIRES_devel="
|
||||
squirrel$secondaryArchSuffix == $portVersion base
|
||||
"
|
||||
|
||||
BUILD_PREREQUIRES="
|
||||
haiku${secondaryArchSuffix}_devel
|
||||
cmd:gcc$secondaryArchSuffix
|
||||
cmd:make
|
||||
"
|
||||
|
||||
BUILD()
|
||||
{
|
||||
if [ $effectiveTargetArchitecture = x86 ]; then
|
||||
make $jobArgs
|
||||
else
|
||||
make sq64 $jobArgs
|
||||
fi
|
||||
}
|
||||
|
||||
INSTALL()
|
||||
{
|
||||
mkdir -p $binDir
|
||||
cp -r bin/* $binDir
|
||||
|
||||
mkdir -p $includeDir
|
||||
cp -r include/* $includeDir
|
||||
|
||||
mkdir -p $developDocDir
|
||||
cp -r doc/* $developDocDir
|
||||
|
||||
mkdir -p $libDir
|
||||
cp -r lib/* $develLibDir
|
||||
|
||||
rm -rf $libDir
|
||||
|
||||
packageEntries devel \
|
||||
$developDir
|
||||
}
|
||||
89
dev-lang/squirrel/squirrel-3.2.recipe
Normal file
89
dev-lang/squirrel/squirrel-3.2.recipe
Normal file
@@ -0,0 +1,89 @@
|
||||
SUMMARY="A light-weight scripting language"
|
||||
DESCRIPTION="Squirrel is a light weight programming language featuring higher-order \
|
||||
functions, classes/inheritance, delegation, tail recursion, generators, \
|
||||
cooperative threads, exception handling, reference counting and garbage \
|
||||
collection on demand. C-like syntax."
|
||||
HOMEPAGE="http://www.squirrel-lang.org"
|
||||
COPYRIGHT="2003-2016 Alberto Demichelis"
|
||||
LICENSE="MIT"
|
||||
REVISION="1"
|
||||
SOURCE_URI="https://github.com/albertodemichelis/squirrel/archive/v$portVersion.tar.gz"
|
||||
CHECKSUM_SHA256="02805414cfadd5bbb921891d3599b83375a40650abd6404a8ab407dc5e86a996"
|
||||
# Grabbed from Gentoo
|
||||
PATCHES="squirrel-3.2-CVE-2022-30292.patch"
|
||||
|
||||
ARCHITECTURES="all !x86_gcc2"
|
||||
SECONDARY_ARCHITECTURES="x86"
|
||||
|
||||
commandBinDir=$binDir
|
||||
commandSuffix=$secondaryArchSuffix
|
||||
if [ "$targetArchitecture" = x86_gcc2 ]; then
|
||||
commandSuffix=
|
||||
commandBinDir=$prefix/bin
|
||||
fi
|
||||
|
||||
libVersion="0.0.0"
|
||||
libVersionCompat="$libVersion compat >= ${libVersion%%.*}"
|
||||
|
||||
PROVIDES="
|
||||
squirrel$secondaryArchSuffix = $portVersion
|
||||
cmd:sq$commandSuffix = $portVersion
|
||||
lib:libsqstdlib$secondaryArchSuffix = $libVersionCompat
|
||||
lib:libsquirrel$secondaryArchSuffix = $libVersionCompat
|
||||
"
|
||||
REQUIRES="
|
||||
haiku$secondaryArchSuffix
|
||||
"
|
||||
|
||||
PROVIDES_devel="
|
||||
squirrel${secondaryArchSuffix}_devel = $portVersion
|
||||
devel:libsqstdlib$secondaryArchSuffix = $libVersionCompat
|
||||
devel:libsquirrel$secondaryArchSuffix = $libVersionCompat
|
||||
"
|
||||
REQUIRES_devel="
|
||||
squirrel$secondaryArchSuffix == $portVersion base
|
||||
"
|
||||
|
||||
BUILD_REQUIRES="
|
||||
haiku${secondaryArchSuffix}_devel
|
||||
"
|
||||
BUILD_PREREQUIRES="
|
||||
cmd:cmake
|
||||
cmd:gcc$secondaryArchSuffix
|
||||
cmd:make
|
||||
"
|
||||
|
||||
BUILD()
|
||||
{
|
||||
cmake -B build -S . -DCMAKE_BUILD_TYPE=Release \
|
||||
$cmakeDirArgs \
|
||||
-DCMAKE_INSTALL_BINDIR=$commandBinDir \
|
||||
-DDISABLE_STATIC=ON
|
||||
make -C build $jobArgs
|
||||
}
|
||||
|
||||
INSTALL()
|
||||
{
|
||||
make -C build install
|
||||
|
||||
prepareInstalledDevelLibs libsqstdlib libsquirrel
|
||||
|
||||
# Add pkgconfig file
|
||||
mkdir -p $developLibDir/pkgconfig
|
||||
cat > $developLibDir/pkgconfig/squirrel.pc << EOF
|
||||
bindir=$commandBinDir
|
||||
exec_prefix=$prefix
|
||||
libdir=$libDir
|
||||
includedir=$includeDir
|
||||
|
||||
Name: squirrel
|
||||
Description: $SUMMARY
|
||||
Version: $portVersion
|
||||
Libs: -L${developLibDir} -lsqstdlib -lsquirrel
|
||||
Cflags: -I${includeDir}
|
||||
EOF
|
||||
|
||||
packageEntries devel \
|
||||
$developDir \
|
||||
$libDir/cmake
|
||||
}
|
||||
Reference in New Issue
Block a user