]> git.pld-linux.org Git - packages/mold.git/blobdiff - mold.spec
upstream fixes for x86 32bit non-PIC failures; rel 2
[packages/mold.git] / mold.spec
index c00c2536a647d558606eabf274766a538bf77046..f2a812b72babff81d22738348ba5fe8e7fcac9d0 100644 (file)
--- a/mold.spec
+++ b/mold.spec
@@ -1,26 +1,33 @@
+#
+# Conditional build:
+%bcond_without tests           # build without tests
+
 Summary:       mold: A Modern Linker
 Name:          mold
-Version:       1.2.0
-Release:       1
+Version:       1.6.0
+Release:       2
 License:       GPL v3+
 Group:         Development/Libraries
 Source0:       https://github.com/rui314/mold/archive/v%{version}/%{name}-%{version}.tar.gz
-# Source0-md5: 6e9dba635bd3ed1d39a8fe6411a2005e
-Patch0:                atomic.patch
+# Source0-md5: f6eb0adbc0ebd5dc75aed698bddd1a0e
+Patch0:                x86-nonpic.patch
 URL:           https://github.com/rui314/mold
+BuildRequires: cmake >= 3.13
+%{?with_tests:BuildRequires:   glibc-static}
 %ifarch %{armv6} riscv64
 BuildRequires: libatomic-devel
 %endif
 BuildRequires: libstdc++-devel >= 6:10
+%{?with_tests:BuildRequires:   libstdc++-static >= 6:10}
 BuildRequires: mimalloc-devel >= 1.7
 BuildRequires: openssl-devel
-BuildRequires: pkgconfig
 BuildRequires: rpmbuild(macros) >= 2.007
 BuildRequires: tbb-devel >= 2021.3.0
 BuildRequires: zlib-devel
+BuildRequires: zstd-devel
 Requires:      mimalloc >= 1.7
 Requires:      tbb >= 2021.3.0
-ExclusiveArch: %{ix86} %{x8664} %{arm} aarch64 riscv64
+ExclusiveArch: %{ix86} %{x8664} %{arm} aarch64 ppc64le riscv64 sparc64
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
@@ -37,32 +44,23 @@ especially in rapid debug-edit-rebuild cycles.
 %{__rm} -r third-party/{mimalloc,tbb}
 
 %build
-%{__make} \
-       ARCH="%{_target_cpu}" \
-       CC="%{__cc}" \
-       CXX="%{__cxx}" \
-       CFLAGS="%{rpmcppflags} %{rpmcflags}" \
-       CXXFLAGS="%{rpmcppflags} %{rpmcxxflags}" \
-       LDFLAGS="%{rpmldflags}" \
-       SYSTEM_MIMALLOC=1 \
-       SYSTEM_TBB=1 \
-       PREFIX="%{_prefix}" \
-       BINDIR="%{_bindir}" \
-       LIBDIR="%{_libdir}" \
-       MANDIR="%{_mandir}"
+%cmake -B build \
+       %{cmake_on_off tests BUILD_TESTING} \
+       -DMOLD_USE_MIMALLOC:BOOL=ON \
+       -DMOLD_USE_SYSTEM_MIMALLOC:BOOL=ON \
+       -DMOLD_USE_SYSTEM_TBB:BOOL=ON
+
+%{__make} -C build
+
+%if %{with tests}
+%{__make} -C build test
+%endif
 
 %install
 rm -rf $RPM_BUILD_ROOT
 
-%{__make} install \
-       D=$RPM_BUILD_ROOT \
-       SYSTEM_MIMALLOC=1 \
-       SYSTEM_TBB=1 \
-       STRIP=: \
-       PREFIX="%{_prefix}" \
-       BINDIR="%{_bindir}" \
-       LIBDIR="%{_libdir}" \
-       MANDIR="%{_mandir}"
+%{__make} -C build install \
+       DESTDIR=$RPM_BUILD_ROOT
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -78,3 +76,4 @@ rm -rf $RPM_BUILD_ROOT
 %dir %{_libexecdir}/mold
 %attr(755,root,root) %{_libexecdir}/mold/ld
 %{_mandir}/man1/mold.1*
+%{_mandir}/man1/ld.mold.1*
This page took 0.190468 seconds and 4 git commands to generate.