From 53596231c8c7253dee4ef8f8df6aa1293727c0b1 Mon Sep 17 00:00:00 2001 From: TomaSajt <62384384+TomaSajt@users.noreply.github.com> Date: Sun, 15 Sep 2024 23:01:50 +0200 Subject: [PATCH 01/16] gramma: remove mkYarnPackage usage --- pkgs/by-name/gr/gramma/package.json | 84 ----------------------------- pkgs/by-name/gr/gramma/package.nix | 32 ++++++++--- 2 files changed, 24 insertions(+), 92 deletions(-) delete mode 100644 pkgs/by-name/gr/gramma/package.json diff --git a/pkgs/by-name/gr/gramma/package.json b/pkgs/by-name/gr/gramma/package.json deleted file mode 100644 index 5aa4d87333b0..000000000000 --- a/pkgs/by-name/gr/gramma/package.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "name": "gramma", - "version": "1.6.0", - "license": "ISC", - "repository": "https://github.com/caderek/gramma", - "homepage": "https://caderek.github.io/gramma/", - "description": "Command line grammar checker", - "main": "src/index.js", - "bin": "src/cli.js", - "exports": { - ".": "./src/index.js", - "./esm": "./bundle/gramma.esm.js", - "./esm-min": "./bundle/gramma.esm.min.js", - "./iife": "./bundle/gramma.min.js" - }, - "types": "src/index.d.ts", - "scripts": { - "build": "rm -rf bin; yarn run build:win64; yarn run build:macos; yarn run build:linux64; yarn run build:zip; yarn run build:bundles", - "build:win64": "pkg -c package.json -t node16-win-x64 --out-path bin/windows64 src/cli.js", - "build:macos": "pkg -c package.json -t node16-macos-x64 --out-path bin/macos src/cli.js", - "build:linux64": "pkg -c package.json -t node16-linux-x64 --out-path bin/linux64 src/cli.js", - "build:bundles": "yarn run build:esm; yarn run build:esm-min; yarn run build:iife", - "build:esm": "esbuild src/index.js --bundle --outfile=bundle/gramma.esm.js --format=esm", - "build:esm-min": "esbuild src/index.js --bundle --outfile=bundle/gramma.esm.min.js --format=esm --minify", - "build:iife": "esbuild src/index.js --bundle --outfile=bundle/gramma.min.js --format=iife --minify --global-name=gramma", - "build:zip": "node scripts/zipBinaries.js", - "format": "prettier --write \"src/**/*.js\"", - "lint": "eslint src/**", - "test": "jest", - "test:ci": "jest --coverage && cat ./coverage/lcov.info | codacy-coverage", - "check:langs": "node scripts/checkLanguagesSupport.js", - "prepare": "husky install", - "definitions": "tsc" - }, - "keywords": [ - "grammar", - "command-line", - "checker" - ], - "author": "Maciej Cąderek | maciej.caderek@gmail.com", - "dependencies": { - "cli-progress": "^3.9.1", - "decompress": "^4.2.1", - "decompress-unzip": "^4.0.1", - "dotenv": "^10.0.0", - "intercept-stdout": "^0.1.2", - "isomorphic-fetch": "^3.0.0", - "kleur": "^4.1.4", - "portfinder": "^1.0.28", - "progress-stream": "^2.0.0", - "prompts": "^2.4.1", - "query-string": "^7.0.1", - "rimraf": "^3.0.2", - "tcp-port-used": "^1.0.2", - "yargs": "^17.2.1" - }, - "devDependencies": { - "@types/jest": "^27.0.2", - "codacy-coverage": "^3.4.0", - "esbuild": "^0.13.4", - "eslint": "^7.32.0", - "eslint-config-airbnb": "^18.2.1", - "eslint-config-prettier": "^8.3.0", - "eslint-plugin-import": "^2.24.2", - "eslint-plugin-jsx-a11y": "^6.4.1", - "eslint-plugin-react": "^7.26.1", - "gramma": "^1.5.0", - "husky": "^7.0.0", - "jest": "^27.2.4", - "pkg": "^5.3.3", - "prettier": "^2.4.1", - "shelljs": "^0.8.4", - "typescript": "^4.4.3" - }, - "jest": { - "verbose": true, - "testMatch": [ - "**/?(*.)(spec|test).?(m)js" - ] - }, - "engines": { - "node": ">=12.0.0" - } -} diff --git a/pkgs/by-name/gr/gramma/package.nix b/pkgs/by-name/gr/gramma/package.nix index d5ba331d0003..2161522c3fb3 100644 --- a/pkgs/by-name/gr/gramma/package.nix +++ b/pkgs/by-name/gr/gramma/package.nix @@ -1,34 +1,50 @@ { lib, - mkYarnPackage, + stdenvNoCC, fetchYarnDeps, fetchFromGitHub, - nix-update-script -}: mkYarnPackage rec { + yarnConfigHook, + yarnInstallHook, + nodejs, + nix-update-script, +}: + +stdenvNoCC.mkDerivation (finalAttrs: { pname = "gramma"; version = "1.6.0"; src = fetchFromGitHub { owner = "caderek"; repo = "gramma"; - rev = "v${version}"; + rev = "refs/tags/v${finalAttrs.version}"; hash = "sha256-gfBwKpsttdhjD/Opn8251qskURpwLX2S5NSbpwP3hFg="; }; - packageJSON = ./package.json; + postPatch = '' + # Set a script name to avoid yargs using cli.js as $0 + substituteInPlace src/cli.js \ + --replace-fail '.demandCommand()' '.demandCommand().scriptName("gramma")' + ''; + offlineCache = fetchYarnDeps { - yarnLock = "${src}/yarn.lock"; + yarnLock = "${finalAttrs.src}/yarn.lock"; hash = "sha256-FuR6wUhAaej/vMgjAlICMEj1pPf+7PFrdu2lTFshIkg="; }; + nativeBuildInputs = [ + yarnConfigHook + yarnInstallHook + nodejs + ]; + passthru.updateScript = nix-update-script { }; meta = { description = "command-line grammar checker"; homepage = "https://caderek.github.io/gramma/"; - changelog = "https://github.com/caderek/gramma/releases/tag/v${version}"; + changelog = "https://github.com/caderek/gramma/releases/tag/v${finalAttrs.version}"; license = lib.licenses.isc; mainProgram = "gramma"; maintainers = with lib.maintainers; [ pyrox0 ]; }; -} +}) From 0fbfad403a76651f41739a410597aec659e3f0bf Mon Sep 17 00:00:00 2001 From: Dee Anzorge Date: Thu, 26 Sep 2024 19:52:16 +0200 Subject: [PATCH 02/16] unicode-character-database: 15.1.0 -> 16.0.0 Release announcement: https://www.unicode.org/versions/Unicode16.0.0/ --- pkgs/data/misc/unicode-character-database/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/data/misc/unicode-character-database/default.nix b/pkgs/data/misc/unicode-character-database/default.nix index 393fe7d2a806..cf61d30108f4 100644 --- a/pkgs/data/misc/unicode-character-database/default.nix +++ b/pkgs/data/misc/unicode-character-database/default.nix @@ -5,11 +5,11 @@ stdenvNoCC.mkDerivation rec { pname = "unicode-character-database"; - version = "15.1.0"; + version = "16.0.0"; src = fetchurl { url = "https://www.unicode.org/Public/zipped/${version}/UCD.zip"; - sha256 = "sha256-yxxmPQU5JlAM1QEilzYEV1JxOgZr11gCCYWYt6cFYXc="; + sha256 = "sha256-yG3YHysUpDsMwGSqX4mqckE4aAHjXFnHmE5XmDJjTrI="; }; nativeBuildInputs = [ From 8039b13d00fd1910ea706591086ca88e80c45ddb Mon Sep 17 00:00:00 2001 From: Dee Anzorge Date: Fri, 27 Sep 2024 00:41:10 +0200 Subject: [PATCH 03/16] gucharmap: 15.1.5 -> 16.0.1 Diff: https://gitlab.gnome.org/GNOME/gucharmap/-/compare/15.1.5...16.0.1 --- pkgs/by-name/gu/gucharmap/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/gu/gucharmap/package.nix b/pkgs/by-name/gu/gucharmap/package.nix index c22eae151402..f6fd425d434b 100644 --- a/pkgs/by-name/gu/gucharmap/package.nix +++ b/pkgs/by-name/gu/gucharmap/package.nix @@ -45,7 +45,7 @@ let }; in stdenv.mkDerivation (finalAttrs: { pname = "gucharmap"; - version = "15.1.5"; + version = "16.0.1"; outputs = [ "out" "lib" "dev" "devdoc" ]; @@ -54,7 +54,7 @@ in stdenv.mkDerivation (finalAttrs: { owner = "GNOME"; repo = "gucharmap"; rev = finalAttrs.version; - hash = "sha256-PG86D8QvqHdmo3aJseCerngmuWUqtSMdWzbixWE2HOQ="; + hash = "sha256-eQ27TIggwQ2RjDQO5ytVrUT7iNtbP5HOwMcpzweMW8A="; }; strictDeps = true; From 0f7e7b687eebdb9d4a482f1594290cf9e9e58d69 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Mon, 7 Oct 2024 09:22:21 +0300 Subject: [PATCH 04/16] dbeaver-bin: don't depend on swt (not needed at all) --- pkgs/by-name/db/dbeaver-bin/package.nix | 3 --- 1 file changed, 3 deletions(-) diff --git a/pkgs/by-name/db/dbeaver-bin/package.nix b/pkgs/by-name/db/dbeaver-bin/package.nix index d8f5a5362c36..ef29c8a67548 100644 --- a/pkgs/by-name/db/dbeaver-bin/package.nix +++ b/pkgs/by-name/db/dbeaver-bin/package.nix @@ -9,7 +9,6 @@ autoPatchelfHook, wrapGAppsHook3, gtk3, - swt, glib, webkitgtk_4_0, glib-networking, @@ -65,11 +64,9 @@ stdenvNoCC.mkDerivation (finalAttrs: { makeWrapper $out/opt/dbeaver/dbeaver $out/bin/dbeaver \ --prefix PATH : "${openjdk17}/bin" \ --set JAVA_HOME "${openjdk17.home}" \ - --prefix CLASSPATH : "$out/dbeaver/plugins/*:${swt}/jars/swt.jar" \ --prefix GIO_EXTRA_MODULES : "${glib-networking}/lib/gio/modules" \ --prefix LD_LIBRARY_PATH : "$out/lib:${ lib.makeLibraryPath [ - swt gtk3 glib webkitgtk_4_0 From 7c16395c9f1ce5b300a8a80625bc5d98b7102f99 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Mon, 7 Oct 2024 09:23:31 +0300 Subject: [PATCH 05/16] portfolio: don't depend on swt (not needed at all) --- pkgs/by-name/po/portfolio/package.nix | 3 --- 1 file changed, 3 deletions(-) diff --git a/pkgs/by-name/po/portfolio/package.nix b/pkgs/by-name/po/portfolio/package.nix index c73b6985f341..6d8d826007d2 100644 --- a/pkgs/by-name/po/portfolio/package.nix +++ b/pkgs/by-name/po/portfolio/package.nix @@ -9,7 +9,6 @@ makeDesktopItem, openjdk17, stdenvNoCC, - swt, webkitgtk_4_0, wrapGAppsHook3, gitUpdater, @@ -29,7 +28,6 @@ let glib-networking gtk3 libsecret - swt webkitgtk_4_0 ]; in @@ -56,7 +54,6 @@ stdenvNoCC.mkDerivation (finalAttrs: { makeWrapper $out/portfolio/PortfolioPerformance $out/bin/portfolio \ --prefix LD_LIBRARY_PATH : "${runtimeLibs}" \ - --prefix CLASSPATH : "${swt}/jars/swt.jar" \ --prefix PATH : ${openjdk17}/bin # Create desktop item From 271e05bbfb2f3d08e548f4d5efc24a76ff705807 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Mon, 7 Oct 2024 09:28:00 +0300 Subject: [PATCH 06/16] ipscan: mark as broken (doesn't really launch) --- pkgs/tools/security/ipscan/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/tools/security/ipscan/default.nix b/pkgs/tools/security/ipscan/default.nix index f61944fe63ea..149cd322219b 100644 --- a/pkgs/tools/security/ipscan/default.nix +++ b/pkgs/tools/security/ipscan/default.nix @@ -51,5 +51,7 @@ stdenv.mkDerivation rec { license = licenses.gpl2Only; platforms = [ "x86_64-linux" ]; maintainers = with maintainers; [ kylesferrazza totoroot ]; + # Very similar issue to hdfview, see: https://github.com/NixOS/nixpkgs/issues/340048 + broken = true; }; } From c582a1e5e650173bc3abb7b19e6af90c61cbb578 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Mon, 7 Oct 2024 09:40:26 +0300 Subject: [PATCH 07/16] vuze: mark as broken --- pkgs/applications/networking/p2p/vuze/default.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/applications/networking/p2p/vuze/default.nix b/pkgs/applications/networking/p2p/vuze/default.nix index e24601757685..0d3ee40236b5 100644 --- a/pkgs/applications/networking/p2p/vuze/default.nix +++ b/pkgs/applications/networking/p2p/vuze/default.nix @@ -26,5 +26,8 @@ stdenv.mkDerivation rec { license = licenses.unfree; platforms = platforms.all; maintainers = [ ]; + # Doesn't launch, gives java related incompatibilities errors. Probably + # related to swt. Same error happens with swt_jdk8 + broken = true; }; } From 729a27a947a50e38589d520c2604c2d0191db7a9 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Mon, 7 Oct 2024 10:04:30 +0300 Subject: [PATCH 08/16] tuxguitar: nixfmt & don't use 'with lib;' in meta --- .../editors/music/tuxguitar/default.nix | 63 ++++++++++++++----- 1 file changed, 48 insertions(+), 15 deletions(-) diff --git a/pkgs/applications/editors/music/tuxguitar/default.nix b/pkgs/applications/editors/music/tuxguitar/default.nix index a602de8a37b7..7c853967218f 100644 --- a/pkgs/applications/editors/music/tuxguitar/default.nix +++ b/pkgs/applications/editors/music/tuxguitar/default.nix @@ -1,11 +1,32 @@ -{ lib, stdenv, fetchurl, swt, jre, makeWrapper, alsa-lib, jack2, fluidsynth, libpulseaudio, nixosTests }: +{ + lib, + stdenv, + fetchurl, + swt, + jre, + makeWrapper, + alsa-lib, + jack2, + fluidsynth, + libpulseaudio, + nixosTests, +}: -let metadata = assert stdenv.hostPlatform.system == "i686-linux" || stdenv.hostPlatform.system == "x86_64-linux"; - if stdenv.hostPlatform.system == "i686-linux" then - { arch = "x86"; sha256 = "sha256-k4FQrt72VNb5FdYMzxskcVhKlvx8MZelUlLCItxDB7c="; } - else - { arch = "x86_64"; sha256 = "sha256-mj5wVQlY2xFzdulvMdb5Qb5HGwr7RElzIkpOLjaAfGA="; }; -in stdenv.mkDerivation rec { +let + metadata = + assert stdenv.hostPlatform.system == "i686-linux" || stdenv.hostPlatform.system == "x86_64-linux"; + if stdenv.hostPlatform.system == "i686-linux" then + { + arch = "x86"; + sha256 = "sha256-k4FQrt72VNb5FdYMzxskcVhKlvx8MZelUlLCItxDB7c="; + } + else + { + arch = "x86_64"; + sha256 = "sha256-mj5wVQlY2xFzdulvMdb5Qb5HGwr7RElzIkpOLjaAfGA="; + }; +in +stdenv.mkDerivation rec { version = "1.5.5"; pname = "tuxguitar"; @@ -14,7 +35,9 @@ in stdenv.mkDerivation rec { sha256 = metadata.sha256; }; - nativeBuildInputs = [ makeWrapper ]; + nativeBuildInputs = [ + makeWrapper + ]; installPhase = '' mkdir -p $out/bin @@ -27,22 +50,32 @@ in stdenv.mkDerivation rec { wrapProgram $out/bin/tuxguitar \ --set JAVA "${jre}/bin/java" \ - --prefix LD_LIBRARY_PATH : "$out/lib/:${lib.makeLibraryPath [ swt alsa-lib jack2 fluidsynth libpulseaudio ]}" \ + --prefix LD_LIBRARY_PATH : "$out/lib/:${ + lib.makeLibraryPath [ + swt + alsa-lib + jack2 + fluidsynth + libpulseaudio + ] + }" \ --prefix CLASSPATH : "${swt}/jars/swt.jar:$out/lib/tuxguitar.jar:$out/lib/itext.jar" ''; - passthru.tests = { inherit (nixosTests) tuxguitar; }; + passthru.tests = { + inherit (nixosTests) tuxguitar; + }; - meta = with lib; { + meta = { description = "Multitrack guitar tablature editor"; longDescription = '' TuxGuitar is a multitrack guitar tablature editor and player written in Java-SWT. It can open GuitarPro, PowerTab and TablEdit files. ''; homepage = "http://www.tuxguitar.com.ar/"; - sourceProvenance = with sourceTypes; [ binaryBytecode ]; - license = licenses.lgpl2; - maintainers = [ maintainers.ardumont ]; - platforms = platforms.linux; + sourceProvenance = with lib.sourceTypes; [ binaryBytecode ]; + license = lib.licenses.lgpl2; + maintainers = with lib.maintainers; [ ardumont ]; + platforms = lib.platforms.linux; }; } From e72eb22590baf1d1cfae0d8ed7b721242eb3e9e7 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Mon, 7 Oct 2024 10:06:40 +0300 Subject: [PATCH 09/16] tuxguitar: use finalAttrs pattern --- pkgs/applications/editors/music/tuxguitar/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/editors/music/tuxguitar/default.nix b/pkgs/applications/editors/music/tuxguitar/default.nix index 7c853967218f..5dc2f9c0a6cd 100644 --- a/pkgs/applications/editors/music/tuxguitar/default.nix +++ b/pkgs/applications/editors/music/tuxguitar/default.nix @@ -26,12 +26,12 @@ let sha256 = "sha256-mj5wVQlY2xFzdulvMdb5Qb5HGwr7RElzIkpOLjaAfGA="; }; in -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { version = "1.5.5"; pname = "tuxguitar"; src = fetchurl { - url = "mirror://sourceforge/${pname}/${pname}-${version}-linux-${metadata.arch}.tar.gz"; + url = "mirror://sourceforge/tuxguitar/tuxguitar-${finalAttrs.version}-linux-${metadata.arch}.tar.gz"; sha256 = metadata.sha256; }; @@ -78,4 +78,4 @@ stdenv.mkDerivation rec { maintainers = with lib.maintainers; [ ardumont ]; platforms = lib.platforms.linux; }; -} +}) From dd12b437a6f6fd2b7d778ba7aad6c37dd841dbb6 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Mon, 7 Oct 2024 10:07:33 +0300 Subject: [PATCH 10/16] tuxguitar: rename passthru nixos test attribute --- pkgs/applications/editors/music/tuxguitar/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/editors/music/tuxguitar/default.nix b/pkgs/applications/editors/music/tuxguitar/default.nix index 5dc2f9c0a6cd..aec5f0999dd9 100644 --- a/pkgs/applications/editors/music/tuxguitar/default.nix +++ b/pkgs/applications/editors/music/tuxguitar/default.nix @@ -63,7 +63,7 @@ stdenv.mkDerivation (finalAttrs: { ''; passthru.tests = { - inherit (nixosTests) tuxguitar; + nixos = nixosTests.tuxguitar; }; meta = { From b76ff9137f97509dff1ae18271ac6c8fa4697e80 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Sun, 6 Oct 2024 22:36:21 +0300 Subject: [PATCH 11/16] swt: 4.5 -> 4.33 Fixes #219771. Previous attempt: #75609 --- pkgs/by-name/sw/swt/awt-libs.patch | 8 --- pkgs/by-name/sw/swt/gtk-libs.patch | 14 ---- pkgs/by-name/sw/swt/package.nix | 105 +++++++++-------------------- 3 files changed, 30 insertions(+), 97 deletions(-) delete mode 100644 pkgs/by-name/sw/swt/awt-libs.patch delete mode 100644 pkgs/by-name/sw/swt/gtk-libs.patch diff --git a/pkgs/by-name/sw/swt/awt-libs.patch b/pkgs/by-name/sw/swt/awt-libs.patch deleted file mode 100644 index 6c3ff53b7983..000000000000 --- a/pkgs/by-name/sw/swt/awt-libs.patch +++ /dev/null @@ -1,8 +0,0 @@ ---- a/make_linux.mak -+++ b/make_linux.mak -@@ -63,4 +63,4 @@ - - AWT_LFLAGS = -shared ${SWT_LFLAGS} --AWT_LIBS = -L$(AWT_LIB_PATH) -ljawt -+AWT_LIBS = `pkg-config --libs x11` -L$(AWT_LIB_PATH) -ljawt - diff --git a/pkgs/by-name/sw/swt/gtk-libs.patch b/pkgs/by-name/sw/swt/gtk-libs.patch deleted file mode 100644 index cd13082b5df7..000000000000 --- a/pkgs/by-name/sw/swt/gtk-libs.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- a/make_linux.mak -+++ b/make_linux.mak -@@ -53,9 +53,4 @@ - --# Do not use pkg-config to get libs because it includes unnecessary dependencies (i.e. pangoxft-1.0) --GTKCFLAGS = `pkg-config --cflags gtk+-$(GTK_VERSION) gtk+-unix-print-$(GTK_VERSION)` -+GTKCFLAGS = `pkg-config --cflags gtk+-$(GTK_VERSION) gthread-2.0 gtk+-unix-print-$(GTK_VERSION) x11 xtst` -+GTKLIBS = `pkg-config --libs gtk+-$(GTK_VERSION) gthread-2.0 gtk+-unix-print-$(GTK_VERSION) x11 xtst` --ifeq ($(GTK_VERSION), 3.0) --GTKLIBS = `pkg-config --libs-only-L gtk+-$(GTK_VERSION) gthread-2.0` $(XLIB64) -L/usr/X11R6/lib -lgtk-3 -lgdk-3 -lcairo -lgthread-2.0 -lXtst --else --GTKLIBS = `pkg-config --libs-only-L gtk+-$(GTK_VERSION) gthread-2.0` $(XLIB64) -L/usr/X11R6/lib -lgtk-x11-$(GTK_VERSION) -lgthread-2.0 -lXtst --endif - diff --git a/pkgs/by-name/sw/swt/package.nix b/pkgs/by-name/sw/swt/package.nix index 7f386779d47d..04d880dc3368 100644 --- a/pkgs/by-name/sw/swt/package.nix +++ b/pkgs/by-name/sw/swt/package.nix @@ -1,13 +1,9 @@ { - atk, fetchzip, - gtk2, + gtk3, jdk, lib, - libGL, libGLU, - libXt, - libXtst, pkg-config, stdenv, stripJavaArchivesHook, @@ -15,18 +11,16 @@ stdenv.mkDerivation (finalAttrs: { pname = "swt"; - version = "4.5"; - fullVersion = "${finalAttrs.version}-201506032000"; + version = "4.33"; + fullVersion = "${finalAttrs.version}-202409030240"; hardeningDisable = [ "format" ]; passthru.srcMetadataByPlatform = { x86_64-linux.platform = "gtk-linux-x86_64"; - x86_64-linux.hash = "sha256-JhzRCrVzsM2NBf65l6CDZdgchlbECHGUg0J0bQVT2Z0="; - i686-linux.platform = "gtk-linux-x86"; - i686-linux.hash = "sha256-C7H1CUFkl7GPpqDFSzYnlLWa1XcawI2hbtsn9fIJio0="; + x86_64-linux.hash = "sha256-0OUr+jpwTx5/eoA6Uo2E9/SBAtf+IMMiSVRhOfaWFhE="; x86_64-darwin.platform = "cocoa-macosx-x86_64"; - x86_64-darwin.hash = "sha256-CrSFkrlnSP2uQzRrRzv8F0lXEA7TNK9RFe2neDjtXnI="; + x86_64-darwin.hash = "sha256-n948C/YPF55WPYvub3re/wARLP1Wk+XhJiIuI0YQH5c="; }; passthru.srcMetadata = finalAttrs.passthru.srcMetadataByPlatform.${stdenv.hostPlatform.system} or null; @@ -56,84 +50,39 @@ stdenv.mkDerivation (finalAttrs: { }; nativeBuildInputs = [ + jdk stripJavaArchivesHook pkg-config ]; buildInputs = [ - atk - gtk2 - jdk - libGL + gtk3 libGLU - libXtst - ] ++ lib.optionals (lib.hasPrefix "8u" jdk.version) [ libXt ]; - - patches = [ - ./awt-libs.patch - ./gtk-libs.patch ]; - prePatch = '' - # clear whitespace from makefiles (since we match on EOL later) - sed -i 's/ \+$//' ./*.mak + SWT_JAVA_HOME = jdk; + AWT_LIB_PATH = "${jdk}/lib/openjdk/lib"; + # Used by the makefile which is responsible for the shared objects only + OUTPUT_DIR = "${placeholder "out"}/lib"; + # GTK4 is not supported yet. Waiting for: + # https://github.com/eclipse-platform/eclipse.platform.swt/pull/1482 + makeFlags = "gtk3"; + preBuild = '' + cd library + mkdir -p ${finalAttrs.OUTPUT_DIR} ''; - postPatch = - let - makefile-sed = builtins.toFile "swt-makefile.sed" '' - # fix pkg-config invocations in CFLAGS/LIBS pairs. - # - # change: - # FOOCFLAGS = `pkg-config --cflags `foo bar` - # FOOLIBS = `pkg-config --libs-only-L foo` -lbaz - # into: - # FOOCFLAGS = `pkg-config --cflags foo bar` - # FOOLIBS = `pkg-config --libs foo bar` - # - # the latter works more consistently. - /^[A-Z0-9_]\+CFLAGS = `pkg-config --cflags [^`]\+`$/ { - N - s/${'' - ^\([A-Z0-9_]\+\)CFLAGS = `pkg-config --cflags \(.\+\)`\ - \1LIBS = `pkg-config --libs-only-L .\+$''}/${'' - \1CFLAGS = `pkg-config --cflags \2`\ - \1LIBS = `pkg-config --libs \2`''}/ - } - # fix WebKit libs not being there - s/\$(WEBKIT_LIB) \$(WEBKIT_OBJECTS)$/\0 `pkg-config --libs glib-2.0`/g - ''; - in - '' - declare -a makefiles=(./*.mak) - sed -i -f ${makefile-sed} "''${makefiles[@]}" - # assign Makefile variables eagerly & change backticks to `$(shell …)` - sed -i -e 's/ = `\([^`]\+\)`/ := $(shell \1)/' \ - -e 's/`\([^`]\+\)`/$(shell \1)/' \ - "''${makefiles[@]}" - ''; - - buildPhase = '' - runHook preBuild - - export JAVA_HOME=${jdk} - - ./build.sh - + # Build the jar + postBuild = '' + cd ../ mkdir out find org/ -name '*.java' -type f -exec javac -d out/ {} + - - runHook postBuild ''; + # The makefile doesn't have an install target, the installation of the shared + # objects is part of the `all` target. installPhase = '' runHook preInstall - if [[ -n "$prefix" ]]; then - install -d -- "$prefix" - fi - - install -Dm 644 -t "$out/lib" -- *.so - install -d -- "$out/jars" install -m 644 -t out -- version.txt (cd out && jar -c *) > "$out/jars/swt.jar" @@ -147,8 +96,14 @@ stdenv.mkDerivation (finalAttrs: { A widget toolkit for Java to access the user-interface facilities of the operating systems on which it is implemented. ''; - license = lib.licenses.epl10; + license = with lib.licenses; [ + # All of these are located in the about_files directory of the source + ijg + lgpl21 + mpl11 + mpl20 + ]; maintainers = [ ]; - platforms = lib.platforms.linux; + platforms = lib.attrNames finalAttrs.passthru.srcMetadataByPlatform; }; }) From 51475bd9d35a0f7b9cb40c7dce573996b0bbe9d7 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Mon, 7 Oct 2024 10:08:49 +0300 Subject: [PATCH 12/16] tuxguitar: 1.5.5 -> 1.6.4; move to pkgs/by-name --- .../tu/tuxguitar/package.nix} | 24 +++++-------------- pkgs/top-level/all-packages.nix | 5 ---- 2 files changed, 6 insertions(+), 23 deletions(-) rename pkgs/{applications/editors/music/tuxguitar/default.nix => by-name/tu/tuxguitar/package.nix} (69%) diff --git a/pkgs/applications/editors/music/tuxguitar/default.nix b/pkgs/by-name/tu/tuxguitar/package.nix similarity index 69% rename from pkgs/applications/editors/music/tuxguitar/default.nix rename to pkgs/by-name/tu/tuxguitar/package.nix index aec5f0999dd9..d3399471a75a 100644 --- a/pkgs/applications/editors/music/tuxguitar/default.nix +++ b/pkgs/by-name/tu/tuxguitar/package.nix @@ -9,30 +9,17 @@ jack2, fluidsynth, libpulseaudio, + lilv, nixosTests, }: -let - metadata = - assert stdenv.hostPlatform.system == "i686-linux" || stdenv.hostPlatform.system == "x86_64-linux"; - if stdenv.hostPlatform.system == "i686-linux" then - { - arch = "x86"; - sha256 = "sha256-k4FQrt72VNb5FdYMzxskcVhKlvx8MZelUlLCItxDB7c="; - } - else - { - arch = "x86_64"; - sha256 = "sha256-mj5wVQlY2xFzdulvMdb5Qb5HGwr7RElzIkpOLjaAfGA="; - }; -in stdenv.mkDerivation (finalAttrs: { - version = "1.5.5"; + version = "1.6.4"; pname = "tuxguitar"; src = fetchurl { - url = "mirror://sourceforge/tuxguitar/tuxguitar-${finalAttrs.version}-linux-${metadata.arch}.tar.gz"; - sha256 = metadata.sha256; + url = "https://github.com/helge17/tuxguitar/releases/download/${finalAttrs.version}/tuxguitar-${finalAttrs.version}-linux-swt-amd64.tar.gz"; + hash = "sha256-FD1+7jV69E9AfTczjD6DOGD+pPlscg4o8A9ADBUM9B4="; }; nativeBuildInputs = [ @@ -57,6 +44,7 @@ stdenv.mkDerivation (finalAttrs: { jack2 fluidsynth libpulseaudio + lilv ] }" \ --prefix CLASSPATH : "${swt}/jars/swt.jar:$out/lib/tuxguitar.jar:$out/lib/itext.jar" @@ -76,6 +64,6 @@ stdenv.mkDerivation (finalAttrs: { sourceProvenance = with lib.sourceTypes; [ binaryBytecode ]; license = lib.licenses.lgpl2; maintainers = with lib.maintainers; [ ardumont ]; - platforms = lib.platforms.linux; + platforms = [ "x86_64-linux" ]; }; }) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 2d21ffc081ef..0bd2f1cd14aa 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -33078,11 +33078,6 @@ with pkgs; tuxedo-rs = callPackage ../os-specific/linux/tuxedo-rs { }; - tuxguitar = callPackage ../applications/editors/music/tuxguitar { - jre = jre8; - swt = swt_jdk8; - }; - twmn = libsForQt5.callPackage ../applications/misc/twmn { }; testssl = callPackage ../applications/networking/testssl { }; From 329e459dab229ffcade78fe2ab30a0690eddafb6 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Sun, 13 Oct 2024 21:29:07 +0300 Subject: [PATCH 13/16] swt: make it actually useful Co-Authored-By: Ben Wolsieffer --- pkgs/by-name/sw/swt/package.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/sw/swt/package.nix b/pkgs/by-name/sw/swt/package.nix index 04d880dc3368..b06eaa9ab08c 100644 --- a/pkgs/by-name/sw/swt/package.nix +++ b/pkgs/by-name/sw/swt/package.nix @@ -75,7 +75,9 @@ stdenv.mkDerivation (finalAttrs: { postBuild = '' cd ../ mkdir out - find org/ -name '*.java' -type f -exec javac -d out/ {} + + find org/ -name '*.java' -type f -exec javac -encoding utf8 -d out/ {} + + # Copy non Java resource files + find org/ -not -name '*.java' -not -name '*.html' -type f -exec cp {} out/{} \; ''; # The makefile doesn't have an install target, the installation of the shared From c70579b0a564176e2aa9d9e042d13f6d9f8bd023 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Mon, 14 Oct 2024 12:06:40 +0300 Subject: [PATCH 14/16] dataexplorer: make it launch by using swt built with jdk17 Co-Authored-By: Ben Wolsieffer --- pkgs/by-name/da/dataexplorer/package.nix | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/da/dataexplorer/package.nix b/pkgs/by-name/da/dataexplorer/package.nix index 4ee2b0a0e81a..09406b6b3beb 100644 --- a/pkgs/by-name/da/dataexplorer/package.nix +++ b/pkgs/by-name/da/dataexplorer/package.nix @@ -4,11 +4,12 @@ , ant # executable fails to start for jdk > 17 , jdk17 +, swt , makeWrapper , strip-nondeterminism -}: - -stdenv.mkDerivation (finalAttrs: { +}: let + swt-jdk17 = swt.override { jdk = jdk17; }; +in stdenv.mkDerivation (finalAttrs: { pname = "dataexplorer"; version = "3.9.0"; @@ -40,12 +41,15 @@ stdenv.mkDerivation (finalAttrs: { runHook preInstall ant -Dprefix=$out/share/ -f build/build.xml install + # Use SWT from nixpkgs + ln -sf '${swt-jdk17}/jars/swt.jar' "$out/share/DataExplorer/java/ext/swt.jar" # The sources contain a wrapper script in $out/share/DataExplorer/DataExplorer # but it hardcodes bash shebang and does not pin the java path. # So we create our own wrapper, using similar cmdline args as upstream. mkdir -p $out/bin makeWrapper ${jdk17}/bin/java $out/bin/DataExplorer \ + --prefix LD_LIBRARY_PATH : '${swt-jdk17}/lib' \ --add-flags "-Xms64m -Xmx3092m -jar $out/share/DataExplorer/DataExplorer.jar" \ --set SWT_GTK3 0 From e592a523114e3f2d02d61717e4cb9c514710c3db Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Sun, 20 Oct 2024 21:12:09 +1100 Subject: [PATCH 15/16] Substitute reference to `elixir` --- pkgs/development/beam-modules/elixir-ls/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/development/beam-modules/elixir-ls/default.nix b/pkgs/development/beam-modules/elixir-ls/default.nix index 8d4eba70cc00..cfda8d21a495 100644 --- a/pkgs/development/beam-modules/elixir-ls/default.nix +++ b/pkgs/development/beam-modules/elixir-ls/default.nix @@ -56,7 +56,8 @@ mixRelease { substituteInPlace $out/lib/launch.sh \ --replace "ERL_LIBS=\"\$SCRIPTPATH:\$ERL_LIBS\"" \ "ERL_LIBS=$out/lib:\$ERL_LIBS" \ - --replace "exec elixir" "exec ${elixir}/bin/elixir" + --replace "exec elixir" "exec ${elixir}/bin/elixir" \ + --replace 'echo "" | elixir' "echo \"\" | ${elixir}/bin/elixir" runHook postInstall ''; From 435051f990d1cbf724a8973e6d8449f686cba18f Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Sun, 20 Oct 2024 21:32:10 +1100 Subject: [PATCH 16/16] Also patch `zsh` launcher --- pkgs/development/beam-modules/elixir-ls/default.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/development/beam-modules/elixir-ls/default.nix b/pkgs/development/beam-modules/elixir-ls/default.nix index cfda8d21a495..3bf8c57b7543 100644 --- a/pkgs/development/beam-modules/elixir-ls/default.nix +++ b/pkgs/development/beam-modules/elixir-ls/default.nix @@ -52,12 +52,14 @@ mixRelease { substitute release/debug_adapter.sh $out/bin/elixir-debug-adapter \ --replace 'exec "''${dir}/launch.sh"' "exec $out/lib/launch.sh" chmod +x $out/bin/elixir-debug-adapter - # prepare the launcher + # prepare the launchers substituteInPlace $out/lib/launch.sh \ --replace "ERL_LIBS=\"\$SCRIPTPATH:\$ERL_LIBS\"" \ "ERL_LIBS=$out/lib:\$ERL_LIBS" \ --replace "exec elixir" "exec ${elixir}/bin/elixir" \ --replace 'echo "" | elixir' "echo \"\" | ${elixir}/bin/elixir" + substituteInPlace $out/lib/exec.zsh \ + --replace "exec elixir" "exec ${elixir}/bin/elixir" runHook postInstall '';