pkgindex.patch 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. Description: Patch fixes loading the libBLT library from
  2. [package require BLT]. Specifically, it provides correct version
  3. BLT_PATCH_LEVEL and prevents loading the library twice (once
  4. by its real name and onr more time by a symlink if the blt-dev
  5. package is installed). Also, it skips initializing widget bindings
  6. if Tk isn't present.
  7. Author: Sergei Golovan
  8. Author: Steve Langasek <vorlon@debian.org>
  9. Last-Modified: Wed, 21 Mar 2018 10:53:10 +0300
  10. --- a/library/Makefile.in
  11. +++ b/library/Makefile.in
  12. @@ -5,6 +5,7 @@
  13. prefix = @prefix@
  14. exec_prefix = @exec_prefix@
  15. version = @BLT_VERSION@
  16. +patchlevel = @BLT_PATCH_LEVEL@
  17. lib_prefix = @BLT_LIB_PREFIX@
  18. srcdir = @srcdir@
  19. libdir = @libdir@
  20. @@ -49,6 +50,7 @@
  21. pkgIndex:
  22. rm -f pkgIndex.tcl
  23. sed -e 's/%VERSION%/$(version)/' $(srcdir)/pkgIndex.tcl.in | \
  24. + sed -e 's/%PATCHLEVEL%/$(patchlevel)/' | \
  25. sed -e 's/%LIB_PREFIX%/$(lib_prefix)/' | \
  26. sed -e 's;%LIB_DIR%;$(libdir);' > pkgIndex.tcl
  27. --- a/library/pkgIndex.tcl.in
  28. +++ b/library/pkgIndex.tcl.in
  29. @@ -7,23 +7,11 @@
  30. regsub {\.} $version {} version_no_dots
  31. set versuf $version$suffix
  32. + set taillib ${versuf}.[info tclversion]
  33. +
  34. # Determine whether to load the full BLT library or
  35. # the "lite" tcl-only version.
  36. - if {[package vcompare [info tclversion] 8.2] < 0} {
  37. - set taillib ${versuf}.8.0
  38. - } elseif {[package vcompare [info tclversion] 8.3] < 0} {
  39. - set taillib ${versuf}.8.2
  40. - } elseif {[package vcompare [info tclversion] 8.4] < 0} {
  41. - set taillib ${versuf}.8.3
  42. - } elseif {[package vcompare [info tclversion] 8.5] < 0} {
  43. - set taillib ${versuf}.8.4
  44. - } elseif {[package vcompare [info tclversion] 8.6] < 0} {
  45. - set taillib ${versuf}.8.5
  46. - } else {
  47. - set taillib ${versuf}.8.6
  48. - }
  49. -
  50. if { [info commands tk] == "tk" } {
  51. set name1 ${prefix}BLT.${taillib}
  52. set name2 ${prefix}BLT${version_no_dots}${suffix}
  53. @@ -49,11 +37,13 @@
  54. }
  55. if { ![file exists $library] } continue
  56. load $library BLT
  57. + break
  58. }
  59. }
  60. set version "%VERSION%"
  61. +set patchlevel %PATCHLEVEL%
  62. -package ifneeded BLT $version [list LoadBLT25 $version $dir]
  63. +package ifneeded BLT $patchlevel [list LoadBLT25 $version $dir]
  64. # End of package index file
  65. --- a/library/init.tcl
  66. +++ b/library/init.tcl
  67. @@ -8,7 +8,9 @@
  68. }
  69. }
  70. - initializeLibrary
  71. + if {[info commands tk] == "tk"} {
  72. + initializeLibrary
  73. + }
  74. }
  75. --- a/configure.in
  76. +++ b/configure.in
  77. @@ -977,6 +977,13 @@
  78. BLT_VERSION=${BLT_MAJOR_VERSION}.${BLT_MINOR_VERSION}
  79. +AC_MSG_CHECKING([BLT_PATCH_LEVEL])
  80. +AC_CACHE_VAL(blt_cv_patch_level,
  81. +AC_GREP_SYMBOL(blt_cv_patch_level, BLT_PATCH_LEVEL, ${srcdir}/generic/blt.h)
  82. +)
  83. +AC_MSG_RESULT([$blt_cv_patch_level])
  84. +BLT_PATCH_LEVEL=${blt_cv_patch_level}
  85. +
  86. # Add BLT to the run path
  87. libdir=${exec_prefix}/lib
  88. @@ -1386,6 +1393,7 @@
  89. AC_SUBST(DEFINES)
  90. AC_SUBST(BLT_MAJOR_VERSION)
  91. AC_SUBST(BLT_MINOR_VERSION)
  92. +AC_SUBST(BLT_PATCH_LEVEL)
  93. AC_SUBST(BLT_VERSION)
  94. AC_SUBST(AUX_LIBS)
  95. AC_SUBST(TCL_LIB_DIR)