Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gnomeExtensions.material-shell: 12 -> 40.a #125975

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 31 additions & 14 deletions pkgs/desktops/gnome/extensions/material-shell/default.nix
Original file line number Diff line number Diff line change
@@ -1,25 +1,42 @@
{ stdenv, lib, fetchFromGitHub, gnome }:

stdenv.mkDerivation rec {
pname = "gnome-shell-extension-material-shell";
version = "12";

src = fetchFromGitHub {
{ stdenv, pkgs, lib, fetchFromGitHub, nix-gitignore, gnome, glib, nodejs }:
let
ver = "40.a";
source = fetchFromGitHub {
owner = "material-shell";
repo = "material-shell";
rev = version;
sha256 = "0ikrh70drwr0pqjcdz7l1ky8xllpnk7myprjd4s61nqkx9j2iz44";
rev = ver;
sha256 = "Plzjid2X6C5NM/OWaMk78FKUwNT1taubFBtYw1dNIRw=";
};
nodeDependencies = (import ./node-composition.nix {
inherit pkgs;
inherit (stdenv.hostPlatform) system;
}).nodeDependencies.override (oa: {
src = source;
});
in stdenv.mkDerivation rec {
pname = "gnome-shell-extension-material-shell";
version = ver;

# This package has a Makefile, but it's used for building a zip for
# publication to extensions.gnome.org. Disable the build phase so
# installing doesn't build an unnecessary release.
dontBuild = true;
src = source;

buildInputs = [
glib.dev
nodejs
nodeDependencies
];

buildPhase = ''
runHook preBuild
ln -s "${nodeDependencies}/lib/node_modules" ./node_modules
export PATH="${nodeDependencies}/bin:$PATH"
make compile
runHook postBuild
'';

installPhase = ''
runHook preInstall
mkdir -p $out/share/gnome-shell/extensions/${uuid}
cp -r * $out/share/gnome-shell/extensions/${uuid}/
cp -r dist/* $out/share/gnome-shell/extensions/${uuid}/
runHook postInstall
'';

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

    license = licenses.mit;

Though not related to this PR, just FYI, mateial-shell is GPL-3.0 license.
https://github.com/material-shell/material-shell

Expand Down
25 changes: 25 additions & 0 deletions pkgs/desktops/gnome/extensions/material-shell/generate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env nix-shell
#!nix-shell -I nixpkgs=../../../../.. -i bash -p nodePackages.node2nix

set -euo pipefail

if [ "$#" -ne 1 ] || [[ "$1" == -* ]]; then
echo "Regenerates the node composition and package nix files for the material-shell package."
echo "Usage: $0 <git release tag>"
exit 1
fi

wget https://github.com/material-shell/material-shell/raw/$1/package.json
wget https://github.com/material-shell/material-shell/raw/$1/package-lock.json

# We need to use --development flag as all the dependencies that are needed are for
# compiling
node2nix \
--node-env ../../../../development/node-packages/node-env.nix \
--development \
--input ./package.json \
--lock ./package-lock.json \
--output node-packages.nix \
--composition node-composition.nix \

rm package.json package-lock.json
17 changes: 17 additions & 0 deletions pkgs/desktops/gnome/extensions/material-shell/node-composition.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# This file has been generated by node2nix 1.9.0. Do not edit!

{pkgs ? import <nixpkgs> {
inherit system;
}, system ? builtins.currentSystem, nodejs ? pkgs."nodejs-12_x"}:

let
nodeEnv = import ../../../../development/node-packages/node-env.nix {
inherit (pkgs) stdenv lib python2 runCommand writeTextFile;
inherit pkgs nodejs;
libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null;
};
in
import ./node-packages.nix {
inherit (pkgs) fetchurl nix-gitignore stdenv lib fetchgit;
inherit nodeEnv;
}
Loading