Created
May 10, 2025 14:33
-
-
Save sukanka/c946cf0ae7d96d49222cbc28f29d5396 to your computer and use it in GitHub Desktop.
PKGBUILD for XRT, broken
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pkgbase=xrt | |
pkgname=(xrt | |
# xrt-docs | |
) | |
pkgver='202420.2.18.179' | |
pkgrel=1 | |
arch=('x86_64') | |
url="https://github.com/Xilinx/XRT" | |
license=('Apache-2.0 AND GPL-2.0-only') | |
makedepends=( | |
'cmake' 'boost' 'ninja' | |
'libdrm' | |
'ocl-icd' | |
'opencl-clhpp' | |
'git' | |
'rapidjson' | |
'protobuf' | |
'python' | |
'pybind11' | |
'cxxopts' | |
patch | |
) | |
checkdepends=( | |
gtest | |
) | |
source=( | |
"${pkgbase}-${pkgver}.tar.gz::${url}/archive/refs/tags/${pkgver}.tar.gz" | |
git+https://github.com/Xilinx/aiebu.git#commit=89c754f | |
git+https://github.com/Xilinx/aie-rt.git#commit=9f57b82 | |
git+https://github.com/serge1/ELFIO.git#commit=182248f | |
0001-fix-for-boost1.88.patch::https://github.com/sukanka/XRT/commit/b00046e938ca832fcdae95f85cbc29166a73c9c7.diff | |
) | |
sha256sums=('8c03891c8a121631853c2144e4224e456f5658c81857585ac81ea990c8a00f1b' | |
'757eb59730e5887bba52a19eb9705847b8f68a752c27fe0b23cf0684bd7f1143' | |
'9d792b69f8531ba1056844946d6ea5ae776b2e6dd3066070c360c91fc942396f' | |
'5f76abc31dd0bf3708a7026548ab57aaa84adab7a8375e91dafbe50dd9a9b9de' | |
'78441917337b5efa223db4da5f6cab44f4b0ee59a2876f0e028068c9e6a6e5f0') | |
_patch() { | |
pushd "${srcdir}/${pkgbase^^}-${pkgver}" | |
# https://github.com/protocolbuffers/protobuf/issues/18933#issuecomment-2616863749 | |
# sed -i src/runtime_src/core/edge/{common_em,sw_emu}/CMakeLists.txt \ | |
# -e 's|Protobuf REQUIRED|Protobuf CONFIG |g' | |
sed -i '1i find_package(absl REQUIRED COMPONENTS log_internal_message log_internal_check_op)' src/runtime_src/core/pcie/emulation/hw_emu/CMakeLists.txt | |
sed -i 's|${PROTOBUF_LIBRARY}|& absl::log_internal_message absl::log_internal_check_op|g' src/runtime_src/core/pcie/emulation/hw_emu/CMakeLists.txt | |
# boost 1.88 | |
# | |
for p in $srcdir/*.patch; do | |
patch -p1 -l <$p | |
done | |
popd | |
} | |
prepare() { | |
cp -ar aiebu/* ${pkgbase^^}-${pkgver}/src/runtime_src/core/common/aiebu | |
cp -ar ELFIO/* ${pkgbase^^}-${pkgver}/src/runtime_src/core/common/elf | |
cp -ar ELFIO/* ${pkgbase^^}-${pkgver}/src/runtime_src/core/common/aiebu/src/cpp/ELFIO | |
cp -ar aie-rt/* ${pkgbase^^}-${pkgver}/src/runtime_src/core/common/aiebu/lib/aie-rt | |
cp -ar aie-rt ${pkgbase^^}-${pkgver}/src/runtime_src/ | |
_patch | |
} | |
build() { | |
local _cmake_args=( | |
-S ${pkgbase^^}-${pkgver} | |
-B build | |
-G Ninja | |
-DCMAKE_BUILD_TYPE=None | |
-DCMAKE_INSTALL_PREFIX=/opt | |
# -DCMAKE_MODULE_LINKER_FLAGS=\"-Wl,--no-undefined -Wl,--no-undefined\" | |
# -DBUILD_SHARED_LIBS=ON | |
) | |
cmake "${_cmake_args[@]}" | |
ninja -C build | |
} | |
# xrt-aws dkms module is installed. | |
# TODO: check other differences and find what those differences will mean. | |
package_xrt() { | |
DESTDIR="$pkgdir" ninja install -C build | |
} | |
package_xrt-docs() { | |
_pkgname=${pkgbase}-docs | |
pkgdesc="Documentation for the Xilinx Run Time" | |
mkdir -p "${pkgdir}/usr/share/doc" | |
cp -r "${srcdir}/XRT/release_build/runtime_src/doc/html" "${pkgdir}/usr/share/doc/${_pkgname}" | |
install -Dm644 "${srcdir}/XRT/LICENSE" "${pkgdir}/usr/share/licenses/${_pkgname}/LICENSE" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment