Gentoo Archives: gentoo-commits

From: Matthew Smith <matthew@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-gfx/solvespace/
Date: Sun, 03 Jul 2022 08:10:32
Message-Id: 1656835755.775016ae14d1a4df6981f2d655b5147423f79385.matthew@gentoo
1 commit: 775016ae14d1a4df6981f2d655b5147423f79385
2 Author: Matthew Smith <matthew <AT> gentoo <DOT> org>
3 AuthorDate: Sun Jul 3 08:09:15 2022 +0000
4 Commit: Matthew Smith <matthew <AT> gentoo <DOT> org>
5 CommitDate: Sun Jul 3 08:09:15 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=775016ae
7
8 media-gfx/solvespace: add system-mimalloc USE flag
9
10 Using the system mimalloc library causes the language selector to stop
11 working (and possibly other undiscovered bugs), so allow users to go
12 back to the statically linked vendored library if desired.
13
14 Signed-off-by: Matthew Smith <matthew <AT> gentoo.org>
15
16 media-gfx/solvespace/Manifest | 1 +
17 media-gfx/solvespace/metadata.xml | 3 ++
18 ...vespace-3.1.ebuild => solvespace-3.1-r1.ebuild} | 35 +++++++++++++++++-----
19 3 files changed, 31 insertions(+), 8 deletions(-)
20
21 diff --git a/media-gfx/solvespace/Manifest b/media-gfx/solvespace/Manifest
22 index 881e7a36fd2c..d513304e32b5 100644
23 --- a/media-gfx/solvespace/Manifest
24 +++ b/media-gfx/solvespace/Manifest
25 @@ -1,3 +1,4 @@
26 DIST libdxfrw-0.6.3-0b7b7b709d9299565db603f878214656ef5e9ddf.tar.gz 691804 BLAKE2B 84c90a591fac71144e9e13aace7c1a00dfc1bd6f27b0bcde6b60541f5b5d3ccc04ae1c759f60cb467445cc884840d04bf4613b5cc553fbbf6951cac33a084d50 SHA512 9ab498aa7f369be79d800e8ca5ec55fa54be79d0778937b81d4c8da776b3419cb8a75400b54b205efc338da32e2e781afd0bed1bd8efed1a0b212dc8682a2615
27 +DIST mimalloc-2.0.6-f819dbb4e4813fab464aee16770f39f11476bfea.tar.gz 1129745 BLAKE2B 95ea6e64afaa6931e18a22db45ba39d554917e109028adb624120442329bb458d24d7f22a233931c5e15b8b0ce4cc5130b0d4cba0db270a9c84453afd70c33e9 SHA512 b02a76d8a7668a4d3dc8c761473f609060b834761918b58d2143d54dbeb4c342e213010f9402d1c55035b04860936c2f8df73b84e111f5e90b3d58db62c5f85f
28 DIST solvespace-3.0.tar.gz 2734860 BLAKE2B 2efc9d98723c60abdb1c76ac086c40ff2f9b8bc9c315978731493d115fa55a080176ef48d930e3b503c0de0604dbfd2bc3bd99a581f359eb07a23034d09f84bf SHA512 b07b41fac1d67c5350082600a2f09e3fa611a1273e0c93ff93d11a7a1dbf550ff33465686eaff04fdb8350d1fe854ab0301d8723ef31cc65c687ba59cb89187f
29 DIST solvespace-3.1.tar.gz 2764243 BLAKE2B 764637f84a187c6a86cf65cd672466f48e1e5abd9d335945fc47f2ea48f7d22a94f6840a6019f2380e8416e903bb55f97d9adb18fa6f2e7a94933c2a5b51ef6c SHA512 76794c4b103036f423471c72209521c273b40edcf9a725d2407e757b8dded033863f58640f1bcdf19d7dd1b296334f8745a632875e06604fa4d5b261dd23ba98
30
31 diff --git a/media-gfx/solvespace/metadata.xml b/media-gfx/solvespace/metadata.xml
32 index d39d759d5cca..b332c7ef66f6 100644
33 --- a/media-gfx/solvespace/metadata.xml
34 +++ b/media-gfx/solvespace/metadata.xml
35 @@ -15,4 +15,7 @@
36 - mechanism design — use the constraint solver to simulate planar or spatial linkages, with pin, ball, or slide joints
37 - plane and solid geometry — replace hand-solved trigonometry and spreadsheets with a live dimensioned drawing
38 </longdescription>
39 + <use>
40 + <flag name="system-mimalloc">Use system <pkg>dev-libs/mimalloc</pkg> instead of vendored library</flag>
41 + </use>
42 </pkgmetadata>
43
44 diff --git a/media-gfx/solvespace/solvespace-3.1.ebuild b/media-gfx/solvespace/solvespace-3.1-r1.ebuild
45 similarity index 57%
46 rename from media-gfx/solvespace/solvespace-3.1.ebuild
47 rename to media-gfx/solvespace/solvespace-3.1-r1.ebuild
48 index 00c648f92e37..d6a1211cde9f 100644
49 --- a/media-gfx/solvespace/solvespace-3.1.ebuild
50 +++ b/media-gfx/solvespace/solvespace-3.1-r1.ebuild
51 @@ -9,21 +9,29 @@ DXFRW_COMMIT="0b7b7b709d9299565db603f878214656ef5e9ddf"
52 DXFRW_PV="0.6.3"
53 DXFRW_P="libdxfrw-${DXFRW_PV}-${DXFRW_COMMIT}"
54
55 +# dynamically linking with mimalloc causes segfaults when changing
56 +# language. bug #852839
57 +MIMALLOC_COMMIT="f819dbb4e4813fab464aee16770f39f11476bfea"
58 +MIMALLOC_PV="2.0.6"
59 +MIMALLOC_P="mimalloc-${MIMALLOC_PV}-${MIMALLOC_COMMIT}"
60 +
61 inherit cmake toolchain-funcs xdg
62
63 DESCRIPTION="Parametric 2d/3d CAD"
64 HOMEPAGE="http://solvespace.com"
65 SRC_URI="https://github.com/solvespace/solvespace/archive/v${PV}.tar.gz -> ${P}.tar.gz
66 - https://github.com/solvespace/libdxfrw/archive/${DXFRW_COMMIT}.tar.gz -> ${DXFRW_P}.tar.gz"
67 + https://github.com/solvespace/libdxfrw/archive/${DXFRW_COMMIT}.tar.gz -> ${DXFRW_P}.tar.gz
68 + !system-mimalloc? ( https://github.com/microsoft/mimalloc/archive/${MIMALLOC_COMMIT}.tar.gz -> ${MIMALLOC_P}.tar.gz )"
69
70 # licenses
71 # + SolveSpace (GPL-3+)
72 # |- Bitstream Vera (BitstreamVera)
73 # + libdxfrw (GPL-2+)
74 +# + mimalloc (MIT)
75
76 -IUSE="openmp"
77 +IUSE="openmp +system-mimalloc"
78 KEYWORDS="~amd64 ~x86"
79 -LICENSE="BitstreamVera GPL-2+ GPL-3+"
80 +LICENSE="BitstreamVera GPL-2+ GPL-3+ !system-mimalloc? ( MIT )"
81 SLOT="0"
82
83 RDEPEND="
84 @@ -35,7 +43,6 @@ RDEPEND="
85 dev-libs/json-c:=
86 dev-libs/libsigc++:2
87 dev-libs/libspnav[X]
88 - dev-libs/mimalloc:=
89 media-libs/fontconfig
90 media-libs/freetype:2[X]
91 media-libs/libpng:0=
92 @@ -43,6 +50,7 @@ RDEPEND="
93 virtual/opengl
94 x11-libs/cairo[X]
95 x11-libs/gtk+:3[X]
96 + system-mimalloc? ( dev-libs/mimalloc:= )
97 "
98 DEPEND="
99 ${RDEPEND}
100 @@ -50,10 +58,9 @@ DEPEND="
101 "
102 BDEPEND="virtual/pkgconfig"
103
104 -PATCHES=( "${FILESDIR}"/${PN}-3.1-use-system-mimalloc.patch )
105 -
106 -# This is shown to the user in the UI and --version.
107 -MY_HASH="0e0b0252e23dd5bd4ae82ababcc54c44aee036d6"
108 +# This is shown to the user in the UI and --version and should be
109 +# updated during each version bump.
110 +MY_HASH="70bde63cb32a7f049fa56cbdf924e2695fcb2916"
111
112 pkg_pretend() {
113 [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
114 @@ -67,6 +74,18 @@ src_prepare() {
115 rm -r extlib/libdxfrw || die
116 mv "${WORKDIR}"/libdxfrw-${DXFRW_COMMIT} extlib/libdxfrw || die
117
118 + if use system-mimalloc; then
119 + # Ideally this patch would be applied unconditionally and it
120 + # would add an option like `-DUSE_SYSTEM_MIMALLOC=On', but
121 + # hopefully this patch is only needed temporarily and the odd
122 + # interactions with the system's libmimalloc will be fixed
123 + # shortly... :)
124 + PATCHES=( "${FILESDIR}"/${PN}-3.1-use-system-mimalloc.patch )
125 + else
126 + rm -r extlib/mimalloc || die
127 + mv "${WORKDIR}"/mimalloc-${MIMALLOC_COMMIT} extlib/mimalloc || die
128 + fi
129 +
130 sed -i '/include(GetGitCommitHash)/d' CMakeLists.txt || die
131
132 cmake_src_prepare