tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
nile: init at 1.0.0
Aidan Gauland
2 years ago
4d5658d7
5a29bee7
+86
2 changed files
expand all
collapse all
unified
split
pkgs
games
nile
default.nix
top-level
all-packages.nix
+84
pkgs/games/nile/default.nix
···
1
1
+
{ lib
2
2
+
, writeScript
3
3
+
, buildPythonApplication
4
4
+
, fetchFromGitHub
5
5
+
, pythonOlder
6
6
+
, setuptools
7
7
+
, requests
8
8
+
, protobuf
9
9
+
, pycryptodome
10
10
+
, zstandard
11
11
+
, json5
12
12
+
, platformdirs
13
13
+
, cacert
14
14
+
}:
15
15
+
16
16
+
buildPythonApplication rec {
17
17
+
pname = "nile";
18
18
+
version = "1.0.0";
19
19
+
format = "pyproject";
20
20
+
21
21
+
src = fetchFromGitHub {
22
22
+
owner = "imLinguin";
23
23
+
repo = "nile";
24
24
+
rev = "f5f3b96f6483c59cfc646afbda6e97cb0bd94778";
25
25
+
hash = "sha256-HibY3U9/MibEDwHY+YiErW/pz6qwtps8wwjhznTISgA=";
26
26
+
};
27
27
+
28
28
+
disabled = pythonOlder "3.8";
29
29
+
30
30
+
propagatedBuildInputs = [
31
31
+
setuptools
32
32
+
requests
33
33
+
protobuf
34
34
+
pycryptodome
35
35
+
zstandard
36
36
+
json5
37
37
+
platformdirs
38
38
+
];
39
39
+
40
40
+
pyprojectAppendix = ''
41
41
+
[tool.setuptools.packages.find]
42
42
+
include = ["nile*"]
43
43
+
'';
44
44
+
45
45
+
postPatch = ''
46
46
+
echo "$pyprojectAppendix" >> pyproject.toml
47
47
+
'';
48
48
+
49
49
+
pythonImportsCheck = [ "nile" ];
50
50
+
51
51
+
meta = with lib; {
52
52
+
description = "Unofficial Amazon Games client";
53
53
+
homepage = "https://github.com/imLinguin/nile";
54
54
+
license = with licenses; [ gpl3 ];
55
55
+
maintainers = with maintainers; [ aidalgol ];
56
56
+
};
57
57
+
58
58
+
# Upstream does not create git tags when bumping the version, so we have to
59
59
+
# extract it from the source code on the main branch.
60
60
+
passthru.updateScript = writeScript "gogdl-update-script" ''
61
61
+
#!/usr/bin/env nix-shell
62
62
+
#!nix-shell -i bash -p curl gnused jq common-updater-scripts
63
63
+
set -eou pipefail;
64
64
+
65
65
+
owner=imLinguin
66
66
+
repo=nile
67
67
+
path='nile/__init__.py'
68
68
+
69
69
+
version=$(
70
70
+
curl --cacert "${cacert}/etc/ssl/certs/ca-bundle.crt" \
71
71
+
https://raw.githubusercontent.com/$owner/$repo/main/$path |
72
72
+
sed -n 's/^\s*version\s*=\s*"\([0-9]\.[0-9]\.[0-9]\)"\s*$/\1/p')
73
73
+
74
74
+
commit=$(curl --cacert "${cacert}/etc/ssl/certs/ca-bundle.crt" \
75
75
+
https://api.github.com/repos/$owner/$repo/commits?path=$path |
76
76
+
jq -r '.[0].sha')
77
77
+
78
78
+
update-source-version \
79
79
+
${pname} \
80
80
+
"$version" \
81
81
+
--file=./pkgs/games/nile/default.nix \
82
82
+
--rev=$commit
83
83
+
'';
84
84
+
}
+2
pkgs/top-level/all-packages.nix
···
37600
37600
37601
37601
nexuiz = callPackage ../games/nexuiz { };
37602
37602
37603
37603
+
nile = python3Packages.callPackage ../games/nile { };
37604
37604
+
37603
37605
ninvaders = callPackage ../games/ninvaders { };
37604
37606
37605
37607
njam = callPackage ../games/njam { };