nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 stdenvNoCC,
3 lib,
4 fetchurl,
5 makeWrapper,
6 writeText,
7 makeDesktopItem,
8 copyDesktopItems,
9 jre,
10}:
11let
12 icon = fetchurl {
13 # In case tigerjython/tjinstall becomes unavailable, use this url - see comment for src in MkDerivation
14 #url = "https://web.archive.org/web/20240623120114/https://raw.githubusercontent.com/tigerjython/tjinstall/master/tjlogo64.png";
15 url = "https://raw.githubusercontent.com/tigerjython/tjinstall/611c56d4e765731883656a5c4b71209d72b5ab74/tjlogo64.png";
16 hash = "sha256-tw3uDWLtcMHYmN6JGsEvVKLgI09v5DF27V2+OF9Z5tA=";
17 };
18in
19stdenvNoCC.mkDerivation (finalAttrs: {
20 pname = "tigerjython";
21
22 # UPDATE instructions
23 #
24 # We cache potentially unstable upstream input (.tar.gz file) via https://web.archive.org - this is a common procedure in Nixpkgs.
25 #
26 # - Open https://tigerjython.ch/en/products/download and identify the new version string for "TigerJython IDE for Linux"
27 version = "2.40";
28
29 # - and copy download link (most likely https://tjgroup.ch/user/pages/download/TigerJython.tar.gz) to clipboard.
30 # - Open http://web.archive.org and paste download link from clipboard into "Save Page Now" field and hit the "Save Page" button.
31 # - Unselect "Save Error Pages" and hit "Save Page" again.
32 # - Wait for the archive link to be generated and copy it to the url field - adjust hash accordingly.
33 src = fetchurl {
34 url = "http://web.archive.org/web/20250104142121/https://tjgroup.ch/download/TigerJython.tar.gz";
35 hash = "sha256-V/POFftRs/jjgNaHOrKcW2AdlQY2yjO+xiwJi63oECo=";
36 };
37
38 nativeBuildInputs = [
39 makeWrapper
40 copyDesktopItems
41 ];
42
43 desktopItems = [
44 (makeDesktopItem {
45 name = "TigerJython";
46 desktopName = "TigerJython";
47 comment = "The Python IDE for beginners";
48 type = "Application";
49 categories = [ "Education" ];
50 terminal = false;
51 startupNotify = false;
52 exec = "tigerjython";
53 icon = "tigerjython";
54 mimeTypes = [ "text/x-python" ];
55 })
56 ];
57
58 dontConfigure = true;
59 dontBuild = true;
60
61 # https://tobiaskohn.ch/jython/faq.html
62 # Q: Can I install TigerJython for multiple users?
63 # A: Yes, create a config file.
64 # This file must be named tigerjython2.cfg and located
65 # in the same folder as tigerjython2.jar
66 tjconfig = writeText "tjconfig" ''
67 configfile = sys.userpath + ".tjython.cfg"
68 jython.cachedir = sys.userpath + ".jython.cache"
69 '';
70
71 installPhase = ''
72 runHook preInstall
73
74 export CUSTOM_LIBS=$out/share/java
75 export JAR=$CUSTOM_LIBS/tigerjython2.jar
76 export CFG=$CUSTOM_LIBS/tigerjython2.cfg
77 export ADDITIONAL_LIBS_DIR=$CUSTOM_LIBS/Lib
78 export EXAMPLES_DIR=$CUSTOM_LIBS/TestSamples
79
80 install -Dm444 bin/tigerjython2.jar $JAR
81 install -Dm444 bin/Lib/* --target-directory=$ADDITIONAL_LIBS_DIR
82 install -Dm444 bin/TestSamples/* --target-directory=$EXAMPLES_DIR
83
84 install -Dm444 $tjconfig $CFG
85
86 makeWrapper ${jre}/bin/java $out/bin/tigerjython \
87 --add-flags "-Duser.dir=$CUSTOM_LIBS/" \
88 --add-flags "-Xmx512M" \
89 --add-flags "-jar $JAR" \
90 --prefix _JAVA_OPTIONS " " "-Dawt.useSystemAAFontSettings=gasp"
91
92 runHook postInstall
93 '';
94
95 postInstall = ''
96 install -Dm444 ${icon} $out/share/icons/hicolor/64x64/apps/tigerjython.png
97 '';
98
99 meta = {
100 homepage = "https://www.tigerjython.ch";
101 downloadPage = "https://tigerjython.ch/en/products/download";
102 description = "Simple development environment for programming in Python";
103 longDescription = ''
104 Designing, coding, and amazing. TigerJython offers everything you need
105 to go from Python programming beginner to professional.
106 You will find a wide variety of tutorials and can get started right away
107 in programming environments specially developed for you.
108 '';
109 license = lib.licenses.unfreeRedistributable;
110 maintainers = with lib.maintainers; [ rcmlz ];
111 platforms = lib.platforms.all;
112 mainProgram = "tigerjython";
113 };
114})