Skip to content

Instantly share code, notes, and snippets.

@kbeckmann
Created June 25, 2021 09:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kbeckmann/59fe5318900fb69a20f50081d022a42c to your computer and use it in GitHub Desktop.
Save kbeckmann/59fe5318900fb69a20f50081d022a42c to your computer and use it in GitHub Desktop.
PKGFILE for Vivado 2021.1 ML Standard
From ffe67c452109cb71ebc30c8c8272b10b2b29f99e Mon Sep 17 00:00:00 2001
From: Konrad Beckmann <konrad.beckmann@gmail.com>
Date: Fri, 25 Jun 2021 11:28:03 +0200
Subject: [PATCH] 2021.1 ML standard
---
PKGBUILD | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/PKGBUILD b/PKGBUILD
index e1f9990..56b4be5 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -27,8 +27,8 @@
pkgname=vivado
_srcname=Xilinx_Unified
-pkgver=2020.2
-_more_ver=1118_1232
+pkgver=2021.1
+_more_ver=0610_2318
pkgrel=1
pkgdesc="FPGA/CPLD design suite for Xilinx devices"
url="https://www.xilinx.com/products/design-tools/vivado.html"
@@ -46,7 +46,7 @@ source=("file:///${_srcname}_${pkgver}_${_more_ver}.tar.gz"
'spoof_homedir.c')
# checksum from https://www.xilinx.com/support/download.html
-md5sums=('523e8596f114ab5e389c14df50ecb1d8'
+md5sums=('SKIP'
'69d14ad64f6ec44e041eaa8ffcb6f87c')
# takes forever for probably minimal gain
@@ -69,7 +69,7 @@ package() {
--batch Install \
--agree XilinxEULA,3rdPartyEULA,WebTalkTerms \
--product Vivado \
- --edition 'Vivado HL WebPACK' \
+ --edition 'Vivado ML Standard' \
--location "$pkgdir/opt/Xilinx"
# install udev rules
--
2.32.0
# Maintainer: xiretza <aur@xiretza.xyz>
# Contributor: Darren Wu <$(base64 --decode <<<'ZGFycmVuMTk5NzA4MTBAZ21haWwuY29tCg==')>
# BUILD INSTRUCTIONS:
#
# 1. Log in to xilinx.com
# 2. Go to https://www.xilinx.com/support/download/index.html/content/xilinx/en/downloadNav/vivado-design-tools.html
# 3. Download "All OS installer Single-File Download (TAR/GZIP)" - WARNING: This file is >35GB in size
# 4. Place the .tar.gz in the same directory as the PKGBUILD
# 5. Build!
#
# No refunds for broken AUR helpers, just use make(chroot)pkg.
#
# SOME MORE NOTES:
#
# This package is huge. The download alone is a 44GB .tar.gz, which decompresses to ~45GB,
# and the final zstd-compressed package is another 21GB. Reserve ~150GB in total for building.
#
# It can also take up to two hours to build, being mostly limited by I/O and single-thread
# performance. `namcap` takes another 30 minutes, make sure you're not running that automatically.
#
# It *also* requires a reasonably ugly hack to build: since package() is run under fakeroot,
# and the installer tries to access the home directory no matter what `--location` is set to,
# it fails during "Running post-install tasks" because it tries to access `/root`.
# To fix this, a tiny shared library (see spoof_homedir.c) is LD_PRELOADed. Its only job is to
# wrap the `getpwuid()` function and modify the original return value for uid==0.
pkgname=vivado
_srcname=Xilinx_Unified
pkgver=2021.1
_more_ver=0610_2318
pkgrel=1
pkgdesc="FPGA/CPLD design suite for Xilinx devices"
url="https://www.xilinx.com/products/design-tools/vivado.html"
arch=('x86_64')
license=('custom')
depends=('ncurses5-compat-libs'
'libpng12'
'lib32-libpng12'
'gtk2')
optdepends=('fxload'
'digilent.adept.runtime'
'digilent.adept.utilities')
source=("file:///${_srcname}_${pkgver}_${_more_ver}.tar.gz"
'spoof_homedir.c')
# checksum from https://www.xilinx.com/support/download.html
md5sums=('SKIP'
'69d14ad64f6ec44e041eaa8ffcb6f87c')
# takes forever for probably minimal gain
options=('!strip')
prepare() {
mkdir -p "$srcdir/installer_temp"
}
build() {
# build our getpwuid() wrapper library
gcc -shared -fPIC -D "FAKE_HOME=\"$srcdir/installer_temp\"" spoof_homedir.c -o spoof_homedir.so -ldl
}
package() {
cd "${_srcname}_${pkgver}_${_more_ver}"
# LD_PRELOAD already contains libfakeroot.so, add our own library before that
LD_PRELOAD="$srcdir/spoof_homedir.so:$LD_PRELOAD" ./xsetup \
--batch Install \
--agree XilinxEULA,3rdPartyEULA,WebTalkTerms \
--product Vivado \
--edition 'Vivado ML Standard' \
--location "$pkgdir/opt/Xilinx"
# install udev rules
install -Dm644 "$pkgdir/opt/Xilinx/Vivado/${pkgver}/data/xicom/cable_drivers/lin64/install_script/install_drivers/52-xilinx-digilent-usb.rules" -t "$pkgdir/usr/lib/udev/rules.d/"
install -Dm644 "$pkgdir/opt/Xilinx/Vivado/${pkgver}/data/xicom/cable_drivers/lin64/install_script/install_drivers/52-xilinx-ftdi-usb.rules" -t "$pkgdir/usr/lib/udev/rules.d/"
install -Dm644 "$pkgdir/opt/Xilinx/Vivado/${pkgver}/data/xicom/cable_drivers/lin64/install_script/install_drivers/52-xilinx-pcusb.rules" -t "$pkgdir/usr/lib/udev/rules.d/"
# install desktop files
for deskfile in "$srcdir"/installer_temp/Desktop/*.desktop; do
sed -i -e "s|$pkgdir||g" "$deskfile"
install -Dm644 -t "$pkgdir/usr/share/applications/" "$deskfile"
done
# clean up artefacts, remove leading $pkgdir from paths
rm -rf "$pkgdir/opt/Xilinx/.xinstall/"
find "$pkgdir/opt/Xilinx/" -name '*settings64*' -exec sed -i -e "s|$pkgdir||g" '{}' \+
# Save space for subsequent packaging, checking etc
cd ..
rm -rf "${_srcname}_${pkgver}_${_more_ver}"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment