-
-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
rcmlz
committed
Jun 25, 2024
1 parent
8d80824
commit 3be738d
Showing
1 changed file
with
87 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
{ stdenv | ||
, lib | ||
, fetchurl | ||
, makeWrapper | ||
, makeDesktopItem | ||
, copyDesktopItems | ||
, jre | ||
}: | ||
let | ||
icon = fetchurl { | ||
# In case tigerjython/tjinstall becomes unavailable, use this url - see comment for src in MkDerivation | ||
#url = "https://web.archive.org/web/20240623120114/https://raw.githubusercontent.com/tigerjython/tjinstall/master/tjlogo64.png"; | ||
url = "https://raw.githubusercontent.com/tigerjython/tjinstall/611c56d4e765731883656a5c4b71209d72b5ab74/tjlogo64.png"; | ||
hash = "sha256-tw3uDWLtcMHYmN6JGsEvVKLgI09v5DF27V2+OF9Z5tA="; | ||
}; | ||
in | ||
stdenv.mkDerivation (finalAttrs: { | ||
pname = "tigerjython"; | ||
version = "2.39"; | ||
|
||
# we cache potentially unstable upstream input (.tar.gz file) via https://web.archive.org - this is a common procedure in Nixpkgs | ||
src = fetchurl { | ||
url = "http://web.archive.org/web/20240119124245/https://tigerjython.ch/user/pages/download/TigerJython.tar.gz"; | ||
hash = "sha256-PdoAOjr19aLmXYrLtMCq/tZ2Fqq7pINTuhFyMMiC0yM="; | ||
}; | ||
|
||
nativeBuildInputs = [ | ||
makeWrapper | ||
copyDesktopItems | ||
]; | ||
|
||
desktopItems = [ (makeDesktopItem { | ||
name = "TigerJython"; | ||
exec = "tigerjython"; | ||
icon = "tigerjython"; | ||
desktopName = "TigerJython"; | ||
comment = "The Python IDE for beginners"; | ||
categories = [ "Education" ]; | ||
}) ]; | ||
|
||
dontConfigure = true; | ||
dontBuild = true; | ||
|
||
installPhase = '' | ||
runHook preInstall | ||
export JAR=$out/share/java/tigerjython2.jar | ||
export CUSTOM_LIBS=$out/share/java | ||
export EXAMPLES_DIR=$CUSTOM_LIBS/Examples | ||
install -Dm444 bin/tigerjython2.jar $JAR | ||
install -Dm444 bin/Lib/* --target-directory=$CUSTOM_LIBS | ||
install -Dm444 bin/TestSamples/* --target-directory=$EXAMPLES_DIR | ||
makeWrapper ${jre}/bin/java $out/bin/tigerjython \ | ||
--add-flags "-jar $JAR" \ | ||
--add-flags "-Duser.dir=$CUSTOM_LIBS/" \ | ||
--add-flags "-cp=.:$CUSTOM_LIBS/" \ | ||
--add-flags "-Xmx512M" \ | ||
--set _JAVA_OPTIONS '-Dawt.useSystemAAFontSettings=lcd' | ||
runHook postInstall | ||
''; | ||
|
||
postInstall = '' | ||
install -Dm444 ${icon} $out/share/icons/hicolor/64x64/apps/tigerjython.png | ||
''; | ||
|
||
# Tests need a DISPLAY | ||
doCheck = false; | ||
|
||
meta = with lib; { | ||
homepage = "https://www.tigerjython.com"; | ||
downloadPage = "https://tigerjython.ch/en/products/download"; | ||
description = "Simple development environment for programming in Python"; | ||
longDescription = '' | ||
Designing, coding, and amazing. TigerJython offers everything you need | ||
to go from Python programming beginner to professional. | ||
You will find a wide variety of tutorials and can get started right away | ||
in programming environments specially developed for you. | ||
''; | ||
license = licenses.unfreeRedistributable; | ||
maintainers = with maintainers; [ rcmlz ]; | ||
platforms = platforms.all; | ||
mainProgram = "tigerjython"; | ||
}; | ||
}) |