From e8289c618c0ede3ef856f9fa6da8c1144b6ab887 Mon Sep 17 00:00:00 2001 From: Mihail Ivanchev Date: Fri, 29 Dec 2023 13:21:10 +0100 Subject: [PATCH] New package: erlang-cl-1.2.4 --- srcpkgs/erlang-cl/patches/cflags.patch | 26 +++++++++++++++++++++ srcpkgs/erlang-cl/template | 31 ++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 srcpkgs/erlang-cl/patches/cflags.patch create mode 100644 srcpkgs/erlang-cl/template diff --git a/srcpkgs/erlang-cl/patches/cflags.patch b/srcpkgs/erlang-cl/patches/cflags.patch new file mode 100644 index 0000000000000..6df8f7fca31cb --- /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..7a3f189 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..836ed776dc983 --- /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 ocl-icd" +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 +}