Diff mujs-1.1.0 with a mujs-1.1.2

/usr/portage/dev-lang/mujs/mujs-1.1.2.ebuild 2021-05-31 15:09:00.000000000 +0300
3 3

  
4 4
EAPI=7
5 5

  
6
inherit flag-o-matic toolchain-funcs
6
inherit flag-o-matic multilib toolchain-funcs
7 7

  
8 8
DESCRIPTION="An embeddable JavaScript interpreter in C"
9 9
HOMEPAGE="https://mujs.com/ https://github.com/ccxvii/mujs"
10
SRC_URI="https://github.com/ccxvii/mujs/archive/${PV}.tar.gz -> ${P}.tar.gz"
11
# Not available right now.
12
#SRC_URI="https://mujs.com/downloads/${P}.tar.xz"
10
SRC_URI="https://mujs.com/downloads/${P}.tar.xz"
11
#SRC_URI=" https://github.com/ccxvii/mujs/archive/${PV}.tar.xz -> ${P}.tar.xz"
13 12

  
14 13
LICENSE="ISC"
15 14
# subslot matches SONAME
16 15
SLOT="0/${PV}"
17 16
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ppc ppc64 ~s390 sparc x86 ~amd64-linux ~ppc-macos ~x64-macos"
18
IUSE="static-libs"
19 17

  
20 18
RDEPEND="sys-libs/readline:0="
21 19
DEPEND="${RDEPEND}"
22 20

  
23 21
PATCHES=(
24
	"${FILESDIR}/${PN}-1.1.0-flags.patch"
22
	"${FILESDIR}"/${PN}-1.1.1-flags.patch
25 23
)
26 24

  
27 25
src_prepare() {
......
29 27

  
30 28
	tc-export AR CC
31 29

  
30
	append-cflags -fPIC
31

  
32 32
	# library's ABI (and API) changes in ~each release:
33 33
	# diff 'usr/includemujs.h' across releases to validate
34
	append-cflags -fPIC -Wl,-soname=lib${PN}.so.${PV}
34
	if [[ ${CHOST} == *-darwin* ]] ; then
35
		append-cflags -Wl,-install_name,"${EPREFIX}"/usr/$(get_libdir)/lib${PN}.${PV}.dylib
36
	else
37
		append-cflags -Wl,-soname=lib${PN}.so.${PV}
38
	fi
35 39
}
36 40

  
37 41
src_compile() {
38
	emake VERSION=${PV} prefix=/usr shared
42
	# We need to use ${PV} for the pkgconfig file
43
	# #784461
44
	emake \
45
		VERSION=${PV} \
46
		XCFLAGS="${CFLAGS}" \
47
		XCPPFLAGS="${CPPFLAGS}" \
48
		prefix=/usr \
49
		shell shared
39 50
}
40 51

  
41 52
src_install() {
42 53
	local myemakeargs=(
43 54
		DESTDIR="${ED}"
55
		VERSION=${PV}
44 56
		libdir="/usr/$(get_libdir)"
45
		prefix="/usr"
46
		VERSION="${PV}"
47
		$(usex static-libs install-static '')
57
		prefix=/usr
48 58
	)
49 59

  
50 60
	emake "${myemakeargs[@]}" install-shared
51 61

  
52
	mv -v "${ED}"/usr/$(get_libdir)/lib${PN}.so{,.${PV}} || die
53

  
54
	dosym lib${PN}.so.${PV} /usr/$(get_libdir)/lib${PN}.so
55
	dosym lib${PN}.so.${PV} /usr/$(get_libdir)/lib${PN}.so.${PV:0:1}
62
	# TODO: Tidy up this logic, improve readability
63
	if [[ ${CHOST} == *-darwin* ]] ; then
64
		mv -v "${ED}"/usr/$(get_libdir)/lib${PN}.so "${ED}"/usr/$(get_libdir)/lib${PN}.${PV}.dylib || die
65
		dosym lib${PN}.${PV}.dylib /usr/$(get_libdir)/lib${PN}.dylib
66
		dosym lib${PN}.${PV}.dylib /usr/$(get_libdir)/lib${PN}.${PV:0:1}.dylib
67
	else
68
		mv -v "${ED}"/usr/$(get_libdir)/lib${PN}.so{,.${PV}} || die
69
		dosym lib${PN}.so.${PV} /usr/$(get_libdir)/lib${PN}.so
70
		dosym lib${PN}.so.${PV} /usr/$(get_libdir)/lib${PN}.so.${PV:0:1}
71
	fi
56 72
}
Thank you!