source: gs3-extensions/mars-src/trunk/packages/CASCADE-MAKE/CHROMAPRINT.sh@ 34677

Last change on this file since 34677 was 34677, checked in by davidb, 3 years ago

Development of supporting packages for essenstia through cascade-make. This was done before it was found the essentia includes a 3rd-party building script that can be run that essentially does the same thing. Commit these files for referece, but not currently being used

  • Property svn:executable set to *
File size: 3.2 KB
Line 
1#!/bin/bash
2
3package=chromaprint
4version=-v1.5.0
5
6progname=$0
7
8source ../cascade-make/lib/cascade-lib.bash GEXT_MARS ../.. $*
9
10prefix=$GEXT_MARS_INSTALLED
11
12#export CFLAGS="$CFLAGS -fPIC"
13#export CXXFLAGS="$CXXFLAGS -fPIC"
14#export LDFLAGS="$LDFLAGS -fPIC"
15
16export CFLAGS="$CFLAGS -I$GEXT_MARS_INSTALLED/include"
17#export CPPFLAGS="$CPPFLAGS -I$GEXT_MARS_INSTALLED/include"
18export CXXFLAGS="$CXXFLAGS -I$GEXT_MARS_INSTALLED/include"
19export LDFLAGS="$LDFLAGS -L$GEXT_MARS_INSTALLED/lib"
20#export LD_LIBRARY_PATH="$GEXT_MARS_INSTALLED/lib"
21
22
23# The following is a workaround that lets 'fpcalc' (the final executable generate) to compile.
24#
25# In theory this shouldn't be needed, but it would appear the 'cmake' rule to Chromaprint
26# don't correctly work out that linking in a static -lavcodec means that -lz also need to be present.
27# Awkward to try and change the rule within cmake, so the decision was made to include it through
28# the LDFLAGS environment variable, even though that means it's presented to all the linking
29# commands in the project.
30
31# How did we get here?
32#
33# The fix is considered a small price to pay in working through a more complicated sequence of
34# errors we had been getting.
35#
36# 1. With default params, chromaprint generates both static and shared libraries. However, compilation
37# failed trying to generate the shared library, as it could not link against the static
38# libavcodec.a (-fPIC issue).
39# 2. So, next we went back to 'ffmpeg' and changed its configure statement to enable shared libraries.
40# However, this lead to a new linking error to do with 'inflate' (in libz) not being found.
41# (It wasn't clear at that point which libz it should be looking for. It was thought that it
42# was probably a system-wide installed one, and perhaps one that was perhaps just the .so file)
43# 3. The decision at that point was made to bundle a version of libz within the 'devel' folder
44# to this extension, and point packages known to need it explicity at that.
45#
46# Step 3 resulted in successful compilation, notwithstanding, the little bugbear that 'fpcalc'
47# fails to include -lz in its linking command (hence the workaround used here!)
48
49export LDFLAGS="$LDFLAGS -lz"
50
51if [ "x$PKG_CONFIG_PATH" = "x" ] ; then
52 export PKG_CONFIG_PATH="$GEXT_MARS_INSTALLED/lib/pkgconfig"
53else
54 export PKG_CONFIG_PATH="$GEXT_MARS_INSTALLED/lib/pkgconfig:$PKG_CONFIG_PATH"
55
56fi
57
58opt_run_untar $force_untar $auto_untar $package $version
59
60#opt_run_configure $force_config $auto_config $package $version $prefix
61if [ $force_config = "1" ] ; then
62 echo "[pushd $package$version]"
63 cd $package$version ;
64
65 if [ ! -f Makefile ] ; then \
66 #cmake -D CMAKE_BUILD_TYPE=RELEASE \
67 # -D CMAKE_INSTALL_PREFIX=$prefix ..;
68 cmake -DCMAKE_BUILD_TYPE=Release \
69 -DCMAKE_INSTALL_PREFIX=$prefix \
70 -DBUILD_TOOLS=ON . \
71 -DBUILD_SHARED_LIBS=OFF \
72 -DCMAKE_C_FLAGS="$CFLAGS" \
73 -DCMAKE_CXX_FLAGS="$CXXFLAGS" \
74 -DCMAKE_EXE_LINKER_FLAGS="$LDFLAGS"
75
76 fi ;
77 cd ..
78
79fi
80
81opt_run_make $compile $package $version
82opt_run_make $install $package $version "install"
83
84opt_run_make $clean $package $version "clean"
85opt_run_make $distclean $package $version "distclean"
86
87opt_run_tarclean $tarclean $package $version
Note: See TracBrowser for help on using the repository browser.