multibootusb: patchelf syslinux, add missing dependencies

This commit is contained in:
Symphorien Gibol 2020-05-01 12:00:00 +00:00 committed by Bjørn Forsman
parent 69c6d18ae4
commit a68a408a7f

View File

@ -1,4 +1,5 @@
{ fetchFromGitHub, libxcb, mtools, p7zip, parted, procps,
{ fetchFromGitHub, libxcb, mtools, p7zip, parted, procps, qemu, unzip, zip,
coreutils, gnugrep, which, gnused, e2fsprogs, autoPatchelfHook, gptfdisk,
python36Packages, qt5, runtimeShell, stdenv, utillinux, wrapQtAppsHook }:
# Note: Multibootusb is tricky to maintain. It relies on the
@ -19,17 +20,30 @@ python36Packages.buildPythonApplication rec {
nativeBuildInputs = [
wrapQtAppsHook
autoPatchelfHook
unzip
zip
];
runTimeDeps = [
coreutils
gnugrep
which
parted
utillinux
qemu
p7zip
gnused
mtools
procps
e2fsprogs
gptfdisk
];
buildInputs = [
libxcb
mtools
p7zip
parted
procps
python36Packages.python
qt5.full
utillinux
];
src = fetchFromGitHub {
@ -52,6 +66,20 @@ python36Packages.buildPythonApplication rec {
python36Packages.six
];
# multibootusb ships zips with various versions of syslinux, we need to patchelf them
postPatch = ''
for zip in $(find . -name "*.zip"); do
zip=$(readlink -f $zip)
target="$(mktemp -d)"
pushd $target
unzip $zip
rm $zip
autoPatchelf .
zip -r $zip *
popd
done
'';
postInstall = ''
# This script doesn't work and it doesn't add much anyway
rm $out/bin/multibootusb-pkexec
@ -69,6 +97,9 @@ python36Packages.buildPythonApplication rec {
# Then, add the installed scripts/ directory to the python path
--prefix "PYTHONPATH" ":" "$out/lib/${python36Packages.python.libPrefix}/site-packages"
# Add some runtime dependencies
--prefix "PATH" ":" "${stdenv.lib.makeBinPath runTimeDeps}"
# Finally, move to directory that contains data
--run "cd $out/share/${pname}"
)