Diff kryoflux-dtc-2.6-r3 with a kryoflux-dtc-3.00

/usr/portage/app-misc/kryoflux-dtc/kryoflux-dtc-3.00.ebuild 2023-10-09 14:52:28.804368333 +0300
4 4
EAPI=8
5 5

  
6 6
MY_P="kryoflux_${PV}_linux"
7
MY_P_WINDOWS="kryoflux_3.00_windows"
7
MY_PV_DTC="3.0.0"
8
MY_P_DTC="dtc-${MY_PV_DTC}-Linux"
9
MY_P_WINDOWS="${MY_P/linux/windows}"
8 10

  
9 11
inherit desktop udev wrapper xdg-utils
10 12

  
11 13
DESCRIPTION="KryoFlux Host Software"
12 14
HOMEPAGE="https://www.kryoflux.com"
13
SRC_URI="
14
	https://www.kryoflux.com/download/${MY_P}.tar.bz2
15
	gui? ( https://www.kryoflux.com/download/${MY_P_WINDOWS}.zip )
16
"
15
SRC_URI="https://www.kryoflux.com/download/${MY_P}.tgz"
17 16
S="${WORKDIR}/${MY_P}"
18 17

  
19
KEYWORDS="-* amd64 x86"
18
KEYWORDS="-* amd64 ~arm64"
20 19
LICENSE="SPS"
21 20
SLOT="0"
22
IUSE="demos doc fast-firmware gui static"
21
IUSE="demos doc gui"
23 22

  
24 23
RDEPEND="
25 24
	dev-libs/spsdeclib
26 25
	virtual/libusb:1
27
	virtual/udev
28 26
	gui? ( virtual/jre )
29 27
"
30 28

  
31
BDEPEND="app-arch/unzip"
29
BDEPEND="
30
	app-arch/unzip
31
	dev-util/patchelf
32
"
32 33

  
34
DOCS=( "DONATIONS.txt" "RELEASE.txt" )
33 35
RESTRICT="bindist mirror"
34

  
35 36
QA_PREBUILT="/usr/bin/kryoflux-dtc"
36 37

  
37 38
src_unpack() {
38
	unpack "${MY_P}".tar.bz2
39
	unpack ${A}
40
	unpack ${MY_P}/dtc/$(usex amd64 x86_64 aarch64)/${MY_P_DTC}.tar.gz
41
	use gui && unpack ${MY_P}/dtc/kryoflux-ui.jar
42
}
39 43

  
40
	if use gui; then
41
		unpack "${MY_P_WINDOWS}".zip
44
src_prepare() {
45
	default
42 46

  
43
		# Extract kryoflux-ui.jar to get a logo for the meny entry
44
		unpack "${MY_P_WINDOWS}"/dtc/kryoflux-ui.jar
45
	fi
47
	# Upstream uses 'libCAPSImage.so.5.1' (uppercase),
48
	# but their source installs 'libcapsimage.so.5' (lowercase)
49
	patchelf --replace-needed libCAPSImage.so.5.1 libcapsimage.so.5 ../${MY_P_DTC}/bin/dtc
46 50
}
47 51

  
48 52
src_install() {
49
	newbin dtc/$(usex amd64 x86_64 i686)/$(usex static static dynamic)/dtc kryoflux-dtc
53
	newbin ../${MY_P_DTC}/bin/dtc kryoflux-dtc
54

  
55
	insinto /lib/firmware
56
	doins ../${MY_P_DTC}/share/dtc/firmware_kf_usb_rosalie.bin
50 57

  
51 58
	cat <<-EOF > "${T}"/80-kryoflux.rules || die
52 59
	ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="03eb", ATTR{idProduct}=="6124", GROUP="floppy", MODE="0660"
......
55 62

  
56 63
	if use gui; then
57 64
		insinto /usr/share/kryoflux-ui
58
		doins "${WORKDIR}"/"${MY_P_WINDOWS}"/dtc/kryoflux-ui.jar
65
		doins dtc/kryoflux-ui.jar
59 66

  
60 67
		dosym ../../bin/kryoflux-dtc /usr/share/kryoflux-ui/dtc
61

  
62 68
		make_wrapper kryoflux-ui "java -jar kryoflux-ui.jar" /usr/share/kryoflux-ui
63 69

  
64
		newicon "${WORKDIR}"/images/disk.png kryoflux-ui.png
65

  
70
		newicon ../images/disk.png kryoflux-ui.png
66 71
		make_desktop_entry "kryoflux-ui" "KryoFlux UI" kryoflux-ui Development
67

  
68 72
		dodoc dtc/kryoflux-ui_README.txt
69 73
	fi
70 74

  
71
	if use fast-firmware; then
72
		insinto /lib/firmware
73
		doins dtc/firmware_fast/firmware_kf_usb_rosalie.bin
74

  
75
		dodoc dtc/firmware_fast/firmware_fast_README.txt
76
	else
77
		insinto /lib/firmware
78
		doins dtc/firmware_kf_usb_rosalie.bin
79
	fi
80

  
81 75
	if use demos; then
82 76
		dodoc -r g64_demo ipf_demo
77
		docompress -x /usr/share/doc/${PF}/g64_demo/BBSB/*.g64
78
		docompress -x /usr/share/doc/${PF}/g64_demo/DOTC/*.g64
79
		docompress -x /usr/share/doc/${PF}/ipf_demo/*.ipf
83 80
	fi
84 81

  
85 82
	if use doc; then
86 83
		dodoc -r docs schematics
84
		docompress -x /usr/share/doc/${PF}/{docs,schematics}/*.pdf
87 85
	fi
88 86

  
89
	local DOCS=( "DONATIONS.txt" "RELEASE.txt" "README.linux" )
90 87
	einstalldocs
91 88
}
92 89

  
......
94 91
	elog "If you want to access your Kryoflux without root access,"
95 92
	elog "please add yourself to the floppy group."
96 93

  
97
	if use fast-firmware; then
98
		elog ""
99
		elog "You have enabled the fast firmware. Please keep in mind,"
100
		elog "that this firmware can cause trouble with older floppy drives."
94
	udev_reload
95

  
96
	if use gui; then
97
		xdg_desktop_database_update
98
		xdg_mimeinfo_database_update
101 99
	fi
100
}
101

  
102
pkg_postrm() {
103
	udev_reload
102 104

  
103 105
	if use gui; then
104 106
		xdg_desktop_database_update
Thank you!