nasm_segelf: new recipe

This commit is contained in:
PulkoMandy
2025-06-21 16:14:50 +02:00
parent cecfe67fd1
commit 4bdb8f962e
2 changed files with 184 additions and 0 deletions

View File

@@ -0,0 +1,72 @@
SUMMARY="The NASM assembler with seglef patches"
DESCRIPTION="The Netwide Assembler, NASM, is an 80x86 and x86-64 assembler \
designed for portability and modularity. It supports a range of object file \
formats, including Linux and *BSD a.out, ELF, COFF, Mach-O, Microsoft 16-bit \
OBJ, Win32 and Win64. It will also output plain binary files. Its syntax is \
designed to be simple and easy to understand, similar to Intel's but less \
complex. It supports all currently known x86 architectural extensions, and \
has strong support for macros."
HOMEPAGE="https://github.com/stsp/nasm-segelf"
COPYRIGHT="1996-2018 The NASM Authors, 2024 Stas Sergeev"
LICENSE="BSD (2-clause)"
REVISION="1"
SOURCE_URI="https://github.com/stsp/nasm-segelf/archive/refs/tags/nasm-segelf-2.16.01-3.tar.gz"
SOURCE_DIR="nasm-segelf-nasm-segelf-2.16.01-3"
CHECKSUM_SHA256="87564b98746a5d291001130d7d444d221aecacc22016284131e97d0ac7febf6b"
PATCHES="nasm_segelf-$portVersion.patchset"
ARCHITECTURES="all !x86_gcc2 ?x86"
SECONDARY_ARCHITECTURES="?x86"
commandBinDir=$binDir
commandSuffix=$secondaryArchSuffix
if [ "$targetArchitecture" = x86_gcc2 ]; then
commandSuffix=
commandBinDir=$prefix/bin
fi
PROVIDES="
nasm_segelf$secondaryArchSuffix = $portVersion compat >= 1
cmd:nasm_segelf$commandSuffix = $portVersion compat >= 1
"
REQUIRES="
haiku$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
"
BUILD_PREREQUIRES="
cmd:awk
cmd:find
cmd:gcc$secondaryArchSuffix
cmd:ld$secondaryArchSuffix
cmd:make
cmd:perl
cmd:sed
"
TEST_REQUIRES="
cmd:perl
"
defineDebugInfoPackage nasm_segelf$secondaryArchSuffix \
$commandBinDir/nasm-segelf \
BUILD()
{
runConfigure --omit-dirs "binDir" ./configure \
--bindir="$commandBinDir"
make $jobArgs
}
INSTALL()
{
make install
}
TEST()
{
make test
}

View File

@@ -0,0 +1,112 @@
From cd1d88f0ba8829395c0aecb954ede90c1da5d25b Mon Sep 17 00:00:00 2001
From: PulkoMandy <pulkomandy@pulkomandy.tk>
Date: Sat, 21 Jun 2025 16:01:14 +0200
Subject: Simplify invokation of perl scripts
There is no need for timestamp files, that's Make job. Running
subcommands and doing crazy things doesn't work for some reason (rules
are invoked a thousand times and eventually don't generate the
files). A straight rule invoking the script should be fine.
diff --git a/Makefile.in b/Makefile.in
index c60011b..cfbf84a 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -26,12 +26,12 @@ CC = @CC@
CFLAGS = @CFLAGS@
CPPFLAGS = @CPPFLAGS@
BUILD_CFLAGS = $(CPPFLAGS) $(CFLAGS) @DEFS@
-INTERNAL_CFLAGS = -I$(srcdir) -I$(objdir) \
- -I$(srcdir)/include -I$(objdir)/include \
- -I$(srcdir)/x86 -I$(objdir)/x86 \
- -I$(srcdir)/asm -I$(objdir)/asm \
- -I$(srcdir)/disasm -I$(objdir)/disasm \
- -I$(srcdir)/output -I$(objdir)/output
+INTERNAL_CFLAGS = -iquote$(srcdir) -iquote$(objdir) \
+ -iquote$(srcdir)/include -iquote$(objdir)/include \
+ -iquote$(srcdir)/x86 -iquote$(objdir)/x86 \
+ -iquote$(srcdir)/asm -iquote$(objdir)/asm \
+ -iquote$(srcdir)/disasm -iquote$(objdir)/disasm \
+ -iquote$(srcdir)/output -iquote$(objdir)/output
ALL_CFLAGS = $(BUILD_CFLAGS) $(INTERNAL_CFLAGS)
LDFLAGS = @LDFLAGS@
ALL_LDFLAGS = $(ALL_CFLAGS) $(LDFLAGS)
@@ -161,6 +161,16 @@ LIBOBJ_NW = stdlib/snprintf.$(O) stdlib/vsnprintf.$(O) stdlib/strlcpy.$(O) \
# Warnings depend on all source files, so handle them separately
WARNOBJ = asm/warnings.$(O)
+asm/warnings_c.h:
+ $(RUNPERL) $(srcdir)/asm/warnings.pl c asm/warnings_c.h $(srcdir)
+
+include/warnings.h:
+ $(RUNPERL) $(srcdir)/asm/warnings.pl h include/warnings.h $(srcdir)
+
+doc/warnings.src :
+ $(RUNPERL) $(srcdir)/asm/warnings.pl doc doc/warnings.src $(srcdir)
+
+
LIBOBJ = $(LIBOBJ_NW) $(WARNOBJ)
ALLOBJ_NW = $(PROGOBJ) $(LIBOBJ_NW)
ALLOBJ = $(PROGOBJ) $(LIBOBJ)
@@ -286,35 +296,6 @@ x86/regs.h: x86/regs.dat x86/regs.pl | x86
# dependency by the empty file asm/warnings.time.
WARNFILES = asm/warnings_c.h include/warnings.h doc/warnings.src
-warnings:
- $(RM_F) $(WARNFILES) $(WARNFILES:=.time)
- $(MAKE) asm/warnings.time
-
-asm/warnings.time: $(ALLOBJ_NW:.$(O)=.c) | asm
- : > asm/warnings.time
- $(MAKE) $(WARNFILES:=.time)
-
-asm/warnings_c.h.time: asm/warnings.pl asm/warnings.time | asm
- $(RUNPERL) $(srcdir)/asm/warnings.pl c asm/warnings_c.h $(srcdir)
- : > asm/warnings_c.h.time
-
-asm/warnings_c.h: asm/warnings_c.h.time | asm
- touch $@
-
-include/warnings.h.time: asm/warnings.pl asm/warnings.time | include
- $(RUNPERL) $(srcdir)/asm/warnings.pl h include/warnings.h $(srcdir)
- : > include/warnings.h.time
-
-include/warnings.h: include/warnings.h.time | include
- touch $@
-
-doc/warnings.src.time: asm/warnings.pl asm/warnings.time
- $(RUNPERL) $(srcdir)/asm/warnings.pl doc doc/warnings.src $(srcdir)
- : > doc/warnings.src.time
-
-doc/warnings.src : doc/warnings.src.time
- touch $@
-
# Assembler token hash
asm/tokhash.c: x86/insns.dat x86/insnsn.c asm/tokens.dat asm/tokhash.pl \
perllib/phash.ph | asm
--
2.48.1
From 8be8f785e3627b02ae504f6a2b2523f255bc3d93 Mon Sep 17 00:00:00 2001
From: PulkoMandy <pulkomandy@pulkomandy.tk>
Date: Sat, 21 Jun 2025 16:02:02 +0200
Subject: Import nasm patch for Haiku support
diff --git a/nasmlib/path.c b/nasmlib/path.c
index d228ed1..5d6a5f2 100644
--- a/nasmlib/path.c
+++ b/nasmlib/path.c
@@ -53,7 +53,7 @@
# define curdir "."
#elif defined(unix) || defined(__unix) || defined(__unix__) || \
defined(__UNIX__) || defined(__Unix__) || \
- defined(__MACH__) || defined(__BEOS__)
+ defined(__MACH__) || defined(__BEOS__) || defined(__HAIKU__)
/* Unix and Unix-like operating systems and others using
* the equivalent syntax (slashes as only separators, no concept of volume)
*
--
2.48.1