12 stdenv.mkDerivation (finalAttrs: {
15 fullVersion = "${finalAttrs.version}-202411201800";
17 hardeningDisable = [ "format" ];
19 passthru.srcMetadataByPlatform = {
20 x86_64-linux.platform = "gtk-linux-x86_64";
21 x86_64-linux.hash = "sha256-lKAB2aCI3dZdt3pE7uSvSfxc8vc3oMSTCx5R+71Aqdk=";
22 x86_64-darwin.platform = "cocoa-macosx-x86_64";
23 x86_64-darwin.hash = "sha256-Uns3fMoetbZAIrL/N0eVd42/3uygXakDdxpaxf5SWDI=";
25 passthru.srcMetadata =
26 finalAttrs.passthru.srcMetadataByPlatform.${stdenv.hostPlatform.system} or null;
27 # Alas, the Eclipse Project apparently doesn't produce source-only
28 # releases of SWT. So we just grab a binary release and extract
29 # "src.zip" from that.
32 inherit (finalAttrs.passthru) srcMetadata;
34 assert srcMetadata != null;
36 url = "https://archive.eclipse.org/eclipse/downloads/drops4/R-${finalAttrs.fullVersion}/swt-${finalAttrs.version}-${srcMetadata.platform}.zip";
37 inherit (srcMetadata) hash;
43 renamed="$TMPDIR/src.zip"
44 mv -- "$out/src.zip" "$renamed"
48 mv -- "$unpackDir" "$out"
63 AWT_LIB_PATH = "${jdk}/lib/openjdk/lib";
64 # Used by the makefile which is responsible for the shared objects only
65 OUTPUT_DIR = "${placeholder "out"}/lib";
66 # GTK4 is not supported yet. See:
67 # https://github.com/eclipse-platform/eclipse.platform.swt/issues/652
71 mkdir -p ${finalAttrs.OUTPUT_DIR}
78 find org/ -name '*.java' -type f -exec javac -encoding utf8 -d out/ {} +
79 # Copy non Java resource files
80 find org/ -not -name '*.java' -not -name '*.html' -type f -exec cp {} out/{} \;
83 # The makefile doesn't have an install target, the installation of the shared
84 # objects is part of the `all` target.
88 install -d -- "$out/jars"
89 install -m 644 -t out -- version.txt
90 (cd out && jar -c *) > "$out/jars/swt.jar"
96 homepage = "https://www.eclipse.org/swt/";
98 A widget toolkit for Java to access the user-interface facilities of
99 the operating systems on which it is implemented.
101 license = with lib.licenses; [
102 # All of these are located in the about_files directory of the source
109 platforms = lib.attrNames finalAttrs.passthru.srcMetadataByPlatform;