From ed8e72640cb29a8792e99b7aabc740ccd7ebb7fb Mon Sep 17 00:00:00 2001 From: Nicholas Hassan Date: Thu, 21 Nov 2024 12:54:05 +1030 Subject: [PATCH] duti: update to new darwin SDK pattern remove old SDK, patch build configure checks Signed-off-by: Nicholas Hassan --- .../darwin/duti/buildConfigure.patch | 31 +++++++++++++++++++ pkgs/os-specific/darwin/duti/default.nix | 24 ++++++++------ pkgs/top-level/all-packages.nix | 4 +-- 3 files changed, 46 insertions(+), 13 deletions(-) create mode 100644 pkgs/os-specific/darwin/duti/buildConfigure.patch diff --git a/pkgs/os-specific/darwin/duti/buildConfigure.patch b/pkgs/os-specific/darwin/duti/buildConfigure.patch new file mode 100644 index 0000000000000..e4b29387af067 --- /dev/null +++ b/pkgs/os-specific/darwin/duti/buildConfigure.patch @@ -0,0 +1,31 @@ +diff --git a/Makefile.in b/Makefile.in +index d5c9fda..a596462 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -14,10 +14,7 @@ DUTI_BUILD_DATE=@build_date@ + + CC= @CC@ + FRAMEWORKS= -framework ApplicationServices -framework CoreFoundation +-OPTOPTS= -isysroot @macosx_sdk@ \ +- @macosx_arches@ \ +- -mmacosx-version-min=@macosx_dep_target@ \ +- @OPTOPTS@ ++OPTOPTS= @OPTOPTS@ + + LIBS= @LIBS@ + LDFLAGS= @LDFLAGS@ ${LIBS} +diff --git a/configure.ac b/configure.ac +index 815f395..05caaed 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -15,8 +15,8 @@ AC_PROG_CC + AC_PROG_INSTALL + + AC_CANONICAL_SYSTEM +-DUTI_CHECK_SDK +-DUTI_CHECK_DEPLOYMENT_TARGET ++#DUTI_CHECK_SDK ++#DUTI_CHECK_DEPLOYMENT_TARGET + + # function checks + AC_CHECK_FUNC(strlcpy,have_strlcpy=yes,) diff --git a/pkgs/os-specific/darwin/duti/default.nix b/pkgs/os-specific/darwin/duti/default.nix index 87af500e98e4a..6d46f002ae133 100644 --- a/pkgs/os-specific/darwin/duti/default.nix +++ b/pkgs/os-specific/darwin/duti/default.nix @@ -1,4 +1,9 @@ -{stdenv, lib, fetchFromGitHub, autoreconfHook, ApplicationServices}: +{ + stdenv, + lib, + fetchFromGitHub, + autoreconfHook, +}: stdenv.mkDerivation rec { pname = "duti"; @@ -10,16 +15,12 @@ stdenv.mkDerivation rec { sha256 = "1pg4i6ghpib2gy1sqpml7dbnhr1vbr43fs2pqkd09i4w3nmgpic9"; }; - nativeBuildInputs = [autoreconfHook]; - buildInputs = [ApplicationServices]; - configureFlags = [ - "--with-macosx-sdk=/homeless-shelter" - - # needed to prevent duti from trying to guess our sdk - # NOTE: this is different than stdenv.hostPlatform.config! - "--host=x86_64-apple-darwin18" + patches = [ + ./buildConfigure.patch ]; + nativeBuildInputs = [ autoreconfHook ]; + meta = with lib; { description = "Command-line tool to select default applications for document types and URL schemes on Mac OS X"; longDescription = '' @@ -29,7 +30,10 @@ stdenv.mkDerivation rec { a Microsoft Word document has a UTI of com.microsoft.word.doc. Using duti, the user can change which application acts as the default handler for a given UTI. ''; - maintainers = with maintainers; [matthewbauer n-hass]; + maintainers = with maintainers; [ + matthewbauer + n-hass + ]; platforms = platforms.darwin; license = licenses.publicDomain; homepage = "https://github.com/moretension/duti/"; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e060ad0a3d778..ab255d872ce14 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -19010,9 +19010,7 @@ with pkgs; compressDrvWeb = callPackage ../build-support/compress-drv/web.nix { }; - duti = callPackage ../os-specific/darwin/duti { - inherit (darwin.apple_sdk.frameworks) ApplicationServices; - }; + duti = callPackage ../os-specific/darwin/duti { }; dnstracer = callPackage ../tools/networking/dnstracer { inherit (darwin) libresolv;