From 26a7892191357bac501fdc77a5c5c1031384fcf1 Mon Sep 17 00:00:00 2001 From: Robert Lowry Date: Sat, 18 Dec 2021 09:17:06 -0600 Subject: [PATCH] solvespace: update to 3.0 --- srcpkgs/solvespace/patches/char_width.patch | 91 --------------------- srcpkgs/solvespace/template | 30 +++++-- 2 files changed, 23 insertions(+), 98 deletions(-) delete mode 100644 srcpkgs/solvespace/patches/char_width.patch diff --git a/srcpkgs/solvespace/patches/char_width.patch b/srcpkgs/solvespace/patches/char_width.patch deleted file mode 100644 index 2a52a9feb534..000000000000 --- a/srcpkgs/solvespace/patches/char_width.patch +++ /dev/null @@ -1,91 +0,0 @@ ---- a/src/textwin.cpp 2017-04-16 04:00:21.000000000 -0500 -+++ b/src/textwin.cpp 2019-02-01 00:47:55.270922800 -0600 -@@ -85,7 +85,7 @@ - editControl.halfRow = halfRow; - editControl.col = col; - -- int x = LEFT_MARGIN + CHAR_WIDTH*col; -+ int x = LEFT_MARGIN + CHAR_WIDTH_*col; - int y = (halfRow - SS.TW.scrollPos)*(LINE_HEIGHT/2); - - ShowTextEditControl(x, y + 18, str); -@@ -447,7 +447,7 @@ - double ox = oldMousePos.x, oy = oldMousePos.y - LINE_HEIGHT; - ox += 3; - oy -= 3; -- int tw = (str.length() + 1)*(CHAR_WIDTH - 1); -+ int tw = (str.length() + 1)*(CHAR_WIDTH_ - 1); - ox = min(ox, (double) (width - 25) - tw); - oy = max(oy, 5.0); - -@@ -583,7 +583,7 @@ - int width, height; - GetTextWindowSize(&width, &height); - -- int px = LEFT_MARGIN + CHAR_WIDTH*editControl.col; -+ int px = LEFT_MARGIN + CHAR_WIDTH_*editControl.col; - int py = (editControl.halfRow - SS.TW.scrollPos)*(LINE_HEIGHT/2); - - py += LINE_HEIGHT + 5; -@@ -842,8 +842,8 @@ - if(ltop < (scrollPos-1)) continue; - if(ltop > scrollPos+halfRows) break; - -- for(c = 0; c < min((width/CHAR_WIDTH)+1, (int) MAX_COLS); c++) { -- int x = LEFT_MARGIN + c*CHAR_WIDTH; -+ for(c = 0; c < min((width/CHAR_WIDTH_)+1, (int) MAX_COLS); c++) { -+ int x = LEFT_MARGIN + c*CHAR_WIDTH_; - int y = (ltop-scrollPos)*(LINE_HEIGHT/2) + 4; - - int fg = meta[r][c].fg; -@@ -866,7 +866,7 @@ - // Move the quad down a bit, so that the descenders - // still have the correct background. - y += adj; -- ssglAxisAlignedQuad(x, x + CHAR_WIDTH, y, y + bh, false); -+ ssglAxisAlignedQuad(x, x + CHAR_WIDTH_, y, y + bh, false); - y -= adj; - } - } else if(a == 1) { -@@ -912,8 +912,8 @@ - glLineWidth(1); - glBegin(GL_LINES); - int yp = y + CHAR_HEIGHT; -- glVertex2d(LEFT_MARGIN + cs*CHAR_WIDTH, yp); -- glVertex2d(LEFT_MARGIN + cf*CHAR_WIDTH, yp); -+ glVertex2d(LEFT_MARGIN + cs*CHAR_WIDTH_, yp); -+ glVertex2d(LEFT_MARGIN + cf*CHAR_WIDTH_, yp); - glEnd(); - - glEnable(GL_TEXTURE_2D); -@@ -979,7 +979,7 @@ - hoveredCol = 0; - - // Find the corresponding character in the text buffer -- int c = (int)((x - LEFT_MARGIN) / CHAR_WIDTH); -+ int c = (int)((x - LEFT_MARGIN) / CHAR_WIDTH_); - int hh = (LINE_HEIGHT)/2; - y += scrollPos*hh; - int r; ---- a/src/toolbar.cpp 2017-04-16 03:56:19.000000000 -0500 -+++ b/src/toolbar.cpp 2019-02-01 00:47:55.270922800 -0600 -@@ -218,7 +218,7 @@ - } - } - -- int tw = str.length() * (SS.TW.CHAR_WIDTH - 1) + 10, -+ int tw = str.length() * (SS.TW.CHAR_WIDTH_ - 1) + 10, - th = SS.TW.LINE_HEIGHT + 2; - - double ox = toolbarMouseX + 3, oy = toolbarMouseY + 3; ---- a/src/ui.h 2017-04-16 04:00:07.000000000 -0500 -+++ b/src/ui.h 2019-02-01 00:47:55.270922800 -0600 -@@ -27,7 +27,7 @@ - float fgColorTable[256*3]; - - enum { -- CHAR_WIDTH = 9, -+ CHAR_WIDTH_ = 9, - CHAR_HEIGHT = 16, - LINE_HEIGHT = 20, - LEFT_MARGIN = 6, diff --git a/srcpkgs/solvespace/template b/srcpkgs/solvespace/template index 377c0e4cbd15..1b35dc15b042 100644 --- a/srcpkgs/solvespace/template +++ b/srcpkgs/solvespace/template @@ -1,15 +1,31 @@ # Template file for 'solvespace' pkgname=solvespace -version=2.3 -revision=3 -wrksrc=solvespace +version=3.0 +revision=1 +_libdxfrw_hash=0b7b7b709d9299565db603f878214656ef5e9ddf +_mimalloc_hash=4e643b6d3178e0ea2a093b7e14fe621631a91e4b build_style=cmake -hostmakedepends="pkg-config" -makedepends="glew-devel gtkmm2-devel json-c-devel" +hostmakedepends="pkg-config git" +makedepends="glew-devel gtkmm-devel json-c-devel gettext-devel libspnav-devel" short_desc="Parametric 2d/3d CAD" maintainer="Robert Lowry " license="GPL-3.0-or-later" homepage="https://solvespace.com/index.pl" -distfiles="https://github.com/solvespace/solvespace/releases/download/v${version}/solvespace-source.tar.gz" -checksum=0be0b2100c0b01eddded2a4dc60455d61cf67816189905af0e73082bfef96000 +distfiles="https://github.com/solvespace/solvespace/archive/refs/tags/v${version}.tar.gz + https://github.com/solvespace/libdxfrw/archive/${_libdxfrw_hash}.tar.gz + https://github.com/microsoft/mimalloc/archive/${_mimalloc_hash}.tar.gz" +checksum="04cda618fbbbe2db92713adf2fff4264017f858bac6f737c9da11efab693be4f + 3f7d37ee63f85219da3c63a266023008b8df993965a355739a3fdff3bfb2f932 + 448ac898c72468c4f632a0818cc4b8ec83a4669402ee059d74df35f94f3e2f34" nocross="https://travis-ci.org/bobertlo/void-packages/jobs/487251265" + +post_extract() { + rm -r "${wrksrc}/extlib/libdxfrw" + mv "${XBPS_BUILDDIR}/libdxfrw-${_libdxfrw_hash}" "${wrksrc}/extlib/libdxfrw" + rm -r "${wrksrc}/extlib/mimalloc" + mv "${XBPS_BUILDDIR}/mimalloc-${_mimalloc_hash}" "${wrksrc}/extlib/mimalloc" +} + +pre_configure() { + vsed -i 's/include(GetGitCommitHash)/#include(GetGitCommitHash)/g' CMakeLists.txt +}