2019-02-23 22:33:22 +01:00
|
|
|
{
|
2021-01-11 08:54:33 +01:00
|
|
|
lib, stdenv
|
2019-02-23 22:33:22 +01:00
|
|
|
, makeWrapper
|
|
|
|
, makeDesktopItem
|
|
|
|
, fetchurl
|
2020-09-19 21:56:23 +02:00
|
|
|
, jdk8
|
2019-02-23 22:33:22 +01:00
|
|
|
}:
|
2018-07-14 01:11:43 +02:00
|
|
|
|
|
|
|
let
|
2019-02-23 22:33:22 +01:00
|
|
|
generic = { version, sha256, ... }@attrs:
|
|
|
|
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 23:52:01 +02:00
|
|
|
in stdenv.mkDerivation {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "charles";
|
2019-02-23 22:33:22 +01:00
|
|
|
inherit version;
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://www.charlesproxy.com/assets/release/${version}/charles-proxy-${version}.tar.gz";
|
|
|
|
inherit sha256;
|
|
|
|
};
|
2021-02-07 10:17:39 +01:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2018-07-14 01:11:43 +02:00
|
|
|
|
2019-02-23 22:33:22 +01:00
|
|
|
installPhase = ''
|
2020-09-19 21:56:23 +02:00
|
|
|
makeWrapper ${jdk8.jre}/bin/java $out/bin/charles \
|
2019-02-23 22:33:22 +01:00
|
|
|
--add-flags "-Xmx1024M -Dcharles.config='~/.charles.config' -jar $out/share/java/charles.jar"
|
2018-07-14 01:11:43 +02:00
|
|
|
|
2019-02-23 22:33:22 +01:00
|
|
|
for fn in lib/*.jar; do
|
|
|
|
install -D -m644 $fn $out/share/java/$(basename $fn)
|
|
|
|
done
|
2018-07-14 01:11:43 +02:00
|
|
|
|
2019-02-23 22:33:22 +01:00
|
|
|
mkdir -p $out/share/applications
|
|
|
|
ln -s ${desktopItem}/share/applications/* $out/share/applications/
|
2018-07-14 07:28:27 +02:00
|
|
|
|
2019-02-23 22:33:22 +01:00
|
|
|
mkdir -p $out/share/icons
|
|
|
|
cp -r icon $out/share/icons/hicolor
|
|
|
|
'';
|
2018-07-14 01:11:43 +02:00
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2019-02-23 22:33:22 +01:00
|
|
|
description = "Web Debugging Proxy";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://www.charlesproxy.com/";
|
2019-02-23 22:33:22 +01:00
|
|
|
maintainers = [ maintainers.kalbasit ];
|
2021-01-15 14:21:58 +01:00
|
|
|
license = lib.licenses.unfree;
|
|
|
|
platforms = lib.platforms.linux ++ lib.platforms.darwin;
|
2019-02-23 22:33:22 +01:00
|
|
|
};
|
|
|
|
};
|
2018-07-14 01:11:43 +02:00
|
|
|
|
2019-08-13 23:52:01 +02:00
|
|
|
in {
|
2019-02-23 22:33:22 +01:00
|
|
|
charles4 = (generic {
|
2019-04-14 18:29:46 +02:00
|
|
|
version = "4.2.8";
|
|
|
|
sha256 = "1jzjdhzxgrq7pdfryfkg0hsjpyni14ma4x8jbdk1rqll78ccr080";
|
2019-02-23 22:33:22 +01:00
|
|
|
});
|
|
|
|
charles3 = (generic {
|
|
|
|
version = "3.12.3";
|
|
|
|
sha256 = "13zk82ny1w5zd9qcs9qkq0kdb22ni5byzajyshpxdfm4zv6p32ss";
|
|
|
|
});
|
2018-07-14 01:11:43 +02:00
|
|
|
}
|
2019-02-23 22:33:22 +01:00
|
|
|
|