Commit cdacf678 authored by qzylinra's avatar qzylinra
Browse files

hiddify-app: drop

This software has a problematic license, which is discussed at https://github.com/NixOS/nixpkgs/issues/369727. The software and its upstream have significant conflicts. It is not well-maintained, and multiple users have complained about its poor user experience.
parent 48702740
Loading
Loading
Loading
Loading
+0 −152
Original line number Diff line number Diff line
{
  lib,
  fetchFromGitHub,
  flutter324,
  buildGoModule,
  libayatana-appindicator,
  makeDesktopItem,
  copyDesktopItems,
  autoPatchelfHook,
}:

let
  metaCommon = {
    description = "Multi-platform auto-proxy client, supporting Sing-box, X-ray, TUIC, Hysteria, Reality, Trojan, SSH etc";
    license = with lib.licenses; [
      unfree # upstream adds non-free additional conditions. https://github.com/hiddify/hiddify-app/blob/0f6b15057f626016fcd7a0c075f1c8c2f606110a/LICENSE.md#additional-conditions-to-gpl-v3
      gpl3Only
    ];
    maintainers = with lib.maintainers; [ ];
  };

  libcore = buildGoModule rec {
    pname = "hiddify-core";
    version = "3.1.8";

    src = fetchFromGitHub {
      owner = "hiddify";
      repo = "hiddify-core";
      tag = "v${version}";
      hash = "sha256-NRzzkC3xbRVP20Pm29bHf8YpxmnjISgF46c8l9qU4rA=";
    };

    vendorHash = "sha256-a7NFZt4/w2+oaZG3ncaOrrhASxUptcWS/TeaIQrgLe4=";

    GO_BUILD_FLAGS = ''
      -tags "with_gvisor,with_quic,with_wireguard,with_ech,with_utls,with_clash_api,with_grpc" \
      -trimpath \
      -ldflags "-s -w" \
    '';

    buildPhase = ''
      runHook preBuild

      go build ${GO_BUILD_FLAGS} -buildmode=c-shared -o bin/lib/libcore.so ./custom
      mkdir lib
      cp bin/lib/libcore.so ./lib/libcore.so
      CGO_LDFLAGS="./lib/libcore.so" go build ${GO_BUILD_FLAGS} -o bin/HiddifyCli ./cli/bydll

      runHook postBuild
    '';

    installPhase = ''
      runHook preInstall

      install -Dm0755 bin/HiddifyCli $out/bin/HiddifyCli
      install -Dm0755 lib/libcore.so $out/lib/libcore.so

      runHook postInstall
    '';

    meta = metaCommon // {
      homepage = "https://github.com/hiddify/hiddify-core";
      mainProgram = "HiddifyCli";
    };
  };
in
flutter324.buildFlutterApplication {
  pname = "hiddify-app";
  version = "2.5.7-unstable-2025-01-06";

  src = fetchFromGitHub {
    owner = "hiddify";
    repo = "hiddify-app";
    rev = "a7547d298a5f8058446b6a470e56fe4efa3c1ccd";
    hash = "sha256-5I/k2KxdWiNsgwJY+bqMVqtC2eGshKbpLYzsPrmvhmY=";
  };

  pubspecLock = lib.importJSON ./pubspec.lock.json;

  gitHashes = {
    circle_flags = "sha256-dqORH4yj0jU8r9hP9NTjrlEO0ReHt4wds7BhgRPq57g=";
    flutter_easy_permission = "sha256-fs2dIwFLmeDrlFIIocGw6emOW1whGi9W7nQ7mHqp8R0=";
    humanizer = "sha256-zsDeol5l6maT8L8R6RRtHyd7CJn5908nvRXIytxiPqc=";
  };

  postPatch = ''
    substituteInPlace linux/my_application.cc \
      --replace-fail "./hiddify.png" "${placeholder "out"}/share/pixmaps/hiddify.png"
  '';

  nativeBuildInputs = [
    autoPatchelfHook
    copyDesktopItems
  ];

  buildInputs = [
    libayatana-appindicator
  ];

  preBuild = ''
    mkdir -p libcore/bin
    cp -r ${libcore}/lib libcore/bin/lib
    cp ${libcore}/bin/HiddifyCli libcore/bin/HiddifyCli
    packageRun build_runner build --delete-conflicting-outputs
    packageRun slang
  '';

  flutterBuildFlags = [
    "--target lib/main_prod.dart"
  ];

  desktopItems = [
    (makeDesktopItem {
      name = "hiddify";
      exec = "hiddify";
      icon = "hiddify";
      genericName = "Hiddify";
      desktopName = "Hiddify";
      categories = [
        "Network"
      ];
      keywords = [
        "Hiddify"
        "Proxy"
        "VPN"
        "V2ray"
        "Nekoray"
        "Xray"
        "Psiphon"
        "OpenVPN"
      ];
    })
  ];

  postInstall = ''
    install -Dm0644 assets/images/source/ic_launcher_border.png $out/share/pixmaps/hiddify.png
  '';

  preFixup = ''
    patchelf --shrink-rpath --allowed-rpath-prefixes "$NIX_STORE" $out/app/hiddify-app/lib/lib*.so
  '';

  extraWrapProgramArgs = ''
    --prefix LD_LIBRARY_PATH : $out/app/hiddify-app/lib
  '';

  meta = metaCommon // {
    homepage = "https://hiddify.com";
    mainProgram = "hiddify";
    platforms = lib.platforms.linux;
  };
}
+0 −2531

File deleted.

Preview size limit exceeded, changes collapsed.

+1 −0
Original line number Diff line number Diff line
@@ -926,6 +926,7 @@ mapAliases {
  haven-cli = throw "'haven-cli' has been removed due to the official announcement of the project closure. Read more at https://havenprotocol.org/2024/12/12/project-closure-announcement"; # Added 2025-02-25
  hawknl = throw "'hawknl' has been removed as it was unmaintained and the upstream unavailable"; # Added 2025-05-07
  HentaiAtHome = hentai-at-home; # Added 2024-06-12
  hiddify-app = throw "hiddify-app has been removed, since it is unmaintained"; # added 2025-08-20
  hll2390dw-cups = throw "The hll2390dw-cups package was dropped since it was unmaintained."; # Added 2024-06-21
  hoarder = throw "'hoarder' has been renamed to 'karakeep'"; # Added 2025-04-21
  hmetis = throw "'hmetis' has been removed as it was unmaintained and the upstream was unavailable"; # Added 2025-05-05