#!/bin/sh # ===================================================================== # Projet : DARKMAKE # Fichier : compile # Auteur : Nicolas "DarkHack" Chapuis (c) 2026 # ================== DARKHACK ================== # [ darkweb.fr - system online ] # Powered by Perplexity, your AI assistant # [https://www.perplexity.ai](https://www.perplexity.ai) # ============================================== # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ===================================================================== rootDarkMake="${rootDarkMake:-/etc/darkmake}" if ! type "shInclude" > /dev/null; then # rootDarkContainer="${rootDarkContainer:-/etc/darkcontainer}" . /etc/darksh/lib/shTools shLog="${shLog:-"lib unistring install"}" shDebugEnable="${shDebugEnable:-1}" shDebug "$*" $(shInclude ${rootDarkMake}/pkg/lib-sh/pkg-config) fi autoPath="lib/system/libunistring" shErrorOnMissing "autoPath" #extraConfigure="" \ #. ${rootDarkMake}/lib/autotools/libtool/install/basics path_install_vars="${rootDarkMake}/${autoPath}/global/install_vars" \ . "${rootDarkMake}/pkg/bin/checks" shLog="[ $pkgName/$pkgVersion ]" M4DIR="$M4DIR -I${pkgSrc}/gnulib-m4" #PKG_M4DIR="-I${pkgSrc}/gnulib-m4" if [ ! -f "${pkgSrc}/.darkPatch" ];then touch "${pkgSrc}/.darkPatch" cd "${pkgSrc}" # cp $LIBTOOL ${pkgSrc}/ && echo cp $LIBTOOL ${pkgSrc}/ [ ! -f ${pkgSrc}/lib/Makefile.gnulib ] && cp ${rootDarkMake}/lib/system/libunistring/missing/Makefile.gnulib ${pkgSrc}/lib && echo cp ${rootDarkMake}/lib/system/libunistring/missing/Makefile.gnulib ${pkgSrc}/lib [ ! -f ${pkgSrc}/tests/Makefile.gnulib ] && cp ${rootDarkMake}/lib/system/libunistring/missing/testMakefile.gnulib ${pkgSrc}/tests/Makefile.gnulib && echo cp ${rootDarkMake}/lib/system/libunistring/missing/testMakefile.gnulib ${pkgSrc}/tests/Makefile.gnulib for fileP in lib/Makefile.gnulib tests/Makefile.gnulib;do file="${pkgSrc}/${fileP}" if [ -f "/usr/share/gnulib/build-aux/declared.sh" ];then echo " ${file}:lgpl:2or3" cp "/usr/share/gnulib/build-aux/declared.sh" ${pkgSrc}/lib else sed -i "s/\-\-lgpl=3orGPLv2/\-\-lgpl=3/g" "${file}" fi done sed -i "s/AC_INIT.*/AC_INIT( \[libunistring\] ,\[$(sh -c ". ${pkgSrc}/version.sh;echo \${VERSION_NUMBER}" )\] )/g" "${pkgSrc}/configure.ac" sed -i "s/\. \$srcdir\/version.sh.*//g" "${pkgSrc}/configure.ac" sed -i "s/gl_INIT_PACKAGE.*/gl_INIT_PACKAGE( \[libunistring\] ,\[$(sh -c ". ${pkgSrc}/version.sh;echo \${VERSION_NUMBER}" )\] )/g" "${pkgSrc}/configure.ac" gnuLibFilesToSearch="${pkgSrc}/lib/Makefile.gnulib" fi . ${rootDarkMake}/lib/autotools/libtool/install/basics #. ${rootDarkMake}/lib/autotools/libtool/install/init mypkgdirlog="${pkgDirLog}" mkdir "${pkgDirLog}/manual" pkgDirLog="${mypkgdirlog}/manual" #pkgDirLog="${mypkgdirlog}" # We need to patch unicase/special-casing-table.h for gperf < 3.1 GPERF_VER=$(gperf --version | { IFS=' .' read x y major minor bugfix _ printf "%d%02d%02d" $major $minor $bugfix }) if [ $GPERF_VER -le 30100 ]; then echo "Patching lib/unicase/special-casing-table.h/c for gperf < 3.1(1) =====================================" ## patchRegExp="s/gl_unicase_special_lookup.*/gl_unicase_special_lookup\ \(const char \*str, unsigned int len\);/g" # patchRegExp="s/const char \*str, unsigned int len/register const char \*str, register size_t len/g" # ## for file in lib/unicase/special-casing.h lib/unicase/special-casing.c;do # for file in lib/unicase/special-casing.h;do # if [ -f "$pkgSrc/$file" ];then # echo "patching:$pkgSrc/$file" # if [ ! -f $pkgSrc/$file.bak ];then cp $pkgSrc/$file $pkgSrc/$file.bak;fi # sed -i "$patchRegExp" $pkgSrc/$file # fi # done # patchRegExp="s/gl_unicase_special_lookup.*/gl_unicase_special_lookup\ \(const char \*str, unsigned int len\)/g" patchRegExp="s/register const char \*str, register size_t len/const char \*str, unsigned int len/g" for file in lib/unicase/special-casing-table.h;do if [ ! -f "$pkgSrc/$file" ];then echo "no file:$pkgSrc/$file" else echo "patching:$pkgSrc/$file" if [ ! -f $pkgSrc/$file.bak ];then cp $pkgSrc/$file $pkgSrc/$file.bak;fi sed -i "$patchRegExp" $pkgSrc/$file fi done fi cd $pkgSrc cpt=0 fileLog="${pkgDirLog}/C${cpt}_configureHelp.log" cpt=$((cpt + 1 ));shDebug 1 "CONFIGURE Help $fileLog" printEnv > $fileLog ./configure --help >> $fileLog 2>&1 fileLog="${pkgDirLog}/C${cpt}_configure.log" cpt=$((cpt + 1 ));shDebug 1 "CONFIGURE $fileLog" printEnv > $fileLog echo ./configure ${extraConfigure} >> $fileLog 2>&1 ./configure ${extraConfigure} >> $fileLog 2>&1 tail -50l $fileLog echo "Press any key to continue... ";read REPLY #sed -i "s/\/usr\/local\/lib\/libltdl.so //g" "${pkgSrc}/lib/Makefile" #cp $LIBTOOL ${pkgSrc}/ && echo cp $LIBTOOL ${pkgSrc}/ stdCleanMakeInstallWithCheck=1 . ${rootDarkMake}/lib/autotools/make/install/stdCleanMakeInstall --check exit # Change lib/unistr.h to be usable standalone. sed -e 's/if GNULIB_[A-Za-z0-9_]* || .*/if 1/g' \ -e 's/if GNULIB_[A-Za-z0-9_]*/if 1/g' \ -e 's/HAVE_INLINE/UNISTRING_HAVE_INLINE/g' \ < lib/unistr.in.h \ > lib/unistr.in.h.tmp \ && mv lib/unistr.in.h.tmp lib/unistr.in.h # Change lib/unictype.h and lib/uninorm.h for shared libraries on Woe32 systems. sed -e 's/extern const uc_general_category_t UC_/extern LIBUNISTRING_DLL_VARIABLE const uc_general_category_t UC_/' \ -e 's/extern const uc_property_t UC_/extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_/' \ < lib/unictype.in.h \ > lib/unictype.in.h.tmp \ && mv lib/unictype.in.h.tmp lib/unictype.in.h sed -e 's/extern const struct unicode_normalization_form /extern LIBUNISTRING_DLL_VARIABLE const struct unicode_normalization_form /' \ < lib/uninorm.in.h \ > lib/uninorm.in.h.tmp \ && mv lib/uninorm.in.h.tmp lib/uninorm.in.h sed -e 's/extern const casing_/extern LIBUNISTRING_DLL_VARIABLE const casing_/' \ < lib/unicase.in.h \ > lib/unicase.in.h.tmp \ && mv lib/unicase.in.h.tmp lib/unicase.in.h if [ ! -f "${pkgSrc}/configure" ];then echo "[ $pkgName/$pkgVersion ] ======== CORRECT UNICASE ========" [ ! -f ${pkgSrc}/lib/Makefile.gnulib ] && cp ${rootDarkMake}/lib/system/libunistring/missing/Makefile.gnulib ${pkgSrc}/lib && echo cp ${rootDarkMake}/lib/system/libunistring/missing/Makefile.gnulib ${pkgSrc}/lib [ ! -f ${pkgSrc}/tests/Makefile.gnulib ] && cp ${rootDarkMake}/lib/system/libunistring/missing/testMakefile.gnulib ${pkgSrc}/tests && echo cp ${rootDarkMake}/lib/system/libunistring/missing/testMakefile.gnulib ${pkgSrc}/tests echo "AUTOGEN:$pkgSrc" cd $pkgSrc fileLog="${pkgDirLog}/A0_autogen.log" printEnv > $fileLog echo ./autogen.sh $M4DIR >> $fileLog 2>&1 AUTOM4TE="${cmdAutom4te}" AUTOCONF="${cmdAutoconf}" AUTOHEADER="${cmdAutoheader}" AUTOMAKE="${cmdAutomake}" ACLOCAL="${cmdAclocal}" \ AUTOPOINT="${cmdAutopoint}" AUTOUPDATE="${cmdAutoupdate}" AUTOSCAN="${cmdAutoscan}" \ YACC="$YACC" INTLBISON="$INTLBISON" CC="$CC" CXX="$CXX" \ GNULIB_SRCDIR="$GNULIB_SRCDIR" GNULIB_TOOL="$GNULIB_TOOL" \ LIBGNU_LIBS="$LIBGNU_LIBS" LIBGNU_CFLAGS="$LIBGNU_CFLAGS" LIBGNU_PATH="$LIBGNU_PATH" \ LIBTOOL_LIBS="$LIBTOOL_LIBS" LIBTOOL_CFLAGS="$LIBTOOL_CFLAGS" LIBTOOL_PATH="$LIBTOOL_PATH" LIBTOOL="$LIBTOOL" LIBTOOLIZE="$LIBTOOLIZE" \ LIBRARY_PATH="$LIBRARY_PATH" LD_RUN_PATH="$LD_RUN_PATH" LD_LIBRARY_PATH="$LD_LIBRARY_PATH" \ M4DIR="$M4DIR" LIBS="$LIBS" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" LDFLAGS="$LDFLAGS" \ ./autogen.sh $M4DIR >> $fileLog 2>&1 AUTORECONF_CONF="${AUTORECONF_CONF:-$M4DIR -ivf}" echo "AUTORECONF:$pkgSrc $AUTORECONF_CONF" fileLog="${pkgDirLog}/A1_autoreconf.log" printEnv > $fileLog echo $cmdAutoreconf $AUTORECONF_CONF >> $fileLog 2>&1 AUTOM4TE="${cmdAutom4te}" AUTOCONF="${cmdAutoconf}" AUTOHEADER="${cmdAutoheader}" AUTOMAKE="${cmdAutomake}" ACLOCAL="${cmdAclocal}" \ AUTOPOINT="${cmdAutopoint}" AUTOUPDATE="${cmdAutoupdate}" AUTOSCAN="${cmdAutoscan}" \ YACC="$YACC" INTLBISON="$INTLBISON" CC="$CC" CXX="$CXX" \ GNULIB_SRCDIR="$GNULIB_SRCDIR" GNULIB_TOOL="$GNULIB_TOOL" \ LIBGNU_LIBS="$LIBGNU_LIBS" LIBGNU_CFLAGS="$LIBGNU_CFLAGS" LIBGNU_PATH="$LIBGNU_PATH" \ LIBTOOL_LIBS="$LIBTOOL_LIBS" LIBTOOL_CFLAGS="$LIBTOOL_CFLAGS" LIBTOOL_PATH="$LIBTOOL_PATH" LIBTOOL="$LIBTOOL" LIBTOOLIZE="$LIBTOOLIZE" \ LIBRARY_PATH="$LIBRARY_PATH" LD_RUN_PATH="$LD_RUN_PATH" LD_LIBRARY_PATH="$LD_LIBRARY_PATH" \ M4DIR="$M4DIR" LIBS="$LIBS" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" LDFLAGS="$LDFLAGS" \ $cmdAutoreconf $AUTORECONF_CONF >> $fileLog 2>&1 # withoutGnuLibInit=1 LIBTOOLIZE="" \ # . ${rootDarkMake}/lib/autotools/libtool/install/init #if [ ! -f "${pkgSrc}/configure" ];then mkdir "$pkgDirLog/3_retry" pkgDirLog="$pkgDirLog/3_retry" \ . ${rootDarkMake}/lib/autotools/libtool/install/init #fi extraConfigure="" #extraConfigure="${extraConfigure}" cd $pkgSrc cpt=0 fileLog="${pkgDirLog}/C${cpt}_configureHelp.log" cpt=$((cpt + 1 ));shDebug 1 "CONFIGURE Help $fileLog" printEnv > $fileLog ./configure --help >> $fileLog 2>&1 fileLog="${pkgDirLog}/C${cpt}_configure.log" cpt=$((cpt + 1 ));shDebug 1 "CONFIGURE $fileLog" printEnv > $fileLog echo ./configure ${extraConfigure} >> $fileLog 2>&1 ./configure ${extraConfigure} >> $fileLog 2>&1 tail -50l $fileLog echo "Press any key to continue... ";read REPLY sed -i "s/\/usr\/local\/lib\/libltdl.so //g" "${pkgSrc}/lib/Makefile" cp $LIBTOOL ${pkgSrc}/ && echo cp $LIBTOOL ${pkgSrc}/ . ${rootDarkMake}/lib/autotools/make/install/stdCleanMakeInstall --check #extraConfigure="${extraConfigure}" withoutGnuLibInit=1 \ #. ${rootDarkMake}/lib/autotools/libtool/install/basics fi exit #=========================================================================================================================== if [ 0 -eq 1 ];then echo "Patching lib/unicase/special-casing-table.h/c for gperf < 3.1(0) =====================================" #grep '^gl_unicase_special_lookup' $(srcdir)/unicase/special-casing-table.h | #sed -e 's/register //' -e 's/^/ /' -e 's/$/;/' patchRegExp="s/gl_unicase_special_lookup.*/gl_unicase_special_lookup\ \(const char \*str, register size_t len\)/g" for file in lib/unicase/special-casing-table.h;do if [ ! -f "$pkgSrc/$file" ];then echo "no file:$pkgSrc/$file" else echo "patching:$pkgSrc/$file" if [ ! -f $pkgSrc/$file.bak ];then cp $pkgSrc/$file $pkgSrc/$file.bak;fi sed -i "$patchRegExp" $pkgSrc/$file fi done patchRegExp="s/gl_unicase_special_lookup.*/gl_unicase_special_lookup\ \(const char \*str, size_t len\);/g" for file in lib/unicase/special-casing.h lib/unicase/special-casing.c;do if [ ! -f "${pkgSrc}/${file}" ];then echo "no file:$pkgSrc/$file" else echo "patching:$pkgSrc/$file" if [ ! -f $pkgSrc/$file.bak ];then cp $pkgSrc/$file $pkgSrc/$file.bak;fi sed -i "$patchRegExp" $pkgSrc/$file fi done else #!/bin/sh if ! type "shInclude" > /dev/null 2>&1; then rootDarkMake="${rootDarkMake:-/etc/darkmake}" . /etc/darkcontainer/lib/shTools shLog="libunistring-initcompile" shDebugEnable="1" shDebug "$*" fi path_install_vars="${rootDarkMake}/lib/system/libunistring/global/install_vars" \ . ${rootDarkMake}/lib/autotools/pkg-config/bin/checks shLog="[ $pkgName/$pkgVersion ]" cpt=0 cd $pkgSrc if [ ! -f "$pkgSrc/configure" ];then cd $pkgSrc filesToInit="" for subFolder in $(find . | grep Makefile\.am$ | rev | cut -d/ -f 2- | rev | tr '\n' ' ');do if [ "$subFolder" = "." ];then filesToInit="$filesToInit $pkgSrc/configure"; else filesToInit="$filesToInit $pkgSrc/$subFolder/configure";fi done filesToInit="$filesToInit" \ YACC="$YACC" INTLBISON="$INTLBISON" CC="$CC" \ GNULIB_SRCDIR="$GNULIB_SRCDIR" GNULIB_TOOL="$GNULIB_TOOL" \ LIBGNU_LIBS="$LIBGNU_LIBS" LIBGNU_CFLAGS="$LIBGNU_CFLAGS" LIBGNU_PATH="$LIBGNU_PATH" \ LIBTOOL_LIBS="$LIBTOOL_LIBS" LIBTOOL_CFLAGS="$LIBTOOL_CFLAGS" LIBTOOL_PATH="$LIBTOOL_PATH" LIBTOOL="$LIBTOOL" LIBTOOLIZE="$LIBTOOLIZE" \ LIBRARY_PATH="$LIBRARY_PATH" LD_RUN_PATH="$LD_RUN_PATH" LD_LIBRARY_PATH="$LD_LIBRARY_PATH" \ M4DIR="$M4DIR" LIBS="$LIBS" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" LDFLAGS="$LDFLAGS" \ pkgDirLog="$pkgDirLog" pkgSrc="$pkgSrc" pkgName="$pkgName" pkgVersion="$pkgVersion" \ . ${rootDarkMake}/lib/autotools/libtool/install/init #AUTORECONF_CONF="none" AUTOMAKE_CONF="non" \ fi cd $pkgSrc if [ ! -f "$pkgSrc/configure" ];then if [ -f $pkgSrc/aclocal.m4 ];then rm $pkgSrc/aclocal.m4;fi dirIncludeM4=" -I ." if [ -d $pkgSrc/m4 ];then dirIncludeM4="$dirIncludeM4 -I m4";fi if [ -d /usr/share/aclocal ];then dirIncludeM4="$dirIncludeM4 -I /usr/share/aclocal";fi if [ -d /usr/local/share/aclocal ];then dirIncludeM4="$dirIncludeM4 -I /usr/local/share/aclocal";fi dirIncludeM4="$dirIncludeM4 -I gnulib-m4 " echo "[ $pkgName/$pkgVersion ] dirIncludeM4:$dirIncludeM4" echo "[ $pkgName/$pkgVersion ] M4DIR:$M4DIR" # sed -i "s/--lgpl=3orGPLv2/--lgpl=3/g" $pkgSrc/autogen.sh echo "[ $pkgName/$pkgVersion ]======== AUTOGEN LIBTOOL=$LIBTOOL ========" ./autogen.sh $M4DIR > $pkgDirLog/00_autogen.log 2>&1 if [ ! -f "$pkgSrc/configure" ];then echo "[ $pkgName/$pkgVersion ] autoreconf.log" autoreconf -ivf $M4DIR > $pkgDirLog/00_autoreconf.log 2>&1 echo "[ $pkgName/$pkgVersion ] aclocal.log" aclocal $M4DIR > $pkgDirLog/00_aclocal.log 2>&1 $LIBTOOLIZE --force > $pkgDirLog/01_libtoolize.log 2>&1 autoheader > $pkgDirLog/02_autoheader.log 2>&1 echo "[ $pkgName/$pkgVersion ] automake.log :$(ls -ahn ./ltmain.sh)"; automake --force-missing --add-missing > $pkgDirLog/03_automake.log 2>&1 autoconf > $pkgDirLog/04_autoconf.log 2>&1 autoreconf -fiv $M4DIR > $pkgDirLog/05_autoreconf.log 2>&1 echo "[ $pkgName/$pkgVersion ] autoscan.log" autoscan > $pkgDirLog/06_autoscan.log 2>&1 # LIBTOOL=$LIBTOOL autoconf > $pkgDirLog/07_autoconf.log 2>&1 # ./autogen.sh > $pkgDirLog/autogen.log 2>&1 fi fi echo "[ $pkgName/$pkgVersion ] ======== CONFIGURE ========" YACC="$YACC" INTLBISON="$INTLBISON" CC="$CC" \ GNULIB_SRCDIR="$GNULIB_SRCDIR" GNULIB_TOOL="$GNULIB_TOOL" \ LIBGNU_LIBS="$LIBGNU_LIBS" LIBGNU_CFLAGS="$LIBGNU_CFLAGS" LIBGNU_PATH="$LIBGNU_PATH" \ LIBTOOL_LIBS="$LIBTOOL_LIBS" LIBTOOL_CFLAGS="$LIBTOOL_CFLAGS" LIBTOOL_PATH="$LIBTOOL_PATH" LIBTOOL="$LIBTOOL" LIBTOOLIZE="$LIBTOOLIZE" \ LIBRARY_PATH="$LIBRARY_PATH" LD_RUN_PATH="$LD_RUN_PATH" LD_LIBRARY_PATH="$LD_LIBRARY_PATH" \ M4DIR="$M4DIR" LIBS="$LIBS" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" LDFLAGS="$LDFLAGS" \ ./configure --help > $pkgDirLog/CX_configureHelp.log 2>&1 YACC="$YACC" INTLBISON="$INTLBISON" CC="$CC" \ GNULIB_SRCDIR="$GNULIB_SRCDIR" GNULIB_TOOL="$GNULIB_TOOL" \ LIBGNU_LIBS="$LIBGNU_LIBS" LIBGNU_CFLAGS="$LIBGNU_CFLAGS" LIBGNU_PATH="$LIBGNU_PATH" \ LIBTOOL_LIBS="$LIBTOOL_LIBS" LIBTOOL_CFLAGS="$LIBTOOL_CFLAGS" LIBTOOL_PATH="$LIBTOOL_PATH" LIBTOOL="$LIBTOOL" LIBTOOLIZE="$LIBTOOLIZE" \ LIBRARY_PATH="$LIBRARY_PATH" LD_RUN_PATH="$LD_RUN_PATH" LD_LIBRARY_PATH="$LD_LIBRARY_PATH" \ M4DIR="$M4DIR" LIBS="$LIBS" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" LDFLAGS="$LDFLAGS" \ ./configure > $pkgDirLog/CO_configure.log 2>&1 tail $pkgDirLog/CO_configure.log echo "Press any key to continue... ";read REPLY stdCleanMakeBeforeInstall="check" \ YACC="$YACC" INTLBISON="$INTLBISON" CC="$CC" \ GNULIB_SRCDIR="$GNULIB_SRCDIR" GNULIB_TOOL="$GNULIB_TOOL" \ LIBGNU_LIBS="$LIBGNU_LIBS" LIBGNU_CFLAGS="$LIBGNU_CFLAGS" LIBGNU_PATH="$LIBGNU_PATH" \ LIBTOOL_LIBS="$LIBTOOL_LIBS" LIBTOOL_CFLAGS="$LIBTOOL_CFLAGS" LIBTOOL_PATH="$LIBTOOL_PATH" LIBTOOL="$LIBTOOL" LIBTOOLIZE="$LIBTOOLIZE" \ LIBRARY_PATH="$LIBRARY_PATH" LD_RUN_PATH="$LD_RUN_PATH" LD_LIBRARY_PATH="$LD_LIBRARY_PATH" \ M4DIR="$M4DIR" LIBS="$LIBS" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" LDFLAGS="$LDFLAGS" \ pkgDirLog="$pkgDirLog" pkgSrc="$pkgSrc" pkgName="$pkgName" pkgVersion="$pkgVersion" . ${rootDarkMake}/lib/autotools/make/install/stdCleanMakeInstall GPERF_VER=$(gperf --version | { IFS=' .' read x y major minor bugfix _ printf "%d%02d%02d" $major $minor $bugfix }) if [ $GPERF_VER -le 30100 ]; then echo "Patching lib/unicase/special-casing-table.h/c for gperf < 3.1(1) =====================================" # patchRegExp="s/gl_unicase_special_lookup.*/gl_unicase_special_lookup\ \(const char \*str, unsigned int len\)/g" # for file in lib/unicase/special-casing-table.h;do # if [ ! -f "$pkgSrc/$file" ];then # echo "no file:$pkgSrc/$file" # else # echo "patching:$pkgSrc/$file" # if [ ! -f $pkgSrc/$file.bak ];then cp $pkgSrc/$file $pkgSrc/$file.bak;fi # sed -i "$patchRegExp" $pkgSrc/$file # fi # done patchRegExp="s/gl_unicase_special_lookup.*/gl_unicase_special_lookup\ \(const char \*str, unsigned int len\);/g" # #patchRegExp="s/gl_unicase_special_lookup.*/gl_unicase_special_lookup\ \(const char \*str, size_t len\)/g" ## for file in lib/unicase/special-casing.h lib/unicase/special-casing.c;do for file in lib/unicase/special-casing.h;do if [ ! -f "$pkgSrc/$file" ];then echo "no file:$pkgSrc/$file --------------------------------" # echo "no file:$pkgSrc/$file generate GPERF" # gperf -m 10 ${pkgSrc}/lib/unicase/special-casing-table.gperf | sed -e "$patchRegExp" > ${pkgSrc}/lib/unicase/special-casing-table.h # patchRegExp="s/mv \$(srcdir)\/unicase\/special/#/g" # sed -i "${patchRegExp}" ${pkgSrc}/lib/Makefile.in ## sed -i "${patchRegExp}" ${pkgSrc}/lib/Makefile.am # sed -i "${patchRegExp}" ${pkgSrc}/lib/Makefile else echo "patching:$pkgSrc/$file" if [ ! -f $pkgSrc/$file.bak ];then cp $pkgSrc/$file $pkgSrc/$file.bak;fi sed -i "$patchRegExp" $pkgSrc/$file fi done fi