From 2dd03b6554f79008b91e220e1cbeaf2ce01be11b Mon Sep 17 00:00:00 2001 From: Karchnu Date: Fri, 23 Apr 2021 02:33:07 +0200 Subject: [PATCH] Add crystal recipe --- recipes/crystal/Makefile | 46 ++++++++++++++++++++++++++++++++++++++++ recipes/crystal/README | 1 + 2 files changed, 47 insertions(+) create mode 100644 recipes/crystal/Makefile create mode 100644 recipes/crystal/README diff --git a/recipes/crystal/Makefile b/recipes/crystal/Makefile new file mode 100644 index 0000000..5399258 --- /dev/null +++ b/recipes/crystal/Makefile @@ -0,0 +1,46 @@ +name = crystal +version = 1.0.0 +release = 0 +URL = https://github.com/crystal-lang/crystal/archive/$(version).tar.gz + +build-dependencies = llvm-10-dev +dependencies = libyaml libevent pcre llvm-10 libressl + +SYSCONF ?= ../../ +include $(SYSCONF)/package.mk + +build_custom: + cd $(bdir) ; \ + make release=1 \ + FLAGS="--release --no-debug" \ + CRYSTAL_PATH="$(pwd)/src" \ + CRYSTAL_CONFIG_VERSION="$(version)" \ + CRYSTAL_CONFIG_PATH="lib:$(PREFIX)/lib/crystal" \ + CRYSTAL_CACHE_DIR="/tmp/crystal" \ + LLVM_CONFIG=$(PREFIX)/bin/llvm-config ; \ + make docs CRYSTAL_CACHE_DIR="$(TMP)/crystal" + +fake_root_install_custom: + @mkdir -p "$(pkg_fake_root_dir)/$(PREFIX)/bin" + @mkdir -p "$(pkg_fake_root_dir)/$(PREFIX)/lib" + @mkdir -p "$(pkg_fake_root_dir)/$(PREFIX)/share/man/man1" + + $(Q)install -m755 "$(bdir)/.build/crystal" "$(pkg_fake_root_dir)/$(PREFIX)/bin/crystal" + + $(Q)cp -r $(bdir)/src "$(pkg_fake_root_dir)/$(PREFIX)/lib/crystal" + + $(Q)rm -rf $(pkg_fake_root_dir)/$(PREFIX)/lib/crystal/ext/sigfault.* + $(Q)rm -rf $(pkg_fake_root_dir)/$(PREFIX)/lib/crystal/llvm/ext/llvm_ext.o + + $(Q)mkdir -p "$(pkg_fake_root_dir)/$(PREFIX)/share/doc/crystal" + $(Q)cp -r $(bdir)/docs "$(pkg_fake_root_dir)/$(PREFIX)/share/doc/crystal/api" + $(Q)cp -r $(bdir)/samples "$(pkg_fake_root_dir)/$(PREFIX)/share/doc/crystal/" + + $(Q)install -m644 $(bdir)/man/crystal.1 "$(pkg_fake_root_dir)/$(PREFIX)/share/man/man1/" + + @# We’ll probably want those at some point… in due time, and in splits. + @#install -m644 etc/completion.bash "$(pkg_fake_root_dir)/$(PREFIX)/share/bash-completion/completions/crystal" + @#install -m644 etc/completion.zsh "$(pkg_fake_root_dir)/$(PREFIX)/share/zsh/site-functions/_crystal" + +create_custom: build-env configure build_custom fake_root_install_custom packages clean_working_dir +all: create_custom diff --git a/recipes/crystal/README b/recipes/crystal/README new file mode 100644 index 0000000..50cf1d4 --- /dev/null +++ b/recipes/crystal/README @@ -0,0 +1 @@ +Build is working, but the LLVM parameter needs to be fixed.