Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] How to compile Gimp plugins for Windows on Linux

Status
Not open for further replies.

buzzerbazooka

Newbie
Joined
Aug 15, 2012
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,374
This is only an example showing how to get to a Gimp plugin as fast as possible (as you can waste a lot of time with compilation stuff). If you prefer using cygwin, you should better have a look at **broken link removed**. I avoid cygwin, as I don't like to download tons of packages and msys and still something missing...

I'm using a Fedora system with mingw as cross-compiler in this example, as the mingw packages are available through the package manager like in many other distributions. The plugin that I will compile for Windows XP (32 bit) is the Gimp Deskew plugin. Its source code can be downloaded from here.

Besides the Deskew source code we will also need to install some packages i.e. Gimp (we need at least the header files), MingW, etc.. In my case (some build tools were already installed on my system):
Code:
yum install gimp gimp-devel gimp-devel-tools glibc-devel.i686 
mingw32-{gcc-c++,pthreads,gdk-pixbuf,cairo,libpng,glib2,pixman,freetype,gtk2,atk,pango,harfbuzz,libltdl,pkg-config}
We have to unzip and enter the Deskew source code folder:
Code:
unzip -q gimp-deskew-plugin-1.1.zip
cd gimp-deskew-plugin-1.1
... and set some variables for the configuration (here is a more detailed description):
Code:
export HOST="i686-w64-mingw32"
export PATH="/usr/$HOST/bin:$PATH"
export DEP_PREFIX="/usr/$HOST/sys-root/mingw"
export PKG_CONFIG_LIBDIR=""
export PKG_CONFIG_PATH="$DEP_PREFIX/lib/pkgconfig"
export ACLOCAL_FLAGS="-I $DEP_PREFIX/share/aclocal"
export RANLIB="$HOST-ranlib"
export CC="$HOST-gcc"
export CXX="$HOST-g++"
export CPP="$HOST-cpp"
export CPATH="$DEP_PREFIX/include"
export C_INCLUDE_PATH="$CPATH"
export CFLAGS="-I$CPATH"
export CXXFLAGS="-I$CPATH"
export CPPFLAGS="-I$CPATH"
export LD_LIBRARY_PATH="$DEP_PREFIX/lib"
export LDFLAGS="-L$LD_LIBRARY_PATH -L$LD_LIBRARY_PATH/gimp -mwindows"

MINGW_INC="$DEP_PREFIX/include"
INC_ARGS="-I$DEP_PREFIX/lib/glib-2.0/include -I$MINGW_INC/glib-2.0 -I$DEP_PREFIX/lib/gtk-2.0/include -I$MINGW_INC/gtk-2.0 -I$MINGW_INC/gdk-pixbuf-2.0 -I$MINGW_INC/cairo -I$MINGW_INC/libpng15 -I$MINGW_INC/pixman-1 -I$MINGW_INC/freetype2 -I$MINGW_INC/atk-1.0 -I$MINGW_INC/pango-1.0 -I$MINGW_INC/harfbuzz -I/usr/include/gimp-2.0"

export GIMP_CFLAGS="-pthread $INC_ARGS"
export GIMP_LIBS="-lglib-2.0 -lgtk-win32-2.0 -lgimpui-2.0-0 -lgimpwidgets-2.0-0 -lgimpmodule-2.0-0 -lgimp-2.0-0 -lgimpmath-2.0-0 -lgimpconfig-2.0-0 -lgimpcolor-2.0-0 -lgimpbase-2.0-0 -lgdk-win32-2.0 -lgdk_pixbuf-2.0 -limm32 -lshell32 -lole32 -latk-1.0 -lpangocairo-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangowin32-1.0 -lgdi32 -lfreetype -lfontconfig -lpango-1.0 -lm -lcairo -lgobject-2.0 -lintl.dll"

The GIMP_LIBS contains the libraries also shown by 'gimptool --libs' and 7 additional ones. Take care of having them in the right order!
The GIMP_CFLAGS are set according to the required libraries.

Specify a folder for the turnkey Deskew plugin:
Code:
export DESTDIR="/home/joe/deskew"
To run the configuration and generate the Makefiles enter:
Code:
./autogen.sh --host=$HOST
Alternatively you could create and run the configure script with the following commands:
Code:
autoreconf -i --force $INC_ARGS
autoheader --force $INC_ARGS
aclocal --force
automake -f
autopoint --force
libtoolize --force
./configure --host=$HOST
If everything went fine, you should be asked to type:
Code:
make
Finally you can put everything you need into the DESTDIR folder (/home/joe/deskew) with:
Code:
make install
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top