summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Smith <matthew@gentoo.org>2022-07-03 09:09:15 +0100
committerMatthew Smith <matthew@gentoo.org>2022-07-03 09:09:15 +0100
commit775016ae14d1a4df6981f2d655b5147423f79385 (patch)
treeef3b0eb1d6beb80c740fcca2d6a83f388ea42d6d /media-gfx/solvespace
parentdev-java/hamcrest: new package, add 2.2 (diff)
downloadgentoo-775016ae14d1a4df6981f2d655b5147423f79385.tar.gz
gentoo-775016ae14d1a4df6981f2d655b5147423f79385.tar.bz2
gentoo-775016ae14d1a4df6981f2d655b5147423f79385.zip
media-gfx/solvespace: add system-mimalloc USE flag
Using the system mimalloc library causes the language selector to stop working (and possibly other undiscovered bugs), so allow users to go back to the statically linked vendored library if desired. Signed-off-by: Matthew Smith <matthew@gentoo.org>
Diffstat (limited to 'media-gfx/solvespace')
-rw-r--r--media-gfx/solvespace/Manifest1
-rw-r--r--media-gfx/solvespace/metadata.xml3
-rw-r--r--media-gfx/solvespace/solvespace-3.1-r1.ebuild (renamed from media-gfx/solvespace/solvespace-3.1.ebuild)35
3 files changed, 31 insertions, 8 deletions
diff --git a/media-gfx/solvespace/Manifest b/media-gfx/solvespace/Manifest
index 881e7a36fd2c..d513304e32b5 100644
--- a/media-gfx/solvespace/Manifest
+++ b/media-gfx/solvespace/Manifest
@@ -1,3 +1,4 @@
DIST libdxfrw-0.6.3-0b7b7b709d9299565db603f878214656ef5e9ddf.tar.gz 691804 BLAKE2B 84c90a591fac71144e9e13aace7c1a00dfc1bd6f27b0bcde6b60541f5b5d3ccc04ae1c759f60cb467445cc884840d04bf4613b5cc553fbbf6951cac33a084d50 SHA512 9ab498aa7f369be79d800e8ca5ec55fa54be79d0778937b81d4c8da776b3419cb8a75400b54b205efc338da32e2e781afd0bed1bd8efed1a0b212dc8682a2615
+DIST mimalloc-2.0.6-f819dbb4e4813fab464aee16770f39f11476bfea.tar.gz 1129745 BLAKE2B 95ea6e64afaa6931e18a22db45ba39d554917e109028adb624120442329bb458d24d7f22a233931c5e15b8b0ce4cc5130b0d4cba0db270a9c84453afd70c33e9 SHA512 b02a76d8a7668a4d3dc8c761473f609060b834761918b58d2143d54dbeb4c342e213010f9402d1c55035b04860936c2f8df73b84e111f5e90b3d58db62c5f85f
DIST solvespace-3.0.tar.gz 2734860 BLAKE2B 2efc9d98723c60abdb1c76ac086c40ff2f9b8bc9c315978731493d115fa55a080176ef48d930e3b503c0de0604dbfd2bc3bd99a581f359eb07a23034d09f84bf SHA512 b07b41fac1d67c5350082600a2f09e3fa611a1273e0c93ff93d11a7a1dbf550ff33465686eaff04fdb8350d1fe854ab0301d8723ef31cc65c687ba59cb89187f
DIST solvespace-3.1.tar.gz 2764243 BLAKE2B 764637f84a187c6a86cf65cd672466f48e1e5abd9d335945fc47f2ea48f7d22a94f6840a6019f2380e8416e903bb55f97d9adb18fa6f2e7a94933c2a5b51ef6c SHA512 76794c4b103036f423471c72209521c273b40edcf9a725d2407e757b8dded033863f58640f1bcdf19d7dd1b296334f8745a632875e06604fa4d5b261dd23ba98
diff --git a/media-gfx/solvespace/metadata.xml b/media-gfx/solvespace/metadata.xml
index d39d759d5cca..b332c7ef66f6 100644
--- a/media-gfx/solvespace/metadata.xml
+++ b/media-gfx/solvespace/metadata.xml
@@ -15,4 +15,7 @@
- mechanism design — use the constraint solver to simulate planar or spatial linkages, with pin, ball, or slide joints
- plane and solid geometry — replace hand-solved trigonometry and spreadsheets with a live dimensioned drawing
</longdescription>
+ <use>
+ <flag name="system-mimalloc">Use system <pkg>dev-libs/mimalloc</pkg> instead of vendored library</flag>
+ </use>
</pkgmetadata>
diff --git a/media-gfx/solvespace/solvespace-3.1.ebuild b/media-gfx/solvespace/solvespace-3.1-r1.ebuild
index 00c648f92e37..d6a1211cde9f 100644
--- a/media-gfx/solvespace/solvespace-3.1.ebuild
+++ b/media-gfx/solvespace/solvespace-3.1-r1.ebuild
@@ -9,21 +9,29 @@ DXFRW_COMMIT="0b7b7b709d9299565db603f878214656ef5e9ddf"
DXFRW_PV="0.6.3"
DXFRW_P="libdxfrw-${DXFRW_PV}-${DXFRW_COMMIT}"
+# dynamically linking with mimalloc causes segfaults when changing
+# language. bug #852839
+MIMALLOC_COMMIT="f819dbb4e4813fab464aee16770f39f11476bfea"
+MIMALLOC_PV="2.0.6"
+MIMALLOC_P="mimalloc-${MIMALLOC_PV}-${MIMALLOC_COMMIT}"
+
inherit cmake toolchain-funcs xdg
DESCRIPTION="Parametric 2d/3d CAD"
HOMEPAGE="http://solvespace.com"
SRC_URI="https://github.com/solvespace/solvespace/archive/v${PV}.tar.gz -> ${P}.tar.gz
- https://github.com/solvespace/libdxfrw/archive/${DXFRW_COMMIT}.tar.gz -> ${DXFRW_P}.tar.gz"
+ https://github.com/solvespace/libdxfrw/archive/${DXFRW_COMMIT}.tar.gz -> ${DXFRW_P}.tar.gz
+ !system-mimalloc? ( https://github.com/microsoft/mimalloc/archive/${MIMALLOC_COMMIT}.tar.gz -> ${MIMALLOC_P}.tar.gz )"
# licenses
# + SolveSpace (GPL-3+)
# |- Bitstream Vera (BitstreamVera)
# + libdxfrw (GPL-2+)
+# + mimalloc (MIT)
-IUSE="openmp"
+IUSE="openmp +system-mimalloc"
KEYWORDS="~amd64 ~x86"
-LICENSE="BitstreamVera GPL-2+ GPL-3+"
+LICENSE="BitstreamVera GPL-2+ GPL-3+ !system-mimalloc? ( MIT )"
SLOT="0"
RDEPEND="
@@ -35,7 +43,6 @@ RDEPEND="
dev-libs/json-c:=
dev-libs/libsigc++:2
dev-libs/libspnav[X]
- dev-libs/mimalloc:=
media-libs/fontconfig
media-libs/freetype:2[X]
media-libs/libpng:0=
@@ -43,6 +50,7 @@ RDEPEND="
virtual/opengl
x11-libs/cairo[X]
x11-libs/gtk+:3[X]
+ system-mimalloc? ( dev-libs/mimalloc:= )
"
DEPEND="
${RDEPEND}
@@ -50,10 +58,9 @@ DEPEND="
"
BDEPEND="virtual/pkgconfig"
-PATCHES=( "${FILESDIR}"/${PN}-3.1-use-system-mimalloc.patch )
-
-# This is shown to the user in the UI and --version.
-MY_HASH="0e0b0252e23dd5bd4ae82ababcc54c44aee036d6"
+# This is shown to the user in the UI and --version and should be
+# updated during each version bump.
+MY_HASH="70bde63cb32a7f049fa56cbdf924e2695fcb2916"
pkg_pretend() {
[[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
@@ -67,6 +74,18 @@ src_prepare() {
rm -r extlib/libdxfrw || die
mv "${WORKDIR}"/libdxfrw-${DXFRW_COMMIT} extlib/libdxfrw || die
+ if use system-mimalloc; then
+ # Ideally this patch would be applied unconditionally and it
+ # would add an option like `-DUSE_SYSTEM_MIMALLOC=On', but
+ # hopefully this patch is only needed temporarily and the odd
+ # interactions with the system's libmimalloc will be fixed
+ # shortly... :)
+ PATCHES=( "${FILESDIR}"/${PN}-3.1-use-system-mimalloc.patch )
+ else
+ rm -r extlib/mimalloc || die
+ mv "${WORKDIR}"/mimalloc-${MIMALLOC_COMMIT} extlib/mimalloc || die
+ fi
+
sed -i '/include(GetGitCommitHash)/d' CMakeLists.txt || die
cmake_src_prepare