penpot-desktop: init at 0.10.0 (#377064)

authored by Matthieu Coudron and committed by GitHub c28bf08e cad31696

+160
+7
maintainers/maintainer-list.nix
··· 16983 16983 githubId = 30942198; 16984 16984 name = "Noah Snelson"; 16985 16985 }; 16986 + ntbbloodbath = { 16987 + email = "bloodbathalchemist@protonmail.com"; 16988 + matrix = "@ntbbloodbath:matrix.org"; 16989 + github = "ntbbloodbath"; 16990 + githubId = 36456999; 16991 + name = "Alejandro Martin"; 16992 + }; 16986 16993 nthorne = { 16987 16994 email = "notrupertthorne@gmail.com"; 16988 16995 github = "nthorne";
+39
pkgs/by-name/pe/penpot-desktop/electron-package-lock.diff
··· 1 + diff --git i/package-lock.json w/package-lock.json 2 + index 039e3c0..135e0a0 100644 3 + --- i/package-lock.json 4 + +++ w/package-lock.json 5 + @@ -18,7 +18,7 @@ 6 + "@commitlint/cli": "^19.6.1", 7 + "@commitlint/config-conventional": "^19.6.0", 8 + "@eslint/js": "^9.19.0", 9 + - "electron": "^34.0.1", 10 + + "electron": "^33.3.1", 11 + "electron-builder": "^25.1.8", 12 + "eslint": "^9.19.0", 13 + "globals": "^15.14.0", 14 + @@ -3495,9 +3495,9 @@ 15 + } 16 + }, 17 + "node_modules/electron": { 18 + - "version": "34.0.1", 19 + - "resolved": "https://registry.npmjs.org/electron/-/electron-34.0.1.tgz", 20 + - "integrity": "sha512-aArw5tAM80i3CKwEREnyZSM1SkARf5Jd1yBMTIdOL4pB1M+p/oDeyWSFI9Dl+vujyfJKiK4SS5+j19wna1onMw==", 21 + + "version": "33.3.1", 22 + + "resolved": "https://registry.npmjs.org/electron/-/electron-33.3.1.tgz", 23 + + "integrity": "sha512-Z7l2bVgpdKxHQMI4i0CirBX2n+iCYKOx5mbzNM3BpOyFELwlobEXKmzCmEnwP+3EcNeIhUQyIEBFQxN06QgdIw==", 24 + "dev": true, 25 + "hasInstallScript": true, 26 + "license": "MIT", 27 + diff --git i/package.json w/package.json 28 + index 9525e62..deb065e 100644 29 + --- i/package.json 30 + +++ w/package.json 31 + @@ -43,7 +43,7 @@ 32 + "@commitlint/cli": "^19.6.1", 33 + "@commitlint/config-conventional": "^19.6.0", 34 + "@eslint/js": "^9.19.0", 35 + - "electron": "^34.0.1", 36 + + "electron": "^33.1.1", 37 + "electron-builder": "^25.1.8", 38 + "eslint": "^9.19.0", 39 + "globals": "^15.14.0",
+114
pkgs/by-name/pe/penpot-desktop/package.nix
··· 1 + { 2 + lib, 3 + buildNpmPackage, 4 + copyDesktopItems, 5 + electron_33, 6 + fetchFromGitHub, 7 + jq, 8 + makeDesktopItem, 9 + makeWrapper, 10 + nodejs_22, 11 + stdenv, 12 + }: 13 + 14 + let 15 + description = "Unofficial desktop application for the open-source design tool, Penpot"; 16 + icon = "penpot"; 17 + nodejs = nodejs_22; 18 + electron = electron_33; 19 + in 20 + buildNpmPackage rec { 21 + pname = "penpot-desktop"; 22 + version = "0.10.0"; 23 + 24 + src = fetchFromGitHub { 25 + owner = "author-more"; 26 + repo = "penpot-desktop"; 27 + tag = "v${version}"; 28 + hash = "sha256-KlTE61k5rl13GPpOznpugSn1hmn55Cd/Z9vhwDjWhPo="; 29 + }; 30 + 31 + patches = [ 32 + ./electron-package-lock.diff # this downgrades electron version from 34 to 33 to match the latest available version in nixpkgs 33 + ]; 34 + 35 + makeCacheWritable = true; 36 + npmFlags = [ 37 + "--engine-strict" 38 + "--legacy-peer-deps" 39 + ]; 40 + npmDepsHash = "sha256-DWZ1ih4i0vyYlShBWkJTCq0IKgT4CgEmvURnGoQiSy0="; 41 + # Do not run the default build script as it leads to errors caused by the electron-builder configuration 42 + dontNpmBuild = true; 43 + 44 + env.ELECTRON_SKIP_BINARY_DOWNLOAD = "1"; 45 + 46 + nativeBuildInputs = [ 47 + jq 48 + nodejs 49 + makeWrapper 50 + copyDesktopItems 51 + ]; 52 + 53 + preBuild = '' 54 + if [[ $(jq --raw-output '.devDependencies.electron' < package.json | grep -E --only-matching '\^[0-9]+' | sed -e 's/\^//') != ${lib.escapeShellArg (lib.versions.major electron.version)} ]]; then 55 + echo 'ERROR: electron version mismatch' 56 + exit 1 57 + fi 58 + ''; 59 + 60 + postBuild = '' 61 + npm exec electron-builder -- \ 62 + --dir \ 63 + --c.electronDist=${electron.dist} \ 64 + --c.electronVersion=${electron.version} 65 + ''; 66 + 67 + installPhase = '' 68 + runHook preInstall 69 + 70 + mkdir $out 71 + 72 + pushd dist/linux-${lib.optionalString stdenv.hostPlatform.isAarch64 "arm64-"}unpacked 73 + mkdir -p $out/opt/Penpot 74 + cp -r locales resources{,.pak} $out/opt/Penpot 75 + popd 76 + 77 + makeWrapper '${lib.getExe electron}' "$out/bin/penpot-desktop" \ 78 + --add-flags $out/opt/Penpot/resources/app.asar \ 79 + --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}" \ 80 + --set-default ELECTRON_IS_DEV 0 \ 81 + --inherit-argv0 82 + 83 + pushd build 84 + for icon in icon.*; do 85 + dir=$out/share/icons/hicolor/"''${icon%.*}"/apps 86 + mkdir -p "$dir" 87 + cp "$icon" "$dir"/${icon}.png 88 + done 89 + popd 90 + 91 + runHook postInstall 92 + ''; 93 + 94 + desktopItems = [ 95 + (makeDesktopItem { 96 + name = "Penpot"; 97 + exec = "penpot-desktop %U"; 98 + inherit icon; 99 + comment = description; 100 + desktopName = "Penpot"; 101 + categories = [ "Graphics" ]; 102 + }) 103 + ]; 104 + 105 + meta = { 106 + changelog = "https://github.com/author-more/penpot-desktop/releases/tag/v${version}"; 107 + inherit description; 108 + homepage = "https://github.com/author-more/penpot.desktop"; 109 + license = lib.licenses.agpl3Only; 110 + maintainers = with lib.maintainers; [ ntbbloodbath ]; 111 + platforms = electron.meta.platforms; 112 + mainProgram = "penpot-desktop"; 113 + }; 114 + }