From 884cacc8e5c4681de6813fde802bd86d701013ca Mon Sep 17 00:00:00 2001 From: PulkoMandy Date: Sat, 21 Jun 2025 17:38:10 +0200 Subject: [PATCH] fdpp: new recipe. --- app-emulation/fdpp/fdpp-1.9.recipe | 76 ++++++++++++++++++++ app-emulation/fdpp/patches/fdpp-1.9.patchset | 50 +++++++++++++ 2 files changed, 126 insertions(+) create mode 100644 app-emulation/fdpp/fdpp-1.9.recipe create mode 100644 app-emulation/fdpp/patches/fdpp-1.9.patchset diff --git a/app-emulation/fdpp/fdpp-1.9.recipe b/app-emulation/fdpp/fdpp-1.9.recipe new file mode 100644 index 000000000..25e4326ba --- /dev/null +++ b/app-emulation/fdpp/fdpp-1.9.recipe @@ -0,0 +1,76 @@ +SUMMARY="64-bit DOS core based on FreeDOS" +DESCRIPTION="Userspace library to run DOS programs in dosemu2." +HOMEPAGE="https://github.com/dosemu2/fdpp" +COPYRIGHT="2024 Stas Sergeev" +LICENSE="GNU GPL v3" +SOURCE_URI="https://github.com/dosemu2/fdpp/archive/refs/tags/1.9.tar.gz" +SOURCE_DIR="$portVersionedName" +CHECKSUM_SHA256="65fdf0819d490c8ba32fc706309f483f0c6547ff65c860efbb4323e4138896ed" +REVISION="1" +PATCHES="$portVersionedName.patchset" + +ARCHITECTURES="all" +SECONDARY_ARCHITECTURES="?x86" + +PROVIDES=" + fdpp$secondaryArchSuffix = $portVersion + lib:libfdpp$secondaryArchSuffix = 35 + lib:libfdldr$secondaryArchSuffix = 35 + " +REQUIRES=" + haiku$secondaryArchSuffix + lib:libelf + " + +PROVIDES_devel=" + fdpp_devel$secondaryArchSuffix = $portVersion + devel:libfdpp$secondaryArchSuffix = 35 + devel:libfdldr$secondaryArchSuffix = 35 +" + +REQUIRES_devel=" + fdpp$secondaryArchSuffix == $portVersion base +" + +BUILD_REQUIRES=" + haiku${secondaryArchSuffix}_devel + devel:libelf + " +BUILD_PREREQUIRES=" + cmd:autom4te + cmd:clang$secondaryArchSuffix + cmd:cpp + cmd:git + cmd:make + cmd:meson + cmd:nasm_segelf + cmd:pkg_config + cmd:thunk_gen + " + +BUILD() +{ + mkdir -p build + ./configure.meson --prefix=$prefix build + + meson compile -C build +} + +INSTALL() +{ + echo "MESON INSTALL" + meson install -C build + + echo "FIXUPS" + mkdir -p $developDir + mv $prefix/include $includeDir + + fixPkgconfig fdpp + + mv $libDir/fdpp/* $libDir + + prepareInstalledDevelLibs \ + libfdpp libfdldr + packageEntries devel \ + $developDir +} diff --git a/app-emulation/fdpp/patches/fdpp-1.9.patchset b/app-emulation/fdpp/patches/fdpp-1.9.patchset new file mode 100644 index 000000000..fc36f037d --- /dev/null +++ b/app-emulation/fdpp/patches/fdpp-1.9.patchset @@ -0,0 +1,50 @@ +From 3619f3a1bb5fed464df76b449aaf66f3d8ebfade Mon Sep 17 00:00:00 2001 +From: PulkoMandy +Date: Sat, 21 Jun 2025 17:36:35 +0200 +Subject: Fix build on Haiku + + +diff --git a/fdpp/kernel/makefile b/fdpp/kernel/makefile +index 0c1aabe..1b54982 100644 +--- a/fdpp/kernel/makefile ++++ b/fdpp/kernel/makefile +@@ -57,7 +57,7 @@ $(T)/$(TARGET).elf $(T)/$(TARGET).map &: $(DEPS_OF_ELF) + else + $(T)/%.elf $(T)/%.map : $(DEPS_OF_ELF) + endif +- $(CROSS_LD) -melf_i386 -static -Map=$(T)/$(TARGET).map -o $(T)/$(TARGET).elf \ ++ $(CROSS_LD) -melf_i386_haiku -static -Map=$(T)/$(TARGET).map -o $(T)/$(TARGET).elf \ + $(LA) $(PF) $(^:%.ld=-T%.ld) + chmod -x $(T)/$(TARGET).elf + +diff --git a/fdpp/kernel/meson.build b/fdpp/kernel/meson.build +index bded24c..c3e017e 100644 +--- a/fdpp/kernel/meson.build ++++ b/fdpp/kernel/meson.build +@@ -70,7 +70,7 @@ executable(TARGET + '.elf', + [SRCS, sfiles, plt_inc], + include_directories: incdir2, + nasm_args: nargs, +- link_args: ['-Wl,-melf_i386', '-Wl,-static', ++ link_args: ['-Wl,-melf_i386_haiku', '-Wl,-static', + '-Wl,-Map=' + TARGET + '.map', '-nostdlib', + '-Wl,--emit-relocs', '-Wl,-T' + kernel_ld], + install: true, +diff --git a/fdpp/loader/elf.c b/fdpp/loader/elf.c +index 7842026..21c7429 100644 +--- a/fdpp/loader/elf.c ++++ b/fdpp/loader/elf.c +@@ -28,6 +28,10 @@ + #include + #include "elf_priv.h" + ++#ifdef __HAIKU__ ++#include "private/system/arch/x86/arch_elf.h" ++#endif ++ + struct elfstate { + char *addr; + size_t mapsize; +-- +2.48.1 +