alien_sdl: switch to secondaryArch, add tests, cleanup

The original patch function is replaced with a patchset. Instead, patch a hardcoded include path via the patch function.

TODO: additional_cflags in ConfigData are still wrong (they use the wrong include paths).
They should be fixed or removed if not needed.

TODO: determine if the 'build_*' entries in ConfigData are needed.
If not, this could maybe be changed to an 'any' arch package.
(By default, this calls the `sdl-config` script from SDL anyway, so it depends on the environment
whether secondaryArch will be used or not.)
This commit is contained in:
Joachim Mairböck
2023-09-17 10:54:24 +02:00
parent 26a2b186e6
commit 5fddf5d5d3
2 changed files with 53 additions and 7 deletions

View File

@@ -16,23 +16,31 @@ functionality (see below)."
HOMEPAGE="https://metacpan.org/pod/Alien::SDL"
COPYRIGHT="2009-2015 Kartik Thakore"
LICENSE="Artistic"
REVISION="2"
REVISION="3"
SOURCE_URI="https://cpan.metacpan.org/authors/id/F/FR/FROGGS/Alien-SDL-$portVersion.tar.gz"
CHECKSUM_SHA256="c9aa2c9dc3c63d89773c7d7203f2a46d1b924d0c72d9f801af147a3dc8bc512a"
SOURCE_DIR="Alien-SDL-$portVersion"
PATCHES="alien_sdl-$portVersion.patchset"
ARCHITECTURES="all"
ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"
PROVIDES="
alien_sdl = $portVersion
alien_sdl$secondaryArchSuffix = $portVersion
cmd:sdl_config.pl
"
if [ -n "$secondaryArchSuffix" ]; then
PROVIDES+="
alien_sdl = $portVersion
"
fi
REQUIRES="
haiku$secondaryArchSuffix
vendor_perl
"
BUILD_REQUIRES="
haiku_devel
haiku${secondaryArchSuffix}_devel
archive_extract
archive_zip
capture_tiny
@@ -43,11 +51,17 @@ BUILD_REQUIRES="
text_patch
"
BUILD_PREREQUIRES="
cmd:sdl_config
cmd:sdl_config$secondaryArchSuffix
"
TEST_REQUIRES="
cmd:gcc$secondaryArchSuffix
devel:libsdl$secondaryArchSuffix
"
PATCH()
{
sed -i '/^GetOptions/d' Build.PL
sed -i "s,'include','$relativeIncludeDir',g" lib/Alien/SDL.pm
}
BUILD()
@@ -58,5 +72,16 @@ BUILD()
INSTALL()
{
./Build install --installdirs vendor
./Build pure_install
# remove architecture-specific files (this would be an "any" arch package,
# but it isn't because of different paths on secondaryArch)
cd $prefix
rm -r $(perl -V:vendorarch | cut -d\' -f2 | cut -d/ -f5-)
# cut extracts the quoted string and strips the prefix (which is perl's and not ours)
}
TEST()
{
./Build test
}

View File

@@ -0,0 +1,21 @@
From 8b27091e1529167f00d6f3499b4326d57c3800ac Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Joachim=20Mairb=C3=B6ck?= <j.mairboeck@gmail.com>
Date: Sun, 17 Sep 2023 09:53:31 +0200
Subject: remove GetOptions call which breaks the build
diff --git a/Build.PL b/Build.PL
index cb9a..d3d5 100644
--- a/Build.PL
+++ b/Build.PL
@@ -9,7 +9,6 @@ use My::Utility qw(check_config_script check_prebuilt_binaries check_prereqs_lib
use Getopt::Long;
my ( $ans, $travis ) = 0;
-GetOptions( "travis" => \$travis );
print "Welcome to Alien::SDL module installation\n";
print "-----------------------------------------\n";
--
2.37.3