# find-debuginfo cannot process foreign ARM archives. They retain target debug # information through NDLESS_TARGET_CFLAGS while native tools get normal debuginfo. %global _find_debuginfo_opts --no-ar-files # Fedora's native brp-strip-lto cannot inspect ARM relocatable objects. %global __brp_strip_lto %{nil} Name: ndless-sdk Version: 2022^git20260706.9484d8d Release: 3%{?dist} Summary: SDK for programs targeting Ndless on the TI-Nspire # Base scripts are MPL-1.1 or public domain; Luna and ELFIO are MIT. License: MPL-1.1 AND LicenseRef-Fedora-Public-Domain AND MIT URL: https://github.com/ndless-nspire/Ndless Source0: https://github.com/ndless-nspire/Ndless/archive/9484d8da7c7a4dde9766138c2e42e1d1e3acfcd4/Ndless-9484d8da7c7a4dde9766138c2e42e1d1e3acfcd4.tar.gz Source1: https://github.com/Vogtinator/nspire-io/archive/d084a245286c073d161e1ed602788946aff79aee/nspire-io-d084a245286c073d161e1ed602788946aff79aee.tar.gz Source2: https://github.com/madler/zlib/archive/cacf7f1d4e3d44d871b605da3b647f07d718623f/zlib-cacf7f1d4e3d44d871b605da3b647f07d718623f.tar.gz Source3: https://github.com/freetype/freetype/archive/069083cccd73d1d68da68116c8d050bb62cdfe0e/freetype-069083cccd73d1d68da68116c8d050bb62cdfe0e.tar.gz Source4: https://github.com/ndless-nspire/luna/archive/a9924a9a968954eba9adcc161a58ac607f97ce8c/luna-a9924a9a968954eba9adcc161a58ac607f97ce8c.tar.gz Source5: nspire-tools.1 Source6: %{name}.rpmlintrc # Fedora-specific compatibility with the system Newlib headers. Patch0: 0001-libsyscalls-define-path-max-for-newlib-4.5.patch # Downstream cross-build fix; suitable for upstream but not yet submitted. Patch1: 0002-freetype-ignore-host-rpm-cflags.patch # Fedora-specific ordering required by Fedora's fully populated Newlib archive. Patch2: 0003-linker-filter-fedora-default-libraries.patch # Downstream installed-layout fix; suitable for upstream but not yet submitted. Patch3: 0004-nspire-tools-use-prebuilt-zehn-loaders.patch # Downstream native build-system fix; suitable for upstream but not yet submitted. Patch4: 0005-host-tools-honor-rpm-build-flags.patch # Fedora-specific target debuginfo support for foreign static archives. Patch5: 0006-target-libraries-retain-debug-info.patch # Fedora-specific removal of prohibited, prebuilt, or bundled-font samples. Patch6: 0007-build-only-shippable-samples.patch # genzehn currently serializes Zehn structures only on little-endian hosts. # Upstream tracking: https://github.com/ndless-nspire/Ndless/issues/501 # Fedora's emulated RISC-V repositories do not provide arm-none-eabi-gcc-cs. ExcludeArch: s390x riscv64 BuildRequires: arm-none-eabi-binutils-cs BuildRequires: arm-none-eabi-gcc-cs BuildRequires: arm-none-eabi-gcc-cs-c++ BuildRequires: arm-none-eabi-newlib BuildRequires: bash BuildRequires: boost-devel BuildRequires: findutils BuildRequires: gcc-c++ BuildRequires: make BuildRequires: php-cli BuildRequires: tar BuildRequires: which BuildRequires: zlib-devel Requires: arm-none-eabi-binutils-cs Requires: arm-none-eabi-gcc-cs Requires: arm-none-eabi-gcc-cs-c++ Requires: arm-none-eabi-newlib Requires: coreutils Requires: findutils Requires: grep Requires: make Requires: sed Requires: which Recommends: %{name}-devel%{?_isa} = %{version}-%{release} Suggests: %{name}-examples = %{version}-%{release} # The SDK currently has no interface for externally supplied target libraries. # Public upstream tracking: https://github.com/ndless-nspire/Ndless/issues/500 Provides: bundled(elfio) = 3.2 Provides: bundled(luna) Provides: bundled(minizip) = 1.1 %description Ndless SDK host tools and compiler wrappers for building programs targeting Ndless on the TI-Nspire. Fedora supplies the compiler, binary utilities, and C and C++ target libraries through its ARM bare-metal cross tool chain packages. %package devel Summary: Development files for the Ndless SDK # SDK code is MPL/public domain, nspire-io is LGPL-3.0-only, target zlib # uses Zlib, FreeType uses FTL, and the Lua 5.1 headers use MIT. License: MPL-1.1 AND LicenseRef-Fedora-Public-Domain AND LGPL-3.0-only AND Zlib AND FTL AND MIT Requires: %{name}%{?_isa} = %{version}-%{release} Provides: %{name}-static = %{version}-%{release} # These are ARM-target libraries, not native Fedora system libraries. # Public upstream tracking: https://github.com/ndless-nspire/Ndless/issues/500 Provides: bundled(freetype) = 2.7.1 Provides: bundled(lua) = 5.1 Provides: bundled(nspire-io) Provides: bundled(zlib) = 1.2.11 %description devel Headers, ARM target static libraries, startup objects, and linker scripts for developing Ndless programs. %package examples Summary: Example source programs for the Ndless SDK # Remaining upstream examples are explicitly released into the public domain. License: LicenseRef-Fedora-Public-Domain BuildArch: noarch Requires: %{name} = %{version}-%{release} Recommends: %{name}-devel = %{version}-%{release} %description examples Example source programs for building TI-Nspire applications with the Ndless SDK. %prep %setup -q -n Ndless-9484d8da7c7a4dde9766138c2e42e1d1e3acfcd4 rm -rf ndless-sdk/thirdparty/nspire-io \ ndless-sdk/thirdparty/zlib \ ndless-sdk/thirdparty/freetype2 \ ndless-sdk/tools/luna mkdir -p ndless-sdk/thirdparty/nspire-io \ ndless-sdk/thirdparty/zlib \ ndless-sdk/thirdparty/freetype2 \ ndless-sdk/tools/luna tar -xf %{SOURCE1} -C ndless-sdk/thirdparty/nspire-io --strip-components=1 tar -xf %{SOURCE2} -C ndless-sdk/thirdparty/zlib --strip-components=1 tar -xf %{SOURCE3} -C ndless-sdk/thirdparty/freetype2 --strip-components=1 tar -xf %{SOURCE4} -C ndless-sdk/tools/luna --strip-components=1 %patch -P 0 -p1 %patch -P 1 -p1 %patch -P 2 -p1 %patch -P 3 -p1 %patch -P 4 -p1 %patch -P 5 -p1 %patch -P 6 -p1 # Fedora packages must rebuild every program binary and library from source. find ndless-sdk -type f \( -name '*.a' -o -name '*.o' -o \ -name '*.elf' -o -name '*.tns' \) -delete rm -f ndless-sdk/bin/genzehn ndless-sdk/tools/luna/luna # CPOL-1.02 is not allowed in Fedora. The FreeType sample bundles DroidSans, # and the SDL samples depend on prebuilt libraries whose source is absent. rm -rf ndless-sdk/samples/particles \ ndless-sdk/samples/freetype \ ndless-sdk/samples/helloworld-sdl \ ndless-sdk/samples/link-sdl \ ndless-sdk/include/SDL rm -f ndless-sdk/bin/sdl-config ndless-sdk/lib/README_nSDL %build export PATH="$PWD/ndless-sdk/bin:%{_bindir}:$PATH" export NDLESS_TARGET_CFLAGS=-g # Native tools honor Fedora flags via Patch4. ARM artifacts intentionally use # upstream target flags plus -g instead of incompatible native architecture flags. %make_build -C ndless-sdk %check test -x ndless-sdk/bin/genzehn test -s ndless-sdk/samples/helloworld-cpp/helloworld-cpp.tns test -s ndless-sdk/lib/libndls.a test -s ndless-sdk/system/crt0.o test ! -e ndless-sdk/samples/particles test ! -e ndless-sdk/samples/freetype test ! -e ndless-sdk/include/SDL test ! -e ndless-sdk/lib/libSDL.a test ! -e ndless-sdk/lib/libSDL_gfx.a test ! -e ndless-sdk/lib/libSDL_image.a %make_build -C ndless-sdk/samples clean %install sdkroot=%{buildroot}%{_libdir}/%{name} examplesroot=%{buildroot}%{_datadir}/%{name}/examples mkdir -p "$sdkroot" %{buildroot}%{_bindir} "$(dirname "$examplesroot")" cp -a ndless-sdk/bin \ ndless-sdk/include \ ndless-sdk/lib \ ndless-sdk/system \ "$sdkroot/" cp -a ndless-sdk/samples "$examplesroot" %make_build -C "$examplesroot" clean install -Dpm0755 ndless-sdk/tools/luna/luna \ "$sdkroot/tools/luna/luna" install -Dpm0644 ndless-sdk/tools/luna/LICENSE \ "$sdkroot/tools/luna/LICENSE" install -d "$sdkroot/tools/zehn_loader" install -pm0644 ndless-sdk/tools/zehn_loader/zehn_loader*.tns \ "$sdkroot/tools/zehn_loader/" find "$sdkroot" "$examplesroot" -name .gitignore -delete for tool in arm-none-eabi-ld.gold genzehn make-prg nspire-as nspire-g++ \ nspire-gcc nspire-ld nspire-tools; do ln -s "%{_libdir}/%{name}/bin/$tool" \ "%{buildroot}%{_bindir}/$tool" done install -Dpm0644 %{SOURCE5} \ %{buildroot}%{_mandir}/man1/nspire-tools.1 for tool in arm-none-eabi-ld.gold genzehn make-prg nspire-as nspire-g++ \ nspire-gcc nspire-ld; do ln -s nspire-tools.1 %{buildroot}%{_mandir}/man1/$tool.1 done licensedir=%{buildroot}%{_licensedir}/%{name} install -Dpm0644 Mozilla-Public-License-v1.1.html \ "$licensedir/Mozilla-Public-License-v1.1.html" install -Dpm0644 ndless-sdk/thirdparty/nspire-io/LICENSE \ "$licensedir/nspire-io/LICENSE" install -Dpm0644 ndless-sdk/thirdparty/freetype2/docs/LICENSE.TXT \ "$licensedir/freetype2/LICENSE.TXT" install -Dpm0644 ndless-sdk/thirdparty/zlib/README \ "$licensedir/zlib/README" install -Dpm0644 ndless-sdk/tools/luna/LICENSE \ "$licensedir/luna/LICENSE" install -Dpm0644 ndless-sdk/tools/genzehn/elfio-3.2/COPYING \ "$licensedir/elfio/COPYING" install -Dpm0644 ndless-sdk/include/LICENSE.txt \ "$licensedir/include/LICENSE.txt" install -Dpm0644 ndless-sdk/system/LICENSE.txt \ "$licensedir/system/LICENSE.txt" install -Dpm0644 ndless-sdk/samples/LICENSE.txt \ "$licensedir/samples/LICENSE.txt" %files %license %{_licensedir}/%{name}/Mozilla-Public-License-v1.1.html %license %{_licensedir}/%{name}/luna/LICENSE %license %{_licensedir}/%{name}/elfio/COPYING %doc README.md %dir %{_licensedir}/%{name} %dir %{_licensedir}/%{name}/luna %dir %{_licensedir}/%{name}/elfio %dir %{_datadir}/%{name} %dir %{_libdir}/%{name} %{_bindir}/arm-none-eabi-ld.gold %{_bindir}/genzehn %{_bindir}/make-prg %{_bindir}/nspire-as %{_bindir}/nspire-g++ %{_bindir}/nspire-gcc %{_bindir}/nspire-ld %{_bindir}/nspire-tools %{_mandir}/man1/*.1* %{_libdir}/%{name}/bin %{_libdir}/%{name}/tools %files devel %license %{_licensedir}/%{name}/nspire-io/LICENSE %license %{_licensedir}/%{name}/freetype2/LICENSE.TXT %license %{_licensedir}/%{name}/zlib/README %license %{_licensedir}/%{name}/include/LICENSE.txt %license %{_licensedir}/%{name}/system/LICENSE.txt %doc README.md %dir %{_licensedir}/%{name}/nspire-io %dir %{_licensedir}/%{name}/freetype2 %dir %{_licensedir}/%{name}/zlib %dir %{_licensedir}/%{name}/include %dir %{_licensedir}/%{name}/system %{_libdir}/%{name}/include %{_libdir}/%{name}/lib %{_libdir}/%{name}/system %files examples %license %{_licensedir}/%{name}/samples/LICENSE.txt %doc README.md %dir %{_licensedir}/%{name}/samples %{_datadir}/%{name}/examples %changelog * Fri Aug 28 2026 Ziyang Bai - 2022^git20260706.9484d8d-3 - Add Fedora 43, 44, 45, and Rawhide multi-architecture COPR support - Exclude big-endian s390x pending upstream genzehn endian support * Fri Aug 28 2026 Ziyang Bai - 2022^git20260706.9484d8d-2 - Remove prohibited, bundled-font, and prebuilt SDL sample content - Split development files and examples into policy-compliant subpackages - Restore native hardening, PIE, stripping, and debuginfo generation - Declare bundled target components and broaden host architecture support * Thu Aug 27 2026 Ziyang Bai - 2022^git20260706.9484d8d-1 - Package the pinned Ndless SDK snapshot with Fedora's ARM bare-metal toolchain