diff --git a/pkgs/by-name/ne/nettee/fix-cmake-output.patch b/pkgs/by-name/ne/nettee/fix-cmake-output.patch new file mode 100644 index 000000000000..205cfa36bc62 --- /dev/null +++ b/pkgs/by-name/ne/nettee/fix-cmake-output.patch @@ -0,0 +1,25 @@ +Index: a/CMakeLists.txt +=================================================================== +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -6,17 +6,18 @@ + SET(FS11 -D_POSIX_SOURCE) + endif (UNIX) + + #modify next line if a different installation target is required +-SET(CMAKE_INSTALL_PREFIX "/usr/local") +-SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_INSTALL_PREFIX}/bin) ++#SET(CMAKE_INSTALL_PREFIX "/usr/local") ++#SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_INSTALL_PREFIX}/bin) + add_executable(nettee nettee.c rb.c nio.c) + ###add_executable(stub_child_process stub_child_process.c rb.c nio.c) + ###add_executable(stub_parent_process stub_parent_process.c rb.c nio.c) + # + target_compile_options(nettee PRIVATE ${FS9} ${FS10} ${FS11}) + ###target_compile_options(stub_child_process PRIVATE ${FS9} ${FS11}) + ###target_compile_options(stub_parent_process PRIVATE ${FS9} ${FS11}) ++install(TARGETS nettee DESTINATION "${CMAKE_INSTALL_PREFIX}/bin") + # + ##################################################### + # + #install man pages diff --git a/pkgs/by-name/ne/nettee/package.nix b/pkgs/by-name/ne/nettee/package.nix new file mode 100644 index 000000000000..5528cd19bc55 --- /dev/null +++ b/pkgs/by-name/ne/nettee/package.nix @@ -0,0 +1,41 @@ +{ + stdenv, + lib, + fetchurl, + cmake, + versionCheckHook, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "nettee"; + version = "0.3.5"; + + src = fetchurl { + url = "mirror://sourceforge/nettee/nettee-${finalAttrs.version}.tar.gz"; + hash = "sha256-WeZ18CLexdWy8RlHNh0Oo/6KXxzShZT8/xklAWyB8ss="; + }; + + patches = [ ./fix-cmake-output.patch ]; + + nativeBuildInputs = [ cmake ]; + + # additional shell scripts require accudate (not in nixpkgs) + postInstall = '' + rm $out/bin/*.sh + ''; + + nativeInstallCheckInputs = [ + versionCheckHook + ]; + versionCheckProgramArg = "-version"; + doInstallCheck = true; + + meta = { + homepage = "https://sourceforge.net/projects/nettee"; + description = ''Network "tee" program''; + license = lib.licenses.gpl2Only; + maintainers = with lib.maintainers; [ Profpatsch ]; + platforms = lib.platforms.linux; + mainProgram = "nettee"; + }; +}) diff --git a/pkgs/tools/networking/nettee/default.nix b/pkgs/tools/networking/nettee/default.nix deleted file mode 100644 index ccdc96cd3c42..000000000000 --- a/pkgs/tools/networking/nettee/default.nix +++ /dev/null @@ -1,82 +0,0 @@ -{ - stdenv, - lib, - fetchurl, - cleanPackaging, -}: - -let - version = "0.3.4"; - sha256 = "00xbkp99x9v07r34w7m2p8gak5hdsdbka36n7a733rdrrkgf5z7r"; - -in -stdenv.mkDerivation { - pname = "nettee"; - inherit version; - - src = fetchurl { - url = "http://saf.bio.caltech.edu/pub/software/linux_or_unix_tools/beta-nettee-${version}.tar.gz"; - inherit sha256; - }; - - meta = { - homepage = "http://saf.bio.caltech.edu/nettee.html"; - description = ''Network "tee" program''; - license = lib.licenses.gpl2Only; - maintainers = with lib.maintainers; [ Profpatsch ]; - platforms = lib.platforms.linux; - mainProgram = "nettee"; - }; - - outputs = [ - "bin" - "man" - "doc" - "out" - ]; - - patchPhase = '' - # h_addr field was removed - sed -e '1 i #define h_addr h_addr_list[0]' \ - -i nettee.c - ''; - - buildPhase = '' - cat README.TXT - mkdir -p $bin/bin - $CC -o $bin/bin/nettee \ - -Wall -pedantic -std=c99\ - -D_LARGEFILE64_SOURCE -D_POSIX_SOURCE -D_XOPEN_SOURCE\ - nettee.c rb.c nio.c - ''; - - installPhase = '' - ${ - cleanPackaging.commonFileActions { - docFiles = [ - "*.html" - "*.TXT" - "LICENSE" - "*.sh" - "topology.txt" - "beowulf.master" - "topology_info" - ]; - noiseFiles = [ - "*.c" - "*.h" - "nettee" - ]; - } - } $doc/share/doc/nettee - - mkdir -p $man/share/man/{man1,man3} - mv nettee.1 $man/share/man/man1 - mv nettee_cmd.3 $man/share/man/man3 - ''; - - postFixup = '' - ${cleanPackaging.checkForRemainingFiles} - ''; - -} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 057c6c48359c..5812fa981add 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10235,10 +10235,6 @@ with pkgs; inherit (skawarePackages) cleanPackaging; }; - nettee = callPackage ../tools/networking/nettee { - inherit (skawarePackages) cleanPackaging; - }; - slibGuile = callPackage ../development/libraries/slib { scheme = guile; };