Skip to content

Instantly share code, notes, and snippets.

/PKGBUILD
Created Nov 20, 2017

Embed
What would you like to do?
pkgname=diffimg
_pkgname=Diffimg
pkgver=2.2.0
pkgrel=1
pkgdesc="Simple image comparison tool"
arch=('i686' 'x86_64')
license=('GPL2')
depends=(qt4 qwt-qt4 opencv2-opt freeimage)
makedepends=(qt4 qwt-qt4 opencv2-opt freeimage cmake)
url='http://sourceforge.net/projects/diffimg/'
source=(
http://downloads.sourceforge.net/project/diffimg/${pkgver}/${_pkgname}-${pkgver}-src.zip
diffimg.desktop
CMakeLists.patch
FindOpenCV.cmake
)
sha256sums=('5d19a4999c320cfd12c2c5bf769f408877e2e6858a3641502e295f5dfb92df80'
'9649dfa6359fb0224f3d4dd06d1d64678daa259df73d618810a27712c84c2d6f'
'6a56a9b274363980c1e608883dc9497f770e6a2c6e92b7421e1ae6aa04684eca'
'084dce6a485b5fb2cc776d65c21022303f74a27adf30097dbdc5bf018ce3aa2b')
install='diffimg.install'
prepare(){
cd "$srcdir"/$_pkgname-$pkgver-src
patch -p1 -i $srcdir/CMakeLists.patch
install $srcdir/FindOpenCV.cmake build/cmake/FindOpenCV.cmake
}
build() {
cd "$srcdir"/$_pkgname-$pkgver-src
sed -i -e 's/\r//' \
-e 's/|/-print0 |/' \
-e "s#dos2unix#-0 sed -i 's|\\\r||'#" \
tounix.sh
sh ./tounix.sh
cd ./build
sed -i -e 's;\"\/usr\/include\/qwt\";\"\/usr\/include\/qwt\-qt4\";g' CMakeLists.txt
#what follows are horrible kludges to get perceptualdiff to compile properly with "opencv2-opt", none of which worked
# cd ../3rdparty/perceptualdiff
# sed -i -e 's;\.\.\/opencv\/include;\/opt\/opencv2\/include\/opencv2;g' perceptualdiff.pro
# sed -i -e 's;\.\.\/opencv\/core\/include;\/opt\/opencv2\/include\/opencv2\/core;g' perceptualdiff.pro
# sed -i -e 's;\.\.\/opencv\/highgui\/include;\/opt\/opencv2\/include\/opencv2\/highgui;g' perceptualdiff.pro
# sed -i -e 's;\.\.\/opencv\/imgproc\/include;\/opt\/opencv2\/include\/opencv2\/imgproc;g' perceptualdiff.pro
# sed -i '20i CMAKE\_INCLUDE\_PATH\=\"\/opt\/opencv2\/include\/opencv2\;\/opt\/opencv2\/include\/opencv2\/core\;\/opt\/opencv2\/include\/opencv2\/imgproc\;\/opt\/opencv2\/include\/opencv2\/highgui\"\n' OpenCVImageLoader.cpp
# sed -i -e 's;opencv2\/imgproc\/imgproc\.hpp;\/opt\/opencv2\/include\/opencv2\/imgproc\/imgproc\.hpp;g' OpenCVImageLoader.cpp
# sed -i -e 's;opencv2\/highgui\/highgui\.hpp;\/opt\/opencv2\/include\/opencv2\/core\/core\.hpp\>\n\#include \<\/opt\/opencv2\/include\/opencv2\/highgui\/highgui\.cpp;g' OpenCVImageLoader.cpp
# cd ../../build
cmake .
# qmake-qt4 -recursive INSTALL_PREFIX=/usr diffimg.pro
make
}
package() {
cd "$srcdir"/$_pkgname-$pkgver-src
install -Dm644 ../$pkgname.desktop "$pkgdir"/usr/share/applications/$pkgname.desktop
cd ./build
make INSTALL_ROOT="${pkgdir}" install
# install -dm755 "$pkgdir"/usr/share/icons
# ln -s ../pixmaps/res/diffimg.ico "$pkgdir"/usr/share/icons/diffimg.ico
# fix conflicts with graphviz
mv "$pkgdir"/usr/bin/$pkgname "$pkgdir"/usr/bin/${_pkgname}
mv "$pkgdir"/usr/share/man/man1/$pkgname.1.gz "$pkgdir"/usr/share/man/man1/${_pkgname}.1.gz
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.