%bcond_with check %bcond_with docs # gcc: fatal error: environment variable 'RPM_ARCH' not defined %undefine _package_note_flags Name: nim Version: 1.6.12 Release: %autorelease Summary: A statically typed compiled systems programming language # compiler is MIT, nimble package manager is BSD License: MIT and BSD URL: https://nim-lang.org/ Source: https://nim-lang.org/download/nim-%{version}.tar.xz # https://github.com/nim-lang/Nim/pull/20943 Patch0: https://raw.githubusercontent.com/topazus/fedora-src/main/fix-s390x.patch Patch1: https://raw.githubusercontent.com/topazus/fedora-src/main/fix-install-location.patch BuildRequires: gcc-c++ make BuildRequires: openssl-devel BuildRequires: pcre BuildRequires: help2man # used for building docs and testing BuildRequires: nodejs # build pdf doc BuildRequires: texlive-xetex texlive-metafont dejavu-fonts-all BuildRequires: gnu-free-serif-fonts texlive-gofonts texlive-relsize BuildRequires: texlive-parskip texlive-dingbat texlive-fvextra BuildRequires: texlive-tcolorbox texlive-tikzfill texlive-ulem BuildRequires: texlive-tabulary texlive-pdfcol %if %{with check} BuildRequires: gc-devel BuildRequires: SFML-devel %endif %description Nim is a statically typed compiled systems programming language. It combines successful concepts from mature languages like Python, Ada and Modula. Its design 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. %if %{with docs} %package doc Summary: Documentation for Nim programming language %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. %endif %prep %autosetup -p1 %build 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 # build bootstrap compiler ./build.sh # build the koch management tool ./bin/nim compile -d:release koch # build a new version of the compiler ./koch boot -d:release # build tools ./koch tools -d:release # generate documentation %if %{with docs} #./koch docs -d:release ./koch pdf %endif rm lib/pure/unidecode/gen.py # regenerate installer script rm install.sh ./koch geninstall %install ./install.sh \ %{buildroot}%{_bindir} \ %{buildroot}%{_sysconfdir} \ %{buildroot}%{_libdir} \ %{buildroot}%{_docdir} \ %{buildroot}%{_datadir} \ %{buildroot}%{_datadir}/nimble/pkgs/compiler-%{version} mkdir -p %{buildroot}%{_bindir} install -Dp -m755 bin/nim{ble,grep,suggest,pretty} %{buildroot}%{_bindir} # completions install -Dp -m644 tools/nim.bash-completion %{buildroot}%{bash_completions_dir}/nim install -Dp -m644 tools/nim.zsh-completion %{buildroot}%{zsh_completions_dir}/_nim install -Dp -m644 dist/nimble/nimble.bash-completion %{buildroot}%{bash_completions_dir}/nimble install -Dp -m644 dist/nimble/nimble.zsh-completion %{buildroot}%{zsh_completions_dir}/_nimble %if %{with docs} mkdir -p %{buildroot}%{_docdir}/%{name} #cp -a doc/html %{buildroot}%{_docdir}/%{name} #cp tools/dochack/dochack.js %{buildroot}%{_docdir}/%{name} cp doc/pdf/*.pdf %{buildroot}%{_docdir}/%{name} %endif # https://github.com/nim-lang/Nim/issues/7401 mkdir -p %{buildroot}%{_mandir}/man1 for manpage in nim nimble nimgrep nimpretty nimsuggest; do help2man bin/$manpage -o %{buildroot}%{_mandir}/man1/$manpage.1 gzip %{buildroot}%{_mandir}/man1/$manpage.1 done %if %{with check} %check cat << EOT >> tests_to_skip EOT ./koch tests \ --nim:$PWD/bin/nim \ --failing \ --targets:"c cpp js objc" --skipFrom:tests_to_skip \ all %endif %files %license copying.txt dist/nimble/license.txt %doc doc/readme.txt %dir %{_sysconfdir}/nim %config(noreplace) %{_sysconfdir}/nim/* %{_bindir}/nim{,ble} %{_libdir}/nim/ %{_datadir}/nimble/ %{_mandir}/man1/nim{,ble}.1* %{bash_completions_dir}/nim* %{zsh_completions_dir}/_nim* %files tools %license copying.txt %{_bindir}/nim{grep,suggest,pretty} %{_mandir}/man1/nim{grep,pretty,suggest}.1* %if %{with docs} %files doc %doc %{_docdir}/nim %endif %changelog %autochangelog