%global pkgvers 0 %global scdate0 20241107 %global schash0 22c22228b387cbd1db229bb83eedf9e2964f78c1 %global branch0 master %global source0 https://github.com/RTimothyEdwards/magic.git %global sshort0 %{expand:%%{lua:print(('%{schash0}'):sub(1,8))}} Name: magic Version: %(curl -s https://raw.githubusercontent.com/rtimothyedwards/magic/%{schash0}/VERSION) Release: %{scdate0}.%{pkgvers}.git%{sshort0}%{?dist} Summary: A very capable VLSI layout tool License: MIT URL: http://opencircuitdesign.com/magic/ Source1: %{name}.desktop Source2: %{name}.png Patch1: %{name}-7.4.35-64bit.patch BuildRequires: make gcc BuildRequires: desktop-file-utils tcsh git python3 BuildRequires: cairo-devel libGL-devel libGLU-devel libGLw-devel BuildRequires: libXext-devel libXi-devel libXmu-devel tk-devel m4 %if 0%{?fedora} BuildRequires: blt %endif %undefine __brp_mangle_shebangs %description Magic is a venerable VLSI layout tool. Magic VLSI remains popular with universities and small companies. Magic is widely cited as being the easiest tool to use for circuit layout, even for people who ultimately rely on commercial tools for their product design flow. %package doc Summary: Documentation for magic, A very capable VLSI layout tool Requires: %{name} = %{version}-%{release} %description doc This package contains the documentation of magic in the postscript and some tutorials. %prep %setup -T -c -n %{name} git clone --depth 1 -n -b %{branch0} %{source0} . git fetch --depth 1 origin %{schash0} git reset --hard %{schash0} git log --format=fuller rm -rf readline sed -i.cflags -e 's|CFLAGS=.*CFLAGS|:|' configure sed -i.nocpp \ scripts/configure.in scripts/configure \ -e 's|-lstdc++||' %{nil} sed -i.arch scripts/defs.mak.in \ -e 's|^INSTALL_LIBDIR.*$|INSTALL_LIBDIR\t=%{_libdir}|' sed -i "s|/usr/local/bin/tclsh|%{_bindir}/tclsh|" tcltk/strip_reflibs.tcl sed -i "s|package require -exact|package require|" tcltk/tkcon.tcl %if "x%{?__isa_bits}" == "x64" %patch -P 1 -p0 -b .64bit %endif # Doesn't seem to need these. sed -i scripts/configure -e 's| -lfontconfig -lfreetype||' %global optflags %(echo "%{optflags} -Wno-error=implicit-function-declaration -Wno-error=implicit-int" | sed -e 's|-Werror=format-security||') %build export WISH=%{_bindir}/wish %configure \ --with-tcl=%{_libdir} \ --with-tk=%{_libdir} \ --with-tcllibs=%{_libdir} \ --with-tklibs=%{_libdir} \ %{nil} sed -i 's|readline||g' defs.mak sed -i 's|readline||g' scripts/defs.mak #%make %%{?_smp_mflags} # Parallel make _silently_ fails make -j1 %install make install \ DESTDIR=%{buildroot} \ INSTALL="%{__install} -c -p" \ CP="%{__cp} -p" desktop-file-install \ --vendor "" \ --dir %{buildroot}%{_datadir}/applications/ \ %{SOURCE1} # applying timestamps cp -pr README* TODO VERSION scmos/ .. cp -pr %{buildroot}%{_libdir}/%{name}/{doc/,tutorial} .. rm -rf %{buildroot}%{_libdir}/%{name}/{doc/,tutorial} rm -f doc/html/Makefile chmod -x %{buildroot}%{_libdir}/%{name}/tcl/console.tcl mkdir -p %{buildroot}%{_datadir}/icons/hicolor/128x128/apps/ install -cpm 0644 %{SOURCE2} \ %{buildroot}%{_datadir}/icons/hicolor/128x128/apps/%{name}.png # Remove manpage currently unused for TCL building # to avoid file conflict (bug 1330507) rm -f %{buildroot}%{_mandir}/man1/extcheck.1* %files %doc README* %doc TODO %doc VERSION %{_bindir}/%{name} %{_bindir}/ext2sim %{_bindir}/ext2spice %dir %{_libdir}/%{name}/ %dir %{_libdir}/%{name}/tcl/ %{_libdir}/%{name}/sys/ %{_libdir}/%{name}/tcl/bitmaps/ %{_libdir}/%{name}/tcl/*tcl %{_libdir}/%{name}/tcl/*.so %{_libdir}/%{name}/tcl/magicdnull %{_libdir}/%{name}/tcl/magicexec %{_mandir}/man?/* %{_datadir}/applications/%{name}.desktop %{_datadir}/icons/hicolor/128x128/apps/%{name}.png %files doc %doc doc/ %doc scmos/ %changelog * Thu Dec 23 2021 Cristian Balint - upstream github build * Mon Dec 20 2021 Mamoru TASAKA - 8.3.241-1 - 8.3.241