tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
xcursor-pro: init at 2.0.2
lactose
1 year ago
4807bfbf
7afc19dd
+105
3 changed files
expand all
collapse all
unified
split
pkgs
by-name
xc
xcursor-pro
package.nix
sources.nix
update.sh
+54
pkgs/by-name/xc/xcursor-pro/package.nix
···
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
···
1
+
{
2
+
stdenvNoCC,
3
+
lib,
4
+
fetchurl,
5
+
variants ? [ ],
6
+
}:
7
+
8
+
let
9
+
sources = import ./sources.nix;
10
+
knownVariants = builtins.attrNames sources;
11
+
selectedVariants =
12
+
if (variants == [ ]) then
13
+
knownVariants
14
+
else
15
+
let
16
+
unknownVariants = lib.subtractLists knownVariants variants;
17
+
in
18
+
if (unknownVariants != [ ]) then
19
+
throw "Unknown variant(s): ${lib.concatStringsSep unknownVariants}"
20
+
else
21
+
variants;
22
+
in
23
+
stdenvNoCC.mkDerivation (finalAttrs: {
24
+
pname = "xcursor-pro";
25
+
version = "2.0.2";
26
+
srcs = map (variant: fetchurl { inherit (sources.${variant}) url sha256; }) selectedVariants;
27
+
28
+
sourceRoot = ".";
29
+
30
+
installPhase = ''
31
+
runHook preInstall
32
+
33
+
for theme in XCursor-Pro-{${lib.concatStringsSep "," selectedVariants}}; do
34
+
mkdir -p $out/share/icons/$theme/cursors
35
+
cp -a $theme/cursors/* $out/share/icons/$theme/cursors/
36
+
install -m644 $theme/index.theme $out/share/icons/$theme/index.theme
37
+
done
38
+
39
+
runHook postInstall
40
+
'';
41
+
42
+
passthru.updateScript = ./update.sh;
43
+
44
+
meta = {
45
+
homepage = "https://github.com/ful1e5/XCursor-pro";
46
+
description = "Modern XCursors";
47
+
license = lib.licenses.gpl3;
48
+
platforms = lib.platforms.unix;
49
+
maintainers = with lib.maintainers; [
50
+
lactose
51
+
midirhee12
52
+
];
53
+
};
54
+
})
+15
pkgs/by-name/xc/xcursor-pro/sources.nix
···
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
···
1
+
{
2
+
Dark = {
3
+
url = "https://github.com/ful1e5/XCursor-pro/releases/download/v2.0.2/XCursor-Pro-Dark.tar.xz";
4
+
sha256 = "12r7b2wygasl5yk0k5m6b640q4b23k072myzpz8s5jkyvnp3p84n";
5
+
};
6
+
Light = {
7
+
url = "https://github.com/ful1e5/XCursor-pro/releases/download/v2.0.2/XCursor-Pro-Light.tar.xz";
8
+
sha256 = "19vddq8ajdxxzl3fnvac7p4lmb2hvyszpl25f5nmpm84xwp1kdla";
9
+
};
10
+
Red = {
11
+
url = "https://github.com/ful1e5/XCursor-pro/releases/download/v2.0.2/XCursor-Pro-Red.tar.xz";
12
+
sha256 = "00rhqmcfczy3nvk95rgy22mi6yqpp7ggbxck1z0ay2qv6cfics9m";
13
+
};
14
+
}
15
+
# old version was 2.0.1
+36
pkgs/by-name/xc/xcursor-pro/update.sh
···
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
···
1
+
#!/usr/bin/env nix-shell
2
+
#! nix-shell -i bash -p nix-prefetch jq
3
+
4
+
latest_release=$(curl --silent https://api.github.com/repos/ful1e5/XCursor-pro/releases/latest)
5
+
version=$(jq -r '.tag_name' <<<"$latest_release")
6
+
version="${version#*v}"
7
+
8
+
dirname="$(dirname "$0")"
9
+
if [ "$UPDATE_NIX_OLD_VERSION" = "$version" ]; then
10
+
printf 'No new version available, current: %s\n' $version
11
+
exit 0
12
+
else
13
+
printf 'Updated to version %s\n' $version
14
+
sed -i "s/version = \"$UPDATE_NIX_OLD_VERSION\"/version = \"$version\"/" "$dirname/package.nix"
15
+
fi
16
+
17
+
printf '{\n' > "$dirname/sources.nix"
18
+
19
+
while
20
+
read -r name
21
+
read -r url
22
+
do
23
+
variant="${name#*-*-}"
24
+
variant="${variant%%.*}"
25
+
26
+
{
27
+
printf ' %s = {\n' "$variant"
28
+
printf ' url = \"%s\";\n' "$url"
29
+
printf ' sha256 = \"%s\";\n' "$(nix-prefetch-url "$url")"
30
+
printf ' };\n'
31
+
} >> "$dirname/sources.nix"
32
+
done < <(jq -r '.assets[] |
33
+
select(.name | endswith(".tar.xz") and (contains("all") | not)) |
34
+
.name, .browser_download_url' <<<"$latest_release")
35
+
36
+
printf '}\n' >> "$dirname/sources.nix"