Re: How to build two flavors of the same package?

2023-01-18 Thread Iñaki Ucar
On Tue, 17 Jan 2023 at 22:28, Till Hofmann  wrote:
>
> Hi all,
>
> Someone (rightfully) suggested that we should build glfw twice, once
> with wayland support and once without:
> https://bugzilla.redhat.com/show_bug.cgi?id=2152319
>
> Is there any best practice how to build the same package in two
> different flavors, in this case cmake-based? I vaguely remember seeing a
> spec file that did that, but I don't remember where.
>
> Thanks for any pointers!

In flexiblas.spec, for 64-bit BLAS, we do

%build
%cmake -B build \

%make_build -C build
%if 0%{?__isa_bits} == 64
%cmake -B build64 \

%make_build -C build64
%endif

%install
%make_install -C build
%if 0%{?__isa_bits} == 64
%make_install -C build64
%endif

etc.

-- 
Iñaki Úcar
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Re: How to build two flavors of the same package?

2023-01-17 Thread Orion Poplawski

On 1/17/23 14:28, Till Hofmann wrote:

Hi all,

Someone (rightfully) suggested that we should build glfw twice, once 
with wayland support and once without:

https://bugzilla.redhat.com/show_bug.cgi?id=2152319

Is there any best practice how to build the same package in two 
different flavors, in this case cmake-based? I vaguely remember seeing a 
spec file that did that, but I don't remember where.


Thanks for any pointers!


In vtk.spec I do things like:

%global _vpath_builddir build
%cmake %{cmake_gen} \
 %{vtk_cmake_options} \
 -DVTK_BUILD_DOCUMENTATION:BOOL=ON \
 -DVTK_BUILD_EXAMPLES:BOOL=ON \
 -DVTK_BUILD_TESTING:BOOL=ON
%cmake_build -- --output-sync
%cmake_build --target DoxygenDoc

%if %{with mpich}
%global _vpath_builddir build-mpich
%_mpich_load
export CC=mpicc
export CXX=mpic++
%cmake %{cmake_gen} \
 %{vtk_cmake_options} \
 -DCMAKE_PREFIX_PATH:PATH=$MPI_HOME \
 -DCMAKE_INSTALL_PREFIX:PATH=$MPI_HOME \
 -DCMAKE_INSTALL_LIBDIR:PATH=lib \
 -DCMAKE_INSTALL_JNILIBDIR:PATH=lib/%{name} \
 -DCMAKE_INSTALL_QMLDIR:PATH=lib/qt5/qml \
 -DVTK_USE_MPI:BOOL=ON
%cmake_build -- --output-sync
%_mpich_unload
%endif

--
Orion Poplawski
he/him/his  - surely the least important thing about me
IT Systems Manager 720-772-5637
NWRA, Boulder/CoRA Office FAX: 303-415-9702
3380 Mitchell Lane   or...@nwra.com
Boulder, CO 80301 https://www.nwra.com/



smime.p7s
Description: S/MIME Cryptographic Signature
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Re: How to build two flavors of the same package?

2023-01-17 Thread Jerry James
On Tue, Jan 17, 2023 at 2:28 PM Till Hofmann  wrote:
> Hi all,
>
> Someone (rightfully) suggested that we should build glfw twice, once
> with wayland support and once without:
> https://bugzilla.redhat.com/show_bug.cgi?id=2152319
>
> Is there any best practice how to build the same package in two
> different flavors, in this case cmake-based? I vaguely remember seeing a
> spec file that did that, but I don't remember where.
>
> Thanks for any pointers!
>
> Kind regards,
> Till

I don't know about best practices, but it seems like you could do
something like this:

%build
%cmake 
%cmake_build
mv %{_vpath_builddir} build-first

%cmake 
%cmake_build
mv %{_vpath_builddir} build-second

%install
mv build-first %{_vpath_builddir}
%cmake_install
mv %{_vpath_builddir} build-first

mv build-second %{_vpath_builddir}
%cmake_install
mv %{_vpath_builddir} build-second

%check
mv build-first %{_vpath_builddir}
%ctest
mv %{_vpath_builddir} build-first

mv build-second %{_vpath_builddir}
%ctest
mv %{_vpath_builddir} build-second


I made that up off the top of my head and haven't tried it, so it may
have some fatal flaw.  Take with a large grain of salt.
-- 
Jerry James
http://www.jamezone.org/
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


How to build two flavors of the same package?

2023-01-17 Thread Till Hofmann

Hi all,

Someone (rightfully) suggested that we should build glfw twice, once 
with wayland support and once without:

https://bugzilla.redhat.com/show_bug.cgi?id=2152319

Is there any best practice how to build the same package in two 
different flavors, in this case cmake-based? I vaguely remember seeing a 
spec file that did that, but I don't remember where.


Thanks for any pointers!

Kind regards,
Till
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue