Skip to content

Commit

Permalink
fix(nim): symlink /usr/lib/nim/dist to %_datadir (#2198)
Browse files Browse the repository at this point in the history
  • Loading branch information
madonuko authored Oct 5, 2024
1 parent 7d283bb commit b11d62a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 15 deletions.
5 changes: 3 additions & 2 deletions anda/langs/nim/nim-nightly/nim-nightly.spec
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

Name: nim-nightly
Version: %ver^%commit_date.%shortcommit
Release: 2%?dist
Release: 3%?dist
Summary: Imperative, multi-paradigm, compiled programming language
License: MIT and BSD
URL: https://nim-lang.org
Expand Down Expand Up @@ -124,7 +124,8 @@ ln -s %_prefix/lib/nim %buildroot%_prefix/lib/nim/lib || true
rm -rf %buildroot/nim || true
rm %buildroot%_bindir/*.bat || true

cp -r dist %buildroot%_datadir/nim/
cp -r dist %buildroot%_prefix/lib/nim/
ln -s %_prefix/lib/nim/dist %buildroot%_datadir/nim/dist


%files
Expand Down
28 changes: 15 additions & 13 deletions anda/langs/nim/nim/nim.spec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

Name: nim
Version: 2.2.0
Release: 2%?dist
Release: 3%?dist
Summary: Imperative, multi-paradigm, compiled programming language
License: MIT and BSD
URL: https://nim-lang.org
Expand All @@ -12,7 +12,7 @@ Source2: nimgrep.1
Source3: nimble.1
Source4: nimsuggest.1
BuildRequires: gcc mold git-core gcc-c++ nodejs openssl-devel pkgconfig(bash-completion) gc-devel pcre-devel
BuildRequires: redhat-rpm-config
BuildRequires: redhat-rpm-config anda-srpm-macros
Requires: gcc


Expand Down Expand Up @@ -46,18 +46,14 @@ and its standard library.


%prep
rm -rf ./*
# using git clone to include submodules
git clone --recurse-submodules -j8 https://github.com/nim-lang/Nim -b v%version --depth 1 .
# hack
cp /usr/bin/mold /usr/bin/ld
%git_clone https://github.com/nim-lang/Nim v%version


%build
export CFLAGS="${CFLAGS} -Ofast"
export CXXFLAGS="${CXXFLAGS} -Ofast"
export FFLAGS="${FFLAGS} -Ofast"
export FCFLAGS="${FCFLAGS} -Ofast"
export CFLAGS="${CFLAGS} -Ofast -fuse-ld=mold"
export CXXFLAGS="${CXXFLAGS} -Ofast -fuse-ld=mold"
export FFLAGS="${FFLAGS} -Ofast -fuse-ld=mold"
export FCFLAGS="${FCFLAGS} -Ofast -fuse-ld=mold"

export PATH="$(pwd):$(pwd)/bin:${PATH}"

Expand All @@ -81,6 +77,11 @@ sed -i '/<link.*fonts.googleapis.com/d' doc/html/*.html


%install
export CFLAGS="${CFLAGS} -Ofast -fuse-ld=mold"
export CXXFLAGS="${CXXFLAGS} -Ofast -fuse-ld=mold"
export FFLAGS="${FFLAGS} -Ofast -fuse-ld=mold"
export FCFLAGS="${FCFLAGS} -Ofast -fuse-ld=mold"

export PATH="$(pwd):$(pwd)/bin:${PATH}"

# --main:compiler/nim.nim
Expand Down Expand Up @@ -113,12 +114,13 @@ install -Dm755 bin/* -t %buildroot%_bindir
install -d %buildroot%_includedir
cp -a %buildroot%_prefix/lib/nim/lib/*.h %buildroot%_includedir
ln -s %_prefix/lib/nim %buildroot%_prefix/lib/nim/lib # compiler needs lib from here
ln -s %_prefix/lib/nim/system.nim %_prefix/lib/system.nim # nimsuggest bug
#ln -s %_prefix/lib/nim/system.nim %buildroot%_prefix/lib/system.nim # nimsuggest bug
rm -rf %buildroot/nim || true
rm %buildroot%_bindir/*.bat || true
rm -rf %buildroot%_bindir/empty.txt

cp -r dist %buildroot%_datadir/nim/
cp -r dist %buildroot%_prefix/lib/nim/
ln -s %_prefix/lib/nim/dist %buildroot%_datadir/nim/dist


%files
Expand Down

0 comments on commit b11d62a

Please sign in to comment.