mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-25 16:33:15 +00:00
flclash: init at 0.8.66
This commit is contained in:
parent
0752b0e37e
commit
ef08fafbea
96
pkgs/by-name/fl/flclash/package.nix
Normal file
96
pkgs/by-name/fl/flclash/package.nix
Normal file
@ -0,0 +1,96 @@
|
||||
{
|
||||
lib,
|
||||
fetchFromGitHub,
|
||||
flutter,
|
||||
keybinder3,
|
||||
libayatana-appindicator,
|
||||
buildGoModule,
|
||||
makeDesktopItem,
|
||||
copyDesktopItems,
|
||||
}:
|
||||
let
|
||||
pname = "flclash";
|
||||
version = "0.8.66";
|
||||
src =
|
||||
(fetchFromGitHub {
|
||||
owner = "chen08209";
|
||||
repo = "FlClash";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-LkaAALJcP3DGXBMZ3QWLUiyT9Kr4yTxKIRqYhrW1WOw=";
|
||||
fetchSubmodules = true;
|
||||
}).overrideAttrs
|
||||
(_: {
|
||||
GIT_CONFIG_COUNT = 1;
|
||||
GIT_CONFIG_KEY_0 = "url.https://github.com/.insteadOf";
|
||||
GIT_CONFIG_VALUE_0 = "git@github.com:";
|
||||
});
|
||||
libclash = buildGoModule {
|
||||
inherit pname version src;
|
||||
modRoot = "./core";
|
||||
vendorHash = "sha256-K+PrLFvDHyaxf1NKzcqf0qmfQwT8rctScv1CN+TxY0M=";
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
mkdir -p $out/lib
|
||||
go build -ldflags="-w -s" -tags=with_gvisor -buildmode=c-shared -o $out/lib/libclash.so
|
||||
runHook postBuild
|
||||
'';
|
||||
};
|
||||
in
|
||||
flutter.buildFlutterApplication {
|
||||
inherit pname version src;
|
||||
|
||||
desktopItems = [
|
||||
(makeDesktopItem {
|
||||
name = "FlClash";
|
||||
exec = "FlClash %U";
|
||||
icon = "FlClash";
|
||||
genericName = "FlClash";
|
||||
desktopName = "FlClash";
|
||||
categories = [
|
||||
"Network"
|
||||
];
|
||||
keywords = [
|
||||
"FlClash"
|
||||
"Clash"
|
||||
"ClashMeta"
|
||||
"Proxy"
|
||||
];
|
||||
})
|
||||
];
|
||||
|
||||
patchPhase = ''
|
||||
runHook prePatch
|
||||
substituteInPlace lib/clash/core.dart --replace-fail 'DynamicLibrary.open("libclash.so")' 'DynamicLibrary.open("${libclash}/lib/libclash.so")'
|
||||
runHook postPatch
|
||||
'';
|
||||
|
||||
preBuild = ''
|
||||
mkdir -p ./libclash/linux/
|
||||
cp ${libclash}/lib/libclash.so ./libclash/linux/libclash.so
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
mkdir -p $out/share/pixmaps/
|
||||
cp ./assets/images/icon.png $out/share/pixmaps/FlClash.png
|
||||
'';
|
||||
|
||||
pubspecLock = lib.importJSON ./pubspec.lock.json;
|
||||
|
||||
nativeBuildInputs = [
|
||||
copyDesktopItems
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
keybinder3
|
||||
libayatana-appindicator
|
||||
];
|
||||
|
||||
meta = {
|
||||
description = "Multi-platform proxy client based on ClashMeta, simple and easy to use, open-source and ad-free";
|
||||
homepage = "https://github.com/chen08209/FlClash";
|
||||
mainProgram = "FlClash";
|
||||
license = with lib.licenses; [ gpl3Plus ];
|
||||
maintainers = with lib.maintainers; [ aucub ];
|
||||
platforms = lib.platforms.linux;
|
||||
};
|
||||
}
|
1746
pkgs/by-name/fl/flclash/pubspec.lock.json
Normal file
1746
pkgs/by-name/fl/flclash/pubspec.lock.json
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user