2018-06-17 23:07:06 +01:00
|
|
|
{ stdenv, fetchFromGitHub, qmake, qtbase, qttools, substituteAll, libGLU, makeWrapper }:
|
2014-05-06 23:06:56 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2018-06-17 23:07:06 +01:00
|
|
|
name = "nifskope-${version}";
|
|
|
|
version = "2.0.dev7";
|
2014-05-06 23:06:56 +01:00
|
|
|
|
2018-06-17 23:07:06 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "niftools";
|
|
|
|
repo = "nifskope";
|
|
|
|
rev = "47b788d26ae0fa12e60e8e7a4f0fa945a510c7b2"; # `v${version}` doesn't work with submodules
|
|
|
|
sha256 = "1wqpn53rkq28ws3apqghkzyrib4wis91x171ns64g8kp4q6mfczi";
|
|
|
|
fetchSubmodules = true;
|
2014-05-06 23:06:56 +01:00
|
|
|
};
|
|
|
|
|
2018-06-17 23:07:06 +01:00
|
|
|
patches = [
|
|
|
|
./external-lib-paths.patch
|
|
|
|
(substituteAll {
|
|
|
|
src = ./qttools-bins.patch;
|
|
|
|
qttools = "${qttools.dev}/bin";
|
|
|
|
})
|
|
|
|
];
|
2017-09-10 09:55:58 +01:00
|
|
|
|
2018-06-17 23:07:06 +01:00
|
|
|
buildInputs = [ qtbase qttools libGLU.dev makeWrapper ];
|
|
|
|
nativeBuildInputs = [ qmake ];
|
2014-05-06 23:06:56 +01:00
|
|
|
|
2018-06-17 23:07:06 +01:00
|
|
|
preConfigure = ''
|
|
|
|
shopt -s globstar
|
|
|
|
for i in **/*.cpp; do
|
|
|
|
substituteInPlace $i --replace /usr/share/nifskope $out/share/nifskope
|
|
|
|
done
|
|
|
|
'';
|
2016-04-17 00:52:35 +01:00
|
|
|
|
2018-06-17 23:07:06 +01:00
|
|
|
enableParallelBuilding = true;
|
2014-05-06 23:06:56 +01:00
|
|
|
|
2018-06-17 23:07:06 +01:00
|
|
|
# Inspired by install/linux-install/nifskope.spec.in.
|
|
|
|
installPhase = let
|
|
|
|
qtVersion = "5.${stdenv.lib.versions.minor qtbase.version}";
|
|
|
|
in ''
|
|
|
|
runHook preInstall
|
2014-05-06 23:06:56 +01:00
|
|
|
|
2018-06-17 23:07:06 +01:00
|
|
|
d=$out/share/nifskope
|
|
|
|
mkdir -p $out/bin $out/share/applications $out/share/pixmaps $d/{shaders,lang}
|
|
|
|
cp release/NifSkope $out/bin/
|
|
|
|
cp ./res/nifskope.png $out/share/pixmaps/
|
|
|
|
cp release/{nif.xml,kfm.xml,style.qss} $d/
|
|
|
|
cp res/shaders/*.frag res/shaders/*.prog res/shaders/*.vert $d/shaders/
|
|
|
|
cp ./res/lang/*.ts ./res/lang/*.tm $d/lang/
|
|
|
|
cp ./install/linux-install/nifskope.desktop $out/share/applications
|
|
|
|
|
|
|
|
substituteInPlace $out/share/applications/nifskope.desktop \
|
|
|
|
--replace 'Exec=nifskope' "Exec=$out/bin/NifSkope" \
|
|
|
|
--replace 'Icon=nifskope' "Icon=$out/share/pixmaps/nifskope.png"
|
|
|
|
|
|
|
|
find $out/share -type f -exec chmod -x {} \;
|
|
|
|
|
|
|
|
wrapProgram $out/bin/NifSkope --prefix QT_PLUGIN_PATH : "${qtbase}/lib/qt-${qtVersion}/plugins"
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
2014-05-06 23:06:56 +01:00
|
|
|
|
2018-06-17 23:07:06 +01:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
homepage = http://niftools.sourceforge.net/wiki/NifSkope;
|
2014-05-06 23:06:56 +01:00
|
|
|
description = "A tool for analyzing and editing NetImmerse/Gamebryo '*.nif' files";
|
2018-06-17 23:07:06 +01:00
|
|
|
maintainers = with maintainers; [ eelco ma27 ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
license = licenses.bsd3;
|
2014-05-06 23:06:56 +01:00
|
|
|
};
|
|
|
|
}
|