Github messages for voidlinux
 help / color / mirror / Atom feed
From: benjcal <benjcal@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] msp430-toolchain: update to 9.3.1.2
Date: Sun, 18 Jun 2023 22:41:43 +0200	[thread overview]
Message-ID: <20230618204143._CLPZqyNlRZdAEvOC5WPdzOQ8dzIFXbU59mCIxQEsRY@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-44456@inbox.vuxu.org>

[-- Attachment #1: Type: text/plain, Size: 1279 bytes --]

There is an updated pull request by benjcal against master on the void-packages repository

https://github.com/benjcal/void-packages msp430-toolchain-update-to-9.3.1.2
https://github.com/void-linux/void-packages/pull/44456

msp430-toolchain: update to 9.3.1.2
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/44456.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-msp430-toolchain-update-to-9.3.1.2-44456.patch --]
[-- Type: text/x-diff, Size: 9989 bytes --]

From e70e28f5195d477152a5374fa5b90b38e3b2041c Mon Sep 17 00:00:00 2001
From: Benjamin Calderon <benj.calderon@gmail.com>
Date: Thu, 15 Jun 2023 10:50:28 -0400
Subject: [PATCH] msp430-toolchain: update to 9.3.1.2

---
 .../patches/README-build.patch                | 105 ++++++++++++++++++
 srcpkgs/msp430-toolchain/patches/gcc7.patch   |  11 --
 srcpkgs/msp430-toolchain/template             |  80 +++++--------
 3 files changed, 130 insertions(+), 66 deletions(-)
 create mode 100644 srcpkgs/msp430-toolchain/patches/README-build.patch
 delete mode 100644 srcpkgs/msp430-toolchain/patches/gcc7.patch

diff --git a/srcpkgs/msp430-toolchain/patches/README-build.patch b/srcpkgs/msp430-toolchain/patches/README-build.patch
new file mode 100644
index 000000000000..ca36ed0b818f
--- /dev/null
+++ b/srcpkgs/msp430-toolchain/patches/README-build.patch
@@ -0,0 +1,105 @@
+--- a/msp430-gcc-9.3.1.11-source-full/README-build.sh
++++ b/msp430-gcc-9.3.1.11-source-full/README-build.sh
+@@ -28,14 +28,13 @@
+ set -e
+ set -x
+ 
+-configure_args_common='--target=msp430-elf --enable-languages=c,c++ --disable-nls --enable-initfini-array'
++configure_args_common='--target=msp430-elf --enable-languages=c --disable-nls --enable-initfini-array --prefix=/usr/msp430'
+ # Note: binutils doesn't build without warnings on macOS
+ # https://sourceware.org/ml/binutils/2013-12/msg00051.html
+ configure_args_binutils=$(echo --disable-{sim,gdb,werror})
+ configure_args_gcc=$(echo --enable-target-optspace --enable-newlib-nano-formatted-io)
+ configure_args_gdb_common=$(echo --disable-{binutils,gas,ld,gprof,etc} --without-{mpfr,lzma} --with-static-standard-libraries --disable-source-highlight)
+ configure_args_gdb_nopy="--with-python=no"
+-configure_args_gdb_py="--with-python=python2.7 --program-prefix=msp430-elf- --program-suffix=-py"
+ 
+ pushd gcc
+   # Download sources for gcc prerequisites (gmp, mpfr, mpc, and isl)
+@@ -53,76 +52,35 @@
+   done
+ popd
+ 
+-# Download prerequisites for building MINGW GDB with python2.7 support.
+-if [[ "$configure_args_common" == *"mingw"* ]]; then
+-  python_ws=$(readlink -f mingw-python-workspace)
+-  rm -rf $python_ws
+-  mkdir $python_ws
+-  pushd $python_ws
+-    if [[ "$configure_args_common" == *"i686-w64-mingw32"* ]]; then
+-      python_win_msi_url=https://www.python.org/ftp/python/2.7.17/python-2.7.17.msi
+-    elif [[ "$configure_args_common" == *"x86_64-w64-mingw32"* ]]; then
+-      python_win_msi_url=https://www.python.org/ftp/python/2.7.17/python-2.7.17.amd64.msi
+-    else
+-      echo "ERROR: Unhandled value to --host configure option for python support"
+-    fi
+-    if [ ! -e ../$(basename $python_win_msi_url) ]; then
+-      curl -O $python_win_msi_url
+-    else
+-      cp ../$(basename $python_win_msi_url) .
+-    fi
+-    7za x $(basename $python_win_msi_url)
+-    # Used by python-config.sh
+-    export PYTHON_WIN=$python_ws
+-    configure_args_gdb_py="--with-python=$(readlink -f ../python-config.sh) --program-prefix=msp430-elf- --program-suffix=-py"
+-  popd
+-fi
+-
+ # Create directories
+ rm -rf build install
+ mkdir -p build/{binutils,gcc,gdb} install
+ 
+ # Build binutils
+ pushd build/binutils
+-  ../../binutils/configure $configure_args_common $configure_args_binutils --with-pkgversion="${pkg_version-$USER}"
+-  make
+-  make html
+-  make install install-html DESTDIR=$PWD/../../install
++  ../../binutils/configure $configure_args_common $configure_args_binutils
++  make
++  make install DESTDIR=$PWD/../../install
+ popd
+ 
+ # Build gcc and newlib
+ pushd build/gcc
+   (
+-    export PATH=$PWD/../../install/usr/local/bin:$PATH
+-    ../../gcc/configure $configure_args_common $configure_args_gcc --with-pkgversion="${pkg_version-$USER}"
+-    make
+-    make html
+-    make install install-html DESTDIR=$PWD/../../install
++    export PATH=$PWD/../../install/usr/msp430/bin:$PATH
++    ../../gcc/configure $configure_args_common $configure_args_gcc
++    make
++    make install DESTDIR=$PWD/../../install
+   )
+ popd
+ 
+ # Build GDB without python support
+ pushd build/gdb
+-  ../../gdb/configure $configure_args_common $configure_args_gdb_common $configure_args_gdb_nopy --with-pkgversion="${pkg_version-$USER}"
+-  make
++  ../../gdb/configure $configure_args_common $configure_args_gdb_common $configure_args_gdb_nopy
++  make
+   make install DESTDIR=$PWD/../../install
+ popd
+ 
+-## Build GDB with python support, and the HTML documentation.
+-pushd build/gdb
+-  ../../gdb/configure $configure_args_common $configure_args_gdb_common $configure_args_gdb_py --with-pkgversion="${pkg_version-$USER}"
+-  make
+-  make html
+-  make install install-html DESTDIR=$PWD/../../install
+-  # Remove *-py versions of run and add-index, which are unnaffected by the added Python support.
+-  rm $PWD/../../install/usr/local/bin/msp430-elf-run-py*
+-  rm $PWD/../../install/usr/local/bin/msp430-elf-gdb-add-index-py*
+-  if [[ "$configure_args_common" == *"mingw"* ]]; then
+-    rm -rf $PYTHON_WIN
+-  fi
+-popd
+-
+-echo "Build Complete [toolchain root directory: install/usr/local/bin]"
++echo "Build Complete [toolchain root directory: install/usr/msp430/bin]"
+ exit 0
+ 
+ # The dejagnu/ directory contains a copy of msp430-sim.exp, downloaded from:
diff --git a/srcpkgs/msp430-toolchain/patches/gcc7.patch b/srcpkgs/msp430-toolchain/patches/gcc7.patch
deleted file mode 100644
index f664b41db09e..000000000000
--- a/srcpkgs/msp430-toolchain/patches/gcc7.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/sources/tools/gcc/config/msp430/msp430.c
-+++ b/sources/tools/gcc/config/msp430/msp430.c
-@@ -2209,7 +2209,7 @@
- }
-   const_shift_helpers[] =
- {
--#define CSH(N,C,X,G) { "__mspabi_"N, C, X, gen_##G }
-+#define CSH(N,C,X,G) { "__mspabi_" N, C, X, gen_##G }
- 
-   CSH ("slli", 1, 1, slli_1),
-   CSH ("slll", 1, 1, slll_1),
diff --git a/srcpkgs/msp430-toolchain/template b/srcpkgs/msp430-toolchain/template
index a495ca1cb0c5..36c040d08b4c 100644
--- a/srcpkgs/msp430-toolchain/template
+++ b/srcpkgs/msp430-toolchain/template
@@ -1,81 +1,51 @@
 # Template file for 'msp430-toolchain'
 pkgname=msp430-toolchain
-version=3.05.00.00
-revision=2
+version=9.3.1.2
+revision=1
 archs="x86_64* i686*"
 create_wrksrc=yes
-hostmakedepends="unzip expect flex tar texinfo"
-makedepends="ncurses-devel"
+hostmakedepends="make gcc binutils bzip2 tar curl flex bison texinfo"
 short_desc="Toolchain for the TI MSP430 microprocessor"
-maintainer="Orphaned <orphan@voidlinux.org>"
+maintainer="Benjamin Calderon <benj.calderon@gmail.com>"
 license="GPL-2.0-only"
 homepage="http://www.ti.com/tool/msp430-gcc-opensource"
-distfiles="http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSPGCC/${version//./_}/exports/msp430-gcc-source.tar.bz2
- http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSPGCC/${version//./_}/exports/msp430-gcc-support-files.zip"
-checksum="d2110ec64e8a055ff89b7eef8217b3c233c30e370e2cb43e1ad835dad5907d1c
- 1e2a0903e6b02d5e8aac2a7297ec0685e95a980b13b937b5c7f24f4cf6015407"
+distfiles="https://dr-download.ti.com/software-development/ide-configuration-compiler-or-debugger/MD-LlCjWuAbzH/9.3.1.2/msp430-gcc-9.3.1.11-source-full.tar.bz2
+ https://dr-download.ti.com/software-development/ide-configuration-compiler-or-debugger/MD-LlCjWuAbzH/9.3.1.2/msp430-gcc-support-files-1.212.zip"
+checksum="095197fcd4a81d0df1ea03d62c3c3030f6024ca96df65d828c043bddde634fdd
+ 3b1a39f10a344dfefb767e60ac35becef4c065013be86993195b138a5fb0b8d6"
 nocross=yes
 nostrip=yes
 
 _prefix=/usr/msp430
-_target=msp430-none-elf
 
 do_configure() {
-	unset CC LD AR AS RANLIB CPP CFLAGS CPPFLAGS LDFLAGS
-
-	mkdir obj-msp
-	cd obj-msp
-
-	CFLAGS="-fcommon" CXXFLAGS="-std=c++11" \
-		../sources/tools/configure \
-		--prefix=$_prefix \
-		--enable-languages=c \
-		--program-prefix="msp430-" \
-		--disable-nls \
-		--enable-gold \
-		--without-x \
-		--target=$_target
-	rm -rf tcl
+	cd ${wrksrc}/msp430-gcc-9.3.1.11-source-full
+	chmod +x README-build.sh
 }
 
 do_build() {
-	unset CC LD AR AS RANLIB CPP CFLAGS CPPFLAGS LDFLAGS
-
-	cd obj-msp
-	sed -i 's:^prefix =.*:prefix = '${DESTDIR}'/@prefix@:' \
-		../sources/tools/libgloss/Makefile.in
-	sed -i 's:^LIBEXPAT .*:LIBEXPAT = @LIBEXPAT@ @BDYNAMIC@:' \
-		../sources/tools/gdb/Makefile.in
-
-	make ${makejobs} DESTDIR=${DESTDIR} all
+	cd ${wrksrc}/msp430-gcc-9.3.1.11-source-full
+	./README-build.sh
 }
 
 do_install() {
-	cd obj-msp
-	sed -i '190,194s:$(tooldir):'${DESTDIR}'/$(tooldir):' \
-		msp430-none-elf/libgloss/msp430/Makefile \
-		msp430-none-elf/430/libgloss/msp430/Makefile \
-		msp430-none-elf/430/nomul/libgloss/msp430/Makefile \
-		msp430-none-elf/430/32mul/libgloss/msp430/Makefile \
-		msp430-none-elf/32mul/libgloss/msp430/Makefile \
-		msp430-none-elf/nomul/libgloss/msp430/Makefile \
-		msp430-none-elf/f5mul/libgloss/msp430/Makefile \
-		msp430-none-elf/large/libgloss/msp430/Makefile \
-		msp430-none-elf/large/nomul/libgloss/msp430/Makefile \
-		msp430-none-elf/large/f5mul/libgloss/msp430/Makefile \
-		msp430-none-elf/large/32mul/libgloss/msp430/Makefile
+	vmkdir ${_prefix}
 
-	make DESTDIR=${DESTDIR} prefix=${_prefix} install
+	vcopy ${wrksrc}/msp430-gcc-9.3.1.11-source-full/install/usr /
 
-	# copy msp430-gcc-support-files.zip
-	cp ${wrksrc}/msp430-gcc-support-files/*.h \
-		${DESTDIR}/${_prefix}/${_target}/include/
-	cp ${wrksrc}/msp430-gcc-support-files/*.ld \
-		${DESTDIR}/${_prefix}/${_target}/lib/430/
+	# man pages
+	vmkdir /usr/share/man
+	vcopy ${wrksrc}/msp430-gcc-9.3.1.11-source-full/install/usr/msp430/share/man/man1 /usr/share/man
+	vcopy ${wrksrc}/msp430-gcc-9.3.1.11-source-full/install/usr/msp430/share/man/man5 /usr/share/man
+	rm -rf ${DESTDIR}/${_prefix}/share/man
 
-	mkdir -p ${DESTDIR}/usr/bin
+	# link bin
+	vmkdir /usr/bin
 	cd ${DESTDIR}/${_prefix}/bin
 	for i in *
-	do ln -s ${_prefix}/bin/$i ${DESTDIR}/usr/bin/$i
+		do ln -s ${_prefix}/bin/$i ${DESTDIR}/usr/bin/$i
 	done
+
+	# copy support files
+	vcopy ${wrksrc}/msp430-gcc-support-files/include/* ${_prefix}/include
 }

  parent reply	other threads:[~2023-06-18 20:41 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-15 15:10 [PR PATCH] " benjcal
2023-06-15 15:11 ` [PR REVIEW] " benjcal
2023-06-15 15:12 ` benjcal
2023-06-15 15:19 ` benjcal
2023-06-15 15:21 ` benjcal
2023-06-15 15:22 ` [PR PATCH] [Updated] " benjcal
2023-06-17 20:12 ` benjcal
2023-06-17 20:12 ` benjcal
2023-06-18 18:31 ` benjcal
2023-06-18 20:41 ` benjcal [this message]
2023-06-19  2:20 ` benjcal
2023-07-26 13:59 ` [PR PATCH] [Closed]: " benjcal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230618204143._CLPZqyNlRZdAEvOC5WPdzOQ8dzIFXbU59mCIxQEsRY@z \
    --to=benjcal@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).