This is a nixpkgs derivation of jsplacement. Because it uses electron_4
I've decided against any effort to publish it into nixpkgs
itself, but at least being here someone can add it to their Direnv default.nix or home-manager or similar.
Last active
March 21, 2021 15:50
-
-
Save Shou/a913f0c5af2a2715054a59c138ef2087 to your computer and use it in GitHub Desktop.
jsplacement nixpkg
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Use `callPackage` to "inject" these argument dependencies | |
# i.e. `callPackage ./jsplacement.nix {}` | |
{ lib | |
, stdenv | |
, electron_4 | |
, fetchurl | |
, gcc-unwrapped | |
, makeWrapper | |
, swiftshader | |
, unzip | |
}: | |
let | |
electron = electron_4; | |
ldLibraries = lib.makeLibraryPath [ | |
gcc-unwrapped | |
swiftshader | |
]; | |
in stdenv.mkDerivation rec { | |
pname = "jsplacement"; | |
version = "1.3.0"; | |
src = fetchurl { | |
url = "https://windmillart.net/download/JSplacement-${version}.zip"; | |
sha256 = "17a6yrw0kjnnk4ymcpplpcfw07n34hrklzqbjnc8cy29csciavc4"; | |
}; | |
nativeBuildInputs = [ makeWrapper ]; | |
dontBuild = true; | |
dontConfigure = true; | |
unpackPhase = "${unzip}/bin/unzip $src"; | |
installPhase = '' | |
runHook preInstall | |
mkdir -p $out/bin $out/share/${pname} | |
cp -a {locales,resources} $out/share/${pname} | |
runHook postInstall | |
''; | |
postFixup = '' | |
makeWrapper ${electron}/bin/electron $out/bin/${pname} \ | |
--add-flags $out/share/${pname}/resources/app.asar \ | |
--prefix LD_LIBRARY_PATH : "${ldLibraries}" | |
''; | |
meta = with lib; { | |
description = "JSplacement is a cross-platform pseudo-random 8K displacement map generator written in HTML and JavaScript and built on Electron."; | |
homepage = "https://windmillart.net/?p=jsplacement"; | |
license = licenses.unfree; | |
maintainers = with maintainers; [ shou ]; | |
platforms = [ "x86_64-linux" ]; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment