I have recently come from Gentoo (mainly because x86 entries everywhere in mine portage) and I am attempting to write a package to bring MSP430 development to my Raspberry pi 4.
currently working on a PKGBUILD
file for binutils-msp430.
As neither the manual guide, neither the base PKGBUILD
file were much help, I have been trying to understand the system by reverse engineering some other ones.mine PKGBUILD:
pkgname=binutils-msp430
pkgver=2.22
pkgrel=1
pkgdesc="A set of programs to assemble and manipulate binary and object files for the MSP430 architecture"
arch=('aarch64')
url="http://sourceforge.net/projects/mspgcc/"
license=('GPL')
depends=('zlib')
options=('!emptydirs' '!libtool')
_mspgcc_ver=20120406
_gnu_mirror="http://ftpmirror.gnu.org"
_sf_base="http://sourceforge.net/projects/mspgcc/files"
_zlodej="https://github.com/Zlodej-pozor/msp430/raw/main"
_patches_base="${_sf_base}/Patches/LTS/${_mspgcc_ver}"
$stara_path=$PATH
export PATH="${PATH}:./"
_patches=()
source=("${_sf_base}/mspgcc/mspgcc-${_mspgcc_ver}.tar.bz2"
"${_gnu_mirror}/binutils/binutils-${pkgver}.tar.bz2"
"${_sf_base}/Patches/binutils-2.22/msp430-binutils-2.22-20120911.patch"
"${_zlodej}/msp430-binutils/config.guess")
#"0001_ld_makefile_libdir.patch"
#"0002_binutils-texinfo-5.0-gas-doc.patch"
#"0003-binutils-texinfo-5.0.patch")
sha1sums=('cc96a7233f0b1d2c106eff7db6fc00e4ed9039a8'
'65b304a0b9a53a686ce50a01173d1f40f8efe404'
'5b3aec605f85fea81a22aa52e9900a5e2f9cc460'
'0d2eadae75130308aff0f463fd40ee2c6fd72806' )
# 'b92aba28a090f214a650102ad0f0862c37b45e58'
# '417b1cdb35c41a08d3ca967c165c0d79588986e9')
_builddir=build
prepare() {
cd ${srcdir}/binutils-2.22/
# https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=avr-binutils-atmel
# https://bugs.archlinux.org/task/34629
sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" libiberty/configure
_patch_name="msp430-binutils-${pkgver}-${_mspgcc_ver}.patch"
(cd "${srcdir}/binutils-2.22" &&
# patch -p1 < "${srcdir}/msp430-binutils-2.22-20120407.patch" &&
# patch -p1 < "${srcdir}/msp430-binutils-2.22-20120514.patch" &&
# patch -p1 < "${srcdir}/msp430-binutils-2.22-20120606.patch" &&
# patch -p1 < "${srcdir}/msp430-binutils-2.22-20120618.patch" &&
# patch -p1 < "${srcdir}/msp430-binutils-2.22-20120627.patch" &&
# patch -p1 < "${srcdir}/msp430-binutils-2.22-20120716.patch" &&
patch -p1 < "${srcdir}/msp430-binutils-2.22-20120911.patch" )
cp "${srcdir}/config.guess" ./
rm -frv ${_builddir}
mkdir -p ${_builddir} && cd ${_builddir}
}
build() {
cd ${srcdir}/binutils-2.22/
cd ${_builddir}
CFLAGS="-Os -g0" "${srcdir}/binutils-2.22/configure" \
--prefix=/usr \
--program-prefix="msp430-" \
--disable-multilib \
--disable-werror \
--disable-nls \
--enable-install-libbfd \
--infodir=/usr/share/info \
--libdir=/usr/msp430/lib \
--mandir=/usr/share/man \
--target=msp430
# This checks the host environment and makes sure all the necessary
# tools are available to compile Binutils.
make configure-host
make tooldir=/usr all
}
check() {
cd ${srcdir}/binutils-2.22/${_builddir}
# do not abort on errors - manually check log files
make -k -j1 check || true
}
package() {
cd ${srcdir}/binutils-2.22/${_builddir}
make DESTDIR=${pkgdir} tooldir=/usr install
rm -f ${pkgdir}/usr/lib/libiberty.a
rm -f ${pkgdir}/usr/man/man1/{dlltool,nlmconv,windres}*
rm -f ${pkgdir}/usr/share/info/dir
cd ${pkgdir}/usr/share/info
for file in as bfd binutils configure gprof ld standards ; do
mv ${file}.info "msp430-${file}.info"
done
for bin in addr2line ar as c++filt gprof ld nm objcopy \
objdump ranlib readelf size strings strip
do
rm -f ${pkgdir}/usr/bin/${bin}
done
install -Dm644 "${srcdir}/binutils-2.22/COPYING" \
"${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
My patches go fine, config errors are sorted, but I have newer dealt with .texinfo
files which give the following error:
bfd.texinfo:195: @include: could not find bfdsumm.texi
bfd.texinfo:199: @include: could not find bfdt.texi
bfd.texinfo:200: @include: could not find bfdio.texi
bfd.texinfo:244: @include: could not find init.texi
bfd.texinfo:247: @include: could not find section.texi
bfd.texinfo:250: @include: could not find syms.texi
bfd.texinfo:253: @include: could not find archive.texi
bfd.texinfo:256: @include: could not find format.texi
...
at:
if makeinfo --split-size=5000000 --split-size=5000000 -I /home/asi/Stiahnuté/Balikovanie/src/binutils-2.22/bfd/doc \
-o bfd.info `test -f 'bfd.texinfo' || echo '/home/asi/Stiahnuté/Balikovanie/src/binutils-2.22/bfd/doc/'`bfd.texinfo; \
then \
rc=0; \
else \
rc=$?; \
$restore $backupdir/* `echo "./bfd.info" | sed 's|[^/]*$||'`; \
fi; \
rm -rf $backupdir; exit $rc
I have checked and all those files are in a same directory as the bfd.texinfo.
I am not sure what is the max size of a message on this forum I have put the out put to pastebin as sjevQvC9
. Forum does not let me send links, so you will have to add it up.