nixpkgs/pkgs/tools/misc/staruml/default.nix
Profpatsch 4a7f99d55d treewide: with stdenv.lib; in meta -> with lib;
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
2021-01-11 10:38:22 +01:00

56 lines
1.6 KiB
Nix

{ stdenv, lib, fetchurl, makeWrapper
, dpkg, patchelf
, gtk2, glib, gdk-pixbuf, alsaLib, nss, nspr, GConf, cups, libgcrypt, dbus, systemd
, libXdamage, expat }:
let
inherit (stdenv) lib;
LD_LIBRARY_PATH = lib.makeLibraryPath
[ glib gtk2 gdk-pixbuf alsaLib nss nspr GConf cups libgcrypt dbus libXdamage expat ];
in
stdenv.mkDerivation rec {
version = "2.8.1";
pname = "staruml";
src =
if stdenv.hostPlatform.system == "i686-linux" then fetchurl {
url = "https://s3.amazonaws.com/staruml-bucket/releases-v2/StarUML-v${version}-32-bit.deb";
sha256 = "0vb3k9m3l6pmsid4shlk0xdjsriq3gxzm8q7l04didsppg0vvq1n";
} else fetchurl {
url = "https://s3.amazonaws.com/staruml-bucket/releases-v2/StarUML-v${version}-64-bit.deb";
sha256 = "05gzrnlssjkhyh0wv019d4r7p40lxnsa1sghazll6f233yrqmxb0";
};
nativeBuildInputs = [ makeWrapper dpkg ];
unpackPhase = ''
mkdir pkg
dpkg-deb -x $src pkg
sourceRoot=pkg
'';
installPhase = ''
mkdir $out
mv opt/staruml $out/bin
mkdir -p $out/lib
ln -s ${stdenv.cc.cc.lib}/lib/libstdc++.so.6 $out/lib/
ln -s ${lib.getLib systemd}/lib/libudev.so.1 $out/lib/libudev.so.0
for binary in StarUML Brackets-node; do
${patchelf}/bin/patchelf \
--interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
$out/bin/$binary
wrapProgram $out/bin/$binary \
--prefix LD_LIBRARY_PATH : $out/lib:${LD_LIBRARY_PATH}
done
'';
meta = with lib; {
description = "A sophisticated software modeler";
homepage = "https://staruml.io/";
license = licenses.unfree;
platforms = [ "i686-linux" "x86_64-linux" ];
};
}