From 481bc87b83e84342789e8a5945883c6e14d988da Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Mon, 2 Jan 2023 11:42:56 +0100 Subject: [PATCH] jxrlib: migrate to cmake --- pkgs/development/libraries/jxrlib/default.nix | 28 +++++++++++-------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/pkgs/development/libraries/jxrlib/default.nix b/pkgs/development/libraries/jxrlib/default.nix index 06499e151ba1..e6768dc0fa50 100644 --- a/pkgs/development/libraries/jxrlib/default.nix +++ b/pkgs/development/libraries/jxrlib/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchFromGitHub, python3, fixDarwinDylibNames }: +{ lib, stdenv, fetchFromGitHub, fetchpatch, cmake }: stdenv.mkDerivation rec { pname = "jxrlib"; @@ -13,21 +13,25 @@ stdenv.mkDerivation rec { sha256 = "0rk3hbh00nw0wgbfbqk1szrlfg3yq7w6ar16napww3nrlm9cj65w"; }; - postPatch = '' - substituteInPlace Makefile \ - --replace "cc" "$CC" - '' + lib.optionalString stdenv.isDarwin '' - substituteInPlace Makefile \ - --replace '-shared' '-dynamiclib -undefined dynamic_lookup' \ - --replace '.so' '.dylib' - ''; + patches = [ + (fetchpatch { + url = "https://salsa.debian.org/debian-phototools-team/jxrlib/-/raw/df96f9b9c1fbe9cdc97589c337f8a948bc81c4d0/debian/patches/usecmake.patch"; + sha256 = "sha256-BpCToLgA5856PZk5mXlwAy3Oh9aYP/2wvu2DXDTqufM="; + }) + (fetchpatch { + url = "https://salsa.debian.org/debian-phototools-team/jxrlib/-/raw/6c88037293aff8d5bc8a76ea32b36781c430ede3/debian/patches/bug803743.patch"; + sha256 = "sha256-omIGa+ZrWjaH/IkBn4jgjufF/HEDKw69anVCX4hw+xQ="; + }) + (fetchpatch { + url = "https://salsa.debian.org/debian-phototools-team/jxrlib/-/raw/b23d49062ec6a9b2739c9dade86be525a72fc807/debian/patches/pkg-config.patch"; + sha256 = "sha256-ZACaXEi+rbKIFBHtSBheyFfqV2HYsKKrT+SmTShyUhg="; + }) + ]; - nativeBuildInputs = [ python3 ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames; + nativeBuildInputs = [ cmake ]; strictDeps = true; - makeFlags = [ "DIR_INSTALL=$(out)" "SHARED=1" ]; - meta = with lib; { description = "Implementation of the JPEG XR image codec standard"; homepage = "https://jxrlib.codeplex.com";