Gentoo Archives: gentoo-commits

From: Andrew Ammerlaan <andrewammerlaan@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-libs/linux-gpib/
Date: Thu, 19 May 2022 14:47:37
Message-Id: 1652971645.158682377921343a90268ded06c7726bf1ca2056.andrewammerlaan@gentoo
1 commit: 158682377921343a90268ded06c7726bf1ca2056
2 Author: Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
3 AuthorDate: Thu May 19 14:44:34 2022 +0000
4 Commit: Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
5 CommitDate: Thu May 19 14:47:25 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=15868237
7
8 sci-libs/linux-gpib: update EAPI 6 -> 8, enable py3.{10,11}
9
10 - Removed ED form compile phase
11 - Fixed python install, we need --root not --prefix
12 - Fixed Access Denied when installing perl stuff
13 - Upgraded firmware tarball
14
15 Bug: https://bugs.gentoo.org/836109
16 Closes: https://bugs.gentoo.org/846269
17 Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> gentoo.org>
18
19 sci-libs/linux-gpib/Manifest | 1 +
20 sci-libs/linux-gpib/linux-gpib-4.3.4-r1.ebuild | 181 +++++++++++++++++++++++++
21 2 files changed, 182 insertions(+)
22
23 diff --git a/sci-libs/linux-gpib/Manifest b/sci-libs/linux-gpib/Manifest
24 index 0188573cf647..81181e44515d 100644
25 --- a/sci-libs/linux-gpib/Manifest
26 +++ b/sci-libs/linux-gpib/Manifest
27 @@ -1,2 +1,3 @@
28 DIST gpib_firmware-2006-11-12.tar.gz 169357 BLAKE2B 05f1be78545e025d76e2b9819a5dcac5a6715dfbb6df5c6fbe8b78900adf8ca7b1c28db350674ff1dd9c77e24507e98b536ca1af8b558c9a46ef8c25034c9769 SHA512 164d6fcfb3af43933f0a16645276f7d527a7aa24ef311f6ae3dcd7f45c41f92c855cf221bc946772f43fc2f9524057abc34bbd7d805c89b33ed7e111bc6870af
29 +DIST gpib_firmware-2008-08-10.tar.gz 173004 BLAKE2B 05fcde09de5246b86004c263c733d64316511bdb0b84dfbd9b94cb78e2909c0d191ff21ee0d77e7f0947e9231bd4cd62d6348e8f9beefd6d201b473732ff23d2 SHA512 f2a0ee3316b75ac36ed88568e45ca4c69935a6d10783c65582003ab39686f2a69d3002901866065f4f5efa9fdd4c779e038d1d7ce24bba266a619c164d5ac10d
30 DIST linux-gpib-4.3.4.tar.gz 1395770 BLAKE2B 3c7182ac127851ebf0f5416ea639d7f858c160ba00f01aa7f7e423f6fb7b3be5b089424d3a473497562d040c194483ebc93d8a2a0f64582fb8907b42e2c4b832 SHA512 397ad86883bf562b004673ae47218108d392f2a15121c95926ea38764e7a76b382cb199fd48c35c9777f34c8eb99965e3d4ea2028e86ce02bcda4bd23127cbd5
31
32 diff --git a/sci-libs/linux-gpib/linux-gpib-4.3.4-r1.ebuild b/sci-libs/linux-gpib/linux-gpib-4.3.4-r1.ebuild
33 new file mode 100644
34 index 000000000000..0584a67f9064
35 --- /dev/null
36 +++ b/sci-libs/linux-gpib/linux-gpib-4.3.4-r1.ebuild
37 @@ -0,0 +1,181 @@
38 +# Copyright 1999-2022 Gentoo Authors
39 +# Distributed under the terms of the GNU General Public License v2
40 +
41 +EAPI=8
42 +
43 +PYTHON_COMPAT=( python3_{8..11} )
44 +
45 +inherit readme.gentoo-r1 autotools perl-functions python-single-r1 udev
46 +
47 +# Check for latest firmware version on bump
48 +FW_PV="2008-08-10"
49 +
50 +DESCRIPTION="Driver library for GPIB (IEEE 488.2) hardware"
51 +HOMEPAGE="https://linux-gpib.sourceforge.io/"
52 +SRC_URI="mirror://sourceforge/linux-gpib/${P}.tar.gz
53 + firmware? ( https://linux-gpib.sourceforge.io/firmware/gpib_firmware-${FW_PV}.tar.gz )
54 +"
55 +S="${WORKDIR}/${PN}-user-${PV}"
56 +
57 +LICENSE="GPL-2"
58 +SLOT="0"
59 +KEYWORDS="~amd64 ~arm ~x86"
60 +IUSE="pcmcia static guile perl php python tcl doc firmware"
61 +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
62 +
63 +COMMONDEPEND="
64 + sys-libs/readline:=
65 + tcl? ( dev-lang/tcl:0= )
66 + guile? ( dev-scheme/guile:12 )
67 + perl? ( dev-lang/perl:= )
68 + php? ( dev-lang/php:= )
69 + python? ( ${PYTHON_DEPS} )
70 + firmware? ( sys-apps/fxload )
71 +"
72 +RDEPEND="${COMMONDEPEND}
73 + acct-group/gpib
74 + ~sci-libs/linux-gpib-modules-${PV}
75 +"
76 +DEPEND="${COMMONDEPEND}"
77 +BDEPEND="
78 + virtual/pkgconfig
79 + doc? ( app-text/docbook-sgml-utils )
80 + perl? ( virtual/perl-ExtUtils-MakeMaker )
81 +"
82 +
83 +PATCHES=(
84 + "${FILESDIR}"/${PN}-4.3.0-perl.patch
85 +)
86 +
87 +pkg_setup() {
88 + use perl && perl_set_version
89 + use python && python_setup
90 +}
91 +
92 +src_unpack() {
93 + default
94 + unpack "${WORKDIR}/${P}/${PN}-user-${PV}.tar.gz"
95 +}
96 +
97 +src_prepare() {
98 + default
99 +
100 + # We have to use --root instead of --prefix for setup.py.
101 + # Otherwise the python files are not installed properly into site-packages.
102 + sed -i -e \
103 + 's/--prefix=$(DESTDIR)$(prefix)/--root=$(DESTDIR)/g' \
104 + language/python/Makefile.am || die
105 +
106 + eautoreconf
107 +}
108 +
109 +src_configure() {
110 + econf \
111 + $(use_enable static) \
112 + $(use_enable guile guile-binding) \
113 + $(use_enable perl perl-binding) \
114 + $(use_enable php php-binding) \
115 + $(use_enable python python-binding) \
116 + $(use_enable tcl tcl-binding) \
117 + $(use_enable doc documentation)
118 +}
119 +
120 +src_install() {
121 + # PYTHONDONTWRITEBYTECODE=0 is required, otherwise
122 + # installation of the python files is skipped
123 + FIRM_DIR=/usr/share/usb
124 + emake \
125 + DESTDIR="${ED}" \
126 + INSTALL_MOD_PATH="${ED}" \
127 + HOTPLUG_USB_CONF_DIR=/etc/hotplug/usb \
128 + UDEV_RULES_DIR="$(get_udevdir)"/rules.d \
129 + USB_FIRMWARE_DIR=${FIRM_DIR} \
130 + PYTHONDONTWRITEBYTECODE=0 \
131 + docdir="/usr/share/doc/${PF}/html" install
132 +
133 + if use perl; then
134 + einfo "Installing perl module"
135 + cd "${S}"/language/perl || die
136 + emake DESTDIR="${ED}" install
137 + perl_fix_packlist
138 + perl_delete_emptybsdir
139 + cd "${S}" || die
140 + fi
141 +
142 + echo "KERNEL==\"gpib[0-9]*\", MODE=\"0660\", GROUP=\"gpib\"" >> 99-gpib.rules
143 + udev_dorules 99-gpib.rules
144 +
145 + dodoc doc/linux-gpib.pdf ChangeLog AUTHORS README* NEWS
146 +
147 + insinto /etc
148 + newins util/templates/gpib.conf gpib.conf
149 + newins util/templates/gpib.conf gpib.conf.example
150 +
151 + if use pcmcia; then
152 + insinto /etc/pcmcia
153 + doins "${S}"/etc/pcmcia/*
154 + fi
155 +
156 + # fix rules files
157 + local f
158 + find "${ED}$(get_udevdir)"/rules.d -type f -print0 | while read -rd '' f ; do
159 + grep -q "${ED}" "${f}" && einfo "File ${f} contains a temporary path, fixing."
160 + sed -i -e "s:${ED}:/:g" "${f}"
161 + done
162 +
163 + DOC_CONTENTS="
164 +As the udev rules were changed and refactored in this release it is
165 +necessary to remove any manually installed pre-4.3.0 gpib udev rules files
166 +in /etc/udev/rules.d/. The files to remove are:
167 +\n
168 + 99-agilent_82357a.rules\n
169 + 99-gpib-generic.rules\n
170 + 99-ni_usb_gpib.rules\n
171 +\n
172 +You need to run the 'gpib_config' utility to setup the driver before
173 +you can use it. In order to do it automatically you can add to your
174 +start script something like this (supposing the appropriate driver
175 +is loaded on the startup):
176 +\n
177 + gpib_config --minor 0
178 +\n
179 +To give a user access to the computer's gpib board you will have to add
180 +them to the group 'gpib' or, you could change the permissions on the device
181 +files /dev/gpib[0-15] to something you like better, using 'chmod'
182 +\n
183 +Edit /etc/gpib.conf to match your interface board, and any devices you wish
184 +to open via ibfind(). See the documentation in /usr/share/linux-gpib/html for
185 +more information.
186 +\n
187 +"
188 +
189 + if use pcmcia; then
190 + DOC_CONTENTS+='
191 +For PCMCIA cards:\n
192 +All files needed for a PCMCIA board were copied to /etc/pcmcia.
193 +You may wish to edit the options passed to the gpib_config call in the
194 +/etc/pcmcia/linux-gpib-pcmcia script.
195 +You may need to send a SIGHUP signal to the cardmgr daemon to force it
196 +to reload the files in /etc/pcmcia \(alternatively you could use your
197 +pcmcia init.d script to restart the cardmgr, or you could just reboot\).
198 +The driver module will be loaded as needed by the cardmgr.
199 +
200 +'
201 + fi
202 +
203 + if use firmware; then
204 + DOC_CONTENTS+='
205 +For Agilent \(HP\) 82341C and 82341D cards:
206 +The firmware for these boards is uploaded by passing the appropriate
207 +firmware file from /usr/share/linux-gpib/hp_82341 directory to
208 +gpib_config using the -I or --init-data command line option. Example:\n
209 +gpib_config --minor 0 --init-data /usr/share/linux-gpib/hp_82341/hp_82341c_fw.bin
210 +'
211 + fi
212 +
213 + readme.gentoo_create_doc
214 +}
215 +
216 +pkg_postinst() {
217 + readme.gentoo_print_elog
218 +}