62 lines
Pasted at 2016-12-11 17:58:26 -0800 PST
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
diff --git a/PKGBUILD b/PKGBUILD
index 46ca66d..5954191 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,42 +2,28 @@
 
 pkgname=xilinx-usb-drivers
 pkgver=14.7
-pkgrel=1
-pkgdesc="libusb/ppdev-connector for Xilinx JTAG tools (like iMPACT)"
+pkgrel=2
+pkgdesc="Sets up Digilent USB-JTAG drivers for Xilinx JTAG tools (like iMPACT)"
 arch=('i686' 'x86_64')
 license=('custom')
-depends=('xilinx-ise')
-makedepends=('git')
-options=('!strip')
-source=("git+git://git.zerfleddert.de/usb-driver")
-md5sums=('SKIP')
+depends=('xilinx-ise=14.7' 'fxload' 'digilent.adept.utilities')
 
 if [[ $CARCH == 'i686' ]]; then
-    _arch=lin
+  _arch=lin
 elif [[ $CARCH == 'x86_64' ]]; then
-    _arch=lin64
+  _arch=lin64
 fi
 
-build() {
-    cd ${srcdir}/usb-driver
-    if [[ $CARCH == 'i686' ]]; then
-        make lib32
-    elif [[ $CARCH == 'x86_64' ]]; then
-        make
-    fi
-}
-
 package() {
-    cd ${srcdir}/usb-driver
-
-    mkdir -p ${pkgdir}/usr/share
-    mkdir -p ${pkgdir}/etc/udev/rules.d
+  mkdir -p ${pkgdir}/etc/udev/rules.d
 
-    echo "Copying firmware to /usr/share"
-    for fw in "${XILINX}/bin/$_arch/"xusb*.hex; do
-        cp -v "${fw}" "${pkgdir}/usr/share/"
-    done
+  # Install udev rules
+  sed -e 's/TEMPNODE/tempnode/' -e 's/SYSFS/ATTRS/g' -e 's/BUS/SUBSYSTEMS/' -e 's/sbin/usr\/bin/' -e 's!/usr/share!'${XILINX}'/bin/'$_arch'!' ${XILINX}/bin/$_arch/xusbdfwu.rules >${pkgdir}/etc/udev/rules.d/xusbdfwu.rules
 
-    echo "Installing udev rules"
-    sed -e 's/TEMPNODE/tempnode/' -e 's/SYSFS/ATTRS/g' -e 's/BUS/SUBSYSTEMS/' ${XILINX}/bin/$_arch/xusbdfwu.rules >${pkgdir}/etc/udev/rules.d/xusbdfwu.rules
+  # Install Digilent plugin
+  # See https://wiki.archlinux.org/index.php/Xilinx_ISE_WebPACK#Digilent_USB-JTAG_Drivers
+  mkdir -p ${pkgdir}${XILINX}/lib/$_arch/plugins/Digilent/libCseDigilent
+  cd ${XILINX}/bin/$_arch/digilent/libCseDigilent_2.4.4-$CARCH/$_arch/14.1/libCseDigilent
+  cp libCseDigilent.{so,xml} ${pkgdir}${XILINX}/lib/$_arch/plugins/Digilent/libCseDigilent
+  chmod -x ${pkgdir}${XILINX}/lib/$_arch/plugins/Digilent/libCseDigilent/libCseDigilent.xml
 }