Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add: nimble #1245

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 23 additions & 18 deletions anda/langs/nim/nim-nightly/nim-nightly.spec
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ URL: https://nim-lang.org
Source0: https://github.com/nim-lang/Nim/archive/%commit.tar.gz
Source1: nim.1
Source2: nimgrep.1
Source3: nimble.1
Source4: nimsuggest.1
BuildRequires: gcc mold git gcc-c++ nodejs openssl-devel pkgconfig(bash-completion) gc-devel pcre pcre-devel
Requires: redhat-rpm-config gcc
Requires: gcc
# for some absurd reason this doesn't come with nimble, so…
Requires: nimble
Conflicts: choosenim
Conflicts: nim
# somehow wrong name and never noticed
Provides: nim-nightly = %version-%release
Obsoletes: nim-nighlty < 2.1.1^20240404.9e1b170-2
Expand All @@ -32,6 +34,7 @@ order of priority).

%package tools
Summary: Tools for Nim programming language
Requires: nim-nightly = %version-%release
Provides: nim-nightly-tools = %version-%release
Obsoletes: nim-nighlty-tools < 2.1.1^20240404.9e1b170-2

Expand Down Expand Up @@ -61,9 +64,6 @@ and its standard library.

%prep
%autosetup -n Nim-%commit
# hack
cp /usr/bin/mold /usr/bin/ld


%build
export CFLAGS="${CFLAGS} -Ofast"
Expand All @@ -74,17 +74,18 @@ export FCFLAGS="${FCFLAGS} -Ofast"
export PATH="$(pwd):$(pwd)/bin:${PATH}"

. ci/funs.sh
cp /usr/bin/mold ld
nimBuildCsourcesIfNeeded CFLAGS="${CFLAGS} -Ic_code -w -O3 -fno-strict-aliasing -fPIE" LDFLAGS="-ldl -lm -lrt -pie"

nim c --noNimblePath --skipUserCfg --skipParentCfg --hints:off -d:danger koch.nim
koch boot -d:release -d:nimStrictMode --lib:lib
mold -run nim c --noNimblePath --skipUserCfg --skipParentCfg --hints:off -d:danger koch.nim
mold -run koch boot -d:release -d:nimStrictMode --lib:lib

%ifarch x86_64
koch docs &
mold -run koch docs &
%endif
(cd lib; nim c --app:lib -d:danger -d:createNimRtl -t:-fPIE -l:-pie nimrtl.nim) &
koch tools --skipUserCfg --skipParentCfg --hints:off -d:release -t:-fPIE -l:-pie &
nim c -d:danger -t:-fPIE -l:-pie nimsuggest/nimsuggest.nim &
(cd lib; mold -run nim c --app:lib -d:danger -d:createNimRtl -t:-fPIE -l:-pie nimrtl.nim) &
mold -run koch tools --skipUserCfg --skipParentCfg --hints:off -d:release -t:-fPIE -l:-pie &
mold -run nim c -d:danger -t:-fPIE -l:-pie nimsuggest/nimsuggest.nim &
wait

%ifarch x86_64
Expand All @@ -103,8 +104,7 @@ sh ./install.sh %buildroot/usr/bin
mkdir -p %buildroot/%_bindir %buildroot/%_datadir/bash-completion/completions %buildroot/usr/lib/nim %buildroot%_datadir
install -Dpm755 bin/nim{grep,suggest,pretty} %buildroot/%_bindir
install -Dpm644 tools/nim.bash-completion %buildroot/%_datadir/bash-completion/completions/nim
install -Dpm644 dist/nimble/nimble.bash-completion %buildroot/%_datadir/bash-completion/completions/nimble
install -Dpm644 -t%buildroot/%_mandir/man1 %SOURCE1 %SOURCE2 %SOURCE3 %SOURCE4
install -Dpm644 -t%buildroot/%_mandir/man1 %SOURCE1 %SOURCE2 %SOURCE4
mv %buildroot%_bindir/nim %buildroot%_datadir/
ln -s %_datadir/nim/bin/nim %buildroot%_bindir/nim

Expand All @@ -128,17 +128,22 @@ rm %buildroot%_bindir/*.bat || true
%files
%license copying.txt dist/nimble/license.txt
%doc doc/readme.txt
%_bindir/nim{,ble}
%_mandir/man1/nim{,ble}.1*
%_datadir/bash-completion/completions/nim{,ble}
%_bindir/nim
%dnl %_bindir/nimble
%_mandir/man1/nim.1*
%_mandir/man1/nimble.1*
%_datadir/bash-completion/completions/nim
%_datadir/nim/
%_prefix/lib/nim/
%_sysconfdir/nim/

%files tools
%license copying.txt
%_bindir/nim{grep,suggest,pretty}
%_mandir/man1/nim{grep,suggest}.1*
%_bindir/nimgrep
%_bindir/nimsuggest
%_bindir/nimpretty
%_mandir/man1/nimgrep.1*
%_mandir/man1/nimsuggest.1*

%ifarch x86_64
%files doc
Expand Down
1 change: 1 addition & 0 deletions anda/langs/nim/nim/nim.spec
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ order of priority).

%package tools
Summary: Tools for Nim programming language
Requires: nim = %version-%release
%description tools
Nim is a compiled, garbage-collected systems programming language with a
design that focuses on efficiency, expressiveness, and elegance (in that
Expand Down
5 changes: 5 additions & 0 deletions anda/langs/nim/nimble/anda.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
project pkg {
rpm {
spec = "nimble.spec"
}
}
File renamed without changes.
38 changes: 38 additions & 0 deletions anda/langs/nim/nimble/nimble.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
Name: nimble
Version: 0.14.2
Release: 1%?dist
Summary: Package manager for the Nim programming language
License: BSD
URL: https://github.com/nim-lang/nimble
Source1: nimble.1
# We use `nim` to get `nimble`… to build `nimble`
BuildRequires: nim anda-srpm-macros git-core
Conflicts: nim

%description
%summary.

%prep
git clone %url .
git checkout v%version

%build
nimble setup -y
nim c %nim_c src/nimble

%install
install -Dpm755 src/nimble %buildroot%_bindir/nimble
install -Dpm644 -t%buildroot%_mandir/man1 %SOURCE1
install -Dpm644 nimble.bash-completion %bash_completions_dir/nimble
install -Dpm644 nimble.zsh-completion %zsh_completions_dir/_nimble.zsh

%files
%doc readme.markdown
%license license.txt
%_bindir/nimble
%_mandir/man1/nimble.1
%bash_completions_dir/nimble
%zsh_completions_dir/_nimble.zsh

%changelog
%autochangelog
1 change: 1 addition & 0 deletions anda/langs/nim/nimble/update.rhai
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rpm.version(gh("nim-lang/nimble"));
Loading