# figure out why --debugger:native does not work with *-debuginfo packets %define __nim_common_opts -d:release %define __nim_harden_config() \ for file in %*; do \ echo "gcc.options.always %= \\"\\${gcc.options.always} ${CFLAGS:-%optflags}\\"" >> $file; \ echo "gcc.options.linker %= \\"\\${gcc.options.linker} ${LDFLAGS:-%__global_ldflags}\\"" >> $file; \ done %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 #Source1: https://github.com/nim-lang/atlas/archive/%{atlas_version}/atlas-%{atlas_version}.tar.gz # https://github.com/nim-lang/Nim/blob/v2.0.0/tools/kochdocs.nim#L344 # "asyncftpclient", "punycode", "smtp", "db_connector", "checksums", "atlas" Source2: https://github.com/nim-lang/asyncftpclient/archive/master/asyncftpclient-master.tar.gz Source3: https://github.com/nim-lang/punycode/archive/devel/punycode-devel.tar.gz Source4: https://github.com/nim-lang/smtp/archive/master/smtp-master.tar.gz Source5: https://github.com/nim-lang/db_connector/archive/devel/db_connector-devel.tar.gz Source6: https://github.com/nim-lang/checksums/archive/master/checksums-master.tar.gz Source7: https://github.com/nim-lang/atlas/archive/master/atlas-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 openssl-devel BuildRequires: pkgconfig(bash-completion) # 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 -a2 -a3 -a4 -a5 -a6 -a7 #mv -v atlas-%{atlas_version} dist/atlas 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 %build # build bootstrap compiler ./build.sh %__nim_harden_config compiler/nim.cfg %__nim_harden_config config/nim.cfg # build the koch management tool ./bin/nim compile %{__nim_common_opts} koch # build a new version of the compiler ./koch boot %{__nim_common_opts} -d:useLinenoise # build tools ./koch tools %{__nim_common_opts} # generate documentation ./koch docs sed -i '/