From 70e33e3ae34e799e5b077704ffa35702a190362d Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Fri, 12 Feb 2021 22:32:08 +0000 Subject: [PATCH] glsurf: use current giflib This requires bumping the version of camlimages used by glsurf to a version that supports current giflib. The most recent versions of camlimages (even of 4.x) don't support ocaml 4.01 any more, so I've upgraded to 4.1.2 here, the last version that supports ocaml 4.01 (and which happily supports current giflib). --- .../science/math/glsurf/default.nix | 6 +-- .../ocaml-modules/camlimages/4.0.nix | 41 ------------------- .../ocaml-modules/camlimages/4.1.2.nix | 37 +++++++++++++++++ pkgs/top-level/all-packages.nix | 1 - pkgs/top-level/ocaml-packages.nix | 5 +-- 5 files changed, 42 insertions(+), 48 deletions(-) delete mode 100644 pkgs/development/ocaml-modules/camlimages/4.0.nix create mode 100644 pkgs/development/ocaml-modules/camlimages/4.1.2.nix diff --git a/pkgs/applications/science/math/glsurf/default.nix b/pkgs/applications/science/math/glsurf/default.nix index 3b4604fe2aa8..bf8b5d7673b4 100644 --- a/pkgs/applications/science/math/glsurf/default.nix +++ b/pkgs/applications/science/math/glsurf/default.nix @@ -10,10 +10,10 @@ stdenv.mkDerivation { sha256 = "0w8xxfnw2snflz8wdr2ca9f5g91w5vbyp1hwlx1v7vg83d4bwqs7"; }; - buildInputs = [ freeglut libGLU libGL libmysqlclient mpfr gmp - libtiff libjpeg libpng giflib ] + buildInputs = [ freeglut libGLU libGL libmysqlclient mpfr giflib gmp + libtiff libjpeg libpng ] ++ (with ocamlPackages; [ - ocaml findlib ocaml_mysql lablgl camlimages_4_0 mlgmpidl + ocaml findlib ocaml_mysql lablgl camlimages_4_1_2 mlgmpidl ]); installPhase = '' diff --git a/pkgs/development/ocaml-modules/camlimages/4.0.nix b/pkgs/development/ocaml-modules/camlimages/4.0.nix deleted file mode 100644 index 26735b1c5d7f..000000000000 --- a/pkgs/development/ocaml-modules/camlimages/4.0.nix +++ /dev/null @@ -1,41 +0,0 @@ -{ lib, stdenv, fetchurl, omake, ocaml, libtiff, libjpeg, libpng, giflib, findlib, libXpm, freetype, graphicsmagick, ghostscript }: - -let - pname = "camlimages"; - version = "4.0.1"; -in - -stdenv.mkDerivation { - name = "${pname}-${version}"; - - src = fetchurl { - url = "https://bitbucket.org/camlspotter/camlimages/get/v4.0.1.tar.gz"; - sha256 = "b40237c1505487049799a7af296eb3996b3fa08eab94415546f46d61355747c4"; - }; - - buildInputs = [ ocaml omake findlib graphicsmagick ghostscript ]; - - propagatedBuildInputs = [libtiff libjpeg libpng giflib freetype libXpm ]; - - createFindlibDestdir = true; - - preConfigure = '' - rm ./configure - ''; - - buildPhase = '' - omake - ''; - - installPhase = '' - omake install - ''; - - meta = with lib; { - branch = "4.0"; - homepage = "https://bitbucket.org/camlspotter/camlimages"; - description = "OCaml image processing library"; - license = licenses.lgpl2; - maintainers = [ maintainers.vbgl ]; - }; -} diff --git a/pkgs/development/ocaml-modules/camlimages/4.1.2.nix b/pkgs/development/ocaml-modules/camlimages/4.1.2.nix new file mode 100644 index 000000000000..437cb84d15d3 --- /dev/null +++ b/pkgs/development/ocaml-modules/camlimages/4.1.2.nix @@ -0,0 +1,37 @@ +{ lib, stdenv, fetchFromGitLab, fetchpatch, omake, ocaml, findlib +, graphicsmagick, ghostscript +, freetype, giflib, libjpeg, libpng, libtiff, libXpm +}: + +stdenv.mkDerivation rec { + pname = "camlimages"; + version = "4.1.2"; + + src = fetchFromGitLab { + owner = "camlspotter"; + repo = "camlimages"; + rev = "98661d507e12ce91a51295a50f244cb8265b4439"; # no tag + sha256 = "0kpxj8wm2m17wjq217jzjpfgv1d7sp4w1yd1gi8ipn5rj4sid2j8"; + }; + + buildInputs = [ ocaml omake findlib graphicsmagick ghostscript ]; + propagatedBuildInputs = [ libtiff libjpeg libpng giflib freetype libXpm ]; + + createFindlibDestdir = true; + + buildPhase = '' + omake + ''; + + installPhase = '' + omake install + ''; + + meta = with lib; { + branch = "4.0"; + homepage = "https://bitbucket.org/camlspotter/camlimages"; + description = "OCaml image processing library"; + license = licenses.lgpl2; + maintainers = [ maintainers.vbgl ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 33ffdc7c503a..053c4328df7f 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -14518,7 +14518,6 @@ in glsurf = callPackage ../applications/science/math/glsurf { libpng = libpng12; - giflib = giflib_4_1; ocamlPackages = ocaml-ng.ocamlPackages_4_01_0; }; diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index 5aa7482fdc6e..0561a4ea810e 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -114,12 +114,11 @@ let then callPackage ../development/ocaml-modules/camomile { } else callPackage ../development/ocaml-modules/camomile/0.8.5.nix { }; - camlimages_4_0 = + camlimages_4_1_2 = if lib.versionOlder "4.02" ocaml.version then null - else callPackage ../development/ocaml-modules/camlimages/4.0.nix { + else callPackage ../development/ocaml-modules/camlimages/4.1.2.nix { libpng = pkgs.libpng12; - giflib = pkgs.giflib_4_1; }; camlimages = callPackage ../development/ocaml-modules/camlimages { };