[packages/nim] - new, based Arch and Alpine - 0.1 (it downloads sources by git, no rpmpldcflags, etc.)
witekfl
witekfl at pld-linux.org
Sat Apr 25 16:11:02 CEST 2026
commit dbf62b8516913873d15e62a7cabe890ae8d8dee0
Author: Witold Filipczyk <witekfl at poczta.onet.pl>
Date: Sat Apr 25 16:08:32 2026 +0200
- new, based Arch and Alpine
- 0.1 (it downloads sources by git, no rpmpldcflags, etc.)
build-docs.patch | 9 ++++
nim-config-fix-paths.patch | 18 +++++++
nim.spec | 115 +++++++++++++++++++++++++++++++++++++++++++++
niminst-fix-paths.patch | 21 +++++++++
4 files changed, 163 insertions(+)
---
diff --git a/nim.spec b/nim.spec
new file mode 100644
index 0000000..6133128
--- /dev/null
+++ b/nim.spec
@@ -0,0 +1,115 @@
+#
+# Conditional build:
+%bcond_with tests # tests
+#
+Summary: Nim lang
+Name: nim
+Version: 2.2.10
+Release: 0.1
+License: MIT
+Group: Development/Languages
+Source0: https://github.com/nim-lang/Nim/archive/v%{version}/%{name}-%{version}.tar.gz
+# Source0-md5: 5e8841b25db15574a305711d56a0f979
+Patch0: %{name}-config-fix-paths.patch
+Patch1: %{name}inst-fix-paths.patch
+Patch2: build-docs.patch
+URL: https://nim-lang.org/
+BuildRequires: help2man
+BuildRequires: nodejs
+BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+Nim lang.
+
+%prep
+%setup -q -n Nim-%{version}
+%patch -P0 -p1
+%patch -P1 -p1
+%patch -P2 -p1
+
+%build
+CC="%{__cc}" ./build_all.sh
+#./bin/nim compile -d:release -d:nimUse64BitCTime koch
+#./koch boot -d:release -d:nimUse64BitCTime
+#./koch toolsNoExternal -d:release -d:nimUse64BitCTime
+#./bin/nim compile -d:release -d:nimUse64BitCTime tools/niminst/niminst.nim
+
+%{?with_tests:./koch tests --pedantic --targets="c js" all || true}
+
+# generate man pages
+local h2m_args="--section=1 --no-info --version-string=\"%{version}\""
+help2man --name='Nim Language Compiler' "${h2m_args}" -o nim.1 ./bin/nim
+help2man --name='Nimsuggest' "${h2m_args}" -o nimsuggest.1 ./bin/nimsuggest
+help2man --name='Nimgrep' "${h2m_args}" -o nimgrep.1 ./bin/nimgrep
+help2man --name='Nimpretty' "${h2m_args}" -o nimpretty.1 ./bin/nimpretty
+help2man --name='Nim Package Installer' "${h2m_args}" -o nimble.1 ./bin/nimble
+help2man --name='Atlas' "${h2m_args}" -o atlas.1 ./bin/atlas
+
+# generate install.sh
+./koch distrohelper
+
+%install
+rm -rf $RPM_BUILD_ROOT
+DESTDIR=$RPM_BUILD_ROOT ./install.sh %{_bindir}
+
+# install atlas+nimpretty, as they are not in `install.sh`
+# https://gitlab.archlinux.org/archlinux/packaging/packages/nim/-/work_items/6
+install -vDm755 -t "$RPM_BUILD_ROOT%{_bindir}" bin/{atlas,nimpretty}
+
+# documentation
+find "doc/" -name '*.idx' -delete
+
+# tools
+for fn in nimble nimsuggest nimgrep nim-gdb; do cp ./bin/$fn $RPM_BUILD_ROOT%{_bindir}/; done
+
+sed -i -e 's|/usr/bin/env bash|/bin/bash|g' $RPM_BUILD_ROOT%{_bindir}/nim-gdb
+install -vDm644 -t "$RPM_BUILD_ROOT%{_prefix}/lib/nim/doc" doc/nimdoc.{css,cls}
+install -vDm644 -t "$RPM_BUILD_ROOT%{_prefix}/lib/nim/tools" tools/debug/nim-gdb.py
+install -vDm644 -t "$RPM_BUILD_ROOT%{_prefix}/lib/nim/tools/dochack" tools/dochack/{dochack.js,fuzzysearch.nim}
+
+# man pages
+install -vDm644 -t "$RPM_BUILD_ROOT%{_mandir}/man1" ./*.1
+
+# shell completions
+for comp in {tools,dist/nimble}/*.bash-completion; do
+install -Dm 644 "${comp}" "$RPM_BUILD_ROOT%{bash_compdir}/$(basename "${comp/.bash-completion}")"
+done
+for comp in {tools,dist/nimble}/*.zsh-completion; do
+install -Dm 644 "${comp}" "$RPM_BUILD_ROOT%{zsh_compdir}/_$(basename "${comp/.zsh-completion}")"
+done
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(644,root,root,755)
+%doc readme.md security.md doc/html
+%attr(755,root,root) %{_bindir}/nim
+%attr(755,root,root) %{_bindir}/atlas
+%attr(755,root,root) %{_bindir}/nim-gdb
+%attr(755,root,root) %{_bindir}/nimble
+%attr(755,root,root) %{_bindir}/nimgrep
+%attr(755,root,root) %{_bindir}/nimpretty
+%attr(755,root,root) %{_bindir}/nimsuggest
+%dir %{_sysconfdir}/nim
+%{_sysconfdir}/nim/config.nims
+%{_sysconfdir}/nim/nim.cfg
+%{_sysconfdir}/nim/nimdoc.cfg
+%{_sysconfdir}/nim/nimdoc.tex.cfg
+%{_sysconfdir}/nim/rename.rules.cfg
+%{_datadir}/nimble
+%{bash_compdir}/nim
+%{bash_compdir}/nimble
+%{bash_compdir}/nimgrep
+%{bash_compdir}/nimpretty
+%{bash_compdir}/nimsuggest
+%{_mandir}/man1/atlas.1*
+%{_mandir}/man1/nim.1*
+%{_mandir}/man1/nimble.1*
+%{_mandir}/man1/nimgrep.1*
+%{_mandir}/man1/nimpretty.1*
+%{_mandir}/man1/nimsuggest.1*
+%{_datadir}/nim/doc/html/overview.html
+%{zsh_compdir}/_nim
+%{zsh_compdir}/_nimble
+%{_prefix}/lib/nim
diff --git a/build-docs.patch b/build-docs.patch
new file mode 100644
index 0000000..9080596
--- /dev/null
+++ b/build-docs.patch
@@ -0,0 +1,9 @@
+--- a/build_all.sh
++++ b/build_all.sh
+@@ -13,5 +13,6 @@ nimBuildCsourcesIfNeeded "$@"
+
+ echo_run bin/nim c --noNimblePath --skipUserCfg --skipParentCfg --hints:off koch
+ echo_run ./koch boot -d:release --skipUserCfg --skipParentCfg --hints:off
++echo_run ./koch docs --skipUserCfg --skipParentCfg --hints:off
+ echo_run ./koch tools --skipUserCfg --skipParentCfg --hints:off
+
diff --git a/nim-config-fix-paths.patch b/nim-config-fix-paths.patch
new file mode 100644
index 0000000..6fe6139
--- /dev/null
+++ b/nim-config-fix-paths.patch
@@ -0,0 +1,18 @@
+Updated: 23 Feb 2022 by Nicolas Lorin <androw95220 at gmail.com>
+From: Jakub Jirutka <jakub at jirutka.cz>
+Date: Tue, 23 Aug 2017 22:57:00 +0200
+Subject: [PATCH] Fix default nimblepath in nim.cfg
+
+--- a/config/nim.cfg
++++ b/config/nim.cfg.new
+@@ -44,8 +44,8 @@
+ path="$lib/pure"
+
+ @if not windows:
+- nimblepath="/opt/nimble/pkgs2/"
+- nimblepath="/opt/nimble/pkgs/"
++ nimblepath="/usr/share/nimble/pkgs2/"
++ nimblepath="/usr/share/nimble/pkgs/"
+ @else:
+ # TODO:
+ @end
diff --git a/niminst-fix-paths.patch b/niminst-fix-paths.patch
new file mode 100644
index 0000000..9a0b6a0
--- /dev/null
+++ b/niminst-fix-paths.patch
@@ -0,0 +1,21 @@
+diff -up Nim-2.2.8/tools/niminst/install.nimf.orig Nim-2.2.8/tools/niminst/install.nimf
+--- Nim-2.2.8/tools/niminst/install.nimf.orig 2026-02-22 23:07:19.000000000 +0100
++++ Nim-2.2.8/tools/niminst/install.nimf 2026-04-04 09:54:55.864742610 +0200
+@@ -34,7 +34,7 @@ if [ $# -eq 1 ] ; then
+ libdir="/usr/lib/?proj/lib"
+ docdir="/usr/share/?proj/doc"
+ datadir="/usr/share/?proj/data"
+- nimbleDir="/opt/nimble/pkgs/?c.nimblePkgName-?c.version"
++ nimbleDir="/usr/share/nimble/pkgs/?c.nimblePkgName-?c.version"
+ ;;
+ "/usr/local/bin")
+ bindir=$1
+@@ -42,7 +42,7 @@ if [ $# -eq 1 ] ; then
+ libdir="/usr/local/lib/?proj/lib"
+ docdir="/usr/local/share/?proj/doc"
+ datadir="/usr/local/share/?proj/data"
+- nimbleDir="/opt/nimble/pkgs/?c.nimblePkgName-?c.version"
++ nimbleDir="/usr/local/share/nimble/pkgs/?c.nimblePkgName-?c.version"
+ ;;
+ "/opt")
+ bindir="/opt/?proj/bin"
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/nim.git/commitdiff/dbf62b8516913873d15e62a7cabe890ae8d8dee0
More information about the pld-cvs-commit
mailing list