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

67 lines
1.9 KiB
Nix
Raw Normal View History

2017-08-10 03:57:42 +01:00
{ stdenv, fetchFromGitHub, makeWrapper, qt4, utillinux, coreutils, which, qmake4Hook
2015-09-14 22:11:34 +01:00
, p7zip, mtools, syslinux }:
2015-09-14 22:11:34 +01:00
stdenv.mkDerivation rec {
name = "unetbootin-${version}";
2017-08-10 03:57:42 +01:00
version = "655";
2017-08-10 03:57:42 +01:00
src = fetchFromGitHub {
owner = "unetbootin";
repo = "unetbootin";
rev = version;
sha256 = "1gis75vy172k7lgh8bwgap74s259y9x1wg3rkqhhqncl2vv0w1py";
};
2017-08-10 03:57:42 +01:00
sourceRoot = "${name}-src/src/unetbootin";
2017-08-10 03:57:42 +01:00
buildInputs = [ qt4 ];
nativeBuildInputs = [ makeWrapper qmake4Hook ];
enableParallelBuilding = true;
# Lots of nice hard-coded paths...
2017-08-10 03:57:42 +01:00
postPatch = ''
2015-09-14 22:11:34 +01:00
substituteInPlace unetbootin.cpp \
2017-08-10 03:57:42 +01:00
--replace /bin/df ${coreutils}/bin/df \
--replace /sbin/blkid ${utillinux}/sbin/blkid \
--replace /sbin/fdisk ${utillinux}/sbin/fdisk \
--replace /sbin/sfdisk ${utillinux}/sbin/sfdisk \
--replace /usr/bin/syslinux ${syslinux}/bin/syslinux \
--replace /usr/bin/extlinux ${syslinux}/sbin/extlinux \
2015-09-14 22:11:34 +01:00
--replace /usr/share/syslinux ${syslinux}/share/syslinux
2017-08-10 03:57:42 +01:00
2015-09-14 22:11:34 +01:00
substituteInPlace main.cpp \
--replace /usr/share/unetbootin $out/share/unetbootin
2017-08-10 03:57:42 +01:00
2015-09-14 22:11:34 +01:00
substituteInPlace unetbootin.desktop \
--replace /usr/bin $out/bin
'';
2016-04-17 00:52:24 +01:00
preConfigure = ''
2015-09-14 22:11:34 +01:00
lupdate unetbootin.pro
lrelease unetbootin.pro
'';
installPhase = ''
mkdir -p $out/bin
cp unetbootin $out/bin
mkdir -p $out/share/unetbootin
cp unetbootin_*.qm $out/share/unetbootin
mkdir -p $out/share/applications
cp unetbootin.desktop $out/share/applications
wrapProgram $out/bin/unetbootin \
2017-08-10 03:57:42 +01:00
--prefix PATH : ${stdenv.lib.makeBinPath [ mtools p7zip which ]} \
2017-05-20 19:41:03 +01:00
--set QT_X11_NO_MITSHM 1
2015-09-14 22:11:34 +01:00
'';
meta = with stdenv.lib; {
2017-08-10 03:57:42 +01:00
homepage = http://unetbootin.sourceforge.net/;
description = "A tool to create bootable live USB drives from ISO images";
2017-08-10 03:57:42 +01:00
license = licenses.gpl2Plus;
platforms = platforms.linux;
maintainers = with maintainers; [ ebzzry ];
};
}