File ponyc.spec of Package ponyc

%undefine _debugsource_packages

Name: ponyc
Summary: Compiler for the Pony Language
Version: 0.58.6
Release: 1
Group: Development/Language
License: BSD
URL: https://github.com/ponylang/ponyc
Source0: https://github.com/ponylang/ponyc/archive/%{version}.tar.gz#/ponyc-%{version}.tar.gz
#BuildRequires: llvm11-devel llvm11-static
BuildRequires: llvm-devel llvm-static
BuildRequires: libatomic
BuildRequires: cmake

%description
Pony is an open-source, actor-model, capabilities-secure, high performance
programming language.

%prep
%setup -q
sed -i 's|-Werror|-Wno-error -Wno-stringop-overflow|' Makefile
#sed -i 's|llvm-config|llvm-config-13|' Makefile
#sed -i '5i #include <limits>' lib/gbenchmark/src/benchmark_register.h
sed -i 's|PONY_BUILD_CONFIG|"release"|' src/libponyrt/platform/ponyassert.c
sed -i 's|PONY_VERSION_STR|"0.58.6"|' src/libponyrt/sched/start.c

%build
cmake . -DLLVM_DIR=%{_libdir}/cmake/llvm -DGTest_DIR=%{_libdir}/cmake/GTest -Dbenchmark_DIR=%{_libdir}/cmake/benchmark -DPONY_BUILD_CONFIG=release
mkdir -p build/build_release/obj-native/libponyrt/lang
#llc-11 -filetype=obj -relocation-model=pic src/libponyrt/lang/except_try_catch.ll -o build/release/obj-native/libponyrt/lang/except_try_catch.o
%make_build

%install
make install prefix=%{buildroot}/usr ponydir=%{buildroot}%{_libdir}/pony
%ifarch x86_64 aarch64
mv %{buildroot}/usr/lib/* %{buildroot}/usr/lib64/
%endif

%files
%{_bindir}/ponyc
%{_includedir}/pony/detail/atomics.h
%{_includedir}/pony.h
%{_libdir}/libpony*.a
%{_libdir}/pony

%changelog
* Sun Nov 17 2024 Wei-Lun Chao <bluebat@member.fsf.org> - 0.58.6
- Rebuilt for Fedora
openSUSE Build Service is sponsored by