commit 6f3ecee9c8624ea4e7dd63069f26d763e30fe947 Author: EnumDev Date: Fri Jan 2 13:17:55 2026 +0200 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3e58e5f --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +# Exclude bpm archives +*.bpm \ No newline at end of file diff --git a/check-version.sh b/check-version.sh new file mode 100644 index 0000000..96c6a31 --- /dev/null +++ b/check-version.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# Github repository +REPO="yasm/yasm" + +# Get tag name using Github Rest API +TAG_NAME=$(curl -s -L -H "X-GitHub-Api-Version: 2022-11-28" -H "Authorization: token ${GITHUB_API_TOKEN}" https://api.github.com/repos/"$REPO"/releases/latest | jq -r '.tag_name') + +# Trim 'v' character in TAG_NAME variable +VERSION=$(echo "$TAG_NAME" | tr -d 'v') + +echo "$VERSION" diff --git a/pkg.info b/pkg.info new file mode 100644 index 0000000..c02d099 --- /dev/null +++ b/pkg.info @@ -0,0 +1,18 @@ +name: yasm +description: Rewrite of NASM under the 'new' BSD License +version: 1.3.0 +revision: 1 +url: https://github.com/yasm/yasm +license: BSD-3-Clause,Artistic-1.0,GPL2-or-later,LGPL2.1-or-later +architecture: any +type: source +depends: + - glibc +make_depends: + - python3 + - xmlto +downloads: + - url: https://github.com/yasm/yasm/archive/refs/tags/v${BPM_PKG_VERSION}.tar.gz + extract_to: ${BPM_SOURCE} + extract_strip_components: 1 + checksum: f708be0b7b8c59bc1dbe7134153cd2f31faeebaa8eec48676c10f972a1f13df3 diff --git a/source-files/autotools-2.70.patch b/source-files/autotools-2.70.patch new file mode 100644 index 0000000..9506af3 --- /dev/null +++ b/source-files/autotools-2.70.patch @@ -0,0 +1,29 @@ +From 3e74376b5653102a3957f59005969fcdbbe5a89d Mon Sep 17 00:00:00 2001 +From: Peter Johnson +Date: Fri, 9 Jul 2021 16:02:37 -0500 +Subject: [PATCH] Do not use AC_HEADER_STDC (#178) + +This fixes compatibility with autotools 2.70+ +--- + configure.ac | 6 ------ + 1 file changed, 6 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 01b61097f..2823ecd7d 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -101,14 +101,8 @@ AM_WITH_DMALLOC + # + # Checks for header files. + # +-AC_HEADER_STDC + AC_CHECK_HEADERS([strings.h libgen.h unistd.h direct.h sys/stat.h]) + +-# REQUIRE standard C headers +-if test "$ac_cv_header_stdc" != yes; then +- AC_MSG_ERROR([Standard (ANSI/ISO C89) header files are required.]) +-fi +- + # + # Checks for typedefs, structures, and compiler characteristics. + # diff --git a/source-files/gcc-15.patch b/source-files/gcc-15.patch new file mode 100644 index 0000000..4365ac1 --- /dev/null +++ b/source-files/gcc-15.patch @@ -0,0 +1,36 @@ +From 64ef740eb262f329e55eebadf2ce276b146d44e9 Mon Sep 17 00:00:00 2001 +From: Martin Jansa +Date: Tue, 22 Apr 2025 19:06:24 +0200 +Subject: [PATCH] bitvect: fix build with gcc-15 + +* fixes: +libyasm/bitvect.h:86:32: error: cannot use keyword 'false' as enumeration constant + 86 | typedef enum boolean { false = FALSE, true = TRUE } boolean; + | ^~~~~ +../git/libyasm/bitvect.h:86:32: note: 'false' is a keyword with '-std=c23' onwards + +as suggested in: +https://github.com/yasm/yasm/issues/283#issuecomment-2661108816 + +Signed-off-by: Martin Jansa +--- + libyasm/bitvect.h | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/libyasm/bitvect.h b/libyasm/bitvect.h +index 3aee3a531..a13470ada 100644 +--- a/libyasm/bitvect.h ++++ b/libyasm/bitvect.h +@@ -83,7 +83,11 @@ typedef Z_longword *Z_longwordptr; + #ifdef MACOS_TRADITIONAL + #define boolean Boolean + #else +- typedef enum boolean { false = FALSE, true = TRUE } boolean; ++ #if __STDC_VERSION__ < 202311L ++ typedef enum boolean { false = FALSE, true = TRUE } boolean; ++ #else ++ typedef bool boolean; ++ #endif + #endif + #endif + diff --git a/source-files/note-gnu-property-support.patch b/source-files/note-gnu-property-support.patch new file mode 100644 index 0000000..639f24b --- /dev/null +++ b/source-files/note-gnu-property-support.patch @@ -0,0 +1,24 @@ +From 0799f381d513e18f404654047fa1b412084968c8 Mon Sep 17 00:00:00 2001 +From: kalebskeithley +Date: Sat, 13 May 2023 00:15:02 -0400 +Subject: [PATCH] Update elf-objfmt.c (#148) + +--- + modules/objfmts/elf/elf-objfmt.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/modules/objfmts/elf/elf-objfmt.c b/modules/objfmts/elf/elf-objfmt.c +index 0c3a14263..c4360c03d 100644 +--- a/modules/objfmts/elf/elf-objfmt.c ++++ b/modules/objfmts/elf/elf-objfmt.c +@@ -1077,6 +1077,10 @@ elf_objfmt_section_switch(yasm_object *object, yasm_valparamhead *valparams, + align = 0; + data.type = SHT_PROGBITS; + data.flags = 0; ++ } else if (strcmp(sectname, ".note.gnu.property") == 0) { ++ align = 8; ++ data.type = SHT_NOTE; ++ data.flags = 0; + } else { + /* Default to code */ + align = 1; diff --git a/source-files/reproducible.patch b/source-files/reproducible.patch new file mode 100644 index 0000000..094a4bf --- /dev/null +++ b/source-files/reproducible.patch @@ -0,0 +1,49 @@ +From 61e374f24718975e8175f048e70afaaf0c4771a9 Mon Sep 17 00:00:00 2001 +From: Ismo Puustinen +Date: Sat, 13 May 2023 07:07:35 +0300 +Subject: [PATCH] Remove __DATE__ from version strings (#198) + +Having __DATE__ is causing compilation errors when it's defined by Bazel +build tool like this: -D__DATE__=redacted +--- + frontends/tasm/tasm.c | 1 - + frontends/vsyasm/vsyasm.c | 1 - + frontends/yasm/yasm.c | 1 - + 3 files changed, 3 deletions(-) + +diff --git a/frontends/tasm/tasm.c b/frontends/tasm/tasm.c +index 93c11c98f..353f8c582 100644 +--- a/frontends/tasm/tasm.c ++++ b/frontends/tasm/tasm.c +@@ -228,7 +228,6 @@ static opt_option options[] = + /* version message */ + /*@observer@*/ static const char *version_msg[] = { + PACKAGE_STRING, +- "Compiled on " __DATE__ ".", + "Copyright (c) 2001-2010 Peter Johnson and other Yasm developers.", + "Run yasm --license for licensing overview and summary." + }; +diff --git a/frontends/vsyasm/vsyasm.c b/frontends/vsyasm/vsyasm.c +index 892b9b334..b3a5a592b 100644 +--- a/frontends/vsyasm/vsyasm.c ++++ b/frontends/vsyasm/vsyasm.c +@@ -220,7 +220,6 @@ static opt_option options[] = + /* version message */ + /*@observer@*/ static const char *version_msg[] = { + PACKAGE_STRING, +- "Compiled on " __DATE__ ".", + "Copyright (c) 2001-2010 Peter Johnson and other Yasm developers.", + "Run yasm --license for licensing overview and summary." + }; +diff --git a/frontends/yasm/yasm.c b/frontends/yasm/yasm.c +index bc6f379ad..7ac141e69 100644 +--- a/frontends/yasm/yasm.c ++++ b/frontends/yasm/yasm.c +@@ -219,7 +219,6 @@ static opt_option options[] = + /* version message */ + /*@observer@*/ static const char *version_msg[] = { + PACKAGE_STRING, +- "Compiled on " __DATE__ ".", + "Copyright (c) 2001-2014 Peter Johnson and other Yasm developers.", + "Run yasm --license for licensing overview and summary." + }; diff --git a/source.sh b/source.sh new file mode 100644 index 0000000..8bb9812 --- /dev/null +++ b/source.sh @@ -0,0 +1,39 @@ +# This is the source.sh script. It is executed by BPM in a temporary directory when compiling a source package +# BPM Expects the source code to be extracted into the automatically created 'source' directory which can be accessed using $BPM_SOURCE +# BPM Expects the output files to be present in the automatically created 'output' directory which can be accessed using $BPM_OUTPUT + +# The prepare function is executed in the root of the temp directory +# This function is used for putting downloaded files to the correct location or applying patches +prepare() { + cd "$BPM_SOURCE" + patch -p1 -i "$BPM_WORKDIR"/note-gnu-property-support.patch + patch -p1 -i "$BPM_WORKDIR"/autotools-2.70.patch + patch -p1 -i "$BPM_WORKDIR"/reproducible.patch + patch -p1 -i "$BPM_WORKDIR"/gcc-15.patch + + echo "$BPM_PKG_VERSION" > version + + autoreconf -fi +} + +# The build function is executed in the source directory +# This function is used to compile the source code +build() { + ./configure --prefix=/usr + make +} + +# The check function is executed in the source directory +# This function is used to run tests to verify the package has been compiled correctly +check() { + make check -j1 +} + +# The package function is executed in the source directory +# This function is used to move the compiled files into the output directory +package() { + make DESTDIR="$BPM_OUTPUT" install + + # Install package license + install -Dm644 "$BPM_SOURCE"/{Artistic.txt,BSD.txt,COPYING,GNU_*} -t "$BPM_OUTPUT"/usr/share/licenses/yasm +}