1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-10-18 19:49:40 +00:00

graphics/wings: update to latest git version and allow build

As the released version does not work with Erlang 24 and the
latest devel release is rather buggy, update to the latest commit
from github. That does not suggest that this version is perfect,
I observe some wonkiness when actually displaying models; but at
least it builds.

While here, simplify the port: it doesn't work any worse when
not copying and symlinking the installation directory.
This commit is contained in:
Christoph Moench-Tegeder 2021-11-19 22:52:53 +01:00
parent b833ffcc8a
commit e52bcc38a5
6 changed files with 1090 additions and 512 deletions

View File

@ -1,10 +1,8 @@
# Created by: olgeni@FreeBSD.org
PORTNAME= wings
PORTVERSION= 2.2.6.1
PORTREVISION= 1
DISTVERSION= 2.2.7p1
CATEGORIES= graphics
MASTER_SITES= SF
DIST_SUBDIR= erlang
MAINTAINER= cmt@FreeBSD.org
@ -15,24 +13,25 @@ LICENSE_NAME= Wings 3D License # similar to TclTk license
LICENSE_FILE= ${WRKSRC}/license.terms
LICENSE_PERMS= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
BROKEN= does not build with Erlang 24 (requires erlang-esdl)
BUILD_DEPENDS= erl:lang/erlang \
erlang-esdl>0:devel/erlang-esdl \
erlang-cl>0:devel/erlang-cl \
erlang-wx>0:lang/erlang-wx
erlang-wx>0:lang/erlang-wx \
pkg-config:devel/pkgconf
RUN_DEPENDS:= ${BUILD_DEPENDS}
MAKE_ENV= ESDL_PATH=${LOCALBASE}/lib/erlang/lib/esdl
PLIST_SUB= VERSION="${PORTVERSION}"
USES= gl tar:bzip2 eigen:3 gmake
ALL_TARGET= lang
MAKE_JOBS_UNSAFE=yes
USE_GL= gl glu
SUB_FILES= ${PORTNAME}.sh
USES= gl tar:bzip2 gmake
USE_GITHUB= yes
GH_ACCOUNT= dgud
GH_PROJECT= wings libigl:igl
GH_TAGNAME= a41df275e v2.1.0:igl
PORTSCOUT= limitw:1,even
USE_GL= gl glu
DESKTOP_ENTRIES="Wings" \
"${COMMENT}" \
@ -41,6 +40,10 @@ DESKTOP_ENTRIES="Wings" \
"Graphics;3DGraphics;" \
""
post-extract:
@${MKDIR} ${WRKSRC}/_deps
@${LN} -s ${WRKSRC_igl} ${WRKSRC}/_deps/libigl
post-patch:
@${REINPLACE_CMD} -e 's,include_lib("wings/,include_lib(",g' \
${WRKSRC}/src/*.erl \
@ -54,12 +57,11 @@ post-patch:
do-install:
cd ${WRKSRC} && ${COPYTREE_SHARE} "ebin icons plugins textures shaders patches" \
${STAGEDIR}${PREFIX}/lib/erlang/lib/${DISTNAME}
${STAGEDIR}${PREFIX}/lib/erlang/lib/${PORTNAME}
cd ${WRKSRC} && ${COPYTREE_SHARE} "src" \
${STAGEDIR}${PREFIX}/lib/erlang/lib/${DISTNAME} "-name *\.erl"
${STAGEDIR}${PREFIX}/lib/erlang/lib/${PORTNAME} "-name *\.erl"
cd ${WRKSRC} && ${COPYTREE_SHARE} "priv" \
${STAGEDIR}${PREFIX}/lib/erlang/lib/${DISTNAME} "-name *\.so"
${LN} -sf ${DISTNAME} ${STAGEDIR}${PREFIX}/lib/erlang/lib/${PORTNAME}
${STAGEDIR}${PREFIX}/lib/erlang/lib/${PORTNAME} "-name *\.so"
${INSTALL_SCRIPT} ${WRKDIR}/${PORTNAME}.sh ${STAGEDIR}${PREFIX}/bin/${PORTNAME}
${INSTALL_DATA} ${WRKSRC}/src/${PORTNAME}.icon ${STAGEDIR}${PREFIX}/share/pixmaps/${PORTNAME}.ico

View File

@ -1,3 +1,5 @@
TIMESTAMP = 1620636323
SHA256 (erlang/wings-2.2.6.1.tar.bz2) = 94edba42012682ffcec16117282f028cfb39daa29dbd39023746d290f833a4b4
SIZE (erlang/wings-2.2.6.1.tar.bz2) = 3266532
TIMESTAMP = 1637355482
SHA256 (erlang/dgud-wings-2.2.7p1-a41df275e_GH0.tar.gz) = 96fa14772464ca5943e8a2e8a5f918f8ebb9e2326d9efe59ffcfd01d2641400a
SIZE (erlang/dgud-wings-2.2.7p1-a41df275e_GH0.tar.gz) = 3600948
SHA256 (erlang/dgud-libigl-v2.1.0_GH0.tar.gz) = 816ec64b6b2fbabcb1c6353c7df8a2fc1ad5bf4c607b332871a6ab8b29c89dbc
SIZE (erlang/dgud-libigl-v2.1.0_GH0.tar.gz) = 976016

View File

@ -0,0 +1,66 @@
--- Makefile.orig 2021-10-01 21:29:37.160867000 +0200
+++ Makefile 2021-10-01 21:32:11.015663000 +0200
@@ -17,7 +17,7 @@
DEPS=cl
endif
-DEPS += libigl eigen
+DEPS += libigl
SUBDIRS=c_src intl_tools src e3d plugins_src icons
#
@@ -106,35 +106,38 @@
# External Dependencies
#
-CL_REPO = https://github.com/tonyrog/cl.git
-IGL_REPO = https://github.com/dgud/libigl.git
-EIGEN_REPO = https://github.com/eigenteam/eigen-git-mirror.git
+# do not try to pull stuff during build
+# CL_REPO = https://github.com/tonyrog/cl.git
+# IGL_REPO = https://github.com/dgud/libigl.git
+# EIGEN_REPO = https://github.com/eigenteam/eigen-git-mirror.git
-CL_VER=cl-1.2.4
-IGL_VER=master
-EIGEN_VER=3.3.7
+# CL_VER=cl-1.2.4
+# IGL_VER=master
+# EIGEN_VER=3.3.7
# see libigl/cmake/LibiglDownloadExternal.cmake for eigen version
GIT_FLAGS = -c advice.detachedHead=false clone --depth 1
.PHONY: cl igl eigen
+# use erlang-cl from ports
# cl (erl wrapper library) not in path try to download and build it
-cl: _deps/cl
- @(cd _deps/cl; rebar3 compile > ../build_log 2>&1 && rm ../build_log) \
- || echo ***Warning*** OpenCL not useable >> _deps/build_log
+# cl: _deps/cl
+# @(cd _deps/cl; rebar3 compile > ../build_log 2>&1 && rm ../build_log) \
+# || echo ***Warning*** OpenCL not useable >> _deps/build_log
+#
+# _deps/cl:
+# git $(GIT_FLAGS) -b $(CL_VER) $(CL_REPO) _deps/cl
-_deps/cl:
- git $(GIT_FLAGS) -b $(CL_VER) $(CL_REPO) _deps/cl
-
# libigl have many useful function
libigl: _deps/libigl
_deps/libigl:
git $(GIT_FLAGS) -b $(IGL_VER) $(IGL_REPO) _deps/libigl
+# use eigen3 from ports
# eigen needed by libigl
-eigen: _deps/eigen
-
-_deps/eigen:
- git $(GIT_FLAGS) -b $(EIGEN_VER) $(EIGEN_REPO) _deps/eigen
+# eigen: _deps/eigen
+#
+# _deps/eigen:
+# git $(GIT_FLAGS) -b $(EIGEN_VER) $(EIGEN_REPO) _deps/eigen

View File

@ -0,0 +1,11 @@
--- c_src/Makefile.orig 2021-10-01 21:40:32.270930000 +0200
+++ c_src/Makefile 2021-10-01 21:41:13.958044000 +0200
@@ -86,7 +86,7 @@
GCC = $(DEF_CC)
endif
-IGL_INCLUDE = -I../_deps/eigen -I../_deps/libigl/include
+IGL_INCLUDE = $(shell pkg-config --cflags eigen3) -I../_deps/libigl/include
# libigl only supports 64bits systems
ifeq (x"${WORDSIZE}",x"64")

View File

@ -0,0 +1,11 @@
--- src/wings_view_win.erl.orig 2021-10-01 22:46:16.450805000 +0200
+++ src/wings_view_win.erl 2021-10-01 22:46:38.699204000 +0200
@@ -253,6 +253,8 @@
case os:type() of
{_, linux} ->
ignore;
+ {_, freebsd} ->
+ ignore;
_ ->
Children = [wxStaticBoxSizer:getStaticBox(LightSz), wxStaticBoxSizer:getStaticBox(CameraSz)
| wxWindow:getChildren(Panel)],

File diff suppressed because it is too large Load Diff