%global pkgvers 0 %global scdate0 20241203 %global sctags0 v0.29.10 %global source0 https://github.com/KLayout/klayout.git Name: klayout Version: %(curl -s https://raw.githubusercontent.com/KLayout/klayout/%{sctags0}/version.sh | grep KLAYOUT_VERSION= | cut -d'"' -f2) Release: %{scdate0}.%{pkgvers}%{?dist} Summary: Your Mask Layout Friend License: GPLv23 URL: https://www.klayout.de Patch0: klayout-gcc12.patch BuildRequires: gcc-c++ make cmake flex bison swig libgit2-devel BuildRequires: zlib-devel python3 tcl-devel git python3-devel ruby-devel expat-devel BuildRequires: qt5-qtbase-devel qt5-qtxmlpatterns-devel desktop-file-utils libcurl-devel BuildRequires: qt5-qtmultimedia-devel qt5-qtsvg-devel qt5-qttools-devel libpng-devel Requires: qt5-qtsvg rubygems %global _lto_cflags %{nil} %undefine _hardened_build %undefine _annotated_build %undefine _strict_symbol_defs_build %undefine _missing_build_ids_terminate_build %global __cmake_in_source_build 1 %description KLayout: Your Mask Layout Friend %package python3 Summary: Python files for %{name} Requires: %{name} = %{version}-%{release} %description python3 This package contains python files for %{name} %prep %setup -T -c -n %{name} git clone --depth 1 -n -b %{sctags0} %{source0} . git reset --hard %{sctags0} git log --format=fuller %patch -P 0 -p0 -b .gcc12~ %build sed -i '/RPATH="$RPATH"/d' build.sh sed -i '/$MAKE_PRG install/d' build.sh sed -i '/$MAKE_PRG $MAKE_OPT/d' build.sh sed -i '/QMAKE_AR/,/QMAKE_CFLAGS_DEBUG/d' build.sh sed -i 's|INCLUDEPATH +=|INCLUDEPATH += $$OUT_PWD/../../layui/layui|g' src/lay/lay/lay.pro sed -i 's|-fvisibility=hidden|-fvisibility=hidden %{optflags} -std=c++14|' src/klayout.pri ./build.sh -qt5 -expert \ -python python3 \ -qmake qmake-qt5 \ -libpng -libcurl -libexpat \ -option %{?_smp_mflags} pushd build-release # parallel build fails gmake %{?_smp_mflags} VERBOSE=0 || true # finish in single thread gmake popd %install rm -rf %{buildroot} pushd build-release gmake install popd # libraries mkdir -p %{buildroot}/%{_libdir} mv -f bin-release/*.so* %{buildroot}/%{_libdir} mv -f bin-release/db_plugins %{buildroot}/%{_libdir}/ mv -f bin-release/lay_plugins %{buildroot}/%{_libdir}/ # python modules mkdir -p %{buildroot}/%{python3_sitearch} mv -f bin-release/pymod/* %{buildroot}/%{python3_sitearch}/ # binaries mkdir -p %{buildroot}/%{_bindir} mv -f bin-release/str* $f %{buildroot}/%{_bindir} mv -f bin-release/klayout $f %{buildroot}/%{_bindir} # Install Desktop file mkdir -p %{buildroot}%{_datadir}/applications desktop-file-install \ --dir=%{buildroot}%{_datadir}/applications \ etc/%{name}.desktop # Install MimeType file mkdir -p %{buildroot}%{_datadir}/mime/packages install -pm 0644 etc/%{name}.metainfo.xml %{buildroot}%{_datadir}/mime/packages/%{name}.metainfo.xml # Install appdata file mkdir -p %{buildroot}%{_datadir}/appdata install -pm 0644 etc/logo.png %{buildroot}%{_datadir}/appdata/%{name}.png %post /usr/bin/update-desktop-database &> /dev/null || : /usr/bin/update-mime-database %{_datadir}/mime &> /dev/null || : %postun /usr/bin/update-desktop-database &> /dev/null || : /usr/bin/update-mime-database %{_datadir}/mime &> /dev/null || : %files %license LICENSE %doc README.md %doc samples %{_bindir}/* %{_libdir}/*.so* %{_libdir}/*plugins/*.so* %{_datadir}/appdata/%{name}.png %{_datadir}/applications/%{name}.desktop %{_datadir}/mime/packages/%{name}.metainfo.xml %files python3 %{python3_sitearch}/* %changelog * Thu Dec 31 2020 Cristian Balint - github update releases