Subject: tcc: use dpatch Package: tcc Severity: minor Version: 0.9.23-4 Tags: patch
Hi, I thought it would be nice to put the mainstream source patches into dpatch. Here is the result, with the git diff summary. Cheers, debian/changelog | 6 ++ debian/control | 2 +- debian/patches/00list | 4 + debian/patches/01_dont_install_libinstall.dpatch | 21 ++++++ debian/patches/02_fix_hardcoded_local_path.dpatch | 54 ++++++++++++++++ .../patches/03_add_va_copy_define_in_stdarg.dpatch | 20 ++++++ .../04_add_bsd_kernel_and_fix_term_in_tcc.dpatch | 68 ++++++++++++++++++++ debian/rules | 5 +- 8 files changed, 177 insertions(+), 3 deletions(-) create mode 100644 debian/patches/00list create mode 100755 debian/patches/01_dont_install_libinstall.dpatch create mode 100755 debian/patches/02_fix_hardcoded_local_path.dpatch create mode 100755 debian/patches/03_add_va_copy_define_in_stdarg.dpatch create mode 100755 debian/patches/04_add_bsd_kernel_and_fix_term_in_tcc.dpatch mode change 100644 => 100755 debian/rules -- System Information: Debian Release: 4.0 APT prefers feisty-updates APT policy: (500, 'feisty-updates'), (500, 'feisty-security'), (500, 'feisty-proposed'), (500, 'feisty-backports'), (500, 'feisty') Architecture: i386 (i686) -- no debconf information -- Marc-André Lureau, GSmartMix
From 69861150ab83cdfe81614abe5a7286154bb473dd Mon Sep 17 00:00:00 2001 From: Marc-Andre Lureau <[EMAIL PROTECTED]> Date: Sun, 15 Apr 2007 18:53:11 +0300 Subject: [PATCH] add dpatch --- debian/changelog | 6 ++ debian/control | 2 +- debian/patches/00list | 4 + debian/patches/01_dont_install_libinstall.dpatch | 21 ++++++ debian/patches/02_fix_hardcoded_local_path.dpatch | 54 ++++++++++++++++ .../patches/03_add_va_copy_define_in_stdarg.dpatch | 20 ++++++ .../04_add_bsd_kernel_and_fix_term_in_tcc.dpatch | 68 ++++++++++++++++++++ debian/rules | 5 +- 8 files changed, 177 insertions(+), 3 deletions(-) create mode 100644 debian/patches/00list create mode 100755 debian/patches/01_dont_install_libinstall.dpatch create mode 100755 debian/patches/02_fix_hardcoded_local_path.dpatch create mode 100755 debian/patches/03_add_va_copy_define_in_stdarg.dpatch create mode 100755 debian/patches/04_add_bsd_kernel_and_fix_term_in_tcc.dpatch mode change 100644 => 100755 debian/rules diff --git a/debian/changelog b/debian/changelog index 1662a05..bff0321 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +tcc (0.9.23-5) unstable; urgency=low + + * Convert source patches to dpatch + + -- Marc-Andre Lureau <[EMAIL PROTECTED]> Sun, 15 Apr 2007 17:29:32 +0200 + tcc (0.9.23-4) unstable; urgency=low * debian/control: Update description as suggested by Moritz Muehlenhoff diff --git a/debian/control b/debian/control index e91d6e9..55507c8 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: tcc Section: devel Priority: optional Maintainer: Romain Francoise <[EMAIL PROTECTED]> -Build-Depends: debhelper (>= 4), texi2html, texinfo, perl +Build-Depends: debhelper (>= 4), dpatch, texi2html, texinfo, perl Standards-Version: 3.7.2 Package: tcc diff --git a/debian/patches/00list b/debian/patches/00list new file mode 100644 index 0000000..a966603 --- /dev/null +++ b/debian/patches/00list @@ -0,0 +1,4 @@ +01_dont_install_libinstall +02_fix_hardcoded_local_path +03_add_va_copy_define_in_stdarg +04_add_bsd_kernel_and_fix_term_in_tcc \ No newline at end of file diff --git a/debian/patches/01_dont_install_libinstall.dpatch b/debian/patches/01_dont_install_libinstall.dpatch new file mode 100755 index 0000000..e1d56ea --- /dev/null +++ b/debian/patches/01_dont_install_libinstall.dpatch @@ -0,0 +1,21 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 01_dont_install_libinstall.dpatch by Marc-Andre Lureau (elmarco) <[EMAIL PROTECTED]> +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Don't install libinstall + [EMAIL PROTECTED]@ + +diff --git a/Makefile b/Makefile +index 89f955b..0eb351c 100644 +--- a/Makefile ++++ b/Makefile +@@ -189,7 +189,7 @@ libtcc1.a: $(LIBTCC1_OBJS) + bcheck.o: bcheck.c + $(CC) -O2 -Wall -c -o $@ $< + +-install: tcc_install libinstall ++install: tcc_install # libinstall + + tcc_install: $(PROGS) tcc.1 libtcc1.a $(BCHECK_O) tcc-doc.html tcc.1 + mkdir -p "$(bindir)" diff --git a/debian/patches/02_fix_hardcoded_local_path.dpatch b/debian/patches/02_fix_hardcoded_local_path.dpatch new file mode 100755 index 0000000..30bf0c2 --- /dev/null +++ b/debian/patches/02_fix_hardcoded_local_path.dpatch @@ -0,0 +1,54 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 02_fix_hardcoded_local_path.dpatch by Marc-Andre Lureau (elmarco) <[EMAIL PROTECTED]> +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Fix hard-coded path + [EMAIL PROTECTED]@ + +diff --git a/examples/ex1.c b/examples/ex1.c +index 2dcff7d..b657891 100755 +--- a/examples/ex1.c ++++ b/examples/ex1.c +@@ -1,4 +1,4 @@ +-#! /usr/local/bin/tcc -run ++#! /usr/bin/tcc -run + #include <tcclib.h> + + int main() +diff --git a/examples/ex4.c b/examples/ex4.c +index 3a3fed7..c1dbb4d 100755 +--- a/examples/ex4.c ++++ b/examples/ex4.c +@@ -1,4 +1,4 @@ +-#!./tcc -run -L/usr/X11R6/lib -lX11 ++#!/usr/bin/tcc -run -L/usr/X11R6/lib -lX11 + #include <stdlib.h> + /* Yes, TCC can use X11 too ! */ + #include <stdio.h> +diff --git a/tcc-doc.texi b/tcc-doc.texi +index 15fe604..3e32096 100644 +--- a/tcc-doc.texi ++++ b/tcc-doc.texi +@@ -123,10 +123,10 @@ Compile @file{a.c} and @file{b.c}, link them together and generate the object fi + Scripting: + + TCC can be invoked from @emph{scripts}, just as shell scripts. You just +-need to add @code{#!/usr/local/bin/tcc -run} at the start of your C source: ++need to add @code{#!/usr/bin/tcc -run} at the start of your C source: + + @example +-#!/usr/local/bin/tcc -run ++#!/usr/bin/tcc -run + #include <stdio.h> + + int main() +@@ -173,7 +173,7 @@ tcc "-run -L/usr/X11R6/lib -lX11" ex4.c + In a script, it gives the following header: + + @example +-#!/usr/local/bin/tcc -run -L/usr/X11R6/lib -lX11 ++#!/usr/bin/tcc -run -L/usr/X11R6/lib -lX11 + #include <stdlib.h> + int main(int argc, char **argv) + @{ diff --git a/debian/patches/03_add_va_copy_define_in_stdarg.dpatch b/debian/patches/03_add_va_copy_define_in_stdarg.dpatch new file mode 100755 index 0000000..1a63dc2 --- /dev/null +++ b/debian/patches/03_add_va_copy_define_in_stdarg.dpatch @@ -0,0 +1,20 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 03_add_va_copy_define_in_stdarg.dpatch by Marc-Andre Lureau (elmarco) <[EMAIL PROTECTED]> +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Add va_copy macro + [EMAIL PROTECTED]@ + +diff --git a/stdarg.h b/stdarg.h +index d562d6d..a9b22b7 100644 +--- a/stdarg.h ++++ b/stdarg.h +@@ -6,6 +6,7 @@ typedef char *va_list; + /* only correct for i386 */ + #define va_start(ap,last) ap = ((char *)&(last)) + ((sizeof(last)+3)&~3) + #define va_arg(ap,type) (ap += (sizeof(type)+3)&~3, *(type *)(ap - ((sizeof(type)+3)&~3))) ++#define va_copy(dest, src) (dest) = (src) + #define va_end(ap) + + /* fix a buggy dependency on GCC in libio.h */ diff --git a/debian/patches/04_add_bsd_kernel_and_fix_term_in_tcc.dpatch b/debian/patches/04_add_bsd_kernel_and_fix_term_in_tcc.dpatch new file mode 100755 index 0000000..23fae7f --- /dev/null +++ b/debian/patches/04_add_bsd_kernel_and_fix_term_in_tcc.dpatch @@ -0,0 +1,68 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 04_add_bsd_kernel_and_fix_term_in_tcc.dpatch by Marc-Andre Lureau (elmarco) <[EMAIL PROTECTED]> +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Add FreeBSD kernel, fix some terminal code + [EMAIL PROTECTED]@ + +diff --git a/tcc.c b/tcc.c +index d7417e2..9180144 100644 +--- a/tcc.c ++++ b/tcc.c +@@ -717,7 +717,7 @@ int __stdcall FreeConsole(void); + #define strtof (float)strtod + #define strtoll (long long)strtol + #endif +-#elif defined(TCC_UCLIBC) || defined(__FreeBSD__) ++#elif defined(TCC_UCLIBC) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) + /* currently incorrect */ + long double strtold(const char *nptr, char **endptr) + { +@@ -5822,6 +5822,7 @@ static void gen_cast(CType *type) + /* we handle char/short/etc... with generic code */ + if (dbt != (VT_INT | VT_UNSIGNED) && + dbt != (VT_LLONG | VT_UNSIGNED) && ++ dbt != VT_BOOL && + dbt != VT_LLONG) + dbt = VT_INT; + if (c) { +@@ -5837,6 +5838,10 @@ static void gen_cast(CType *type) + case VT_LDOUBLE: vtop->c.ui = (unsigned int)vtop->c.d; break; + } + break; ++ case VT_BOOL: ++ vpushi(0); ++ gen_op(TOK_NE); ++ break; + default: + /* int case */ + switch(sbt) { +@@ -8403,6 +8408,9 @@ static void decl_initializer(CType *type, Section *sec, unsigned long c, + no_oblock = 1; + if ((first && tok != TOK_LSTR && tok != TOK_STR) || + tok == '{') { ++ if (tok != '{') ++ error("character array initializer must be a literal," ++ " optionally enclosed in braces"); + skip('{'); + no_oblock = 0; + } +@@ -9474,7 +9482,7 @@ static int rt_get_caller_pc(unsigned long *paddr, + int i; + + if (level == 0) { +-#if defined(__FreeBSD__) ++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) + *paddr = uc->uc_mcontext.mc_eip; + #elif defined(__dietlibc__) + *paddr = uc->uc_mcontext.eip; +@@ -9483,7 +9491,7 @@ static int rt_get_caller_pc(unsigned long *paddr, + #endif + return 0; + } else { +-#if defined(__FreeBSD__) ++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) + fp = uc->uc_mcontext.mc_ebp; + #elif defined(__dietlibc__) + fp = uc->uc_mcontext.ebp; diff --git a/debian/rules b/debian/rules old mode 100644 new mode 100755 index b117bfc..d616516 --- a/debian/rules +++ b/debian/rules @@ -1,4 +1,5 @@ #!/usr/bin/make -f +include /usr/share/dpatch/dpatch.make configure: configure-stamp @@ -11,13 +12,13 @@ configure-stamp: build: build-stamp -build-stamp: configure-stamp +build-stamp: patch-stamp configure-stamp dh_testdir $(MAKE) makeinfo tcc-doc.texi touch build-stamp -clean: +clean: unpatch dh_testdir dh_testroot rm -f build-stamp configure-stamp -- 1.5.0.rc4.26.gcc46a-dirty