summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorFrederik Rietdijk <freddyrietdijk@fridh.nl>2017-12-22 08:40:10 +0000
committerGitHub <noreply@github.com>2017-12-22 08:40:10 +0000
commit7a0fab39f063e6d9eed020392319b7374ad5c44f (patch)
tree384493548aa64d578964fecffd216132b27176ee /pkgs
parent472dd7b0ad9cae1e0329dfaaf7ba32ba9fe9e2cd (diff)
parent4ef36bf65494b6f0117dec6d238ac4575461d6b0 (diff)
downloadnixlib-7a0fab39f063e6d9eed020392319b7374ad5c44f.tar
nixlib-7a0fab39f063e6d9eed020392319b7374ad5c44f.tar.gz
nixlib-7a0fab39f063e6d9eed020392319b7374ad5c44f.tar.bz2
nixlib-7a0fab39f063e6d9eed020392319b7374ad5c44f.tar.lz
nixlib-7a0fab39f063e6d9eed020392319b7374ad5c44f.tar.xz
nixlib-7a0fab39f063e6d9eed020392319b7374ad5c44f.tar.zst
nixlib-7a0fab39f063e6d9eed020392319b7374ad5c44f.zip
Merge pull request #32965 from andersk/woeusb
winusb: unstable-2017-01-30 -> woeusb 3.1.4
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/tools/misc/winusb/default.nix35
-rw-r--r--pkgs/tools/misc/woeusb/default.nix57
-rw-r--r--pkgs/top-level/aliases.nix1
-rw-r--r--pkgs/top-level/all-packages.nix2
4 files changed, 59 insertions, 36 deletions
diff --git a/pkgs/tools/misc/winusb/default.nix b/pkgs/tools/misc/winusb/default.nix
deleted file mode 100644
index b99d77dd70fc..000000000000
--- a/pkgs/tools/misc/winusb/default.nix
+++ /dev/null
@@ -1,35 +0,0 @@
-{ stdenv, fetchFromGitHub, makeWrapper
-, parted, grub2_light, p7zip
-, wxGTK30, gksu }:
-
-stdenv.mkDerivation rec {
-  name = "winusb-unstable-2017-01-30";
-
-  src = fetchFromGitHub {
-    owner = "slacka";
-    repo = "WinUSB";
-    rev = "599f00cdfd5c931056c576e4b2ae04d9285c4192";
-    sha256 = "1219425d1m4463jy85nrc5xz5qy5m8svidbiwnqicy7hp8pdwa7x";
-  };
-
-  buildInputs = [ wxGTK30 makeWrapper ];
-
-  postInstall = ''
-    # don't write data into /
-    substituteInPlace $out/bin/winusb \
-      --replace /media/ /tmp/winusb/
-
-    wrapProgram $out/bin/winusb \
-      --prefix PATH : ${stdenv.lib.makeBinPath [ parted grub2_light p7zip ]}
-    wrapProgram $out/bin/winusbgui \
-      --prefix PATH : ${stdenv.lib.makeBinPath [ gksu ]}
-  '';
-
-  meta = with stdenv.lib; {
-    description = "Create bootable USB disks from Windows ISO images";
-    homepage = https://github.com/slacka/WinUSB;
-    license = licenses.gpl3;
-    maintainers = with maintainers; [ bjornfor gnidorah ];
-    platforms = platforms.linux;
-  };
-}
diff --git a/pkgs/tools/misc/woeusb/default.nix b/pkgs/tools/misc/woeusb/default.nix
new file mode 100644
index 000000000000..436a252e678d
--- /dev/null
+++ b/pkgs/tools/misc/woeusb/default.nix
@@ -0,0 +1,57 @@
+{ stdenv, fetchFromGitHub, autoreconfHook, makeWrapper
+, coreutils, dosfstools, findutils, gawk, gnugrep, grub2_light, ncurses, ntfs3g, parted, utillinux, wget
+, wxGTK30 }:
+
+stdenv.mkDerivation rec {
+  version = "3.1.4";
+  name = "woeusb-${version}";
+
+  src = fetchFromGitHub {
+    owner = "slacka";
+    repo = "WoeUSB";
+    rev = "v${version}";
+    sha256 = "0hvxsm6k6s29wnr3i5b9drf6ml0i32is2l50l3cxvf1f499w4bpc";
+  };
+
+  buildInputs = [ wxGTK30 autoreconfHook makeWrapper ];
+
+  postPatch = ''
+    # Emulate version smudge filter (see .gitattributes, .gitconfig).
+    for file in configure.ac debian/changelog src/woeusb src/woeusb.1 src/woeusbgui.1; do
+      substituteInPlace "$file" \
+        --replace '@@WOEUSB_VERSION@@' '${version}'
+    done
+
+    substituteInPlace src/MainPanel.cpp \
+      --replace "'woeusb " "'$out/bin/woeusb "
+  '';
+
+  postInstall = ''
+    # don't write data into /
+    substituteInPlace "$out/bin/woeusb" \
+      --replace /media/ /run/woeusb/
+
+    # woeusbgui launches woeusb with pkexec, which sets
+    # PATH=/usr/sbin:/usr/bin:/sbin:/bin:/root/bin.  Perhaps pkexec
+    # should be patched with a less useless default PATH, but for now
+    # we add everything we need manually.
+    wrapProgram "$out/bin/woeusb" \
+      --set PATH '${stdenv.lib.makeBinPath [ coreutils dosfstools findutils gawk gnugrep grub2_light ncurses ntfs3g parted utillinux wget ]}'
+  '';
+
+  doInstallCheck = true;
+
+  postInstallCheck = ''
+    # woeusb --version checks for missing runtime dependencies.
+    out_version="$("$out/bin/woeusb" --version)"
+    [ "$out_version" = '${version}' ]
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Create bootable USB disks from Windows ISO images";
+    homepage = https://github.com/slacka/WoeUSB;
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ bjornfor gnidorah ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix
index ba22d0ff42e6..37d764205099 100644
--- a/pkgs/top-level/aliases.nix
+++ b/pkgs/top-level/aliases.nix
@@ -160,6 +160,7 @@ mapAliases (rec {
   vimprobable2Wrapper = vimprobable2; # added 2015-01
   virtviewer = virt-viewer; # added 2015-12-24
   vorbisTools = vorbis-tools; # added 2016-01-26
+  winusb = woeusb; # added 2017-12-22
   x11 = xlibsWrapper; # added 2015-09
   xf86_video_nouveau = xorg.xf86videonouveau; # added 2015-09
   xlibs = xorg; # added 2015-09
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 30b7b594cce0..944cdcda8faf 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -5216,7 +5216,7 @@ with pkgs;
 
   which = callPackage ../tools/system/which { };
 
-  winusb = callPackage ../tools/misc/winusb { };
+  woeusb = callPackage ../tools/misc/woeusb { };
 
   chase = callPackage ../tools/system/chase { };