[tkgate] Append -DUSE_INTERP_RESULT to CFLAGS to work-around Tcl/Tk-8.6

corsepiu corsepiu at fedoraproject.org
Sat Jul 12 17:18:30 UTC 2014


commit 1a831f221de7955fef2d986823f712a25ad622ac
Author: Ralf Corsépius <corsepiu at fedoraproject.org>
Date:   Sat Jul 12 19:16:23 2014 +0200

    Append -DUSE_INTERP_RESULT to CFLAGS to work-around Tcl/Tk-8.6
    
      incompatibilities (FTBFS RHBZ #1107452).
    - Adopt tkgate-2.0-typos.patch, tkgate-2.0-hardening.patch from Debian
      (FTBFS RHBZ #1107452, RHBZ #1037359).
    - Partially modernize spec.
    - Don't ship *.orig2 editor backup files.
    - Make locale packages noarch.
    - Fix paths to tools.
    - Rebase patches.
    - Reflect Source0: having changed.

 .gitignore                 |    2 +-
 sources                    |    2 +-
 tkgate-2.0-doc.patch       |    9 ++++---
 tkgate-2.0-hardening.patch |   26 +++++++++++++++++++++
 tkgate-2.0-lm.patch        |   24 ++++++++++---------
 tkgate-2.0-typos.patch     |   36 +++++++++++++++++++++++++++++
 tkgate.spec                |   53 ++++++++++++++++++++++++++++++++++++-------
 7 files changed, 126 insertions(+), 26 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 7cfe265..6f87fb1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1 @@
-tkgate-2.0-b10.tar.gz
+/tkgate-2.0-b10.tgz
diff --git a/sources b/sources
index 79cf685..dadc12f 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-84ffe959868d39ec856b5ff1c70136c3  tkgate-2.0-b10.tar.gz
+84ffe959868d39ec856b5ff1c70136c3  tkgate-2.0-b10.tgz
diff --git a/tkgate-2.0-doc.patch b/tkgate-2.0-doc.patch
index c78acb5..f2989e5 100644
--- a/tkgate-2.0-doc.patch
+++ b/tkgate-2.0-doc.patch
@@ -1,6 +1,7 @@
---- Makefile.in	2009-01-11 01:13:54.000000000 +0100
-+++ Makefile.in_m	2009-01-21 22:47:18.000000000 +0100
-@@ -216,7 +216,7 @@
+diff -Naur tkgate-2.0-b10.orig/Makefile.in tkgate-2.0-b10/Makefile.in
+--- tkgate-2.0-b10.orig/Makefile.in	2009-09-27 02:24:56.000000000 +0200
++++ tkgate-2.0-b10/Makefile.in	2014-07-12 07:03:30.604924423 +0200
+@@ -234,7 +234,7 @@
  #
  # List of directories that contain data files necessary for tkgate to run.
  #
@@ -9,7 +10,7 @@
  
  #
  # Subdirectories in which more makefiles can be found 
-@@ -226,7 +226,7 @@
+@@ -244,7 +244,7 @@
  #
  # List of data files in this directory that should be included with a tkgate distribution.
  #
diff --git a/tkgate-2.0-hardening.patch b/tkgate-2.0-hardening.patch
new file mode 100644
index 0000000..a083865
--- /dev/null
+++ b/tkgate-2.0-hardening.patch
@@ -0,0 +1,26 @@
+diff -Naur tkgate-2.0-b10.fedora/src/tkgate/block.c tkgate-2.0-b10.work/src/tkgate/block.c
+--- tkgate-2.0-b10.fedora/src/tkgate/block.c	2009-02-22 22:55:03.000000000 +0100
++++ tkgate-2.0-b10.work/src/tkgate/block.c	2014-07-12 07:34:54.559475619 +0200
+@@ -908,7 +908,7 @@
+ 	char buf2[STRMAX];
+ 	strcpy(buf2,value+1);
+ 	buf2[l-2] = 0;
+-	sprintf(buf,quoteChars(buf,buf2,"\"\\"));
++	sprintf(buf,"%s",quoteChars(buf,buf2,"\"\\"));
+ 	fprintf(f,"\"%s\"",buf);
+       } else
+ 	fprintf(f,"\"%s\"",quoteChars(buf,value,"\"\\"));
+diff -Naur tkgate-2.0-b10.fedora/src/tkgate/expr.c tkgate-2.0-b10.work/src/tkgate/expr.c
+--- tkgate-2.0-b10.fedora/src/tkgate/expr.c	2009-01-22 01:09:52.000000000 +0100
++++ tkgate-2.0-b10.work/src/tkgate/expr.c	2014-07-12 07:34:54.560475595 +0200
+@@ -497,7 +497,9 @@
+     if (l < 0) return -1;
+     s += l; n -= l;
+     if (n < 4) return -1;
+-    s += sprintf("%s",findSymbol(e->op));n -= strlen(s);
++    /* the previous code, s += sprintf("%s",findSymbol(e->op)), */
++    /* seemed weird! How could it ever work?                    */
++    s += sprintf(s,"%s",findSymbol(e->op));n -= strlen(s);
+     l = Expr_sprint(s,n,e->r);
+     if (l < 0) return -1;
+     s += l; n -= l;
diff --git a/tkgate-2.0-lm.patch b/tkgate-2.0-lm.patch
index c719ad9..1e651cc 100644
--- a/tkgate-2.0-lm.patch
+++ b/tkgate-2.0-lm.patch
@@ -1,6 +1,16 @@
---- src/tkgate/Makefile.in	2010-03-23 03:55:30.000000000 -0500
-+++ src/tkgate/Makefile.in	2010-03-23 03:56:06.000000000 -0500
-@@ -266,7 +266,7 @@ 
+diff -Naur tkgate-2.0-b10.orig/src/tkgate/Makefile.am tkgate-2.0-b10/src/tkgate/Makefile.am
+--- tkgate-2.0-b10.orig/src/tkgate/Makefile.am	2009-01-21 06:42:19.000000000 +0100
++++ tkgate-2.0-b10/src/tkgate/Makefile.am	2014-07-12 07:07:13.395328575 +0200
+@@ -48,4 +48,4 @@
+ tkgate_LDFLAGS=@TKGATE_LPATH@ @X_LIBS@ @COMMON_LPATH@
+ tkgate_SOURCES=$(BASE_OBJS) main.c
+ #tkgate_LDADD=libtkgate.la
+-tkgate_LDADD=@TKGATE_LIB@ -lcommon
++tkgate_LDADD=@TKGATE_LIB@ -lcommon -lm
+diff -Naur tkgate-2.0-b10.orig/src/tkgate/Makefile.in tkgate-2.0-b10/src/tkgate/Makefile.in
+--- tkgate-2.0-b10.orig/src/tkgate/Makefile.in	2009-09-27 02:24:55.000000000 +0200
++++ tkgate-2.0-b10/src/tkgate/Makefile.in	2014-07-12 07:07:13.394328533 +0200
+@@ -266,7 +266,7 @@
  tkgate_LDFLAGS = @TKGATE_LPATH@ @X_LIBS@ @COMMON_LPATH@
  tkgate_SOURCES = $(BASE_OBJS) main.c
  #tkgate_LDADD=libtkgate.la
@@ -9,11 +19,3 @@
  all: $(BUILT_SOURCES)
  	$(MAKE) $(AM_MAKEFLAGS) all-am
  
---- src/tkgate/Makefile.am	2010-03-23 03:55:19.000000000 -0500
-+++ src/tkgate/Makefile.am	2010-03-23 03:55:41.000000000 -0500
-@@ -48,4 +48,4 @@ 
- tkgate_LDFLAGS=@TKGATE_LPATH@ @X_LIBS@ @COMMON_LPATH@
- tkgate_SOURCES=$(BASE_OBJS) main.c
- #tkgate_LDADD=libtkgate.la
--tkgate_LDADD=@TKGATE_LIB@ -lcommon
-+tkgate_LDADD=@TKGATE_LIB@ -lcommon -lm
diff --git a/tkgate-2.0-typos.patch b/tkgate-2.0-typos.patch
new file mode 100644
index 0000000..cc1ebe8
--- /dev/null
+++ b/tkgate-2.0-typos.patch
@@ -0,0 +1,36 @@
+diff -Naur tkgate-2.0-b10.fedora/src/tkgate/joint.c tkgate-2.0-b10.work/src/tkgate/joint.c
+--- tkgate-2.0-b10.fedora/src/tkgate/joint.c	2009-01-22 01:09:52.000000000 +0100
++++ tkgate-2.0-b10.work/src/tkgate/joint.c	2014-07-12 07:33:25.551106544 +0200
+@@ -443,7 +443,7 @@
+ 
+   td = wireorient(w->nodes,0);
+   if (td == -1) {
+-    logError(ERL_WARN,"Wierd place for 0-wire 1 in joint_fixwires.");
++    logError(ERL_WARN,"Weird place for 0-wire 1 in joint_fixwires.");
+     return;
+   }
+ 
+diff -Naur tkgate-2.0-b10.fedora/src/tkgate/tkgatewin.c tkgate-2.0-b10.work/src/tkgate/tkgatewin.c
+--- tkgate-2.0-b10.fedora/src/tkgate/tkgatewin.c	2009-02-03 16:24:32.000000000 +0100
++++ tkgate-2.0-b10.work/src/tkgate/tkgatewin.c	2014-07-12 07:33:25.551106544 +0200
+@@ -1651,7 +1651,7 @@
+   SimInterface_init(&TkGate.circuit->simulator);
+ 
+   if (sync_Xserver) {
+-    printf("[synchonized X11 connection]\n");
++    printf("[synchronized X11 connection]\n");
+     XSynchronize(TkGate.D,True);
+   }
+   
+diff -Naur tkgate-2.0-b10.fedora/src/tkgate/verify.c tkgate-2.0-b10.work/src/tkgate/verify.c
+--- tkgate-2.0-b10.fedora/src/tkgate/verify.c	2009-01-22 01:09:53.000000000 +0100
++++ tkgate-2.0-b10.work/src/tkgate/verify.c	2014-07-12 07:33:25.552106530 +0200
+@@ -144,7 +144,7 @@
+   switch (g->typeinfo->Code) {
+   case GC_TAP :
+     if (g->wires[TAP_IN]->net != g->wires[TAP_OUT]->net)
+-      verify_error(m,"tap 0x%x(%s) has inconsistant attachments.",
++      verify_error(m,"tap 0x%x(%s) has inconsistent attachments.",
+ 		   g,g->ename,g->wires[TAP_IN]->net->n_signame,g->wires[TAP_OUT]->net->n_signame);
+     break;
+   }
diff --git a/tkgate.spec b/tkgate.spec
index fc2e0e1..e66fe91 100644
--- a/tkgate.spec
+++ b/tkgate.spec
@@ -1,6 +1,6 @@
 Name:           tkgate
 Version:        2.0
-Release:        19.beta10%{?dist}
+Release:        20.beta10%{?dist}
 Summary:        An event driven digital circuit simulator
 
 Group:          Applications/Engineering
@@ -9,9 +9,19 @@ URL:            http://www.tkgate.org/
 
 Patch0:         tkgate-2.0-doc.patch
 Patch1:         tkgate-2.0-lm.patch
-Source0:        ftp://gadoid.ices.cmu.edu/pub/tkgate/pre-release/%{name}-%{version}-b10.tar.gz
+# From debian wheezy
+Patch2:         tkgate-2.0-typos.patch
+# From debian wheezy
+Patch3:         tkgate-2.0-hardening.patch
 
-BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+Source0:        http://www.tkgate.org/downloads/%{name}-%{version}-b10.tar.gz
+
+%{?el5:BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)}
+
+# el5/el6 have been shipped with vendor prefixed desktop files
+# We must continue to do so until EOL of these distros.
+%{?el5:%global vendor_desktop 1}
+%{?el6:%global vendor_desktop 1}
 
 BuildRequires:  tk-devel tcl-devel libICE-devel libSM-devel
 BuildRequires:  desktop-file-utils
@@ -28,6 +38,7 @@ well as user-defined modules for hierarchical design.
 Summary:           Locales and examples for tkgate, Digital Circuit Simulator
 Group:             Documentation
 Requires:          %{name} = %{version}-%{release}
+%{?!el5:BuildArch:         noarch}
 
 %description ca
 This package contains the Catalan locales and examples for tkgate, 
@@ -37,6 +48,7 @@ Digital Circuit Simulator
 Summary:           Locales and examples for tkgate, Digital Circuit Simulator
 Group:             Documentation
 Requires:          %{name} = %{version}-%{release}
+%{?!el5:BuildArch:         noarch}
 
 %description cs
 This package contains the Czech locales and examples for tkgate, 
@@ -46,6 +58,7 @@ Digital Circuit Simulator
 Summary:           Locales and examples for tkgate, Digital Circuit Simulator
 Group:             Documentation
 Requires:          %{name} = %{version}-%{release}
+%{?!el5:BuildArch:         noarch}
 
 %description cy
 This package contains the Welsh locales and examples for tkgate, 
@@ -55,6 +68,7 @@ Digital Circuit Simulator
 Summary:           Locales and examples for tkgate, Digital Circuit Simulator
 Group:             Documentation
 Requires:          %{name} = %{version}-%{release}
+%{?!el5:BuildArch:         noarch}
 
 %description de
 This package contains the German locales and examples for tkgate, 
@@ -64,6 +78,7 @@ Digital Circuit Simulator
 Summary:           Locales and examples for tkgate, Digital Circuit Simulator
 Group:             Documentation
 Requires:          %{name} = %{version}-%{release}
+%{?!el5:BuildArch:         noarch}
 
 %description es
 This package contains the Spanish locales and examples for tkgate, 
@@ -73,6 +88,7 @@ Digital Circuit Simulator
 Summary:           Locales and examples for tkgate, Digital Circuit Simulator
 Group:             Documentation
 Requires:          %{name} = %{version}-%{release}
+%{?!el5:BuildArch:         noarch}
 
 %description fr
 This package contains the French locales and examples for tkgate, 
@@ -82,6 +98,7 @@ Digital Circuit Simulator
 Summary:           Locales and examples for tkgate, Digital Circuit Simulator
 Group:             Documentation
 Requires:          %{name} = %{version}-%{release}
+%{?!el5:BuildArch:         noarch}
 
 %description it
 This package contains the Italian locales and examples for tkgate, 
@@ -92,6 +109,7 @@ Digital Circuit Simulator
 Summary:           Locales and examples for tkgate, Digital Circuit Simulator
 Group:             Documentation
 Requires:          %{name} = %{version}-%{release}
+%{?!el5:BuildArch:         noarch}
 
 %description ja
 This package contains the Japanese locales and examples for tkgate, 
@@ -101,17 +119,21 @@ Digital Circuit Simulator
 %prep
 %setup -q -n %{name}-%{version}-b10
 
-%patch0 -p0 -b .doc
-%patch1 -p0 -b .lm
+%patch0 -p1
+%patch1 -p1
+%patch2 -p1
+%patch3 -p1
 
+# propagate paths to sources
 sed -i "s|\"\${tkg_gateHome}/libexec/verga\"|\"%{_bindir}/verga\"|" scripts/parms.tcl
+sed -i "s|\"%s/libexec/tkgate\",TkGate\.homedir|\"%{_bindir}/tkgate\"|" src/tkgate/verilog_out.c
 
 sed -i "s|license.txt||" scripts/license.tcl
 sed -i "s|TKGATE_LIBDIRS=\"\(.*\)\"|TKGATE_LIBDIRS=\"\1 %{_libdir}\"|" configure
 # E: backup-file-in-package
 find . -type f -name "*~" -exec rm -f  {} ';'
 find . -type f -name "\#*\#" -exec rm -f  {} ';'
-find . -type f \( -name "*.bak" -o -name "*.orig" -o -name "*.old" \) -delete
+find . -type f \( -name "*.bak" -o -name "*.orig" -o -name "*.old" -o -name "*.orig2" \) -delete
 find . -type f -name orig-messages -delete
 
 # spurious-executable-perm
@@ -140,12 +162,13 @@ EOF
 
 
 %build
+CFLAGS="%{optflags} -DUSE_INTERP_RESULT"
 %configure
 %{__make} %{?_smp_mflags} 
 
 
 %install
-%{__rm} -rf %{buildroot}
+%{?el5:%{__rm} -rf %{buildroot}}
 %{__make} INSTALL="install -p" install DESTDIR=%{buildroot}
 
 # Symlink points to BuildRoot:
@@ -153,7 +176,7 @@ EOF
 
 
 # desktop file and its icon
-desktop-file-install            \
+desktop-file-install %{?vendor_desktop:--vendor fedora} \
     --dir %{buildroot}%{_datadir}/applications \
     %{name}.desktop
 
@@ -209,7 +232,7 @@ cp -p site-preferences %{buildroot}%{_datadir}/%{name}/site-preferences
 %{_mandir}/man1/gmac.1.gz
 %{_mandir}/man1/tkgate.1.gz
 %{_mandir}/man1/verga.1.gz
-%{_datadir}/applications/%{name}.desktop
+%{_datadir}/applications/%{?vendor_desktop:fedora-}%{name}.desktop
 %{_datadir}/pixmaps/%{name}.png
 %exclude %{_datadir}/%{name}/locale/ca
 %exclude %{_datadir}/%{name}/locale/cs
@@ -221,6 +244,18 @@ cp -p site-preferences %{buildroot}%{_datadir}/%{name}/site-preferences
 %exclude %{_datadir}/%{name}/locale/ja
 
 %changelog
+* Sat Jul 12 2014 Ralf Corsépius <corsepiu at fedoraproject.org> - 2.0-20.beta10
+- Append -DUSE_INTERP_RESULT to CFLAGS to work-around Tcl/Tk-8.6
+  incompatibilities (FTBFS RHBZ #1107452).
+- Adopt tkgate-2.0-typos.patch, tkgate-2.0-hardening.patch from Debian
+  (FTBFS RHBZ #1107452, RHBZ #1037359).
+- Partially modernize spec.
+- Don't ship *.orig2 editor backup files.
+- Make locale packages noarch.
+- Fix paths to tools.
+- Rebase patches.
+- Reflect Source0: having changed.
+
 * Sat Jul 12 2014 Ville Skyttä <ville.skytta at iki.fi> - 2.0-19.beta10
 - Don't ship editor backup files
 - Fix bogus dates in %%changelog


More information about the scm-commits mailing list