%global bashcompdir %(pkg-config --variable=completionsdir bash-completion 2>/dev/null) %global bashcomproot %(dirname %{bashcompdir} 2>/dev/null) %global atlas_version 0.6.2 %global asyncftpclient_commit 0350c36d9545040f1038258d7a815493a6103de0 Name: nim Version: 2.2.6 Release: 3%{?dist} Summary: Statically typed, imperative programming language # compiler is MIT, nimble package manager is BSD License: MIT and BSD URL: https://nim-lang.org ExcludeArch: s390x Source0: https://nim-lang.org/download/%{name}-%{version}.tar.xz # https://github.com/nim-lang/Nim/blob/v2.0.0/tools/kochdocs.nim#L344 # "asyncftpclient", "punycode", "smtp", "db_connector", "checksums", "atlas", "htmlparser" Source1: https://github.com/nim-lang/atlas/archive/master/atlas-master.tar.gz Source2: https://github.com/nim-lang/sat/archive/master/sat-master.tar.gz Source3: https://github.com/nim-lang/asyncftpclient/archive/master/asyncftpclient-master.tar.gz Source4: https://github.com/nim-lang/punycode/archive/devel/punycode-devel.tar.gz Source5: https://github.com/nim-lang/smtp/archive/master/smtp-master.tar.gz Source6: https://github.com/nim-lang/db_connector/archive/devel/db_connector-devel.tar.gz Source7: https://github.com/nim-lang/checksums/archive/master/checksums-master.tar.gz Source8: https://github.com/nim-lang/htmlparser/archive/master/htmlparser-master.tar.gz # Default gcc options in nim.conf include hardened specs Requires: redhat-rpm-config # Currently compiler uses C sources as intermediate representation Requires: gcc #BuildRequires: nim-srpm-macros BuildRequires: gcc BuildRequires: openssl-devel BuildRequires: pkgconfig(bash-completion) BuildRequires: pcre # building doc BuildRequires: gcc-c++ # https://fedoraproject.org/wiki/Changes/NodejsAlternativesSystem BuildRequires: nodejs BuildRequires: /usr/bin/node BuildRequires: git # test dependencies BuildRequires: gc-devel %if ! (0%{?rhel} && 0%{?rhel} <= 7) Recommends: %{name}-tools%{_isa} = %{version}-%{release} # for using --gc:boehm Suggests: gc-devel Suggests: %{name}-docs = %{version}-%{release} %endif %description Nim is a compiled, garbage-collected systems programming language with a design that focuses on efficiency, expressiveness, and elegance (in that order of priority). %package tools Summary: Tools for Nim programming language %description tools Nim is a compiled, garbage-collected systems programming language with a design that focuses on efficiency, expressiveness, and elegance (in that order of priority). This package provides various tools, which help Nim programmers. %package doc Summary: Documentation for Nim programming language BuildArch: noarch %description doc Nim is a compiled, garbage-collected systems programming language with a design that focuses on efficiency, expressiveness, and elegance (in that order of priority). This package provides documentation and reference manual for the language and its standard library. %prep %setup -q -n %{name}-%{version} -a0 -a1 -a2 -a3 -a4 -a5 -a6 -a7 -a8 cp -r atlas-master dist/atlas mkdir -p dist/atlas/dist mv -v sat-master dist/atlas/dist/sat mkdir -p pkgs mv -v asyncftpclient-master pkgs/asyncftpclient mv -v punycode-devel pkgs/punycode mv -v smtp-master pkgs/smtp mv -v db_connector-devel pkgs/db_connector mv -v checksums-master pkgs/checksums mv -v atlas-master pkgs/atlas mv -v htmlparser-master pkgs/htmlparser sed -i -e 's/-O3/-O2/g' -e 's/-Os/-O2/g' \ config/nim.cfg \ compiler/extccomp.nim for file in {compiler,config}/nim.cfg; do \ echo "gcc.options.always %= \"\${gcc.options.always} ${CFLAGS:-%optflags}\"" >> $file echo "gcc.options.linker %= \"\${gcc.options.linker} ${LDFLAGS:-%__global_ldflags}\"" >> $file done cat {compiler,config}/nim.cfg %build # build bootstrap compiler ./build.sh # build the koch management tool ./bin/nim compile --parallelBuild=%{_smp_build_ncpus} -d:release koch # build a new version of the compiler ./koch boot --parallelBuild=%{_smp_build_ncpus} -d:release # build tools ./koch tools --parallelBuild=%{_smp_build_ncpus} -d:release # generate documentation # use --docCmd:skip to skip runnable examples because some require network access ./koch --localdocs doc -d:release --docCmd:skip sed -i '/