#6 Force out-of-tree CMake build on EPEL 8
Merged a year ago by salimma. Opened a year ago by salimma.
rpms/ salimma/neovim el8-cmake-fix  into  rawhide

file modified
+23 -4
@@ -1,8 +1,24 @@ 

+ %if 0%{?el8}

+ # see https://fedoraproject.org/wiki/Changes/CMake_to_do_out-of-source_builds

+ # EPEL 8's %%cmake defaults to in-source build, which neovim does not support

+ %undefine __cmake_in_source_build

+ %endif

+ 

  %bcond_with jemalloc

- %ifarch %{arm} %{ix86} x86_64 %{mips} aarch64

- %bcond_without luajit

+ %ifarch %{arm} %{ix86} x86_64 %{mips}

+   %bcond_without luajit

  %else

- %bcond_with luajit

+   %ifarch aarch64

+     %if 0%{?el8}

+       # luajit codepath buggy on el8 aarch64

+       # https://bugzilla.redhat.com/show_bug.cgi?id=2065340

+       %bcond_with luajit

+     %else

+       %bcond_without luajit

+     %endif

+   %else

+     %bcond_with luajit

+   %endif

  %endif

  

  %global luv_min_ver 1.42.0
@@ -23,7 +39,7 @@ 

  

  Name:           neovim

  Version:        0.6.1

- Release:        3%{?dist}

+ Release:        4%{?dist}

  

  License:        ASL 2.0

  Summary:        Vim-fork focused on extensibility and agility
@@ -1762,6 +1778,9 @@ 

  %{_datadir}/nvim/runtime/tutor/en/vim-01-beginner.tutor.json

  

  %changelog

+ * Thu Mar 17 2022 Michel Alexandre Salim <salimma@fedoraproject.org> - 0.6.1-4

+ - Support building on EPEL 8

+ 

  * Wed Feb 09 2022 Andreas Schneider <asn@redhat.com> - 0.6.1-3

  - Fix libvterm 0.2 support

  

Signed-off-by: Michel Alexandre Salim salimma@fedoraproject.org

rebased onto 97f5dc0

a year ago

note: updating neovim in epel 8, and with this PR everything builds once some dependencies are branched / updated; see https://bugzilla.redhat.com/show_bug.cgi?id=2062925

Will merge in a day or two but want to check for feedback first

You could always set this. CMake is really meant to do out of source builds, it should actually be the default!

You could always set this. CMake is really meant to do out of source builds, it should actually be the default!

yup, but I think on Fedora (and EPEL9) that's already set by default, so we just need to do this in EPEL 8. Thoughts? I kind of like not setting/unsetting unnecessary things, and gating it to EPEL 8 means we can drop this once EPEL 8 goes away.

Oh, so it's actually the issue that EPEL 8's cmake doesn't support -B

so undefining that macro does the same as this from lua-luv.spec:

%if 0%{?rhel} && 0%{?rhel} < 9
# EPEL8's cmake macros have _vpath_builddir defined
# ... but its cmake does not support -B
# see https://fedoraproject.org/wiki/Changes/CMake_to_do_out-of-source_builds
%global _vpath_builddir .
%endif

I can adjust it to use lua-luv's definition to be consistent

That sounds like a good idea :-)

OK, so it looks like EPEL 8's cmake actually does understand -B now, so out-of-source builds work. but the macros have not been changed to flip this on by default, while neovim's CMakeLists.txt is configured to fail if in-source builds are requested (if -S and -B are not specified so they default to .)

I'm updating the PR with some comments, then doing a local mock build, then a koji scratch build on my EPEL 8 sidetag, then will push it here so we get a Rawhide scratch build too.

There are issues on non-x86_64 architectures on EPEL 8, so I'll update this later, but with commit I'm going to push building on epel8 x86_64 in my side tag does work.

rebased onto 1047226

a year ago

rebased onto c7f726e

a year ago

@asn ok, now it builds properly. Apologies for the janky nested logic for selecting if luajit should be enabled or not, in an earlier iteration I simply added the %if 0%{?el8) / %ifarch aarch64 part later, but I find that you can't override an earlier %bcond_with / %bcond_without by defining it twice.

Indented for better readability, since adding comments at the end of %if macros seems to not work due to macro expansion too.

Pull-Request has been merged by salimma

a year ago
Metadata