nixpkgs/pkgs/applications/graphics/hugin/default.nix
Alexander Bantyev 7b6987ea4e
hugin: use glew-egl to fix startup crash
Currently, hugin crashes on startup with an unhelpful

ERROR: 21:14:22.923574 (/build/hugin-2021.0.0/src/hugin1/hugin/GLViewer.cpp:133) SetUpContext(): Error initialising GLEW: Unknown error.

As outlined in [1], this is caused by glew being compiled without egl
support. As such, switching to glew-egl fixes the problem and hugin
starts up fine.

[1]: https://bbs.archlinux.org/viewtopic.php?id=278127
2022-12-11 21:14:01 +04:00

104 lines
1.9 KiB
Nix

{ lib
, stdenv
, cmake
, fetchurl
, gnumake
, makeWrapper
, pkg-config
, autopanosiftc
, boost
, cairo
, enblend-enfuse
, exiv2
, fftw
, flann
, gettext
, glew-egl
, ilmbase
, lcms2
, lensfun
, libjpeg
, libpng
, libtiff
, libX11
, libXi
, libXmu
, libGLU
, libGL
, openexr
, panotools
, perlPackages
, sqlite
, vigra
, wxGTK
, zlib
}:
stdenv.mkDerivation rec {
pname = "hugin";
version = "2021.0.0";
src = fetchurl {
url = "mirror://sourceforge/hugin/hugin-${version}.tar.bz2";
sha256 = "sha256-BHrqin+keESzTvJ8GdO2l+hJOdyx/bvrLCBGIbZu6tk=";
};
patches = [
# committed upstream but unreleased:
# https://sourceforge.net/p/hugin/hugin/ci/edfddc6070ca6d4223d359fb4b38273a5aed2f2d
./dont-crash-if-XDG_DATA_DIRS-not-set-edfddc6070ca6d4223d359fb4b38273a5aed2f2d.patch
];
buildInputs = [
boost
cairo
exiv2
fftw
flann
gettext
glew-egl
ilmbase
lcms2
lensfun
libjpeg
libpng
libtiff
libX11
libXi
libXmu
libGLU
libGL
openexr
panotools
sqlite
vigra
wxGTK
zlib
];
nativeBuildInputs = [ cmake makeWrapper pkg-config ];
# disable installation of the python scripting interface
cmakeFlags = [ "-DBUILD_HSI:BOOl=OFF" ];
NIX_CFLAGS_COMPILE = "-I${ilmbase.dev}/include/OpenEXR";
postInstall = ''
for p in $out/bin/*; do
wrapProgram "$p" \
--suffix PATH : ${autopanosiftc}/bin \
--suffix PATH : ${enblend-enfuse}/bin \
--suffix PATH : ${gnumake}/bin \
--suffix PATH : ${perlPackages.ImageExifTool}/bin
done
'';
meta = with lib; {
homepage = "http://hugin.sourceforge.net/";
description = "Toolkit for stitching photographs and assembling panoramas, together with an easy to use graphical front end";
license = licenses.gpl2Plus;
maintainers = with maintainers; [ hrdinka ];
platforms = platforms.linux;
};
}