nixpkgs-suyu/pkgs/tools/cd-dvd/unetbootin/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

85 lines
1.9 KiB
Nix
Raw Normal View History

2021-07-05 10:58:40 +02:00
{ lib
, stdenv
, coreutils
, fetchFromGitHub
, mtools
, p7zip
, wrapQtAppsHook
, qtbase
, qttools
, qmake
2021-07-05 10:58:40 +02:00
, syslinux
, util-linux
, which
}:
2015-09-14 23:11:34 +02:00
stdenv.mkDerivation rec {
pname = "unetbootin";
2021-07-05 10:58:40 +02:00
version = "702";
2017-08-10 04:57:42 +02:00
src = fetchFromGitHub {
2021-07-05 10:58:40 +02:00
owner = pname;
repo = pname;
rev = version;
sha256 = "sha256-psX15XicPXAsd36BhuvK0G3GQS8hV/hazzO0HByCqV4=";
};
setSourceRoot = ''
sourceRoot=$(echo */src/unetbootin)
'';
2021-07-05 10:58:40 +02:00
buildInputs = [
qtbase
qttools
qmake
2021-07-05 10:58:40 +02:00
];
nativeBuildInputs = [ wrapQtAppsHook ];
# Lots of nice hard-coded paths...
2017-08-10 04:57:42 +02:00
postPatch = ''
2015-09-14 23:11:34 +02:00
substituteInPlace unetbootin.cpp \
2017-08-10 04:57:42 +02:00
--replace /bin/df ${coreutils}/bin/df \
2020-11-24 16:29:28 +01:00
--replace /sbin/blkid ${util-linux}/sbin/blkid \
--replace /sbin/fdisk ${util-linux}/sbin/fdisk \
--replace /sbin/sfdisk ${util-linux}/sbin/sfdisk \
2017-08-10 04:57:42 +02:00
--replace /usr/bin/syslinux ${syslinux}/bin/syslinux \
--replace /usr/bin/extlinux ${syslinux}/sbin/extlinux \
2015-09-14 23:11:34 +02:00
--replace /usr/share/syslinux ${syslinux}/share/syslinux
2017-08-10 04:57:42 +02:00
2015-09-14 23:11:34 +02:00
substituteInPlace main.cpp \
--replace /usr/share/unetbootin $out/share/unetbootin
2017-08-10 04:57:42 +02:00
2015-09-14 23:11:34 +02:00
substituteInPlace unetbootin.desktop \
--replace /usr/bin $out/bin
'';
2016-04-17 01:52:24 +02:00
preConfigure = ''
2015-09-14 23:11:34 +02:00
lupdate unetbootin.pro
lrelease unetbootin.pro
'';
installPhase = ''
runHook preInstall
2015-09-14 23:11:34 +02:00
install -Dm755 -t $out/bin unetbootin
install -Dm644 -t $out/share/unetbootin unetbootin_*.qm
install -Dm644 -t $out/share/applications unetbootin.desktop
2015-09-14 23:11:34 +02:00
runHook postInstall
2015-09-14 23:11:34 +02:00
'';
2021-07-05 10:58:40 +02:00
qtWrapperArgs = [
"--prefix PATH : ${lib.makeBinPath [ mtools p7zip which ]}"
"--set QT_X11_NO_MITSHM 1"
];
meta = with lib; {
description = "A tool to create bootable live USB drives from ISO images";
homepage = "https://unetbootin.github.io/";
2021-07-05 10:58:40 +02:00
license = licenses.gpl2Plus;
2017-08-10 04:57:42 +02:00
maintainers = with maintainers; [ ebzzry ];
2021-07-05 10:58:40 +02:00
platforms = platforms.linux;
};
}