From 896db32853f5383d687fb8d78cffb1c99c068fce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliv=C3=A9r=20Falvai?= Date: Fri, 8 Nov 2024 20:16:04 +0100 Subject: [PATCH 1/2] lapce: unbreak x86_64-darwin --- pkgs/applications/editors/lapce/default.nix | 14 ++------------ pkgs/top-level/all-packages.nix | 1 - 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/pkgs/applications/editors/lapce/default.nix b/pkgs/applications/editors/lapce/default.nix index 68ff13a0212a..8ebeaecc0481 100644 --- a/pkgs/applications/editors/lapce/default.nix +++ b/pkgs/applications/editors/lapce/default.nix @@ -14,15 +14,11 @@ , libGL , libobjc , libxkbcommon -, Security -, CoreServices -, ApplicationServices -, Carbon -, AppKit , wrapGAppsHook3 , wayland , gobject-introspection , xorg +, apple-sdk_11 }: let rpathLibs = lib.optionals stdenv.hostPlatform.isLinux [ @@ -93,11 +89,7 @@ rustPlatform.buildRustPackage rec { fontconfig ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ libobjc - Security - CoreServices - ApplicationServices - Carbon - AppKit + apple-sdk_11 ]; postInstall = if stdenv.hostPlatform.isLinux then '' @@ -124,7 +116,5 @@ rustPlatform.buildRustPackage rec { license = with licenses; [ asl20 ]; maintainers = with maintainers; [ elliot ]; mainProgram = "lapce"; - # Undefined symbols for architecture x86_64: "_NSPasteboardTypeFileURL" - broken = stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c36270c67f3d..ed542eeaa401 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5293,7 +5293,6 @@ with pkgs; lapce = callPackage ../applications/editors/lapce { inherit (darwin) libobjc; - inherit (darwin.apple_sdk.frameworks) Security CoreServices ApplicationServices Carbon AppKit; }; lcdproc = callPackage ../servers/monitoring/lcdproc { }; From c26249be9a66e67b7a0469613d3ae6fc1f9dbd52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliv=C3=A9r=20Falvai?= Date: Fri, 8 Nov 2024 20:16:52 +0100 Subject: [PATCH 2/2] lapce: format with nixfmt-rfc-style --- pkgs/applications/editors/lapce/default.nix | 91 +++++++++++---------- 1 file changed, 50 insertions(+), 41 deletions(-) diff --git a/pkgs/applications/editors/lapce/default.nix b/pkgs/applications/editors/lapce/default.nix index 8ebeaecc0481..ea649595d645 100644 --- a/pkgs/applications/editors/lapce/default.nix +++ b/pkgs/applications/editors/lapce/default.nix @@ -1,24 +1,25 @@ -{ lib -, stdenv -, fetchFromGitHub -, nix-update-script -, rustPlatform -, cmake -, pkg-config -, perl -, python3 -, fontconfig -, glib -, gtk3 -, openssl -, libGL -, libobjc -, libxkbcommon -, wrapGAppsHook3 -, wayland -, gobject-introspection -, xorg -, apple-sdk_11 +{ + lib, + stdenv, + fetchFromGitHub, + nix-update-script, + rustPlatform, + cmake, + pkg-config, + perl, + python3, + fontconfig, + glib, + gtk3, + openssl, + libGL, + libobjc, + libxkbcommon, + wrapGAppsHook3, + wayland, + gobject-introspection, + xorg, + apple-sdk_11, }: let rpathLibs = lib.optionals stdenv.hostPlatform.isLinux [ @@ -81,29 +82,37 @@ rustPlatform.buildRustPackage rec { gobject-introspection ]; - buildInputs = rpathLibs ++ [ - glib - gtk3 - openssl - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ - fontconfig - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libobjc - apple-sdk_11 - ]; + buildInputs = + rpathLibs + ++ [ + glib + gtk3 + openssl + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + fontconfig + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libobjc + apple-sdk_11 + ]; - postInstall = if stdenv.hostPlatform.isLinux then '' - install -Dm0644 $src/extra/images/logo.svg $out/share/icons/hicolor/scalable/apps/dev.lapce.lapce.svg - install -Dm0644 $src/extra/linux/dev.lapce.lapce.desktop $out/share/applications/lapce.desktop + postInstall = + if stdenv.hostPlatform.isLinux then + '' + install -Dm0644 $src/extra/images/logo.svg $out/share/icons/hicolor/scalable/apps/dev.lapce.lapce.svg + install -Dm0644 $src/extra/linux/dev.lapce.lapce.desktop $out/share/applications/lapce.desktop - $STRIP -S $out/bin/lapce + $STRIP -S $out/bin/lapce - patchelf --add-rpath "${lib.makeLibraryPath rpathLibs}" $out/bin/lapce - '' else '' - mkdir $out/Applications - cp -r extra/macos/Lapce.app $out/Applications - ln -s $out/bin $out/Applications/Lapce.app/Contents/MacOS - ''; + patchelf --add-rpath "${lib.makeLibraryPath rpathLibs}" $out/bin/lapce + '' + else + '' + mkdir $out/Applications + cp -r extra/macos/Lapce.app $out/Applications + ln -s $out/bin $out/Applications/Lapce.app/Contents/MacOS + ''; dontPatchELF = true;