From 3e55a5a91c17b4700b3e8d04758491f338481872 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 | 35 ++++++++++++++++++++++++++ srcpkgs/erlang-cl/template | 31 +++++++++++++++++++++++ 2 files changed, 66 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..71cf1747af17f --- /dev/null +++ b/srcpkgs/erlang-cl/patches/cflags.patch @@ -0,0 +1,35 @@ +diff --git a/c_src/Makefile b/c_src/Makefile +index 224fd5f..f80b2e8 100644 +--- a/c_src/Makefile ++++ b/c_src/Makefile +@@ -50,13 +50,28 @@ WORDSIZE = $(shell $(ERL) -noshell -eval "io:format([126,119,126,110],[erlang:sy + + ifeq ($(OSNAME)$(WSLcross), Linux) + LINUX = Yes ++SET_M32_OR_M64 = No + CFLAGS += -I/usr/include/nvidia-current + CFLAGS += -I/opt/AMDAPP/include ++CFLAGS += -O3 -fPIC ++ifeq ($(MACHINE), x86_64) ++ SET_M32_OR_M64 = Yes ++else ++ifeq ($(MACHINE), i386) ++ SET_M32_OR_M64 = Yes ++else ++ifeq ($(MACHINE), i686) ++ SET_M32_OR_M64 = Yes ++endif ++endif ++endif ++ifeq ($(SET_M32_OR_M64), Yes) + ifeq ($(WORDSIZE), 32) +-CFLAGS += -O3 -fPIC -m32 ++CFLAGS += -m32 + endif + ifeq ($(WORDSIZE), 64) +-CFLAGS += -O3 -fPIC -m64 ++CFLAGS += -m64 ++endif + 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 +}