mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-20 20:03:24 +00:00
commit
c5692758b5
57
pkgs/development/tools/node-webkit/nw11.nix
Normal file
57
pkgs/development/tools/node-webkit/nw11.nix
Normal file
@ -0,0 +1,57 @@
|
||||
{ stdenv, fetchurl, buildEnv, makeWrapper
|
||||
, xlibs, alsaLib, dbus, glib, gtk, atk, pango, freetype, fontconfig
|
||||
, gdk_pixbuf, cairo, zlib, nss, nssTools, nspr, gconf, expat, udev, libcap
|
||||
, libnotify}:
|
||||
let
|
||||
bits = if stdenv.system == "x86_64-linux" then "x64"
|
||||
else "ia32";
|
||||
|
||||
nwEnv = buildEnv {
|
||||
name = "node-webkit-env";
|
||||
paths = [
|
||||
xlibs.libX11 xlibs.libXrender glib gtk atk pango cairo gdk_pixbuf
|
||||
freetype fontconfig xlibs.libXcomposite alsaLib xlibs.libXdamage
|
||||
xlibs.libXext xlibs.libXfixes nss nspr gconf expat dbus stdenv.cc
|
||||
xlibs.libXtst xlibs.libXi xlibs.libXcursor xlibs.libXrandr libcap
|
||||
libnotify
|
||||
];
|
||||
};
|
||||
|
||||
in stdenv.mkDerivation rec {
|
||||
name = "node-webkit-${version}";
|
||||
version = "0.11.2";
|
||||
|
||||
src = fetchurl {
|
||||
url = "http://dl.node-webkit.org/v${version}/node-webkit-v${version}-linux-${bits}.tar.gz";
|
||||
sha256 = if bits == "x64" then
|
||||
"1iby0yrnbk9xfcsfz59f6g00l6rxiyxvq78shs0c145ky7lknq5q" else
|
||||
"1hk3c9z3kwmqaj87vc5k1a7fv8jhkyqw1wjmsl3q5i50w880h398";
|
||||
};
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/share/node-webkit
|
||||
cp -R * $out/share/node-webkit
|
||||
|
||||
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $out/share/node-webkit/nw
|
||||
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $out/share/node-webkit/nwsnapshot
|
||||
|
||||
ln -s ${udev}/lib/libudev.so $out/share/node-webkit/libudev.so.0
|
||||
|
||||
patchelf --set-rpath "${nwEnv}/lib:${nwEnv}/lib64:$out/share/node-webkit" $out/share/node-webkit/nw
|
||||
patchelf --set-rpath "${nwEnv}/lib:${nwEnv}/lib64:$out/share/node-webkit" $out/share/node-webkit/nwsnapshot
|
||||
|
||||
mkdir -p $out/bin
|
||||
ln -s $out/share/node-webkit/nw $out/bin
|
||||
ln -s $out/share/node-webkit/nwsnapshot $out/bin
|
||||
'';
|
||||
|
||||
buildInputs = [ makeWrapper ];
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description = "An app runtime based on Chromium and node.js";
|
||||
homepage = https://github.com/rogerwang/node-webkit;
|
||||
platforms = ["i686-linux" "x86_64-linux"];
|
||||
maintainers = [ maintainers.offline ];
|
||||
license = licenses.bsd3;
|
||||
};
|
||||
}
|
53
pkgs/tools/package-management/nixui/default.nix
Normal file
53
pkgs/tools/package-management/nixui/default.nix
Normal file
@ -0,0 +1,53 @@
|
||||
{ stdenv, pkgs, fetchgit, nix, node_webkit, config, makeDesktopItem, writeScript
|
||||
, profilePaths ? (config.nixui.profilePaths or ["/nix/var/nix/profiles"])
|
||||
, dataDir ? (config.nixui.dataDir or "/tmp")
|
||||
, configurations ? (config.nixui.configurations or ["/etc/nixos/configuration.nix"])
|
||||
, NIX_PATH ? (config.nixui.NIX_PATH or "/nix/var/nix/profiles/per-user/root/channels/nixos:nixpkgs=/etc/nixos/nixpkgs:nixos-config=/etc/nixos/configuration.nix") }:
|
||||
let
|
||||
version = "0.1.0";
|
||||
src = fetchgit {
|
||||
url = "git://github.com/matejc/nixui.git";
|
||||
rev = "refs/tags/${version}";
|
||||
sha256 = "198inv8ih751fc1l4dvjp9p6k4kfacikab61v6f604d45psnk6qf";
|
||||
};
|
||||
nixui = (import "${src}/default.nix" { nixui = src; inherit pkgs; }).build;
|
||||
script = writeScript "nixui" ''
|
||||
#! ${stdenv.shell}
|
||||
export PATH="${nix}/bin:\$PATH"
|
||||
export NIXUI_CONFIG="${config}"
|
||||
${node_webkit}/bin/nw ${nixui}/lib/node_modules/nixui/
|
||||
'';
|
||||
config = builtins.toFile "config.json" ''
|
||||
{
|
||||
"profilePaths": ${builtins.toJSON profilePaths},
|
||||
"dataDir": "${dataDir}",
|
||||
"configurations": ${builtins.toJSON configurations},
|
||||
"NIX_PATH": "${NIX_PATH}"
|
||||
}
|
||||
'';
|
||||
desktop = makeDesktopItem {
|
||||
name = "nixui";
|
||||
exec = script;
|
||||
icon = "${nixui}/lib/node_modules/nixui/img/128.png";
|
||||
desktopName = "NixUI";
|
||||
genericName = "NixUI";
|
||||
};
|
||||
in
|
||||
stdenv.mkDerivation rec {
|
||||
name = "nixui-${version}";
|
||||
inherit version src;
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
ln -s ${script} $out/bin/nixui
|
||||
|
||||
mkdir -p $out/share/applications
|
||||
ln -s ${desktop}/share/applications/* $out/share/applications/
|
||||
'';
|
||||
meta = {
|
||||
description = "NodeWebkit user interface for Nix";
|
||||
homepage = https://github.com/matejc/nixui;
|
||||
license = stdenv.lib.licenses.bsd2;
|
||||
maintainers = [ stdenv.lib.maintainers.matejc ];
|
||||
platforms = stdenv.lib.platforms.unix;
|
||||
};
|
||||
}
|
@ -4795,7 +4795,13 @@ let
|
||||
pythonPackages = python3Packages;
|
||||
};
|
||||
|
||||
node_webkit = callPackage ../development/tools/node-webkit {
|
||||
node_webkit = node_webkit_0_9;
|
||||
|
||||
node_webkit_0_11 = callPackage ../development/tools/node-webkit/nw11.nix {
|
||||
gconf = pkgs.gnome.GConf;
|
||||
};
|
||||
|
||||
node_webkit_0_9 = callPackage ../development/tools/node-webkit/nw9.nix {
|
||||
gconf = pkgs.gnome.GConf;
|
||||
};
|
||||
|
||||
@ -12888,6 +12894,8 @@ let
|
||||
|
||||
nixopsUnstable = callPackage ../tools/package-management/nixops/unstable.nix { };
|
||||
|
||||
nixui = callPackage ../tools/package-management/nixui { node_webkit = node_webkit_0_11; };
|
||||
|
||||
nix-prefetch-scripts = callPackage ../tools/package-management/nix-prefetch-scripts { };
|
||||
|
||||
nix-repl = callPackage ../tools/package-management/nix-repl { };
|
||||
|
Loading…
Reference in New Issue
Block a user