On Wed, Jan 25, 2012 at 8:57 AM, Andy Yew <[email protected]> wrote:
> Dear Mike,
>
> Thanks for the simple (beginner forgiving) explanation and also the
> ijsgutenprint example.
>
> As this makefile (ijsgutenprint) looks similar to some spec file language, i
> also think the spec file method you've suggested might work. Due to lack of
> experience, i'd like to ask for another help from you: Could you "roughly"
> write a "possible" spec file content for my case here (Gutenprint and
> extract-strings)?? For build, configure/compile, & install parts....
>
> After this draft is got, i'll test it out here....

I took the spec file and modified (more like hacked) it to get a host
extract-strings.  You may need work with it some more for the flags
you want.

Builds host version (as static so I don't have to manipulate libs).
Copies extract-strings to a hostbin folder and replaces it with a
wrapper script.
Cleans
Runs configure again for the build.
Removes the extract-strings dependency for generating the header file.
Builds.

It's not very robust (and certainly not upstream worthy), but does get
through that one stage.  Warning, when the cross build runs, it blows
away the wrapper script, but just right after that script is run.  Any
shift in the dependencies is likely to break the hack.  My build did
not complete since I am using a really old homegrown tool-chain, but I
expect like the codesourcery tools will not have the issue I did (well
after the extract-strings handling).

I did not go into the install/deploy, but I do not expect any issues
with those sections.  You can test that out.

Also, the version I found was suffixed with "-pre1", so adjust the
spec file appropriately.


> Thanks in advance!!
> Andy

Caught me in a good mood.


> On Wed, Jan 25, 2012 at 8:10 PM, Mike Goins <[email protected]>
> wrote:
>>
>> On Wed, Jan 25, 2012 at 6:50 AM, Mike Goins
>> <[email protected]> wrote:
>> > On Sun, Jan 22, 2012 at 1:05 PM, Andy Yew <[email protected]>
>> > wrote:
>> >> Hi all,
>> >>
>> >> Has anyone successfully build/LTIB Gutenprint?
>> >
>> >
>> > Gutenprint is one of those that are not cross-compile friendly (after
>> > taking a brief look at it).   It requires running a just built
>> > "extract-strings" on the host, but it does not appear differentiate
>> > between "build" and "host".  There are a couple options to get around
>> > this.
>>
>> Here is another method used to cross-compile the package:
>> http://pits.googlecode.com/svn-history/r5/trunk/ijsgutenprint/Makefile
>>
>> It builds libijs and extract-strings outside the source tree.  A
>> wrapper script file called extract-strings in created in the expected
>> location that references the host binary (which satisfies the rule to
>> build it).
>>
>> It is very possible to do this entirely within the spec file.
>>
>> <snipped for brevity since replying to own message, apologies>
>>
>> _______________________________________________
>> LTIB home page: http://ltib.org
>>
>> Ltib mailing list
>> [email protected]
>> https://lists.nongnu.org/mailman/listinfo/ltib
>
>
%define pfx /opt/freescale/rootfs/%{_target_cpu}

Summary         : gimp
Name            : gutenprint
Version         : 5.2.8
Release         : 0
License         : xxxx
Vendor          : Hongjet
Packager        : xxxx
Group           : xxxx
URL             : http://www.hongjet.com.my/
Source          : %{name}-%{version}-pre1.tar.bz2
BuildRoot       : %{_tmppath}/%{name}
Prefix          : %{pfx}

%Description
%{summary}

%Prep
%setup -n %{name}-%{version}-pre1

%Build
ORIG_PATH=$PATH
OPT_CFGHOST=`echo ${TOOLCHAIN_PREFIX} | perl -n -e 's,-$,,;print'`
export PATH=$UNSPOOF_PATH
./configure --prefix=%{_prefix} --target=$CFGHOST --disable-nls --without-cups --without-libiconv-prefix --without-readline --without-foomatic --without-foomatic3 --disable-shared
make -C src/xml extract-strings
mkdir hostbin
cp -a src/xml/extract-strings hostbin/extract-strings
export PATH=$ORIG_PATH
make distclean
sed -i 's/xmli18n-tmp.h: xml-stamp extract-strings/xmli18n-tmp.h: xml-stamp/' src/xml/Makefile.in
./configure --prefix=%{_prefix} --host=$CFGHOST --build=%{_build} --disable-nls --without-cups --without-libiconv-prefix --without-readline --without-foomatic --without-foomatic3
echo '#!/bin/sh' > src/xml/extract-strings
echo "exec $PWD/hostbin/extract-strings \"\$@\"" >> src/xml/extract-strings
chmod a+x src/xml/extract-strings
make


%Install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT/%{pfx}

%Clean
rm -rf $RPM_BUILD_ROOT

%Files
%defattr(-,root,root)
%{pfx}/*
_______________________________________________
LTIB home page: http://ltib.org

Ltib mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/ltib

Reply via email to