From 124bb278229f7d1997a24e15fb2dd977b21e6cc1 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Mon, 11 Jan 2021 01:14:05 +0100 Subject: [PATCH 1/5] lensfun: update website Project has moved to GitHub. --- pkgs/development/libraries/lensfun/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/libraries/lensfun/default.nix b/pkgs/development/libraries/lensfun/default.nix index addcb5b5a4f..24983d5ce6e 100644 --- a/pkgs/development/libraries/lensfun/default.nix +++ b/pkgs/development/libraries/lensfun/default.nix @@ -19,6 +19,6 @@ stdenv.mkDerivation rec { maintainers = with maintainers; [ ]; license = stdenv.lib.licenses.lgpl3; description = "An opensource database of photographic lenses and their characteristics"; - homepage = "http://lensfun.sourceforge.net/"; + homepage = "https://lensfun.github.io"; }; } From 8c1d575ce479dea79eeefd804825d6884b16ba5c Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Mon, 11 Jan 2021 01:14:34 +0100 Subject: [PATCH 2/5] lensfun: fetchFromGitHub, s/pkgconfig/pkg-config/ --- pkgs/development/libraries/lensfun/default.nix | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/pkgs/development/libraries/lensfun/default.nix b/pkgs/development/libraries/lensfun/default.nix index 24983d5ce6e..b39f281c1bf 100644 --- a/pkgs/development/libraries/lensfun/default.nix +++ b/pkgs/development/libraries/lensfun/default.nix @@ -1,15 +1,20 @@ -{ stdenv, fetchurl, pkgconfig, glib, zlib, libpng, cmake }: +{ stdenv, fetchFromGitHub, pkg-config, glib, zlib, libpng, cmake }: -stdenv.mkDerivation rec { +let version = "0.3.95"; pname = "lensfun"; +in +stdenv.mkDerivation { + inherit pname version; - src = fetchurl { - url = "mirror://sourceforge/lensfun/${version}/${pname}-${version}.tar.gz"; - sha256 = "0218f3xrlln0jmh4gcf1zbpvi2bidgl3b2mblf6c810n7j1rrhl2"; + src = fetchFromGitHub { + owner = "lensfun"; + repo = "lensfun"; + rev = "v${version}"; + sha256 = "0isli0arns8bmxqpbr1jnbnqh5wvspixdi51adm671f9ngng7x5r"; }; - nativeBuildInputs = [ cmake pkgconfig ]; + nativeBuildInputs = [ cmake pkg-config ]; buildInputs = [ glib zlib libpng ]; configureFlags = [ "-v" ]; From 77a64e88d7993643d74012830cedc387d57a8d5d Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Mon, 11 Jan 2021 01:15:14 +0100 Subject: [PATCH 3/5] lensfun: add flokli as maintainer --- pkgs/development/libraries/lensfun/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/libraries/lensfun/default.nix b/pkgs/development/libraries/lensfun/default.nix index b39f281c1bf..1f22f64f057 100644 --- a/pkgs/development/libraries/lensfun/default.nix +++ b/pkgs/development/libraries/lensfun/default.nix @@ -21,7 +21,7 @@ stdenv.mkDerivation { meta = with stdenv.lib; { platforms = platforms.linux ++ platforms.darwin; - maintainers = with maintainers; [ ]; + maintainers = with maintainers; [ flokli ]; license = stdenv.lib.licenses.lgpl3; description = "An opensource database of photographic lenses and their characteristics"; homepage = "https://lensfun.github.io"; From c939d8f1999d0452aca081939f5a9ff743e31ec7 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Mon, 11 Jan 2021 01:19:15 +0100 Subject: [PATCH 4/5] lensfun: don't install helper scripts The `[g-]lensfun-update-data` binaries can't really work on NixOS (as the database is immutable), and most other scripts seem to require the lensfun python bindings (which aren't installed either). Let's disable installing the helper scripts for now. --- pkgs/development/libraries/lensfun/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/libraries/lensfun/default.nix b/pkgs/development/libraries/lensfun/default.nix index 1f22f64f057..c27a2c4daa7 100644 --- a/pkgs/development/libraries/lensfun/default.nix +++ b/pkgs/development/libraries/lensfun/default.nix @@ -17,7 +17,7 @@ stdenv.mkDerivation { nativeBuildInputs = [ cmake pkg-config ]; buildInputs = [ glib zlib libpng ]; - configureFlags = [ "-v" ]; + cmakeFlags = [ "-DINSTALL_HELPER_SCRIPTS=OFF" ]; meta = with stdenv.lib; { platforms = platforms.linux ++ platforms.darwin; From 9137be6daa6274f8fcd1a362ab75cf777375c09d Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Mon, 11 Jan 2021 01:29:50 +0100 Subject: [PATCH 5/5] lensfun: update database to a more recent snapshot lensfun hasn't had a new release since quite some time, and the database updater doesn't work in NixOS (https://github.com/NixOS/nixpkgs/issues/99009). This replaces the database with a more recent snapshot during build, thus adding support for more recent camera models/lenses (as reported in https://github.com/NixOS/nixpkgs/issues/107304) --- pkgs/development/libraries/lensfun/default.nix | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/pkgs/development/libraries/lensfun/default.nix b/pkgs/development/libraries/lensfun/default.nix index c27a2c4daa7..e9e8d3447b9 100644 --- a/pkgs/development/libraries/lensfun/default.nix +++ b/pkgs/development/libraries/lensfun/default.nix @@ -3,6 +3,16 @@ let version = "0.3.95"; pname = "lensfun"; + + # Fetch a more recent version of the repo containing a more recent lens + # database + lensfunDatabase = fetchFromGitHub { + owner = "lensfun"; + repo = "lensfun"; + rev = "4672d765a17bfef7bc994ca7008cb717c61045d5"; + sha256 = "00x35xhpn55j7f8qzakb6wl1ccbljg1gqjb93jl9w3mha2bzsr41"; + }; + in stdenv.mkDerivation { inherit pname version; @@ -14,6 +24,12 @@ stdenv.mkDerivation { sha256 = "0isli0arns8bmxqpbr1jnbnqh5wvspixdi51adm671f9ngng7x5r"; }; + # replace database with a more recent snapshot + postUnpack = '' + rm -R source/data/db + cp -R ${lensfunDatabase}/data/db source/data + ''; + nativeBuildInputs = [ cmake pkg-config ]; buildInputs = [ glib zlib libpng ];