mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2025-01-06 13:16:40 +03:00
multibootusb: Fix QT and refactor
Also removed myself as maintainer because I don't care about this software anymore.
This commit is contained in:
parent
9c691e6fd7
commit
227c4c8b0b
@ -1,21 +1,33 @@
|
|||||||
{ stdenv, python36Packages, fetchFromGitHub, libxcb, mtools, p7zip, parted, procps, utillinux, qt5, runtimeShell }:
|
{ fetchFromGitHub, libxcb, mtools, p7zip, parted, procps,
|
||||||
|
python36Packages, qt5, runtimeShell, stdenv, utillinux, wrapQtAppsHook }:
|
||||||
|
|
||||||
|
# Note: Multibootusb is tricky to maintain. It relies on the
|
||||||
|
# $PYTHONPATH variable containing some of their code, so that
|
||||||
|
# something like:
|
||||||
|
#
|
||||||
|
# from scripts import config
|
||||||
|
#
|
||||||
|
# works. It also relies on the current directory to find some runtime
|
||||||
|
# resources thanks to a use of __file__.
|
||||||
|
#
|
||||||
|
# https://github.com/mbusb/multibootusb/blob/0d34d70c3868f1d7695cfd141141b17c075de967/scripts/osdriver.py#L59
|
||||||
|
|
||||||
python36Packages.buildPythonApplication rec {
|
python36Packages.buildPythonApplication rec {
|
||||||
pname = "multibootusb";
|
pname = "multibootusb";
|
||||||
name = "${pname}-${version}";
|
name = "${pname}-${version}";
|
||||||
version = "9.2.0";
|
version = "9.2.0";
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
wrapQtAppsHook
|
||||||
|
];
|
||||||
|
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
python36Packages.dbus-python
|
|
||||||
python36Packages.pyqt5
|
|
||||||
python36Packages.pytest-shutil
|
|
||||||
python36Packages.python
|
|
||||||
python36Packages.pyudev
|
|
||||||
python36Packages.six
|
|
||||||
libxcb
|
libxcb
|
||||||
mtools
|
mtools
|
||||||
p7zip
|
p7zip
|
||||||
parted
|
parted
|
||||||
procps
|
procps
|
||||||
|
python36Packages.python
|
||||||
qt5.full
|
qt5.full
|
||||||
utillinux
|
utillinux
|
||||||
];
|
];
|
||||||
@ -28,32 +40,42 @@ python36Packages.buildPythonApplication rec {
|
|||||||
sha256 = "0wlan0cp6c2i0nahixgpmkm0h4n518gj8rc515d579pqqp91p2h3";
|
sha256 = "0wlan0cp6c2i0nahixgpmkm0h4n518gj8rc515d579pqqp91p2h3";
|
||||||
};
|
};
|
||||||
|
|
||||||
# Skip the fixup stage where stuff is shrinked (can't shrink text files)
|
# Tests can't run inside the NixOS sandbox
|
||||||
phases = [ "unpackPhase" "installPhase" ];
|
# "Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory"
|
||||||
|
doCheck = false;
|
||||||
|
|
||||||
installPhase = ''
|
pythonPath = [
|
||||||
share="$out/share/${pname}"
|
python36Packages.dbus-python
|
||||||
mkdir -p "$share"
|
python36Packages.pyqt5
|
||||||
cp -r data "$share/data"
|
python36Packages.pytest-shutil
|
||||||
cp -r scripts "$share/scripts"
|
python36Packages.pyudev
|
||||||
cp "${pname}" "$share/${pname}"
|
python36Packages.six
|
||||||
|
];
|
||||||
|
|
||||||
mkdir "$out/bin"
|
makeWrapperArgs = [
|
||||||
cat > "$out/bin/${pname}" <<EOF
|
# Firstly, add all necessary QT variables
|
||||||
#!${runtimeShell}
|
"\${qtWrapperArgs[@]}"
|
||||||
cd "$share"
|
|
||||||
export PYTHONPATH="$PYTHONPATH:$share"
|
|
||||||
export PATH="$PATH:${parted}/bin:${procps}/bin"
|
|
||||||
|
|
||||||
"${python36Packages.python}/bin/python" "${pname}"
|
# Then, add the installed scripts/ directory to the python path
|
||||||
EOF
|
"--prefix" "PYTHONPATH" ":" "$out/lib/${python36Packages.python.libPrefix}/site-packages"
|
||||||
chmod +x "$out/bin/${pname}"
|
|
||||||
|
# Finally, move to directory that contains data
|
||||||
|
"--run" "\"cd $out/share/${pname}\""
|
||||||
|
];
|
||||||
|
|
||||||
|
postInstall = ''
|
||||||
|
# This script doesn't work and it doesn't add much anyway
|
||||||
|
rm $out/bin/multibootusb-pkexec
|
||||||
|
|
||||||
|
# The installed data isn't sufficient for whatever reason, missing gdisk/gdisk.exe
|
||||||
|
mkdir -p "$out/share/${pname}"
|
||||||
|
cp -r data "$out/share/${pname}/data"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
description = "Multiboot USB creator for Linux live disks";
|
description = "Multiboot USB creator for Linux live disks";
|
||||||
homepage = http://multibootusb.org/;
|
homepage = http://multibootusb.org/;
|
||||||
license = licenses.gpl2;
|
license = licenses.gpl2;
|
||||||
maintainers = with maintainers; [ jD91mZM2 ];
|
maintainers = []; # Looking for a maintainer!
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -19012,7 +19012,7 @@ in
|
|||||||
|
|
||||||
moe = callPackage ../applications/editors/moe { };
|
moe = callPackage ../applications/editors/moe { };
|
||||||
|
|
||||||
multibootusb = callPackage ../applications/misc/multibootusb {};
|
multibootusb = qt5.callPackage ../applications/misc/multibootusb {};
|
||||||
|
|
||||||
praat = callPackage ../applications/audio/praat { };
|
praat = callPackage ../applications/audio/praat { };
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user