commit:     a07889772b00f016a65e4270662133fb644603fa
Author:     Matthew Smith <matthew <AT> gentoo <DOT> org>
AuthorDate: Fri Mar 11 18:20:20 2022 +0000
Commit:     Matthew Smith <matthew <AT> gentoo <DOT> org>
CommitDate: Fri Mar 11 18:28:12 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a0788977

media-gfx/solvespace: use system mimalloc

Also bump to EAPI-8, use xdg eclass, correct *DEPEND, and some minor
style tweaks.

x86 keyword dropped as mimalloc is not keyworded for x86.

Signed-off-by: Matthew Smith <matthew <AT> gentoo.org>

 .../files/solvespace-3.0-use-system-mimalloc.patch | 74 ++++++++++++++++++++
 media-gfx/solvespace/solvespace-3.0-r1.ebuild      | 78 ++++++++++++++++++++++
 2 files changed, 152 insertions(+)

diff --git 
a/media-gfx/solvespace/files/solvespace-3.0-use-system-mimalloc.patch 
b/media-gfx/solvespace/files/solvespace-3.0-use-system-mimalloc.patch
new file mode 100644
index 000000000000..485a870449b2
--- /dev/null
+++ b/media-gfx/solvespace/files/solvespace-3.0-use-system-mimalloc.patch
@@ -0,0 +1,74 @@
+From eb8cd7a379503a0206d6ff43a2ce0749a32f2a37 Mon Sep 17 00:00:00 2001
+From: Matthew Smith <matt...@gentoo.org>
+Date: Fri, 11 Mar 2022 18:11:27 +0000
+Subject: [PATCH] build: Use system mimalloc
+
+---
+ CMakeLists.txt     |  8 --------
+ src/CMakeLists.txt | 12 +++---------
+ 2 files changed, 3 insertions(+), 17 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index bdd3670..93485d7 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -173,14 +173,6 @@ endif()
+ message(STATUS "Using in-tree libdxfrw")
+ add_subdirectory(extlib/libdxfrw)
+ 
+-message(STATUS "Using in-tree mimalloc")
+-set(MI_OVERRIDE OFF CACHE BOOL "")
+-set(MI_BUILD_SHARED OFF CACHE BOOL "")
+-set(MI_BUILD_OBJECT OFF CACHE BOOL "")
+-set(MI_BUILD_TESTS OFF CACHE BOOL "")
+-add_subdirectory(extlib/mimalloc EXCLUDE_FROM_ALL)
+-set(MIMALLOC_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/extlib/mimalloc/include)
+-
+ if(WIN32 OR APPLE)
+     # On Win32 and macOS we use vendored packages, since there is little to 
no benefit
+     # to trying to find system versions. In particular, trying to link to 
libraries from
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index 5ac7b41..9f4e2f7 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -55,10 +55,7 @@ target_include_directories(slvs
+ 
+ target_link_libraries(slvs
+     ${util_LIBRARIES}
+-    mimalloc-static)
+-
+-add_dependencies(slvs
+-    mimalloc-static)
++    mimalloc)
+ 
+ set_target_properties(slvs PROPERTIES
+     PUBLIC_HEADER ${CMAKE_SOURCE_DIR}/include/slvs.h
+@@ -213,9 +210,6 @@ add_library(solvespace-core STATIC
+     ${solvespace_core_HEADERS}
+     ${solvespace_core_SOURCES})
+ 
+-add_dependencies(solvespace-core
+-    mimalloc-static)
+-
+ target_link_libraries(solvespace-core
+     ${OpenMP_CXX_LIBRARIES}
+     dxfrw
+@@ -223,7 +217,7 @@ target_link_libraries(solvespace-core
+     ${ZLIB_LIBRARY}
+     ${PNG_LIBRARY}
+     ${FREETYPE_LIBRARY}
+-    mimalloc-static)
++    mimalloc)
+ 
+ if(Backtrace_FOUND)
+     target_link_libraries(solvespace-core
+@@ -430,4 +424,4 @@ if(APPLE)
+             COMMENT "Bundling executable solvespace-cli"
+             VERBATIM)
+     endif()
+-endif()
+\ No newline at end of file
++endif()
+-- 
+2.35.1
+

diff --git a/media-gfx/solvespace/solvespace-3.0-r1.ebuild 
b/media-gfx/solvespace/solvespace-3.0-r1.ebuild
new file mode 100644
index 000000000000..73b691667314
--- /dev/null
+++ b/media-gfx/solvespace/solvespace-3.0-r1.ebuild
@@ -0,0 +1,78 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+# solvespace's libdxfrw is quite heavily modified and incompatible with
+# the upstream libdxfrw.
+DXFRW_COMMIT="0b7b7b709d9299565db603f878214656ef5e9ddf"
+DXFRW_PV="0.6.3"
+DXFRW_P="libdxfrw-${DXFRW_PV}-${DXFRW_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"
+
+# licenses
+# + SolveSpace (GPL-3+)
+# |- Bitstream Vera (BitstreamVera)
+# + libdxfrw (GPL-2+)
+
+IUSE="openmp"
+KEYWORDS="~amd64"
+LICENSE="BitstreamVera GPL-2+ GPL-3+"
+SLOT="0"
+
+RDEPEND="
+       dev-cpp/atkmm:0
+       dev-cpp/glibmm:2
+       dev-cpp/gtkmm:3.0
+       dev-cpp/pangomm:1.4
+       dev-libs/glib:2
+       dev-libs/json-c:=
+       dev-libs/libsigc++:2
+       dev-libs/libspnav
+       dev-libs/mimalloc:=
+       media-libs/fontconfig
+       media-libs/freetype:2
+       media-libs/libglvnd
+       media-libs/libpng:0=
+       sys-libs/zlib
+       virtual/opengl
+       x11-libs/cairo
+       x11-libs/gtk+:3
+"
+DEPEND="${RDEPEND}"
+BDEPEND="virtual/pkgconfig"
+
+PATCHES=( "${FILESDIR}"/${PN}-3.0-use-system-mimalloc.patch )
+
+# This is shown to the user in the UI and --version.
+MY_HASH="0e0b0252e23dd5bd4ae82ababcc54c44aee036d6"
+
+pkg_pretend() {
+       if use openmp; then
+               tc-has-openmp || die "Please switch to an openmp compatible 
compiler"
+       fi
+}
+
+src_prepare() {
+       rm -r extlib/libdxfrw || die
+       mv "${WORKDIR}"/libdxfrw-${DXFRW_COMMIT} extlib/libdxfrw || die
+
+       sed -i '/include(GetGitCommitHash)/d' CMakeLists.txt || die
+
+       cmake_src_prepare
+}
+
+src_configure() {
+       local mycmakeargs=(
+               -DENABLE_OPENMP=$(usex openmp)
+               -DGIT_COMMIT_HASH=${MY_HASH}
+       )
+
+       cmake_src_configure
+}

Reply via email to