From b36effa197d3f86d5a4f77c417d64660281fb942 Mon Sep 17 00:00:00 2001 From: Mihail Ivanchev Date: Fri, 29 Dec 2023 13:21:10 +0100 Subject: [PATCH] New package: wings-2.3 --- srcpkgs/erlang-cl/patches/cflags.patch | 26 ++++++++++++++ srcpkgs/erlang-cl/template | 31 ++++++++++++++++ srcpkgs/wings/files/wings | 8 +++++ srcpkgs/wings/files/wings.desktop | 9 +++++ srcpkgs/wings/files/wings.rc | 15 ++++++++ srcpkgs/wings/patches/triple_quotes.patch | 15 ++++++++ srcpkgs/wings/template | 44 +++++++++++++++++++++++ 7 files changed, 148 insertions(+) create mode 100644 srcpkgs/erlang-cl/patches/cflags.patch create mode 100644 srcpkgs/erlang-cl/template create mode 100755 srcpkgs/wings/files/wings create mode 100644 srcpkgs/wings/files/wings.desktop create mode 100644 srcpkgs/wings/files/wings.rc create mode 100644 srcpkgs/wings/patches/triple_quotes.patch create mode 100644 srcpkgs/wings/template diff --git a/srcpkgs/erlang-cl/patches/cflags.patch b/srcpkgs/erlang-cl/patches/cflags.patch new file mode 100644 index 0000000000000..4d3b914487258 --- /dev/null +++ b/srcpkgs/erlang-cl/patches/cflags.patch @@ -0,0 +1,26 @@ +diff --git a/c_src/Makefile b/c_src/Makefile +index 224fd5f..379fa98 100644 +--- a/c_src/Makefile ++++ b/c_src/Makefile +@@ -52,11 +52,17 @@ ifeq ($(OSNAME)$(WSLcross), Linux) + LINUX = Yes + CFLAGS += -I/usr/include/nvidia-current + CFLAGS += -I/opt/AMDAPP/include +-ifeq ($(WORDSIZE), 32) +-CFLAGS += -O3 -fPIC -m32 ++CFLAGS += -O3 -fPIC ++ifeq (x86_64, $(findstring x86_64,$(XBPS_TARGET_MACHINE))) ++CFLAGS += -m64 ++else ++ifeq (i386, $(findstring i386,$(XBPS_TARGET_MACHINE))) ++CFLAGS += -m32 ++else ++ifeq (i686, $(findstring i686,$(XBPS_TARGET_MACHINE))) ++CFLAGS += -m32 ++endif + endif +-ifeq ($(WORDSIZE), 64) +-CFLAGS += -O3 -fPIC -m64 + endif + LD_SHARED := $(CC) -shared + LDFLAGS += -lOpenCL diff --git a/srcpkgs/erlang-cl/template b/srcpkgs/erlang-cl/template new file mode 100644 index 0000000000000..2de5a62c77481 --- /dev/null +++ b/srcpkgs/erlang-cl/template @@ -0,0 +1,31 @@ +# Template file for 'erlang-cl' +pkgname=erlang-cl +version=1.2.4 +revision=1 +hostmakedepends="git rebar3" +makedepends="ocl-icd-devel" +depends="erlang" +short_desc="Erlang OpenCL bindings" +maintainer="Mihail Ivanchev " +license="MIT" +homepage="https://github.com/tonyrog/cl" +distfiles="https://github.com/tonyrog/cl/archive/refs/tags/cl-${version}.tar.gz" +checksum=577b8788029148f93217d00a1bbdc500db68ee77b2246bbd892269b5bb98c41a + +do_build() { + rebar3 compile +} + +do_install() { + vmkdir usr/lib/erlang/lib/cl-${version} + vmkdir usr/lib/erlang/lib/cl-${version}/ebin + vmkdir usr/lib/erlang/lib/cl-${version}/include + vmkdir usr/lib/erlang/lib/cl-${version}/priv + vmkdir usr/share/doc/${pkgname} + vmkdir usr/share/doc/${pkgname}/examples + vcopy ebin/* usr/lib/erlang/lib/cl-${version}/ebin + vinstall include/cl.hrl 644 usr/lib/erlang/lib/cl-${version}/include + vinstall priv/cl_nif.so 644 usr/lib/erlang/lib/cl-${version}/priv + vcopy examples/* usr/share/doc/${pkgname}/examples + vlicense COPYRIGHT +} diff --git a/srcpkgs/wings/files/wings b/srcpkgs/wings/files/wings new file mode 100755 index 0000000000000..c79885bb5cd86 --- /dev/null +++ b/srcpkgs/wings/files/wings @@ -0,0 +1,8 @@ +#!/bin/sh + +if [ -f /etc/wings.rc ]; then + . /etc/wings.rc +fi + +exec /usr/bin/erl -pa /opt/wings/ebin -noinput -s wings_start start_halt {1+"$@"} + diff --git a/srcpkgs/wings/files/wings.desktop b/srcpkgs/wings/files/wings.desktop new file mode 100644 index 0000000000000..e10099de15214 --- /dev/null +++ b/srcpkgs/wings/files/wings.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Name=Wings 3D +Comment=A subdivision polygon modeler +Exec=/usr/bin/wings -detached +Terminal=false +Type=Application +Icon=wings +Categories=Graphics;3DGraphics; +StartupNotify=false diff --git a/srcpkgs/wings/files/wings.rc b/srcpkgs/wings/files/wings.rc new file mode 100644 index 0000000000000..eb0048179f855 --- /dev/null +++ b/srcpkgs/wings/files/wings.rc @@ -0,0 +1,15 @@ +# wings uses the wxGLCanvas component of wxWidgets for the rendering but +# Wayland users are experiencing issues because wxGLCanvas' Wayland support +# is relatively new. That's why we request the X11 backend to be used. +# Feel free to comment out the following lines and give the Wayland support +# a try. +GDK_BACKEND=x11 +export GDK_BACKEND + +# uncomment this if you have problems with OpenGL (vertices are small, +# faces are invisible, ...). This is caused by buggy drivers, buggy +# graphics cards, etc. +# +# You usually want to leave this as-is: +# LIBGL_ALWAYS_INDIRECT=1 +# export LIBGL_ALWAYS_INDIRECT diff --git a/srcpkgs/wings/patches/triple_quotes.patch b/srcpkgs/wings/patches/triple_quotes.patch new file mode 100644 index 0000000000000..6b04793605b03 --- /dev/null +++ b/srcpkgs/wings/patches/triple_quotes.patch @@ -0,0 +1,15 @@ +diff --git a/plugins_src/import_export/wpc_yafaray.erl b/plugins_src/import_export/wpc_yafaray.erl +index e3ecb184..a36e79a2 100644 +--- a/plugins_src/import_export/wpc_yafaray.erl ++++ b/plugins_src/import_export/wpc_yafaray.erl +@@ -4008,8 +4008,8 @@ export_blend_mat_shader(F, Name, Mat, ExportDir, YafaRay) -> + + Blend_Value = proplists:get_value(blend_value, YafaRay, ?DEF_BLEND_VALUE), + +- uniprintln(F, " ~n" +- " ~n" ++ uniprintln(F, " ~n" ++ " ~n" + " ~n", + [Blend_Mat1,Blend_Mat2,Blend_Value]), + foldl(fun ({modulator,Ps}=M, N) when is_list(Ps) -> diff --git a/srcpkgs/wings/template b/srcpkgs/wings/template new file mode 100644 index 0000000000000..17357773be2b4 --- /dev/null +++ b/srcpkgs/wings/template @@ -0,0 +1,44 @@ +# Template file for 'wings' +pkgname=wings +version=2.3 +revision=1 +build_style=gnu-makefile +hostmakedepends="git" +makedepends="erlang-wx erlang-cl" +depends="desktop-file-utils hicolor-icon-theme" +short_desc="Advanced subdivision modeler that is both powerful and easy to use" +maintainer="Mihail Ivanchev " +license="TCL" +homepage="https://github.com/dgud/wings" +distfiles="https://github.com/dgud/wings/archive/refs/tags/v${version}.tar.gz" +checksum=d8d7751a898afa983b017fe9cd6bdc47dc430e0d86125da782344d4cf1be0f1d +nocross="requires erlang-wx which is unavaiable on cross-built platforms" +create_wrksrc=yes +build_wrksrc=wings + +post_extract() { + mv ${pkgname}-${version} ${build_wrksrc} +} + +pre_build() { +# find -iname "*.erl" -exec sed -i "{}" -e "s;\(-include_lib(.wings\)/;\1-${version}/;" \; +# find -iname "*.hrl" -exec sed -i "{}" -e "s;\(-include_lib(.wings\)/;\1-${version}/;" \; +# sed -i "s;\(ERL_FLAGS += -pa ../../wings\)/ebin;\1-${version}/;" icons/Makefile + CFLAGS+=" -fPIC" + CXXFLAGS+=" -fPIC" +} + +do_install() { + vmkdir opt/${pkgname} + vmkdir opt/${pkgname}{/ebin,/plugins,/shaders,/textures} + vcopy ebin/* opt/${pkgname}/ebin + vcopy plugins/* opt/${pkgname}/plugins + vcopy shaders/* opt/${pkgname}/shaders + vcopy textures/* opt/${pkgname}/textures + vlicense license.terms + vinstall ${FILESDIR}/wings.desktop 644 usr/share/applications + vinstall ebin/wings_icon_256x256.png 644 usr/share/icons/hicolor/256x256/apps wings.png + vinstall ebin/wings_icon_48x48.png 644 usr/share/icons/hicolor/48x48/apps wings.png + vbin ${FILESDIR}/wings + vinstall ${FILESDIR}/wings.rc 644 etc +}