commit e53310aa82eb3ce3436ae10f504242edb20299e9 Author: EnumDev Date: Thu Mar 12 10:35:24 2026 +0200 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9d96df7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +# Ignore BPM archives and signatures +*.bpm +*.bpm.sig diff --git a/check-version.sh b/check-version.sh new file mode 100644 index 0000000..5e28b96 --- /dev/null +++ b/check-version.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +URL="https://www.gnu.org/software/binutils/" + +# Get version number +VERSION=$(curl -s -L "$URL" | grep 'The latest release of GNU binutils is ' | grep -o -E '[0-9]{1,}\.[0-9]{1,}(\.[0-9]{1,})?') + +# Append '.0' if patch number is missing +DOT_COUNT=`tr -dc '.' <<< "$VERSION" | awk '{ print length; }'` +if [ $DOT_COUNT -eq 1 ]; then + VERSION="${VERSION}.0" +fi + +echo "$VERSION" diff --git a/pkg.info b/pkg.info new file mode 100644 index 0000000..a200877 --- /dev/null +++ b/pkg.info @@ -0,0 +1,19 @@ +name: mingw-w64-binutils +description: Cross binutils for the MinGW-w64 cross-compiler +version: 2.46.0 +revision: 1 +url: https://www.gnu.org/software/binutils/ +license: GPL3-or-later +maintainers: + - enumdev@enumerated.dev +architecture: any +type: source +depends: + - glibc + - zlib + - zstd +downloads: + - url: https://sourceware.org/pub/binutils/releases/binutils-${BPM_PKG_VERSION}.tar.xz + extract_to: ${BPM_SOURCE} + extract_strip_components: 1 + checksum: d75a94f4d73e7a4086f7513e67e439e8fcdcbb726ffe63f4661744e6256b2cf2 diff --git a/source.sh b/source.sh new file mode 100644 index 0000000..85b3856 --- /dev/null +++ b/source.sh @@ -0,0 +1,31 @@ +# 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 build function is executed in the source directory +# This function is used to compile the source code +build() { + for target in x86_64-w64-mingw32 i686-w64-mingw32; do + mkdir "$BPM_SOURCE"/${target} + cd "$BPM_SOURCE"/${target} + + ../configure --prefix=/usr --target=${target} --infodir=/usr/share/info/${target} --disable-nls --disable-werror + make + done +} + +# The package function is executed in the source directory +# This function is used to move the compiled files into the output directory +package() { + for target in x86_64-w64-mingw32 i686-w64-mingw32; do + cd "$BPM_SOURCE"/${target} + + make DESTDIR="$BPM_OUTPUT" install + + # Remove unwanted file + rm "$BPM_OUTPUT"/usr/lib/bfd-plugins/libdep.so + done + + # Install package license + install -Dm644 "$BPM_SOURCE"/COPYING "$BPM_OUTPUT"/usr/share/licenses/mingw-w64-binutils/COPYING +}