mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-22 19:50:05 +02:00
dev-lang/nim: add version 0.19.0
Based on #1461 Co-authored-by: Zoltán Mizsei <zmizsei@extrowerk.com>
This commit is contained in:
8
dev-lang/nim/additional-files/config.nims
Normal file
8
dev-lang/nim/additional-files/config.nims
Normal file
@@ -0,0 +1,8 @@
|
||||
import strutils
|
||||
|
||||
const
|
||||
nimblePkgDirs = staticExec "findpaths B_FIND_PATH_DATA_DIRECTORY nimble/pkgs"
|
||||
|
||||
when defined nimbabel:
|
||||
for d in nimblePkgDirs.splitLines:
|
||||
switch "NimblePath", d
|
||||
33
dev-lang/nim/additional-files/nim.rdef.in
Normal file
33
dev-lang/nim/additional-files/nim.rdef.in
Normal file
@@ -0,0 +1,33 @@
|
||||
|
||||
resource app_flags B_ARGV_ONLY;
|
||||
|
||||
resource app_version {
|
||||
major = @MAJOR@,
|
||||
middle = @MIDDLE@,
|
||||
minor = @MINOR@,
|
||||
|
||||
variety = B_APPV_FINAL,
|
||||
internal = 0,
|
||||
|
||||
short_info = "Nim programming language",
|
||||
long_info = "An imperative, multi-paradigm, compiled programming language"
|
||||
};
|
||||
|
||||
resource app_signature "application/x-vnd.nim-lang.org-nim";
|
||||
|
||||
resource vector_icon {
|
||||
$"6E6369660403FF04040304FF1503EFC7430500030614BFFABEEFABD05FC020D0"
|
||||
$"5FC020CF5BBCC0C3CFB9CCCA18B9CCBD66B9CCB740C020B844BCC0B740C020B6"
|
||||
$"09C12AB452BDDC20B849B544B93BB544B93BB5E2B89BB7E9B740B654B81EB7E9"
|
||||
$"B740B96CB422BBF8B61DBBF8B61DBDB0B5B5C15BB55CBF65B547C15BB55CC3CF"
|
||||
$"20C644B55CC644B55CC83AB547CBA6B61DC9EFB5B5CBA6B61DCE33B422CFB6B7"
|
||||
$"40CFB6B740D14BB81ED25BB93BD1BCB89BD25BB93BD49FB849D34CBDDCD195C1"
|
||||
$"2A060EAAAAFA0BD1C9C069D05FC008CDD249CA53C460C3CFC0B1BD4BC460B9CC"
|
||||
$"49B740C008B5D5C069B452BDC4B740C613B740C613B951CA62C3CF60BFB060C7"
|
||||
$"EE60D05FC613CE4DCA62D05FC613D34CBDC4060EAAAAFA0BD1C9C069D05FC008"
|
||||
$"CDD249CA53C460C3CFC0B1BD4BC460B9CC49B740C008B5D5C069B452BDC4B740"
|
||||
$"C613B740C613B951CA62C3CF60BFB060C7EE60D05FC613CE4DCA62D05FC613D3"
|
||||
$"4CBDC4030A020100023ED1640000000000003ED1644200004657120A03010102"
|
||||
$"3ED1640000000000003ED1644200004657120A030102123ED164000000000000"
|
||||
$"3ED1644200004657120117810004"
|
||||
};
|
||||
128
dev-lang/nim/nim-0.19.0.recipe
Normal file
128
dev-lang/nim/nim-0.19.0.recipe
Normal file
@@ -0,0 +1,128 @@
|
||||
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-2018 Andreas Rumpf
|
||||
2017-2018 Nim contributors"
|
||||
LICENSE="MIT"
|
||||
REVISION="1"
|
||||
SOURCE_URI="https://github.com/nim-lang/Nim/archive/v$portVersion/nim-$portVersion.tar.gz"
|
||||
CHECKSUM_SHA256="f6a0b1c7bc227db1f7b8efa3bde0c6f23903c9184beebc99ff0094378c28e1ee"
|
||||
SOURCE_DIR="Nim-$portVersion"
|
||||
SOURCE_URI_2="https://github.com/nim-lang/csources/archive/v$portVersion.tar.gz"
|
||||
CHECKSUM_SHA256_2="68042afae0b24915acac813b52b9ee0a303219e990d3bfa05ca57fb6bbc51578"
|
||||
SOURCE_FILENAME_2="nim-csources-$portVersion.tar.gz"
|
||||
ADDITIONAL_FILES="
|
||||
config.nims
|
||||
nim.rdef.in
|
||||
"
|
||||
|
||||
ARCHITECTURES="!x86_gcc2 ?x86 x86_64"
|
||||
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:nimgrep$secondaryArchSuffix = $portVersion
|
||||
cmd:nimpretty$secondaryArchSuffix = $portVersion
|
||||
cmd:nimsuggest$secondaryArchSuffix = $portVersion
|
||||
"
|
||||
REQUIRES="
|
||||
haiku$secondaryArchSuffix
|
||||
"
|
||||
|
||||
BUILD_REQUIRES="
|
||||
haiku${secondaryArchSuffix}_devel
|
||||
"
|
||||
BUILD_PREREQUIRES="
|
||||
cmd:gcc$secondaryArchSuffix
|
||||
"
|
||||
|
||||
TEST_REQUIRES="
|
||||
lib:libcrypto$secondaryArchSuffix
|
||||
lib:libgc$secondaryArchSuffix
|
||||
lib:libpcre$secondaryArchSuffix >= 1
|
||||
"
|
||||
|
||||
BUILD()
|
||||
{
|
||||
# Bootstrap
|
||||
mkdir -p csources
|
||||
cp -Trud "$sourceDir2/csources-$portVersion" csources
|
||||
cd csources
|
||||
./build.sh
|
||||
cd ..
|
||||
|
||||
# Build
|
||||
bin/nim c -d:release koch
|
||||
./koch boot -d:release
|
||||
|
||||
bin/nim c -d:release -o:bin/nimsuggest nimsuggest/nimsuggest.nim
|
||||
bin/nim c -d:release -o:bin/nimgrep tools/nimgrep.nim
|
||||
bin/nim c -d:release -o:bin/nimpretty nimpretty/nimpretty.nim
|
||||
}
|
||||
|
||||
INSTALL()
|
||||
{
|
||||
install -d -m 755 "$binDir" "$docDir" "$libDir" "$settingsDir"
|
||||
./koch install "$libDir"
|
||||
|
||||
install -t "$libDir/nim/bin" -m 755 bin/{nimsuggest,nimgrep,nimpretty}
|
||||
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"
|
||||
|
||||
complierPkgDir="$dataDir/nimble/pkgs/compiler-$portVersion"
|
||||
install -d -m 755 "$complierPkgDir"
|
||||
mv -t "$complierPkgDir" "$libDir/nim"/compiler{,.nimble}
|
||||
# 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"
|
||||
|
||||
# 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"
|
||||
}
|
||||
|
||||
TEST()
|
||||
{
|
||||
PATH="$sourceDir/bin:$PATH" ./koch tests --targets:"c c++" all
|
||||
}
|
||||
Reference in New Issue
Block a user