aboutsummaryrefslogtreecommitdiff
path: root/nixpkgs/pkgs/applications/graphics/opentoonz
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/applications/graphics/opentoonz')
-rw-r--r--nixpkgs/pkgs/applications/graphics/opentoonz/default.nix51
-rw-r--r--nixpkgs/pkgs/applications/graphics/opentoonz/libtiff.nix21
-rw-r--r--nixpkgs/pkgs/applications/graphics/opentoonz/source.nix16
3 files changed, 88 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/applications/graphics/opentoonz/default.nix b/nixpkgs/pkgs/applications/graphics/opentoonz/default.nix
new file mode 100644
index 00000000000..68830699699
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/opentoonz/default.nix
@@ -0,0 +1,51 @@
+{ boost, cmake, fetchFromGitHub, freeglut, freetype, glew, libjpeg, libmypaint
+, libpng, libtiff, libusb1, lz4, lzma, lzo, openblas, pkgconfig, qtbase
+, qtmultimedia, qtscript, stdenv, superlu, wrapQtAppsHook, }:
+let source = import ./source.nix { inherit fetchFromGitHub; };
+in stdenv.mkDerivation rec {
+ inherit (source) src;
+
+ pname = "opentoonz";
+ version = source.versions.opentoonz;
+
+ nativeBuildInputs = [ cmake pkgconfig wrapQtAppsHook ];
+
+ buildInputs = [
+ boost
+ freeglut
+ freetype
+ glew
+ libjpeg
+ libmypaint
+ libpng
+ libtiff
+ libusb1
+ lz4
+ lzma
+ lzo
+ openblas
+ qtbase
+ qtmultimedia
+ qtscript
+ superlu
+ ];
+
+ postUnpack = "sourceRoot=$sourceRoot/toonz";
+
+ cmakeDir = "../sources";
+ cmakeFlags = [
+ "-DTIFF_INCLUDE_DIR=${libtiff.dev}/include"
+ "-DTIFF_LIBRARY=${libtiff.out}/lib/libtiff.so"
+ ];
+
+ postInstall = ''
+ sed -i '/cp -r .*stuff/a\ chmod -R u+w $HOME/.config/OpenToonz/stuff' $out/bin/opentoonz
+ '';
+
+ meta = {
+ description = "Full-featured 2D animation creation software";
+ homepage = "https://opentoonz.github.io/";
+ license = stdenv.lib.licenses.bsd3;
+ maintainers = with stdenv.lib.maintainers; [ chkno ];
+ };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/opentoonz/libtiff.nix b/nixpkgs/pkgs/applications/graphics/opentoonz/libtiff.nix
new file mode 100644
index 00000000000..6663c47553e
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/opentoonz/libtiff.nix
@@ -0,0 +1,21 @@
+# Per https://github.com/opentoonz/opentoonz/blob/master/doc/how_to_build_linux.md ,
+# opentoonz requires its own modified version of libtiff. We still build it as
+# a separate package
+# 1. For visibility for tools like vulnix, and
+# 2. To avoid a diamond-dependency problem with qt linking the normal libtiff
+# and opentoonz linking qt and this modified libtiff, we build a qt against
+# this modified libtiff as well.
+
+{ fetchFromGitHub, libtiff }:
+let source = import ./source.nix { inherit fetchFromGitHub; };
+in libtiff.overrideAttrs (old: {
+ inherit (source) src;
+ version = source.versions.libtiff + "-opentoonz";
+ postUnpack = (old.postUnpack or "") + ''
+ sourceRoot="$sourceRoot/thirdparty/tiff-${source.versions.libtiff}"
+ '';
+ # opentoonz uses internal libtiff headers
+ postInstall = (old.postInstall or "") + ''
+ cp libtiff/{tif_config,tif_dir,tiffiop}.h $dev/include
+ '';
+})
diff --git a/nixpkgs/pkgs/applications/graphics/opentoonz/source.nix b/nixpkgs/pkgs/applications/graphics/opentoonz/source.nix
new file mode 100644
index 00000000000..7378d2f5f96
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/opentoonz/source.nix
@@ -0,0 +1,16 @@
+# opentoonz's source archive contains both opentoonz's source and a modified
+# version of libtiff that opentoonz requires.
+
+{ fetchFromGitHub, }: rec {
+ versions = {
+ opentoonz = "1.4.0";
+ libtiff = "4.0.3";
+ };
+
+ src = fetchFromGitHub {
+ owner = "opentoonz";
+ repo = "opentoonz";
+ rev = "v${versions.opentoonz}";
+ sha256 = "0vgclx2yydsm5i2smff3fj8m750nhf35wfhva37kywgws01s189b";
+ };
+}