mirror of
https://github.com/yann64/haikuports.git
synced 2026-05-06 15:08:57 +02:00
nim: update to 2.2.0 (#11750)
This commit is contained in:
148
dev-lang/nim/nim-2.2.0.recipe
Normal file
148
dev-lang/nim/nim-2.2.0.recipe
Normal file
@@ -0,0 +1,148 @@
|
||||
SUMMARY="An imperative, multi-paradigm, compiled programming language"
|
||||
DESCRIPTION="Nim is a systems and applications programming language. \
|
||||
Statically typed and compiled, it provides unparalleled performance in an \
|
||||
elegant package.
|
||||
|
||||
Features:
|
||||
* High-performance garbage-collected language
|
||||
* Compiles to C, C++ or JavaScript
|
||||
* Produces dependency-free binaries
|
||||
* Runs on Windows, macOS, Linux, and more"
|
||||
HOMEPAGE="https://nim-lang.org/"
|
||||
COPYRIGHT="2006-2024 Andreas Rumpf
|
||||
2017-2024 Nim contributors"
|
||||
LICENSE="MIT"
|
||||
REVISION="1"
|
||||
SOURCE_URI="https://nim-lang.org/download/nim-$portVersion.tar.xz"
|
||||
SOURCE_DIR="nim-$portVersion"
|
||||
CHECKSUM_SHA256="ce9842849c9760e487ecdd1cdadf7c0f2844cafae605401c7c72ae257644893c"
|
||||
ADDITIONAL_FILES="
|
||||
config.nims
|
||||
nim.rdef.in
|
||||
"
|
||||
|
||||
ARCHITECTURES="all !x86_gcc2 ?x86"
|
||||
if [ "$targetArchitecture" = "x86_gcc2" ]; then
|
||||
# There is no point in having secondaryArch package except for gcc2.
|
||||
# The compiler can already target different architectures effortlessly.
|
||||
SECONDARY_ARCHITECTURES="x86"
|
||||
fi
|
||||
|
||||
GLOBAL_WRITABLE_FILES="
|
||||
settings/nim directory auto-merge
|
||||
settings/nim/config.nims auto-merge
|
||||
settings/nim/nim.cfg auto-merge
|
||||
settings/nim/nimdoc.cfg auto-merge
|
||||
settings/nim/nimdoc.tex.cfg auto-merge
|
||||
"
|
||||
USER_SETTINGS_FILES="
|
||||
settings/nim directory
|
||||
settings/nim/config.nims
|
||||
settings/nim/nim.cfg
|
||||
settings/nim/nimdoc.cfg
|
||||
settings/nim/nimdoc.tex.cfg
|
||||
"
|
||||
|
||||
PROVIDES="
|
||||
nim$secondaryArchSuffix = $portVersion
|
||||
cmd:nim$secondaryArchSuffix = $portVersion
|
||||
cmd:nimble$secondaryArchSuffix = $portVersion
|
||||
cmd:nimgrep$secondaryArchSuffix = $portVersion
|
||||
cmd:nimpretty$secondaryArchSuffix = $portVersion
|
||||
cmd:nimsuggest$secondaryArchSuffix = $portVersion
|
||||
lib:libnimrtl$secondaryArchSuffix = $portVersion
|
||||
"
|
||||
REQUIRES="
|
||||
haiku$secondaryArchSuffix
|
||||
"
|
||||
|
||||
PROVIDES_doc="
|
||||
nim_doc = $portVersion
|
||||
"
|
||||
|
||||
# git and NodeJS are for js docs
|
||||
BUILD_REQUIRES="
|
||||
haiku${secondaryArchSuffix}_devel
|
||||
devel:libpcre$secondaryArchSuffix >= 1
|
||||
cmd:git
|
||||
cmd:node >= 16
|
||||
"
|
||||
BUILD_PREREQUIRES="
|
||||
cmd:gcc$secondaryArchSuffix
|
||||
cmd:make
|
||||
"
|
||||
|
||||
TEST_REQUIRES="
|
||||
lib:libcrypto$secondaryArchSuffix
|
||||
lib:libgc$secondaryArchSuffix
|
||||
cmd:node >= 16
|
||||
"
|
||||
|
||||
BUILD()
|
||||
{
|
||||
export XDG_CACHE_HOME="$sourceDir/cache"
|
||||
sh build.sh
|
||||
bin/nim c koch
|
||||
./koch boot -d:release
|
||||
(cd lib && ../bin/nim c --app:lib -d:createNimRtl -d:release nimrtl.nim)
|
||||
./koch tools
|
||||
|
||||
# Docs
|
||||
./koch docs
|
||||
}
|
||||
|
||||
INSTALL()
|
||||
{
|
||||
install -d -m 755 "$binDir" "$docDir" "$libDir" "$settingsDir" \
|
||||
"$developDocDir"
|
||||
./koch install "$libDir"
|
||||
|
||||
cp -a dist "$libDir/nim/"
|
||||
install -m 755 lib/libnimrtl.so "$libDir/libnimrtl.so"
|
||||
|
||||
install -t "$libDir/nim/bin" -m 755 bin/{nimsuggest,nimgrep,nimpretty,nimble}
|
||||
ln -st "$binDir" "$libDir/nim/bin"/*
|
||||
|
||||
mv "$libDir/nim/config" "$settingsDir/nim"
|
||||
ln -s "$sysconfDir/nim" "$libDir/nim/config"
|
||||
|
||||
mv -T "$libDir/nim/doc" "$docDir"
|
||||
|
||||
### disable the compilerPkgDir for now since it breaks nimble
|
||||
#complierPkgDir="$dataDir/nimble/pkgs/compiler-$portVersion"
|
||||
#install -d -m 755 "$complierPkgDir"
|
||||
#mv -t "$complierPkgDir" "$libDir/nim"/compiler
|
||||
# Apparantly you need some files in docDir for the compiler sources to work
|
||||
#ln -s "$docDir" "$complierPkgDir/doc"
|
||||
|
||||
install -t "$settingsDir/nim" -m 644 "$portDir/additional-files/config.nims"
|
||||
# Completions
|
||||
install -d -m 755 "$dataDir/bash-completion/completions" \
|
||||
"$dataDir/zsh/site-functions"
|
||||
install -m 644 tools/nim.bash-completion \
|
||||
"$dataDir/bash-completion/completions/nim"
|
||||
install -m 644 tools/nim.zsh-completion \
|
||||
"$dataDir/zsh/site-functions/_nim"
|
||||
|
||||
rm -rf "$docDir/html"
|
||||
install -t "$developDocDir" -m 644 doc/html/*.html doc/html/*.js
|
||||
|
||||
# Add Haiku resources
|
||||
local MAJOR="$(echo ${portVersion%%_*} | cut -d. -f1)"
|
||||
local MIDDLE="$(echo ${portVersion%%_*} | cut -d. -f2)"
|
||||
local MINOR="$(echo ${portVersion%%_*} | cut -d. -f3)"
|
||||
sed \
|
||||
-e "s|@MAJOR@|$MAJOR|" \
|
||||
-e "s|@MIDDLE@|$MIDDLE|" \
|
||||
-e "s|@MINOR@|$MINOR|" \
|
||||
"$portDir/additional-files/nim.rdef.in" > nim.rdef
|
||||
|
||||
addResourcesToBinaries nim.rdef "$libDir/nim/bin/nim"
|
||||
|
||||
packageEntries doc "$developDir"
|
||||
}
|
||||
|
||||
TEST()
|
||||
{
|
||||
PATH="$sourceDir/bin:$PATH" ./koch tests --targets:"c c++" all
|
||||
}
|
||||
Reference in New Issue
Block a user