mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-23 15:33:13 +00:00
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
44 lines
1.2 KiB
Nix
44 lines
1.2 KiB
Nix
{ stdenv, fetchurl, lib, libX11, libXext, alsaLib, freetype, brand, type, version, homepage, url, sha256, ... }:
|
|
stdenv.mkDerivation rec {
|
|
inherit type;
|
|
baseName = "${type}-Edit";
|
|
name = "${lib.toLower baseName}-${version}";
|
|
|
|
src = fetchurl {
|
|
inherit url;
|
|
inherit sha256;
|
|
};
|
|
|
|
sourceRoot = ".";
|
|
dontBuild = true;
|
|
dontStrip = true;
|
|
|
|
installPhase = ''
|
|
mkdir -p $out/bin
|
|
cp ${baseName} $out/bin
|
|
'';
|
|
preFixup = let
|
|
# we prepare our library path in the let clause to avoid it become part of the input of mkDerivation
|
|
libPath = lib.makeLibraryPath [
|
|
libX11 # libX11.so.6
|
|
libXext # libXext.so.6
|
|
alsaLib # libasound.so.2
|
|
freetype # libfreetype.so.6
|
|
stdenv.cc.cc.lib # libstdc++.so.6
|
|
];
|
|
in ''
|
|
patchelf \
|
|
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
|
--set-rpath "${libPath}" \
|
|
$out/bin/${baseName}
|
|
'';
|
|
|
|
meta = with lib; {
|
|
inherit homepage;
|
|
description = "Editor for the ${brand} ${type} digital mixer";
|
|
license = licenses.unfree;
|
|
platforms = platforms.linux;
|
|
maintainers = [ maintainers.magnetophon ];
|
|
};
|
|
}
|