%global debug_package %{nil} %global __strip /bin/true Name: ndless-sdk Version: 2022^git20260706.9484d8d Release: 1%{?dist} Summary: SDK for programs targeting Ndless on the TI-Nspire License: MPL-1.1 AND LicenseRef-Fedora-Public-Domain AND LGPL-2.1-or-later AND LGPL-3.0-only AND Zlib AND FTL 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 Patch0: 0001-libsyscalls-define-path-max-for-newlib-4.5.patch Patch1: 0002-freetype-ignore-host-rpm-cflags.patch Patch2: 0003-linker-filter-fedora-default-libraries.patch ExclusiveArch: x86_64 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: boost-devel BuildRequires: gcc-c++ BuildRequires: make 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: make Requires: sed Requires: which %description Ndless SDK headers, libraries, host tools, wrappers, templates, and samples for building programs targeting Ndless on the TI-Nspire. The compiler, binutils, and C and C++ target libraries are supplied by Fedora's ARM bare-metal cross-toolchain packages. %prep %setup -q -n Ndless-9484d8da7c7a4dde9766138c2e42e1d1e3acfcd4 %patch -P 0 -p1 %patch -P 1 -p1 %patch -P 2 -p1 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 %build export PATH="$PWD/ndless-sdk/bin:%{_bindir}:$PATH" %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 %make_build -C ndless-sdk/samples clean %install sdkroot=%{buildroot}%{_libdir}/%{name} mkdir -p "$sdkroot" %{buildroot}%{_bindir} cp -a ndless-sdk/bin \ ndless-sdk/include \ ndless-sdk/lib \ ndless-sdk/system \ ndless-sdk/samples \ "$sdkroot/" 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" -name .gitignore -delete for tool in arm-none-eabi-ld.gold genzehn make-prg nspire-as nspire-g++ \ nspire-gcc nspire-ld nspire-tools sdl-config; do ln -s "%{_libdir}/%{name}/bin/$tool" \ "%{buildroot}%{_bindir}/$tool" 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/tools/luna/LICENSE \ "$licensedir/luna/LICENSE" install -Dpm0644 ndless-sdk/tools/genzehn/elfio-3.2/COPYING \ "$licensedir/elfio/COPYING" install -Dpm0644 ndless-sdk/include/SDL/SDL_copying.h \ "$licensedir/SDL/SDL_copying.h" install -Dpm0644 ndless-sdk/include/LICENSE.txt \ "$licensedir/include/LICENSE.txt" install -Dpm0644 ndless-sdk/system/LICENSE.txt \ "$licensedir/system/LICENSE.txt" %files %license %{_licensedir}/%{name}/Mozilla-Public-License-v1.1.html %license %{_licensedir}/%{name}/nspire-io/LICENSE %license %{_licensedir}/%{name}/freetype2/LICENSE.TXT %license %{_licensedir}/%{name}/luna/LICENSE %license %{_licensedir}/%{name}/elfio/COPYING %license %{_licensedir}/%{name}/SDL/SDL_copying.h %license %{_licensedir}/%{name}/include/LICENSE.txt %license %{_licensedir}/%{name}/system/LICENSE.txt %{_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 %{_bindir}/sdl-config %{_libdir}/%{name}/bin %{_libdir}/%{name}/include %{_libdir}/%{name}/lib %{_libdir}/%{name}/samples %{_libdir}/%{name}/system %{_libdir}/%{name}/tools %changelog * Thu Aug 27 2026 Ziyang - 2022^git20260706.9484d8d-1 - Package the pinned Ndless SDK snapshot with Fedora's ARM bare-metal toolchain