charles: made charles 4.x/3.x available (#56159)
Charles proxy requires a license and each license is bound to the major release version. Therefore it makes sense to make the previous version available to the users. This change provides two new packages `charles3` and `charles4` and `charles` is now an alias for `charles4`.
This commit is contained in:
parent
161122ffee
commit
fae3c6fb9e
|
@ -1,48 +1,68 @@
|
||||||
{ stdenv, fetchurl, makeDesktopItem, jre, makeWrapper }:
|
{
|
||||||
|
stdenv
|
||||||
|
, makeWrapper
|
||||||
|
, makeDesktopItem
|
||||||
|
, fetchurl
|
||||||
|
, jre
|
||||||
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
desktopItem = makeDesktopItem {
|
generic = { version, sha256, ... }@attrs:
|
||||||
categories = "Network;Development;WebDevelopment;Java;";
|
let
|
||||||
desktopName = "Charles";
|
desktopItem = makeDesktopItem {
|
||||||
exec = "charles %F";
|
categories = "Network;Development;WebDevelopment;Java;";
|
||||||
genericName = "Web Debugging Proxy";
|
desktopName = "Charles";
|
||||||
icon = "charles-proxy";
|
exec = "charles %F";
|
||||||
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";
|
genericName = "Web Debugging Proxy";
|
||||||
name = "Charles";
|
icon = "charles-proxy";
|
||||||
startupNotify = "true";
|
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 {
|
attrs' = builtins.removeAttrs attrs ["version" "sha256"];
|
||||||
name = "charles-${version}";
|
in stdenv.mkDerivation rec {
|
||||||
version = "4.2.7";
|
name = "charles-${version}";
|
||||||
|
inherit version;
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "https://www.charlesproxy.com/assets/release/${version}/charles-proxy-${version}.tar.gz";
|
url = "https://www.charlesproxy.com/assets/release/${version}/charles-proxy-${version}.tar.gz";
|
||||||
|
inherit sha256;
|
||||||
|
};
|
||||||
|
buildInputs = [ makeWrapper ];
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
makeWrapper ${jre}/bin/java $out/bin/charles \
|
||||||
|
--add-flags "-Xmx1024M -Dcharles.config='~/.charles.config' -jar $out/share/java/charles.jar"
|
||||||
|
|
||||||
|
for fn in lib/*.jar; do
|
||||||
|
install -D -m644 $fn $out/share/java/$(basename $fn)
|
||||||
|
done
|
||||||
|
|
||||||
|
mkdir -p $out/share/applications
|
||||||
|
ln -s ${desktopItem}/share/applications/* $out/share/applications/
|
||||||
|
|
||||||
|
mkdir -p $out/share/icons
|
||||||
|
cp -r icon $out/share/icons/hicolor
|
||||||
|
'';
|
||||||
|
|
||||||
|
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;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
in rec {
|
||||||
|
charles4 = (generic {
|
||||||
|
version = "4.2.7";
|
||||||
sha256 = "1nycw3wpbfwj4ijjaq5k0f4xipj8j605fs0yjzgl66gmv7r583rd";
|
sha256 = "1nycw3wpbfwj4ijjaq5k0f4xipj8j605fs0yjzgl66gmv7r583rd";
|
||||||
};
|
});
|
||||||
|
charles3 = (generic {
|
||||||
buildInputs = [ makeWrapper ];
|
version = "3.12.3";
|
||||||
|
sha256 = "13zk82ny1w5zd9qcs9qkq0kdb22ni5byzajyshpxdfm4zv6p32ss";
|
||||||
installPhase = ''
|
});
|
||||||
makeWrapper ${jre}/bin/java $out/bin/charles \
|
|
||||||
--add-flags "-Xmx1024M -Dcharles.config='~/.charles.config' -jar $out/share/java/charles.jar"
|
|
||||||
|
|
||||||
for fn in lib/*.jar; do
|
|
||||||
install -D -m644 $fn $out/share/java/$(basename $fn)
|
|
||||||
done
|
|
||||||
|
|
||||||
mkdir -p $out/share/applications
|
|
||||||
ln -s ${desktopItem}/share/applications/* $out/share/applications/
|
|
||||||
|
|
||||||
mkdir -p $out/share/icons
|
|
||||||
cp -r icon $out/share/icons/hicolor
|
|
||||||
'';
|
|
||||||
|
|
||||||
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;
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -958,7 +958,11 @@ in
|
||||||
|
|
||||||
bluemix-cli = callPackage ../tools/admin/bluemix-cli { };
|
bluemix-cli = callPackage ../tools/admin/bluemix-cli { };
|
||||||
|
|
||||||
charles = callPackage ../applications/networking/charles { };
|
charles = charles4;
|
||||||
|
inherit (callPackage ../applications/networking/charles {})
|
||||||
|
charles3
|
||||||
|
charles4
|
||||||
|
;
|
||||||
|
|
||||||
libqmatrixclient = libsForQt5.callPackage ../development/libraries/libqmatrixclient { };
|
libqmatrixclient = libsForQt5.callPackage ../development/libraries/libqmatrixclient { };
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue