From a007fbad33b01c27c615041d08753e21b78ccf00 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Sun, 9 Oct 2005 08:05:05 +0000 Subject: [PATCH] (dos_to_posix)[__CYGWIN__]: Return unconverted value if cygwin_conv_to_posix_path () fails. Fixes absolute file name bug. Backportme. --- ChangeLog | 6 +++ cygwin/mknetrel | 82 +++++++++++++++++++++++++++++++++-------- cygwin/mknetrel.doc | 7 +++- cygwin/mknetrel.libtool | 16 ++++++-- cygwin/mknetrel.split | 65 ++++++++++++++++++++++++++++---- flower/file-name.cc | 10 +++-- scripts/GNUmakefile | 2 +- 7 files changed, 156 insertions(+), 32 deletions(-) diff --git a/ChangeLog b/ChangeLog index a00ddf286f..f2e57bce55 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-10-09 Jan Nieuwenhuizen + + * flower/file-name.cc (dos_to_posix)[__CYGWIN__]: Return + unconverted value if cygwin_conv_to_posix_path () fails. Fixes + absolute file name bug. Backportme. + 2005-10-07 Han-Wen Nienhuys * input/regression/figured-bass-continuation-center.ly: new file. diff --git a/cygwin/mknetrel b/cygwin/mknetrel index 50c6826830..390a1db84a 100644 --- a/cygwin/mknetrel +++ b/cygwin/mknetrel @@ -50,13 +50,7 @@ preconfig () { $src/configure --prefix=$prefix --enable-config=for-build) fi - if [ "$cygwin" == "mingw" ]; then - cp /usr/include/FlexLexer.h . - mkdir python2.3 - cp /usr/include/python2.3/Python.h python2.3 - fi - - GUILE=$($cygwin_prefix/bin/guile-config --version 2>&1 | awk '{print $NF}') + GUILE=$(GUILE_LOAD_PATH=$cygwin_prefix/share/guile/* $cygwin_prefix/bin/guile-config --version 2>&1 | awk '{print $NF}') cat > $target-guile-config < config-console.make + #cp config.hh config-console.hh + + mkdir -p python/out python/out-console touch python/out/midi.lo python/out/midi.so python/out/midi.dll + touch python/out-console/midi.lo python/out-console/midi.so python/out-console/midi.dll fi # cross-compiling: build for build-host, generate doc @@ -103,14 +124,28 @@ prebuild () { CXX=$HOST_CXX \ LDFLAGS="" \ eval make conf=for-build $args) || exit 1 - - mkdir -p mf/out - cp -pv mf/out-for-build/* mf/out + # fake mf and texi + mkdir -p mf/out + cp -pv mf/out-for-build/* mf/out mkdir -p Documentation/user/out cp -pv Documentation/user/out-for-build/*{tely,texi} Documentation/user/out fi + if [ "$cygwin" == "mingw" ]; then + # fake mf and texi + mkdir -p mf/out-console + cp -pv mf/out-for-build/* mf/out-console + mkdir -p Documentation/user/out-console + cp -pv Documentation/user/out-for-build/*{tely,texi} Documentation/user/out-console + # fake manual pages, only works without --enable-config + mkdir -p scripts/out-console + cp scripts/out-for-build/*.1 scripts/out-console + mkdir -p lily/out-console + cp lily/out-for-build/*.1 lily/out-console + make conf=console || exit 1 + fi + addmakeflags "target=$target" ' ' if [ -f "$cygwin_prefix/bin/libpython2.4.dll" ]; then addmakeflags LDFLAGS="$cygwin_prefix/bin/libpython2.4.dll" ' ' @@ -129,8 +164,25 @@ preinstall () { } postinstall () { + if [ "$cygwin" == "mingw" ]; then + cp $inst/usr/share/lilypond/$v/python/* $inst/usr/bin + install -m755 $build/lily/out/lilypond $inst/usr/bin/lilypond-windows + install -m755 $build/lily/out-console/lilypond $inst/usr/bin/ + fi + extras_postinstall + if [ "$cygwin" == "mingw" ]; then + for i in $inst/usr/bin/*; do + m=$(file -b $i) + if echo "$m" | grep "guile"; then + mv $i $i.scm + elif echo "$m" | grep "python"; then + mv $i $i.py + fi + done + fi + cd $build || exit 1 if ! iscygwin && doc; then make conf=for-build webdir=$inst-doc/$packagedocdir web-install @@ -172,15 +224,15 @@ extra_name () { } extra_split () { - mkdir -p # should be in devel... mkdir -p ./$prefix/share/lilypond/$v for i in make python tex vim; do - mv $inst/$prefix/share/lilypond/$v/$i ./$prefix/share/lilypond/ + #for i in make tex vim; do + mv $inst/$prefix/share/lilypond/$v/$i ./$prefix/share/lilypond/$v done mkdir -p ./$prefix/share/lilypond/$v/fonts for i in source svg tfm; do - mv $inst/$prefix/share/lilypond/$v/fonts/$i ./$prefix/share/lilypond/fonts + mv $inst/$prefix/share/lilypond/$v/fonts/$i ./$prefix/share/lilypond/$v/fonts done mkdir -p ./$prefix/share diff --git a/cygwin/mknetrel.doc b/cygwin/mknetrel.doc index 793a8dc3df..48f8a50917 100644 --- a/cygwin/mknetrel.doc +++ b/cygwin/mknetrel.doc @@ -10,7 +10,7 @@ docdir=$docprefix/doc cygdocdir=$docdir/$Cygwin infodir=$docprefix/info mandir=$docprefix/man -packagedocdir=$docdir/$base-$ver +packagedocdir=$docdir/$base fixdoc () { # @@ -28,5 +28,10 @@ fixdoc () { mkdir -p $packagedocdir tar -C $inst/$docprefix/$base -cf - . | tar -C $inst/$packagedocdir -xf - fi + for i in $inst/$docprefix/info/*.info \ + $inst/$docprefix/info/*.info-[0-9] \ + $inst/$docprefix/info/*.info-[0-9][0-9]; do + gzip $i + done true } diff --git a/cygwin/mknetrel.libtool b/cygwin/mknetrel.libtool index d28bf08376..4745d65736 100644 --- a/cygwin/mknetrel.libtool +++ b/cygwin/mknetrel.libtool @@ -37,8 +37,16 @@ fix_libtool_la () { for j in $(ls -1 *.la); do sed -i~ \ -e 's/ *-L *[^"'"'"' ][^"'"'"' ]*//g'\ - -e "s@\( \|=\)\(/usr/lib/lib\)@\1$cygwin_root\2@g"\ + -e "s@\( \|=\|'\)\(/[^ ]*usr/lib/lib\)\([^ ']*\)\.\(a\|la\|so\)[^ ']*@\1-l\3@g"\ $j +## -e "s@\( \|=\|'\)\(cyg\)\([^ ']*\)\(\.dll.a\|.a\)[^ ']*@\1lib\3\4@g"\ +## -e "s@\( \|=\|'\)\(/usr/lib/lib\)\([^ ']*\)\.\(a\|la\|so\)[^ ']*@\1-l\3@g"\ +## -e "s@\( \|=\|'\)\(/usr/lib/lib\)\([^.]*\)\.\(a\|la\|so\)[^ ']*@\1-l\3@g"\ +## -e "s@\( \|=\|'\)\(/usr/lib/lib\)\([^.]*\)[^ ']*@\1-l\3@g"\ +## -e "s@\( \|=\|'\)\(/usr/lib/\)\(lib\)@\1\3@g"\ +## -e "s@\( \|=\)\(/usr/lib/lib\)@\1$cygwin_root\2@g"\ +## -e "s@\( \|=\)\(/usr/lib/lib\)@\1$cygwin_root\2@g"\ +## -e "s@\( \|=\)\(/usr/lib/lib\)\([^ ]*\)[.]\(a\|dll\|la\|so[^ ]*\)@-l\2@g"\ done fi done @@ -49,7 +57,9 @@ fix_libtool_la () { # more libtool fixups. I love libtool. sed -i~ \ -e "s@^dlname=.*@dlname='../bin/$dll_prefix$base-$sover.dll'@" \ - -e "s@^library_names=.*@library_names='$dll_prefix$base.dll.a'@" \ - -e "s@^old_library=.*@old_library='$dll_prefix$base.a'@" \ + -e "s@^library_names=.*@library_names='lib$base.dll.a'@" \ + -e "s@^old_library=.*@old_library='lib$base.a'@" \ $inst/$prefix/lib/lib$base.la +## -e "s@^library_names=.*@library_names='$dll_prefix$base.dll.a'@" \ +## -e "s@^old_library=.*@old_library='$dll_prefix$base.a'@" \ } diff --git a/cygwin/mknetrel.split b/cygwin/mknetrel.split index a64822b2ad..8f67fc0282 100644 --- a/cygwin/mknetrel.split +++ b/cygwin/mknetrel.split @@ -105,11 +105,11 @@ extras_postinstall () { readmes="$(find . -maxdepth 1 -type f -a -name '[A-Z]*' | egrep -v 'Makefile|GNUmakefile')" install -m644 $readmes $inst/$packagedocdir + install -m644 $cygwin/changelog $inst/$packagedocdir/changelog.$Cygwin ## Cygwin readmes cd $src || exit 1 install -d -m755 $inst/$cygdocdir - install -m644 $cygwin/changelog $inst/$cygdocdir/changelog.$Cygwin cd $src || exit 1 install -m644 $cygwin/README $inst/$packagedocdir/README.$Cygwin @@ -119,17 +119,64 @@ extras_postinstall () { install -m644 $cygwin/out/README $inst/$cygdocdir/$package.README } +auto_requires () { + dlls= + requires= + dlls=$(find . -name '*dll' -o -name '*.exe' \ + | xargs $cygcheck 2>&1 | grep '^ [^ ]' \ + | tr -d '[ \r]' | sed 's@.*\\@@g' | sort -u) + for x in $(ls -1 bin/* sbin/*); do + case $x in + *.exeXXX|*.dllXXX) + dlls="$($cygcheck $x 2>&1 | grep '^ [^ ]' | tr -d '[ \r]' | sed 's@.*bin\\@@g') $dlls" + ;; + esac + case "$(file -b $x)" in + "*Bourne shell script*") + requires="bash\n$requires" + ;; + "*guile*script*") + requires="guile\n$requires" + ;; + "*perl*script*") + requires="perl\n$requires" + ;; + "*python*script*") + requires="python\n$requires" + ;; + esac + done + for x in $dlls; do + requires="$(cyg-apt find $x | sed 's/:.*//')\n$requires" + done + requires=$(echo -e "$requires" | sort -u) + echo $requires +} + hint () { if [ -r $shint ]; then cp $shint $hint else cat > $hint <> $hint - grep ^build-requires: $hint || echo "build-requires: $build_depends" >> $hint + if [ "$cygwin" == "cygwin" ]; then + if grep ^build-requires: $hint; then + mv $hint $hint~ + grep -v build-requires $hint~ > $hint + fi + if iscygwin; then + cygcheck=cygcheck.exe + else + cygcheck="wine $cygwin_prefix/bin/cygcheck.exe" + fi + echo "#auto-requires: $(cd usr; auto_requires)" >> $hint + else + grep ^build-requires: $hint || echo "build-requires: $build_depends" >> $hint + fi } domkdist () { @@ -174,7 +221,8 @@ domkdist () { echo creating $tarstem.tar.bz2 cd $inst || exit 1 - shint=$src/$cygwin/setup.hint + name=$base + shint=$src/$cygwin/$name.hint hint=$uploads/setup.hint hint find * -print | egrep -v '\.cvsignore|\.bak$|\.orig$|\.o$|\.rej$|~$|^.#|CVS|/tags$' | sort | tar -T - --no-recursion --owner=0 --group=0 -cjf $tarstem.tar.bz2 @@ -189,9 +237,10 @@ domkdist () { depends=$(eval echo '$'${i}_depends) mkdir -p $subload || exit 1 echo creating $subtarstem.tar.bz2 + name=$subname + cd $inst-$i hint grep ^external-source: $hint || echo "external-source: $base" >> $hint - cd $inst-$i hard2soft find * -print | egrep -v '\.cvsignore|\.bak$|\.orig$|\.o$|\.rej$|~$|^.#|CVS|/tags$' | sort | tar -T - --no-recursion --owner=0 --group=0 -cjf $subtarstem.tar.bz2 done @@ -200,8 +249,8 @@ domkdist () { cd $src/.. || exit 1 echo creating "$tarstem"-src.tar.bz2 ##find $package_src/* -print -follow | egrep -v '\.cvsignore|\.bak$|\.orig$|\.o$|~$|^.#|CVS|%redact|/tags$' | egrep -v "$src_exclude" | sort | tar -T - --no-recursion --owner=0 --group=0 -cjf "$tarstem"-src.tar.bz2 - find $package_src/* -print | egrep -v '\.cvsignore|\.bak$|\.orig$|\.o$|\.rej$|~$|^.#|CVS|%redact|/tags$' | egrep -v "$src_exclude" | sort | tar -T - --no-recursion --owner=0 --group=0 -cjf "$tarstem"-src.tar.bz2 - ##cd $package_src && tar -cj --exclude='\.cvsignore' --exclude='\.bak$' --exclude='\.orig$' --exclude='\.o$' --exclude='~$' --exclude='^.#' --exclude='CVS' --exclude='%redact' --exclude='/tags$' --owner=0 --group=0 -f "$tarstem"-src.tar.bz2 . + find $package_src/* -print | egrep -v '\.cvsignore|\.bak$|\.orig$|\.o$|\.rej$|~$|^.#|CVS|%redact|/tags$|/TAGS$|autom4te.cache$' | egrep -v "$src_exclude" | sort | tar -T - --no-recursion --owner=0 --group=0 -cjf "$tarstem"-src.tar.bz2 + ##cd $package_src && tar -cj --exclude='\.cvsignore' --exclude='\.bak$' --exclude='\.orig$' --exclude='\.o$' --exclude='~$' --exclude='^.#' --exclude='CVS' --exclude='%redact' --exclude='/tags$' --exclude='/TAGS$' --exclude='autom4te.cache' --owner=0 --group=0 -f "$tarstem"-src.tar.bz2 . postpackage } diff --git a/flower/file-name.cc b/flower/file-name.cc index b293078145..2064e07261 100644 --- a/flower/file-name.cc +++ b/flower/file-name.cc @@ -40,12 +40,14 @@ using namespace std; static String dos_to_posix (String file_name) { - char buf[PATH_MAX]; + char buf[PATH_MAX] = ""; char *s = file_name.get_copy_str0 (); - /* urg, wtf? char const* argument gets modified! */ - cygwin_conv_to_posix_path (s, buf); + /* ugh: char const* argument gets modified. */ + int fail = cygwin_conv_to_posix_path (s, buf); delete s; - return buf; + if (!fail) + return buf; + return file_name; } #endif /* __CYGWIN__ */ diff --git a/scripts/GNUmakefile b/scripts/GNUmakefile index 028ae2bbc4..009d4c46b8 100644 --- a/scripts/GNUmakefile +++ b/scripts/GNUmakefile @@ -1,6 +1,6 @@ depth = .. -SEXECUTABLES=convert-ly lilypond-book abc2ly etf2ly mup2ly midi2ly lilypond-invoke-editor +SEXECUTABLES=convert-ly lilypond-book abc2ly etf2ly mup2ly midi2ly lilypond-invoke-editor STEPMAKE_TEMPLATES=script help2man po LOCALSTEPMAKE_TEMPLATES = lilypond -- 2.39.2