2018-07-14 07:17:31 +01:00
|
|
|
{ stdenv, fetchurl, makeDesktopItem, jre, makeWrapper }:
|
2018-07-14 00:11:43 +01:00
|
|
|
|
|
|
|
let
|
|
|
|
desktopItem = makeDesktopItem {
|
|
|
|
categories = "Network;Development;WebDevelopment;Java;";
|
|
|
|
desktopName = "Charles";
|
|
|
|
exec = "charles %F";
|
|
|
|
genericName = "Web Debugging Proxy";
|
2018-07-14 06:28:27 +01:00
|
|
|
icon = "charles-proxy";
|
2018-07-14 00:11:43 +01:00
|
|
|
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";
|
|
|
|
};
|
|
|
|
|
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
name = "charles-${version}";
|
2018-09-15 01:08:19 +01:00
|
|
|
version = "4.2.7";
|
2018-07-14 00:11:43 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://www.charlesproxy.com/assets/release/${version}/charles-proxy-${version}.tar.gz";
|
2018-09-15 01:08:19 +01:00
|
|
|
sha256 = "1nycw3wpbfwj4ijjaq5k0f4xipj8j605fs0yjzgl66gmv7r583rd";
|
2018-07-14 00:11:43 +01:00
|
|
|
};
|
|
|
|
|
2018-07-14 07:17:31 +01:00
|
|
|
buildInputs = [ makeWrapper ];
|
2018-07-14 00:11:43 +01:00
|
|
|
|
2018-07-14 07:17:31 +01:00
|
|
|
installPhase = ''
|
|
|
|
makeWrapper ${jre}/bin/java $out/bin/charles \
|
2018-07-14 07:19:52 +01:00
|
|
|
--add-flags "-Xmx1024M -Dcharles.config='~/.charles.config' -jar $out/share/java/charles.jar"
|
2018-07-14 00:11:43 +01:00
|
|
|
|
2018-07-14 06:28:27 +01:00
|
|
|
for fn in lib/*.jar; do
|
2018-07-14 07:17:31 +01:00
|
|
|
install -D -m644 $fn $out/share/java/$(basename $fn)
|
2018-07-14 06:28:27 +01:00
|
|
|
done
|
|
|
|
|
2018-07-14 00:11:43 +01:00
|
|
|
mkdir -p $out/share/applications
|
|
|
|
ln -s ${desktopItem}/share/applications/* $out/share/applications/
|
|
|
|
|
2018-07-14 06:28:27 +01:00
|
|
|
mkdir -p $out/share/icons
|
|
|
|
cp -r icon $out/share/icons/hicolor
|
2018-07-14 00:11:43 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Web Debugging Proxy";
|
|
|
|
homepage = https://www.charlesproxy.com/;
|
|
|
|
maintainers = [ maintainers.kalbasit ];
|
|
|
|
license = stdenv.lib.licenses.unfree;
|
|
|
|
platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin;
|
|
|
|
};
|
|
|
|
}
|