4a7f99d55d
Part of: https://github.com/NixOS/nixpkgs/issues/108938 meta = with stdenv.lib; is a widely used pattern. We want to slowly remove the `stdenv.lib` indirection and encourage people to use `lib` directly. Thus let’s start with the meta field. This used a rewriting script to mostly automatically replace all occurances of this pattern, and add the `lib` argument to the package header if it doesn’t exist yet. The script in its current form is available at https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
58 lines
1.2 KiB
Nix
58 lines
1.2 KiB
Nix
{ fetchzip
|
|
, libX11
|
|
, libGLU, libGL
|
|
, makeWrapper
|
|
, lib, stdenv
|
|
}:
|
|
|
|
let
|
|
|
|
libPath = stdenv.lib.makeLibraryPath [
|
|
libGLU libGL
|
|
stdenv.cc.cc
|
|
libX11
|
|
];
|
|
|
|
inidir = "\\\${XDG_CONFIG_HOME:-\\$HOME/.config}/kisslicer";
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation {
|
|
name = "kisslicer-1.6.3";
|
|
|
|
src = fetchzip {
|
|
url = "http://www.kisslicer.com/uploads/1/5/3/8/15381852/kisslicer_linux64_1.6.3_release.zip";
|
|
sha256 = "1xmywj5jrcsqv1d5x3mphhvafs4mfm9l12npkhk7l03qxbwg9j82";
|
|
stripRoot = false;
|
|
};
|
|
|
|
phases = [ "unpackPhase" "installPhase" "fixupPhase" ];
|
|
|
|
buildInputs = [
|
|
makeWrapper
|
|
libGLU libGL
|
|
libX11
|
|
];
|
|
|
|
installPhase = ''
|
|
mkdir -p $out/bin
|
|
cp -p * $out/bin
|
|
'';
|
|
|
|
fixupPhase = ''
|
|
chmod 755 $out/bin/KISSlicer
|
|
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
|
--set-rpath ${libPath} $out/bin/KISSlicer
|
|
wrapProgram $out/bin/KISSlicer \
|
|
--add-flags "-inidir ${inidir}" \
|
|
--run "mkdir -p ${inidir}"
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "Convert STL files into Gcode";
|
|
homepage = "http://www.kisslicer.com";
|
|
license = licenses.unfree;
|
|
maintainers = [ maintainers.cransom ];
|
|
platforms = [ "x86_64-linux" ];
|
|
};
|
|
}
|