Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 4a575521a3a8
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 04750438fcf9
Choose a head ref
  • 3 commits
  • 2 files changed
  • 2 contributors

Commits on Jan 15, 2020

  1. Copy the full SHA
    05a507e View commit details
  2. Copy the full SHA
    c08aa3c View commit details
  3. nmap: fix zenmap, reduce vendored libraries (#77753)

    nmap: fix zenmap, reduce vendored libraries
    Mic92 authored Jan 15, 2020
    Copy the full SHA
    0475043 View commit details
Showing with 26 additions and 31 deletions.
  1. +8 −6 pkgs/development/libraries/liblinear/default.nix
  2. +18 −25 pkgs/tools/security/nmap/default.nix
14 changes: 8 additions & 6 deletions pkgs/development/libraries/liblinear/default.nix
Original file line number Diff line number Diff line change
@@ -18,17 +18,19 @@ stdenv.mkDerivation rec {
libSuff = stdenv.hostPlatform.extensions.sharedLibrary;
in ''
mkdir -p $out/lib $out/bin $out/include
cp liblinear.so.3 $out/lib/liblinear.3${libSuff}
ln -s $out/lib/liblinear.3${libSuff} $out/lib/liblinear${libSuff}
${if stdenv.isDarwin then ''
cp liblinear.so.3 $out/lib/liblinear.3.dylib
ln -s $out/lib/liblinear.3.dylib $out/lib/liblinear.dylib
install_name_tool -id liblinear.3.dylib $out/lib/liblinear.3.dylib
'' else ''
cp liblinear.so.3 $out/lib/liblinear.so.3
ln -s $out/lib/liblinear.so.3 $out/lib/liblinear.so
''}
cp train $out/bin/liblinear-train
cp predict $out/bin/liblinear-predict
cp linear.h $out/include
'';

postFixup = stdenv.lib.optionalString stdenv.isDarwin ''
install_name_tool -id liblinear.3.dylib $out/lib/liblinear.3.dylib
'';

meta = with stdenv.lib; {
description = "A library for large linear classification";
homepage = https://www.csie.ntu.edu.tw/~cjlin/liblinear/;
43 changes: 18 additions & 25 deletions pkgs/tools/security/nmap/default.nix
Original file line number Diff line number Diff line change
@@ -1,24 +1,16 @@
{ stdenv, fetchurl, fetchpatch, libpcap, pkgconfig, openssl, lua5_3
, pcre, liblinear, libssh2
, graphicalSupport ? false
, libX11 ? null
, gtk2 ? null
, withPython ? false # required for the `ndiff` binary
, python2Packages ? null
, python2 ? null
, makeWrapper ? null
, withLua ? true
}:

assert withPython -> python2Packages != null;

with stdenv.lib;

let

# Zenmap (the graphical program) also requires Python,
# so automatically enable pythonSupport if graphicalSupport is requested.
pythonSupport = withPython || graphicalSupport;

in stdenv.mkDerivation rec {
stdenv.mkDerivation rec {
name = "nmap${optionalString graphicalSupport "-graphical"}-${version}";
version = "7.80";

@@ -48,29 +40,30 @@ in stdenv.mkDerivation rec {

configureFlags = [
(if withLua then "--with-liblua=${lua5_3}" else "--without-liblua")
]
++ optional (!pythonSupport) "--without-ndiff"
++ optional (!graphicalSupport) "--without-zenmap"
;
] ++ optionals (!graphicalSupport) [ "--without-ndiff" "--without-zenmap" ];

makeFlags = optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
"AR=${stdenv.cc.bintools.targetPrefix}ar"
"RANLIB=${stdenv.cc.bintools.targetPrefix}ranlib"
"CC=${stdenv.cc.targetPrefix}gcc"
];

postInstall = optionalString pythonSupport ''
wrapProgram $out/bin/ndiff --prefix PYTHONPATH : "$(toPythonPath $out)" --prefix PYTHONPATH : "$PYTHONPATH"
'' + optionalString graphicalSupport ''
wrapProgram $out/bin/zenmap --prefix PYTHONPATH : "$(toPythonPath $out)" --prefix PYTHONPATH : "$PYTHONPATH" --prefix PYTHONPATH : $(toPythonPath $pygtk)/gtk-2.0 --prefix PYTHONPATH : $(toPythonPath $pygobject)/gtk-2.0 --prefix PYTHONPATH : $(toPythonPath $pycairo)/gtk-2.0
pythonPath = with python2.pkgs; optionals graphicalSupport [
pygtk pysqlite pygobject2 pycairo
];

nativeBuildInputs = [ pkgconfig ] ++ optionals graphicalSupport [ python2.pkgs.wrapPython ];
buildInputs = [ pcre liblinear libssh2 libpcap openssl ] ++ optionals graphicalSupport (with python2.pkgs; [
python2 libX11 gtk2
]);

postInstall = optionalString graphicalSupport ''
buildPythonPath "$out $pythonPath"
patchPythonScript $out/bin/ndiff
patchPythonScript $out/bin/zenmap
'';

nativeBuildInputs = [ pkgconfig ];
buildInputs = with python2Packages; [ libpcap openssl ]
++ optionals pythonSupport [ makeWrapper python ]
++ optionals graphicalSupport [
libX11 gtk2 pygtk pysqlite pygobject2 pycairo
];
enableParallelBuilding = true;

doCheck = false; # fails 3 tests, probably needs the net