%global commit 8ec3483cd10c57592e4c5350223d6dbac836e851 %global shortcommit %(c=%{commit}; echo ${c:0:7}) # Computed from "git rev-list --count HEAD" in the source checkout %global buildnum 1510 %global _description %{expand: newRPL is a re-implementation of the HP48/49/50 series calculators programming environment. The RPL scripting language is being redesigned and recreated with even more powerful features.} Name: newrpl Version: 0^%{buildnum}git%{shortcommit} Release: %autorelease Summary: The classic RPL programming language reimagined License: BSD URL: https://hpgcc3.org/projects/newrpl Source0: https://sourceforge.net/code-snapshots/git/n/ne/newrpl/sources.git/newrpl-sources-%{commit}.zip Source1: newrpl.desktop Source2: org.hpgcc3.newrpl.metainfo.xml Source3: newrpl-prime.desktop Source4: org.hpgcc3.newrpl-prime.metainfo.xml # Use the system hidapi library instead of the bundled one Patch0: newrpl-use-system-hidapi.patch # Fix build issues Patch1: newrpl-target_pc-stdlib.patch # Fix linker script issues Patch2: newrpl-firmware-link.patch BuildRequires: arm-none-eabi-gcc-cs BuildRequires: arm-none-eabi-newlib BuildRequires: desktop-file-utils BuildRequires: gcc-c++ BuildRequires: libappstream-glib BuildRequires: make BuildRequires: sed BuildRequires: elfutils-libelf-devel BuildRequires: hidapi-devel BuildRequires: qt5-qtbase-devel BuildRequires: qt5-qtquickcontrols2-devel BuildRequires: systemd-devel Suggests: %{name}-compiler Suggests: %{name}-firmware %description %{_description} This package contains the newRPL desktop application. %package compiler Summary: newRPL standalone compiler %description compiler %{_description} This package contains a standalone CLI compiler for newRPL. %package firmware Summary: newRPL firmware for HP calculators Recommends: (%{name} or %{name}-prime) BuildArch: noarch %description firmware %{_description} This package contains the newRPL firmware to be installed on HP calculators. %package prime Summary: %{summary} Suggests: %{name}-compiler Suggests: %{name}-firmware %description prime %{_description} This package contains the HP Prime UI flavor of the newRPL desktop application. %prep %autosetup -n %{name}-sources-%{commit} -p1 # Remove bundled libraries rm -r external # Fix hardcoded settings sed -i *.pro \ -e 's:/usr/local/lib:%{_libdir}:' \ -e 's/"NEWRPL_BUILDNUM=.*"/"NEWRPL_BUILDNUM=%{buildnum}"/' %build # Build the internal tools pushd tools/elf2rom %qmake_qt5 elf2rom.pro %make_build # This is to install the tools within the build tree so the next steps can use # them, it does not install to the buildroot make install popd pushd tools/fonts/bmp2font %qmake_qt5 bmp2font.pro %make_build make install popd # Build the compiler %qmake_qt5 newrpl-comp.pro %make_build make install # Build the desktop UIs # Because the subsequent builds all share the same source tree, we explicitly # clean before every one to avoid issues make clean %qmake_qt5 newrpl-ui-prime.pro %make_build mv newrpl-ui newrpl-ui-prime make clean %qmake_qt5 newrpl-ui.pro %make_build # Build the calculator firmwares for target in newrpl-fw newrpl-fw39 newrpl-fw40 newrpl-fw48 primeg1-newrpl primeg1-multiload; do make clean # Do not use the macro on purpose as we do not want the system compiler and # linker flags here qmake-qt5 "${target}.pro" %make_build done %install install -Dpm0755 -t %{buildroot}%{_bindir} newrpl-comp newrpl-ui newrpl-ui-prime install -Dpm0644 -t %{buildroot}%{_datadir}/%{name} newrpl*.bin NEWRPL.ROM PRIME_OS.ROM install -Dpm0644 bitmap/icon.png %{buildroot}/%{_datadir}/pixmaps/newrpl.png desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{SOURCE1} install -Dpm0644 -t %{buildroot}%{_metainfodir} %{SOURCE2} appstream-util validate-relax --nonet \ %{buildroot}%{_metainfodir}/org.hpgcc3.newrpl.metainfo.xml install -Dpm0644 bitmap/icon.png %{buildroot}/%{_datadir}/pixmaps/newrpl-prime.png desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{SOURCE3} install -Dpm0644 -t %{buildroot}%{_metainfodir} %{SOURCE4} appstream-util validate-relax --nonet \ %{buildroot}%{_metainfodir}/org.hpgcc3.newrpl-prime.metainfo.xml %files %license LICENSE.txt %{_bindir}/newrpl-ui %{_datadir}/applications/newrpl.desktop %{_datadir}/pixmaps/newrpl.png %{_metainfodir}/org.hpgcc3.newrpl.metainfo.xml %files compiler %license LICENSE.txt %{_bindir}/newrpl-comp %files firmware %license LICENSE.txt %{_datadir}/%{name} %files prime %license LICENSE.txt %{_bindir}/newrpl-ui-prime %{_datadir}/applications/newrpl-prime.desktop %{_datadir}/pixmaps/newrpl-prime.png %{_metainfodir}/org.hpgcc3.newrpl-prime.metainfo.xml %changelog %autochangelog