# FIXME: could be removed once nim-srpm-macros will be installed automatically %global nim_arches %{ix86} x86_64 %{arm} aarch64 %{power64} %define __nim_common_opts -d:release --debugger:gdb %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) Name: nim Version: 0.17.2 Release: 1%{?dist} Summary: Statically typed, imperative programming language # compiler is MIT, nimble package manager is BSD License: MIT and BSD URL: https://nim-lang.org ExclusiveArch: %{nim_arches} Source0: https://nim-lang.org/download/%{name}-%{version}.tar.xz Source1: nim.1 Source2: nimgrep.1 Source3: nimble.1 Source4: nimsuggest.1 Patch0: 0001-allow-to-override-directories-in-install-script.patch Patch1: 0002-use-_datadir-for-platform-independent-library-path.patch # https://github.com/nim-lang/Nim/pull/6702 Patch3: 0003-fix-tasyncsend4757-test.patch # https://github.com/nim-lang/Nim/pull/6713 and https://github.com/nim-lang/Nim/pull/6751 Patch4: 0004-fix-arch-detection.patch # https://github.com/nim-lang/Nim/pull/6715 Patch5: 0005-fix-tnewasyncudp-endianness.patch Patch6: 0006-use-versioned-source-links-in-docs.patch # https://github.com/nim-lang/Nim/issues/6747 Patch7: 0007-fix-floats-in-tests.patch BuildRequires: nim-srpm-macros BuildRequires: gcc openssl-devel BuildRequires: pkgconfig(bash-completion) # test dependencies BuildRequires: nodejs-devel %if ! (0%{?rhel} && 0%{?rhel} <= 7) Recommends: %{name}-tools%{_isa} = %{version}-%{release} Suggests: %{name}-docs = %{version}-%{release} %endif %description Nim (formerly known as "Nimrod") is a compiled, garbage-collected systems programming language which has an excellent productivity/performance ratio. Nim's design focuses on efficiency, expressiveness, elegance (in the order of priority). %package tools Summary: Tools for Nim programming language %description tools Nim (formerly known as "Nimrod") is a compiled, garbage-collected systems programming language which has an excellent productivity/performance ratio. Nim's design focuses on efficiency, expressiveness, elegance (in the 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 (formerly known as "Nimrod") is a compiled, garbage-collected systems programming language which has an excellent productivity/performance ratio. Nim's design focuses on efficiency, expressiveness, elegance (in the order of priority). This package provides documentation and reference manual for the language and its standard library. %prep %autosetup -p1 %build # build bootstrap compiler %make_build %__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 web --onlyDocs rm -rf examples install.sh lib/pure/unidecode/gen.py # generate installer script ./koch geninstall %{__nim_common_opts} %install sh install.sh \ %{buildroot}%{_bindir} \ %{buildroot}%{_sysconfdir} \ %{buildroot}%{_datadir} \ %{buildroot}%{_docdir} \ %{buildroot}%{_datadir} install -Dp -m755 bin/nim{ble,grep,suggest} %{buildroot}%{_bindir} install -Dp -m644 tools/nim.bash-completion %{buildroot}%{bashcompdir}/nim install -Dp -m644 dist/nimble/nimble.bash-completion %{buildroot}%{bashcompdir}/nimble install -Dp -m644 -t%{buildroot}%{_mandir}/man1 %SOURCE1 %SOURCE2 %SOURCE3 %SOURCE4 mkdir -p %{buildroot}%{_docdir}/%{name}/html cp -a doc/html/*.html %{buildroot}%{_docdir}/%{name}/html/ cp tools/dochack/nimcache/dochack.js %{buildroot}%{_docdir}/%{name}/ ln -sr %{buildroot}%{_docdir}/%{name}/html/{overview,index}.html %check for cat in lib io async rodfiles js debugger do ./koch tests --pedantic category $cat -d:nimCoroutines || (echo "$cat test category failed" && exit 1) done %files %license copying.txt dist/nimble/license.txt %doc readme.txt %config(noreplace) %{_sysconfdir}/*.cfg %{_datadir}/nim/ %{_datadir}/nimble/ %{_bindir}/nim{,ble} %{_mandir}/man1/nim{,ble}.1* %{bashcompdir}/nim* %files tools %license copying.txt %{_bindir}/nim{grep,suggest} %{_mandir}/man1/nim{grep,suggest}.1* %files doc %doc %{_docdir}/nim %changelog * Tue Sep 26 2017 Sergey Avseyev - 0.17.2-1 - Initial package