mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-28 07:43:43 +00:00
4f0dadbf38
After final improvements to the official formatter implementation, this commit now performs the first treewide reformat of Nix files using it. This is part of the implementation of RFC 166. Only "inactive" files are reformatted, meaning only files that aren't being touched by any PR with activity in the past 2 months. This is to avoid conflicts for PRs that might soon be merged. Later we can do a full treewide reformat to get the rest, which should not cause as many conflicts. A CI check has already been running for some time to ensure that new and already-formatted files are formatted, so the files being reformatted here should also stay formatted. This commit was automatically created and can be verified using nix-builda08b3a4d19
.tar.gz \ --argstr baseRevb32a094368
result/bin/apply-formatting $NIXPKGS_PATH
73 lines
1.8 KiB
Nix
73 lines
1.8 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
fetchFromGitLab,
|
|
pkg-config,
|
|
wrapGAppsHook3,
|
|
withLibui ? true,
|
|
gtk3,
|
|
withUdisks ? stdenv.hostPlatform.isLinux,
|
|
udisks,
|
|
glib,
|
|
libX11,
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "usbimager";
|
|
version = "1.0.10";
|
|
|
|
src = fetchFromGitLab {
|
|
owner = "bztsrc";
|
|
repo = pname;
|
|
rev = version;
|
|
hash = "sha256-HTFopc2xrhp0XYubQtOwMKWTQ+3JSKAyL4mMyQ82kAs=";
|
|
};
|
|
|
|
sourceRoot = "${src.name}/src";
|
|
|
|
nativeBuildInputs = [
|
|
pkg-config
|
|
wrapGAppsHook3
|
|
];
|
|
buildInputs =
|
|
lib.optionals withUdisks [
|
|
udisks
|
|
glib
|
|
]
|
|
++ lib.optional (!withLibui) libX11
|
|
++ lib.optional withLibui gtk3;
|
|
# libui is bundled with the source of usbimager as a compiled static library
|
|
|
|
postPatch = ''
|
|
sed -i \
|
|
-e 's|install -m 2755 -g disk|install |g' \
|
|
-e 's|-I/usr/include/gio-unix-2.0|-I${glib.dev}/include/gio-unix-2.0|g' \
|
|
-e 's|install -m 2755 -g $(GRP)|install |g' Makefile
|
|
'';
|
|
|
|
postInstall = ''
|
|
substituteInPlace $out/share/applications/usbimager.desktop \
|
|
--replace-fail "Exec=/usr/bin/usbimager" "Exec=usbimager"
|
|
'';
|
|
|
|
dontConfigure = true;
|
|
|
|
makeFlags =
|
|
[ "PREFIX=$(out)" ]
|
|
++ lib.optional withLibui "USE_LIBUI=yes"
|
|
++ lib.optional withUdisks "USE_UDISKS2=yes";
|
|
|
|
meta = with lib; {
|
|
description = "Very minimal GUI app that can write compressed disk images to USB drives";
|
|
homepage = "https://gitlab.com/bztsrc/usbimager";
|
|
license = licenses.mit;
|
|
maintainers = with maintainers; [ vdot0x23 ];
|
|
# windows and darwin could work, but untested
|
|
# feel free add them if you have a machine to test
|
|
platforms = with platforms; linux;
|
|
# never built on aarch64-linux since first introduction in nixpkgs
|
|
broken = stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64;
|
|
mainProgram = "usbimager";
|
|
};
|
|
}
|