From d49a4d5515ede136712226fb7c229b0c38223c44 Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Sep 05 2023 02:46:14 +0000 Subject: Fix flatpak build Installation path macros cannot be reliably used to define the location of build dependencies, as they may not be in the same prefix if they are part of the runtime or are buildroot only. mpich and openmpi are neither building nor are needed for flatpak builds. --- diff --git a/hdf5.spec b/hdf5.spec index 28b3569..173ec44 100644 --- a/hdf5.spec +++ b/hdf5.spec @@ -67,8 +67,8 @@ BuildRequires: libaec-devel BuildRequires: gcc, gcc-c++ BuildRequires: git-core -%global with_mpich 1 -%global with_openmpi 1 +%global with_mpich %{undefined flatpak} +%global with_openmpi %{undefined flatpak} %if %{with_mpich} %global mpi_list mpich @@ -189,18 +189,18 @@ HDF5 parallel openmpi static libraries # Junit tests are failing with junit-4.13.1 %if 0%{?rhel} >= 9 || 0%{?fedora} find . ! -name junit.jar -name "*.jar" -delete -ln -s %{_javadir}/hamcrest/hamcrest.jar java/lib/hamcrest-core.jar +ln -s $(build-classpath hamcrest) java/lib/hamcrest-core.jar %else find . -name "*.jar" -delete -ln -s %{_javadir}/hamcrest/core.jar java/lib/hamcrest-core.jar -ln -s %{_javadir}/junit.jar java/lib/junit.jar +ln -s $(build-classpath hamcrest/core) java/lib/hamcrest-core.jar +ln -s $(build-classpath junit) java/lib/junit.jar # Fix test output junit_ver=$(sed -n '//{s/^.*>\([0-9]\.[0-9.]*\)<.*/\1/;p;q}' /usr/share/maven-poms/junit.pom) sed -i -e "s/JUnit version .*/JUnit version $junit_ver/" java/test/testfiles/JUnit-*.txt %endif -ln -s %{_javadir}/slf4j/api.jar java/lib/slf4j-api-1.7.25.jar -ln -s %{_javadir}/slf4j/nop.jar java/lib/ext/slf4j-nop-1.7.25.jar -ln -s %{_javadir}/slf4j/simple.jar java/lib/ext/slf4j-simple-1.7.25.jar +ln -s $(build-classpath slf4j/api) java/lib/slf4j-api-1.7.25.jar +ln -s $(build-classpath slf4j/nop) java/lib/ext/slf4j-nop-1.7.25.jar +ln -s $(build-classpath slf4j/simple) java/lib/ext/slf4j-simple-1.7.25.jar %endif # Force shared by default for compiler wrappers (bug #1266645)