All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] fix for building freetype-native on a symlinked build environment
@ 2010-09-30 12:30 Alexander Stohr
  2010-10-06 21:25 ` Khem Raj
  0 siblings, 1 reply; 4+ messages in thread
From: Alexander Stohr @ 2010-09-30 12:30 UTC (permalink / raw)
  To: openembedded-devel; +Cc: freetype-devel

[-- Attachment #1: Type: text/plain, Size: 1398 bytes --]

in an environment where the "/home" partition had not enough space
for holding a complete open embedded project i created a symlink to
an adequate partition on a second drive for hosting the build environment.

this turned out to badly impact on misc build steps.
the most recent problem i found is the build step used for freetype.

in the seemingly hand written configure script there is
a directory names comparison where some extra actions
are needed in case the directory is not the base dir of freetype build.
in my setup the names were different for some reasons in the embedding tools
(not caring whats the exact origin). in fact both were the very same dir object.
this lead to execution of parts of the script that were not intended
so that this mis-detection finally stopped the build.

the attached patch fixes that problem by changing the comparisonn code so that it
uses the inode numbers of the relevant paths for the comparison.

the patch further applies a check for an already existing subdir.
this suppresses a message on the console in a benign case.

the patch applies to freetype-2.3.6 but should be quite easily portable
to any known later release including the relatively fresh 2.4.2 version.

regards, Alex.
-- 
Neu: GMX De-Mail - Einfach wie E-Mail, sicher wie ein Brief!  
Jetzt De-Mail-Adresse reservieren: http://portal.gmx.net/de/go/demail

[-- Attachment #2: fix-configure-symlink.patch --]
[-- Type: text/x-patch, Size: 674 bytes --]

--- freetype-2.3.6.orig/configure	2007-12-06 17:19:34.000000000 +0100
+++ freetype-2.3.6/configure	2010-09-30 13:43:30.000000000 +0200
@@ -68,9 +68,11 @@
 abs_ft2_dir=`cd "$ft2_dir" && pwd`
 
 # build a dummy Makefile if we are not building in the source tree
+inode_src=`ls -id $abs_ft2_dir | cut -d " " -f 1 || echo -1`
+inode_dst=`ls -id $abs_curr_dir | cut -d " " -f 1 || echo -2`
 
-if test "$abs_curr_dir" != "$abs_ft2_dir"; then
-  mkdir reference
+if test $inode_src -ne $inode_dst; then
+  if [ ! -d reference ]; then mkdir reference; fi
   echo "Copying \`modules.cfg'"
   cp $abs_ft2_dir/modules.cfg $abs_curr_dir
   echo "Generating \`Makefile'"

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch] fix for building freetype-native on a symlinked build environment
@ 2010-10-05 17:08 Alexander Stohr
  0 siblings, 0 replies; 4+ messages in thread
From: Alexander Stohr @ 2010-10-05 17:08 UTC (permalink / raw)
  To: openembedded-devel

my initial proposal got merged into the freetype repository
in a functionally equivalent sed based variant by Werner Lemberg.
it is now most probably included in the short after released freetype version 2.4.3

see this link for the final patch:
http://git.savannah.gnu.org/cgit/freetype/freetype2.git/commit/?id=75eeb32a2e55ffb3e4102ee56cd913a442d1ac9a

regards, Alex.
-- 
GRATIS: Spider-Man 1-3 sowie 300 weitere Videos!
Jetzt freischalten! http://portal.gmx.net/de/go/maxdome



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch] fix for building freetype-native on a symlinked build environment
  2010-09-30 12:30 Alexander Stohr
@ 2010-10-06 21:25 ` Khem Raj
  0 siblings, 0 replies; 4+ messages in thread
From: Khem Raj @ 2010-10-06 21:25 UTC (permalink / raw)
  To: openembedded-devel; +Cc: freetype-devel

On Thu, Sep 30, 2010 at 5:30 AM, Alexander Stohr <Alexander.Stohr@gmx.de> wrote:
> in an environment where the "/home" partition had not enough space
> for holding a complete open embedded project i created a symlink to
> an adequate partition on a second drive for hosting the build environment.
>
> this turned out to badly impact on misc build steps.
> the most recent problem i found is the build step used for freetype.
>
> in the seemingly hand written configure script there is
> a directory names comparison where some extra actions
> are needed in case the directory is not the base dir of freetype build.
> in my setup the names were different for some reasons in the embedding tools
> (not caring whats the exact origin). in fact both were the very same dir object.
> this lead to execution of parts of the script that were not intended
> so that this mis-detection finally stopped the build.
>
> the attached patch fixes that problem by changing the comparisonn code so that it
> uses the inode numbers of the relevant paths for the comparison.
>
> the patch further applies a check for an already existing subdir.
> this suppresses a message on the console in a benign case.
>
> the patch applies to freetype-2.3.6 but should be quite easily portable
> to any known later release including the relatively fresh 2.4.2 version.
>

if you can prepate patches for OE to apply this. It will be helpful.

> regards, Alex.
> --
> Neu: GMX De-Mail - Einfach wie E-Mail, sicher wie ein Brief!
> Jetzt De-Mail-Adresse reservieren: http://portal.gmx.net/de/go/demail
>
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
>
>



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch] fix for building freetype-native on a symlinked build environment
@ 2010-10-07 15:27 Alexander Stohr
  0 siblings, 0 replies; 4+ messages in thread
From: Alexander Stohr @ 2010-10-07 15:27 UTC (permalink / raw)
  To: openembedded-devel

[-- Attachment #1: Type: text/plain, Size: 203 bytes --]

patchyfied for 2.2.1, 2.3.6 and 2.3.12 including recipes changes
see attachment

-- 
GMX DSL Doppel-Flat ab 19,99 &euro;/mtl.! Jetzt auch mit 
gratis Notebook-Flat! http://portal.gmx.net/de/go/dsl

[-- Attachment #2: oe-ft-configure-using-inodes.patch --]
[-- Type: text/x-patch, Size: 6528 bytes --]

diff -Nur openembedded.orig/recipes/freetype/freetype-2.2.1/configure-using-inodes.patch openembedded/recipes/freetype/freetype-2.2.1/configure-using-inodes.patch
--- openembedded.orig/recipes/freetype/freetype-2.2.1/configure-using-inodes.patch	1970-01-01 01:00:00.000000000 +0100
+++ openembedded/recipes/freetype/freetype-2.2.1/configure-using-inodes.patch	2010-10-07 17:01:08.000000000 +0200
@@ -0,0 +1,30 @@
+http://git.savannah.gnu.org/cgit/freetype/freetype2.git/commit/?id=75eeb32a2e55ffb3e4102ee56cd913a442d1ac9a
+
+author  Werner Lemberg <wl@gnu.org>     2010-10-03 18:17:27 (GMT)
+
+Avoid `configure' issues with symbolic links.
+Based on a patch from Alexander Stohr <Alexander.Stohr@gmx.de>.
+* configure: Compare directories using `ls -id'.
+Check existence of `reference' subdirectory before creating it.
+
+--- freetype.orig/configure	2010-10-07 16:46:51.000000000 +0200
++++ freetype/configure	2010-10-07 16:49:52.000000000 +0200
+@@ -67,10 +67,15 @@
+ abs_curr_dir=`pwd`
+ abs_ft2_dir=`cd "$ft2_dir" && pwd`
+ 
+-# build a dummy Makefile if we are not building in the source tree
++# build a dummy Makefile if we are not building in the source tree;
++# we use inodes to avoid issues with symbolic links
++inode_src=`ls -id $abs_ft2_dir | sed 's/ .*//'`
++inode_dst=`ls -id $abs_curr_dir | sed 's/ .*//'`
+ 
+-if test "$abs_curr_dir" != "$abs_ft2_dir"; then
+-  mkdir reference
++if test $inode_src -ne $inode_dst; then
++  if test ! -d reference; then
++    mkdir reference
++  fi
+   echo "Copying \`modules.cfg'"
+   cp $abs_ft2_dir/modules.cfg $abs_curr_dir
+   echo "Generating \`Makefile'"
diff -Nur openembedded.orig/recipes/freetype/freetype_2.2.1.bb openembedded/recipes/freetype/freetype_2.2.1.bb
--- openembedded.orig/recipes/freetype/freetype_2.2.1.bb	2010-10-07 16:30:39.000000000 +0200
+++ openembedded/recipes/freetype/freetype_2.2.1.bb	2010-10-07 17:03:00.000000000 +0200
@@ -5,7 +5,8 @@
 
 SRC_URI = "${SOURCEFORGE_MIRROR}/freetype/freetype-${PV}.tar.bz2 \
 	   file://configure.patch \
-           file://no-hardcode.patch"
+           file://no-hardcode.patch \
+           file://configure-using-inodes.patch"
 S = "${WORKDIR}/freetype-${PV}"
 
 inherit autotools pkgconfig binconfig
diff -Nur openembedded.orig/recipes/freetype/freetype-2.3.12/configure-using-inodes.patch openembedded/recipes/freetype/freetype-2.3.12/configure-using-inodes.patch
--- openembedded.orig/recipes/freetype/freetype-2.3.12/configure-using-inodes.patch	1970-01-01 01:00:00.000000000 +0100
+++ openembedded/recipes/freetype/freetype-2.3.12/configure-using-inodes.patch	2010-10-07 17:11:05.000000000 +0200
@@ -0,0 +1,30 @@
+http://git.savannah.gnu.org/cgit/freetype/freetype2.git/commit/?id=75eeb32a2e55ffb3e4102ee56cd913a442d1ac9a
+
+author  Werner Lemberg <wl@gnu.org>     2010-10-03 18:17:27 (GMT)
+
+Avoid `configure' issues with symbolic links.
+Based on a patch from Alexander Stohr <Alexander.Stohr@gmx.de>.
+* configure: Compare directories using `ls -id'.
+Check existence of `reference' subdirectory before creating it.
+
+--- freetype.orig/configure	2010-10-07 16:46:51.000000000 +0200
++++ freetype/configure	2010-10-07 16:49:52.000000000 +0200
+@@ -78,10 +78,15 @@
+   done
+ fi
+ 
+-# build a dummy Makefile if we are not building in the source tree
++# build a dummy Makefile if we are not building in the source tree;
++# we use inodes to avoid issues with symbolic links
++inode_src=`ls -id $abs_ft2_dir | sed 's/ .*//'`
++inode_dst=`ls -id $abs_curr_dir | sed 's/ .*//'`
+ 
+-if test "$abs_curr_dir" != "$abs_ft2_dir"; then
+-  mkdir reference
++if test $inode_src -ne $inode_dst; then
++  if test ! -d reference; then
++    mkdir reference
++  fi
+   if test ! -r $abs_curr_dir/modules.cfg; then
+     echo "Copying \`modules.cfg'"
+     cp $abs_ft2_dir/modules.cfg $abs_curr_dir
diff -Nur openembedded.orig/recipes/freetype/freetype_2.3.12.bb openembedded/recipes/freetype/freetype_2.3.12.bb
--- openembedded.orig/recipes/freetype/freetype_2.3.12.bb	2010-10-07 16:30:10.000000000 +0200
+++ openembedded/recipes/freetype/freetype_2.3.12.bb	2010-10-07 17:03:24.000000000 +0200
@@ -9,6 +9,7 @@
   file://no-hardcode.patch \
   file://fix-configure.patch \
   file://libtool-tag.patch \
+  file://configure-using-inodes.patch \
 "
 S = "${WORKDIR}/freetype-${PV}"
 
diff -Nur openembedded.orig/recipes/freetype/freetype-2.3.6/configure-using-inodes.patch openembedded/recipes/freetype/freetype-2.3.6/configure-using-inodes.patch
--- openembedded.orig/recipes/freetype/freetype-2.3.6/configure-using-inodes.patch	1970-01-01 01:00:00.000000000 +0100
+++ openembedded/recipes/freetype/freetype-2.3.6/configure-using-inodes.patch	2010-10-07 17:05:13.000000000 +0200
@@ -0,0 +1,30 @@
+http://git.savannah.gnu.org/cgit/freetype/freetype2.git/commit/?id=75eeb32a2e55ffb3e4102ee56cd913a442d1ac9a
+
+author  Werner Lemberg <wl@gnu.org>     2010-10-03 18:17:27 (GMT)
+
+Avoid `configure' issues with symbolic links.
+Based on a patch from Alexander Stohr <Alexander.Stohr@gmx.de>.
+* configure: Compare directories using `ls -id'.
+Check existence of `reference' subdirectory before creating it.
+
+--- freetype.orig/configure	2010-10-07 16:46:51.000000000 +0200
++++ freetype/configure	2010-10-07 16:49:52.000000000 +0200
+@@ -67,10 +67,15 @@
+ abs_curr_dir=`pwd`
+ abs_ft2_dir=`cd "$ft2_dir" && pwd`
+ 
+-# build a dummy Makefile if we are not building in the source tree
++# build a dummy Makefile if we are not building in the source tree;
++# we use inodes to avoid issues with symbolic links
++inode_src=`ls -id $abs_ft2_dir | sed 's/ .*//'`
++inode_dst=`ls -id $abs_curr_dir | sed 's/ .*//'`
+ 
+-if test "$abs_curr_dir" != "$abs_ft2_dir"; then
+-  mkdir reference
++if test $inode_src -ne $inode_dst; then
++  if test ! -d reference; then
++    mkdir reference
++  fi
+   echo "Copying \`modules.cfg'"
+   cp $abs_ft2_dir/modules.cfg $abs_curr_dir
+   echo "Generating \`Makefile'"
diff -Nur openembedded.orig/recipes/freetype/freetype_2.3.6.bb openembedded/recipes/freetype/freetype_2.3.6.bb
--- openembedded.orig/recipes/freetype/freetype_2.3.6.bb	2010-10-07 16:30:26.000000000 +0200
+++ openembedded/recipes/freetype/freetype_2.3.6.bb	2010-10-07 17:03:41.000000000 +0200
@@ -8,6 +8,7 @@
   file://no-hardcode.patch \
   file://fix-configure.patch \
   file://libtool-tag.patch \
+  file://configure-using-inodes.patch \
 "
 S = "${WORKDIR}/freetype-${PV}"
 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-10-07 15:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-07 15:27 [patch] fix for building freetype-native on a symlinked build environment Alexander Stohr
  -- strict thread matches above, loose matches on Subject: below --
2010-10-05 17:08 Alexander Stohr
2010-09-30 12:30 Alexander Stohr
2010-10-06 21:25 ` Khem Raj

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.