From fb7e71330e177d2f6800c49ec48459e481eb7d2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D9=85=D9=87=D8=AF=D9=8A=20=D8=B4=D9=8A=D9=86=D9=88=D9=86?= =?UTF-8?q?=20=28Mehdi=20Chinoune=29?= Date: Fri, 31 Jan 2025 07:26:29 +0100 Subject: [PATCH] nextpnr: re-enable ecp5 --- .../003-fix-build-with-clang-19.patch | 10 ++++++ mingw-w64-nextpnr/PKGBUILD | 35 ++++++++++++------- 2 files changed, 33 insertions(+), 12 deletions(-) create mode 100644 mingw-w64-nextpnr/003-fix-build-with-clang-19.patch diff --git a/mingw-w64-nextpnr/003-fix-build-with-clang-19.patch b/mingw-w64-nextpnr/003-fix-build-with-clang-19.patch new file mode 100644 index 0000000000..cc75d6cb8e --- /dev/null +++ b/mingw-w64-nextpnr/003-fix-build-with-clang-19.patch @@ -0,0 +1,10 @@ +--- a/gui/quadtree.h ++++ b/gui/quadtree.h +@@ -226,7 +226,6 @@ + return *this; + bound_ = other.bound_; + max_elems_ = other.max_elems_; +- children_ = other.max_children_; + children_ = other.children_; + splitx_ = other.splitx_; + splity_ = other.splity_; diff --git a/mingw-w64-nextpnr/PKGBUILD b/mingw-w64-nextpnr/PKGBUILD index 0f426bc168..883f57c0c4 100644 --- a/mingw-w64-nextpnr/PKGBUILD +++ b/mingw-w64-nextpnr/PKGBUILD @@ -4,7 +4,7 @@ _realname=nextpnr pkgbase=mingw-w64-${_realname} pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}" pkgver=0.7 -pkgrel=3 +pkgrel=4 pkgdesc="Portable FPGA place and route tool (mingw-w64)" arch=('any') mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64') @@ -25,15 +25,25 @@ makedepends=( "${MINGW_PACKAGE_PREFIX}-boost" "${MINGW_PACKAGE_PREFIX}-eigen3" "${MINGW_PACKAGE_PREFIX}-icestorm" - #"${MINGW_PACKAGE_PREFIX}-prjtrellis" Fails to build against v1.4 + "${MINGW_PACKAGE_PREFIX}-prjtrellis" "git" ) source=("${_realname}::git+https://github.com/YosysHQ/${_realname}.git#tag=${_realname}-${pkgver}" "001-fix-find-boost-built-with-cmake.patch" - "002-fix-build-with-boost-1.85.patch::https://github.com/YosysHQ/nextpnr/commit/f0859503.patch") + "002-fix-build-with-boost-1.85.patch::https://github.com/YosysHQ/nextpnr/commit/f0859503.patch" + "003-fix-build-with-clang-19.patch") sha256sums=('ed14f31c68a1ec2e7dbae78ebfb3a0a1baa16d9e5c6d0252ffae6485f61906a4' '69f73e0ea3111f7580dc57b62bfefb0943b67de6c9245364f435abf58973d820' - '4e93475cc6c09b93b707d64e06779f419eddcc6f705e5f568180795f0915f745') + '4e93475cc6c09b93b707d64e06779f419eddcc6f705e5f568180795f0915f745' + '8ef99dcca08c7e6b23ca709a7cc083160ef5d78b485606c617697142c31585b9') + +apply_patch_with_msg() { + for _patch in "$@" + do + msg2 "Applying ${_patch}" + patch -Nbp1 -i "${srcdir}/${_patch}" + done +} # pkgver() { # cd "${_realname}" @@ -42,8 +52,10 @@ sha256sums=('ed14f31c68a1ec2e7dbae78ebfb3a0a1baa16d9e5c6d0252ffae6485f61906a4' prepare() { cd "${srcdir}/${_realname}" - patch -p1 -i "${srcdir}"/001-fix-find-boost-built-with-cmake.patch - patch -p1 -i "${srcdir}"/002-fix-build-with-boost-1.85.patch + apply_patch_with_msg \ + 001-fix-find-boost-built-with-cmake.patch \ + 002-fix-build-with-boost-1.85.patch \ + 003-fix-build-with-clang-19.patch git submodule update --init --recursive --depth=1 } @@ -59,9 +71,9 @@ build() { fi unset _extra-archs - # if [ "$CARCH" = "x86_64" ]; then - # _extra_archs=";ecp5" - # fi + if [ "$CARCH" = "x86_64" ]; then + _extra_archs=";ecp5" + fi _pyver=$(${MINGW_PREFIX}/bin/python -c "import sys;sys.stdout.write('.'.join(map(str, sys.version_info[:2])))") @@ -98,7 +110,6 @@ package() { cd "${srcdir}"/build-${MSYSTEM} DESTDIR="${pkgdir}" ${MINGW_PREFIX}/bin/cmake --install . - _licenses="${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}" - mkdir -p "${_licenses}" - install -m 644 "${srcdir}/${_realname}"/COPYING "${_licenses}" + install -Dm644 "${srcdir}"/${_realname}/COPYING \ + "${pkgdir}${MINGW_PREFIX}"/share/licenses/${_realname}/COPYING }