2021-07-12 03:29:09 +01:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2019-02-23 21:33:22 +00:00
|
|
|
, makeWrapper
|
|
|
|
, makeDesktopItem
|
|
|
|
, fetchurl
|
2021-03-29 14:40:51 +01:00
|
|
|
, jdk11
|
2020-09-19 20:56:23 +01:00
|
|
|
, jdk8
|
2019-02-23 21:33:22 +00:00
|
|
|
}:
|
2018-07-14 00:11:43 +01:00
|
|
|
|
|
|
|
let
|
2021-03-29 14:40:51 +01:00
|
|
|
generic = { version, sha256, platform ? "", jdk, ... }@attrs:
|
2019-02-23 21:33:22 +00:00
|
|
|
let
|
|
|
|
desktopItem = makeDesktopItem {
|
|
|
|
categories = "Network;Development;WebDevelopment;Java;";
|
|
|
|
desktopName = "Charles";
|
|
|
|
exec = "charles %F";
|
|
|
|
genericName = "Web Debugging Proxy";
|
|
|
|
icon = "charles-proxy";
|
|
|
|
mimeType = "application/x-charles-savedsession;application/x-charles-savedsession+xml;application/x-charles-savedsession+json;application/har+json;application/vnd.tcpdump.pcap;application/x-charles-trace";
|
|
|
|
name = "Charles";
|
|
|
|
startupNotify = "true";
|
|
|
|
};
|
|
|
|
|
2019-08-13 22:52:01 +01:00
|
|
|
in stdenv.mkDerivation {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "charles";
|
2019-02-23 21:33:22 +00:00
|
|
|
inherit version;
|
|
|
|
|
|
|
|
src = fetchurl {
|
2021-03-29 14:40:51 +01:00
|
|
|
url = "https://www.charlesproxy.com/assets/release/${version}/charles-proxy-${version}${platform}.tar.gz";
|
2019-02-23 21:33:22 +00:00
|
|
|
inherit sha256;
|
|
|
|
};
|
2021-02-07 09:17:39 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2018-07-14 00:11:43 +01:00
|
|
|
|
2019-02-23 21:33:22 +00:00
|
|
|
installPhase = ''
|
2021-03-29 14:40:51 +01:00
|
|
|
makeWrapper ${jdk}/bin/java $out/bin/charles \
|
2019-02-23 21:33:22 +00:00
|
|
|
--add-flags "-Xmx1024M -Dcharles.config='~/.charles.config' -jar $out/share/java/charles.jar"
|
2018-07-14 00:11:43 +01:00
|
|
|
|
2019-02-23 21:33:22 +00:00
|
|
|
for fn in lib/*.jar; do
|
|
|
|
install -D -m644 $fn $out/share/java/$(basename $fn)
|
|
|
|
done
|
2018-07-14 00:11:43 +01:00
|
|
|
|
2019-02-23 21:33:22 +00:00
|
|
|
mkdir -p $out/share/applications
|
|
|
|
ln -s ${desktopItem}/share/applications/* $out/share/applications/
|
2018-07-14 06:28:27 +01:00
|
|
|
|
2019-02-23 21:33:22 +00:00
|
|
|
mkdir -p $out/share/icons
|
|
|
|
cp -r icon $out/share/icons/hicolor
|
|
|
|
'';
|
2018-07-14 00:11:43 +01:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2019-02-23 21:33:22 +00:00
|
|
|
description = "Web Debugging Proxy";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://www.charlesproxy.com/";
|
2021-07-12 03:29:09 +01:00
|
|
|
maintainers = with maintainers; [ kalbasit ];
|
|
|
|
license = licenses.unfree;
|
|
|
|
platforms = platforms.unix;
|
2019-02-23 21:33:22 +00:00
|
|
|
};
|
|
|
|
};
|
2018-07-14 00:11:43 +01:00
|
|
|
|
2019-08-13 22:52:01 +01:00
|
|
|
in {
|
2019-02-23 21:33:22 +00:00
|
|
|
charles4 = (generic {
|
2021-07-12 03:29:09 +01:00
|
|
|
version = "4.6.2";
|
|
|
|
sha256 = "0r5rann7cq665ih0pa66k52081gylk85ashrwq1khbv2jf80yy52";
|
2021-03-29 14:40:51 +01:00
|
|
|
platform = "_amd64";
|
|
|
|
jdk = jdk11;
|
2019-02-23 21:33:22 +00:00
|
|
|
});
|
|
|
|
charles3 = (generic {
|
|
|
|
version = "3.12.3";
|
|
|
|
sha256 = "13zk82ny1w5zd9qcs9qkq0kdb22ni5byzajyshpxdfm4zv6p32ss";
|
2021-03-29 14:40:51 +01:00
|
|
|
jdk = jdk8.jre;
|
2019-02-23 21:33:22 +00:00
|
|
|
});
|
2018-07-14 00:11:43 +01:00
|
|
|
}
|