File tree Expand file tree Collapse file tree 4 files changed +48
-4
lines changed Expand file tree Collapse file tree 4 files changed +48
-4
lines changed Original file line number Diff line number Diff line change 66 pname ,
77 version ,
88 meta ,
9+ passthru ,
910} :
1011stdenvNoCC . mkDerivation ( finalAttrs : {
11- inherit pname version meta ;
12+ inherit
13+ pname
14+ version
15+ meta
16+ passthru
17+ ;
1218
1319 src = fetchurl {
1420 url = "https://github.com/4ian/GDevelop/releases/download/v${ version } /GDevelop-5-${ version } -universal-mac.zip" ;
15- hash = "sha256-0FT4JHGJKy6UapuV2tXKzWm0Esr6DPqu38PllUbUtrY =" ;
21+ hash = "sha256-zvPum8vTEXS0LbwBpzGNmcsm3s7u2oAJBhGYvlV1PWw =" ;
1622 } ;
1723
1824 sourceRoot = "." ;
Original file line number Diff line number Diff line change 66 version ,
77 pname ,
88 meta ,
9+ passthru ,
910} :
1011let
1112 src =
1213 if stdenv . hostPlatform . system == "x86_64-linux" then
1314 fetchurl {
1415 url = "https://github.com/4ian/GDevelop/releases/download/v${ version } /GDevelop-5-${ version } .AppImage" ;
15- hash = "sha256-KV6gzPiu/45ibdzMG707vd10F6qLcm+afwJWa6WlywU =" ;
16+ hash = "sha256-RjpiIy4NqZ9QCevwWR6cKLobbsFjneq+Vhr/t0JfvgU =" ;
1617 }
1718 else
1819 throw "${ pname } -${ version } is not supported on ${ stdenv . hostPlatform . system } " ;
@@ -29,6 +30,7 @@ appimageTools.wrapType2 {
2930 version
3031 src
3132 meta
33+ passthru
3234 ;
3335
3436 extraInstallCommands = ''
Original file line number Diff line number Diff line change 55 ...
66} :
77let
8- version = "5.5.229 " ;
8+ version = "5.5.231 " ;
99 pname = "gdevelop" ;
1010 meta = {
1111 description = "Graphical Game Development Studio" ;
2020 mainProgram = "gdevelop" ;
2121 platforms = [ "x86_64-linux" ] ++ lib . platforms . darwin ;
2222 } ;
23+ passthru . updateScript = ./update.sh ;
2324in
2425if stdenv . hostPlatform . isDarwin then
2526 callPackage ./darwin.nix {
2627 inherit
2728 pname
2829 version
2930 meta
31+ passthru
3032 ;
3133 }
3234else
3537 pname
3638 version
3739 meta
40+ passthru
3841 ;
3942 }
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env nix-shell
2+ #! nix-shell -i bash -p curl jq gnused
3+
4+ set -euo pipefail
5+
6+ cd " $( dirname " $0 " ) " || exit 1
7+
8+ # Grab latest version from the GitHub repository
9+ LATEST_VER=" $( curl --fail -s ${GITHUB_TOKEN: +-u " :$GITHUB_TOKEN " } " https://api.github.com/repos/4ian/GDevelop/releases" | jq -r ' .[0].tag_name' | sed ' s/^v//' ) "
10+ CURRENT_VER=" $( grep -oP ' version = "\K[^"]+' package.nix) "
11+
12+ if [[ " $LATEST_VER " == " $CURRENT_VER " ]]; then
13+ echo " gdevelop is up-to-date"
14+ exit 0
15+ fi
16+
17+ echo " Updating gdevelop from $CURRENT_VER to $LATEST_VER "
18+
19+ # Update the version
20+ sed -i " s#version = \" .*\" ;#version = \" $LATEST_VER \" ;#g" package.nix
21+
22+ # Update hashes
23+ # - Linux
24+
25+ LINUX_HASH=" $( nix-hash --to-sri --type sha256 " $( nix-prefetch-url --type sha256 " https://github.com/4ian/GDevelop/releases/download/v${LATEST_VER} /GDevelop-5-${LATEST_VER} .AppImage" ) " ) "
26+ sed -i " s#hash = \" .*\" #hash = \" $LINUX_HASH \" #g" linux.nix
27+
28+ # - Darwin
29+
30+ DARWIN_HASH=" $( nix-hash --to-sri --type sha256 " $( nix-prefetch-url --type sha256 " https://github.com/4ian/GDevelop/releases/download/v${LATEST_VER} /GDevelop-5-${LATEST_VER} -universal-mac.zip" ) " ) "
31+ sed -i " s#hash = \" .*\" #hash = \" $DARWIN_HASH \" #g" darwin.nix
32+
33+ echo " Updated gdevelop to $LATEST_VER "
You can’t perform that action at this time.
0 commit comments