nixpkgs/pkgs/by-name/sn/snap7/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

39 lines
973 B
Nix

{ stdenv, lib, fetchzip, p7zip }:
stdenv.mkDerivation rec {
pname = "snap7";
version = "1.4.2";
src = fetchzip {
url = "mirror://sourceforge/snap7/${version}/snap7-full-${version}.7z";
sha256 = "1n5gs8bwb6g9vfllf3x12r5yzqzapmlq1bmc6hl854b8vkg30y8c";
postFetch = ''
${p7zip}/bin/7z x $downloadedFile
mkdir $out
cp -r snap7-full-${version}/* $out/
'';
};
outputs = [ "out" "dev" "doc" ];
makefile = "x86_64_linux.mk";
makeFlags = [ "LibInstall=$(out)/lib" ];
preBuild = "cd build/unix";
preInstall = ''
mkdir -p $out/lib
mkdir -p $dev/include
mkdir -p $doc/share
cp $src/examples/cpp/snap7.h $dev/include
cp -r $src/doc $doc/share/
'';
meta = with lib; {
homepage = "https://snap7.sourceforge.net/";
description = "Step7 Open Source Ethernet Communication Suite";
license = licenses.lgpl3;
maintainers = with maintainers; [ freezeboy ];
platforms = platforms.linux;
};
}