diff options
author | CoprDistGit <infra@openeuler.org> | 2024-11-16 15:30:32 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2024-11-16 15:30:32 +0000 |
commit | c812b53a244709b5cd75325d4268644134d1019b (patch) | |
tree | 2c0891cacbd9492299f57c4f17b3712b85586b72 | |
parent | fe54ced5ac54756f5c6f0bb92ad5918907f8e2a3 (diff) |
automatic import of sqlite
-rw-r--r-- | sqlite-Add-DESTDIR-support-to-the-tclextension-install-target.patch | 75 | ||||
-rw-r--r-- | sqlite-drop-tcl-at-sign.patch | 35 | ||||
-rw-r--r-- | sqlite.spec | 3 |
3 files changed, 106 insertions, 7 deletions
diff --git a/sqlite-Add-DESTDIR-support-to-the-tclextension-install-target.patch b/sqlite-Add-DESTDIR-support-to-the-tclextension-install-target.patch new file mode 100644 index 0000000..129d980 --- /dev/null +++ b/sqlite-Add-DESTDIR-support-to-the-tclextension-install-target.patch @@ -0,0 +1,75 @@ +Index: Makefile.in +================================================================== +--- Makefile.in ++++ Makefile.in +@@ -1598,11 +1598,11 @@ + + # Install the SQLite TCL extension in a way that is appropriate for $TCLSH_CMD + # to find it. + # + tclextension-install: tclsqlite3.c +- $(TCLSH_CMD) $(TOP)/tool/buildtclext.tcl --cc "$(CC)" $(CFLAGS) $(OPT_FEATURE_FLAGS) $(OPTS) ++ $(TCLSH_CMD) $(TOP)/tool/buildtclext.tcl --destdir "$(DESTDIR)" --cc "$(CC)" $(CFLAGS) $(OPT_FEATURE_FLAGS) $(OPTS) + + # Install the SQLite TCL extension that is used by $TCLSH_CMD + # + tclextension-uninstall: + $(TCLSH_CMD) $(TOP)/tool/buildtclext.tcl --uninstall + +Index: tool/buildtclext.tcl +================================================================== +--- tool/buildtclext.tcl ++++ tool/buildtclext.tcl +@@ -13,10 +13,11 @@ + --build-only Only build the extension, don't install it + --cc COMPILER Build using this compiler + --info Show info on existing SQLite TCL extension installs + --install-only Install an extension previously build + --uninstall Uninstall the extension ++ --destdir DIR Installation root (used by "make install DESTDIR=...") + + Other options are retained and passed through into the compiler.} + + + set build 1 +@@ -23,10 +24,11 @@ + set install 1 + set uninstall 0 + set infoonly 0 + set CC {} + set OPTS {} ++set DESTDIR ""; # --destdir "$(DESTDIR)" + for {set ii 0} {$ii<[llength $argv]} {incr ii} { + set a0 [lindex $argv $ii] + if {$a0=="--install-only"} { + set build 0 + } elseif {$a0=="--build-only"} { +@@ -40,10 +42,13 @@ + set install 0 + set infoonly 1 + } elseif {$a0=="--cc" && $ii+1<[llength $argv]} { + incr ii + set CC [lindex $argv $ii] ++ } elseif {$a0=="--destdir" && $ii+1<[llength $argv]} { ++ incr ii ++ set DESTDIR [lindex $argv $ii] + } elseif {[string match -* $a0]} { + append OPTS " $a0" + } else { + puts stderr "Unknown option: \"$a0\"\n" + puts stderr $help +@@ -243,12 +248,12 @@ + } + + + if {$install} { + # Install the extension +- set DEST2 $DEST/sqlite$VERSION ++ set DEST2 ${DESTDIR}$DEST/sqlite$VERSION + file mkdir $DEST2 + puts "installing $DEST2/pkgIndex.tcl" + file copy -force pkgIndex.tcl $DEST2 + puts "installing $DEST2/$OUT" + file copy -force $OUT $DEST2 + } + diff --git a/sqlite-drop-tcl-at-sign.patch b/sqlite-drop-tcl-at-sign.patch index a1391bb..a19d9d0 100644 --- a/sqlite-drop-tcl-at-sign.patch +++ b/sqlite-drop-tcl-at-sign.patch @@ -1,8 +1,23 @@ -Index: sqlite/tool/buildtclext.tcl +Index: tool/buildtclext.tcl ================================================================== ---- a/tool/buildtclext.tcl -+++ a/tool/buildtclext.tcl -@@ -140,12 +140,13 @@ +--- tool/buildtclext.tcl ++++ tool/buildtclext.tcl +@@ -105,11 +105,11 @@ + # + #puts "using $LIBDIR/tclConfig.sh" + set fd [open $LIBDIR/tclConfig.sh rb] + set tclConfig [read $fd] + close $fd +- ++ + # Extract parameter we will need from the tclConfig.sh file + # + set TCLMAJOR 8 + regexp {TCL_MAJOR_VERSION='(\d)'} $tclConfig all TCLMAJOR + set SUFFIX so +@@ -138,18 +138,21 @@ + regexp {TCL_SHLIB_LD='([^']+)'} $tclConfig all cmd + set LDFLAGS "$INC -DUSE_TCL_STUBS" if {[string length $OPTS]>1} { append LDFLAGS $OPTS } @@ -12,8 +27,16 @@ Index: sqlite/tool/buildtclext.tcl } else { set OUT libsqlite$VERSION.$SUFFIX } -+ set @ $OUT; # workaround for https://sqlite.org/forum/forumpost/6b1af7eb10884373 ++ set @ $OUT; # Workaround for https://sqlite.org/forum/forumpost/0683a49cb02f31a1 ++ # in which Gentoo edits their tclConfig.sh to include an soname ++ # linker flag which includes ${@} (the target file's name). + set CMD [subst $cmd] } - +- ++ # Show information about prior installs + # + if {$infoonly} { + set cnt 0 + foreach dir $auto_path { + diff --git a/sqlite.spec b/sqlite.spec index f49079a..50265c8 100644 --- a/sqlite.spec +++ b/sqlite.spec @@ -12,6 +12,7 @@ Source0: https://www.sqlite.org/2024/sqlite-src-%{extver}.zip Source1: http://www.sqlite.org/2024/sqlite-doc-%{extver}.zip Source2: https://www.sqlite.org/2024/sqlite-autoconf-%{extver}.tar.gz Patch0: sqlite-drop-tcl-at-sign.patch +Patch1: sqlite-Add-DESTDIR-support-to-the-tclextension-install-target.patch BuildRequires: gcc autoconf tcl tcl-devel BuildRequires: ncurses-devel readline-devel glibc-devel @@ -53,7 +54,7 @@ This contains man files and HTML files for the using of sqlite. %prep #autosetup will fail because of 2 zip files %setup -q -a1 -n %{name}-src-%{extver} -%autopatch -p1 +%autopatch -p0 rm -f %{name}-doc-%{extver}/sqlite.css~ || : |