package.nix (2021B)
1 { 2 lib, 3 stdenv, 4 fetchurl, 5 6 bison, 7 gettext, 8 pkg-config, 9 10 firebird, 11 gd, 12 libmysqlclient, 13 libpq, 14 libz, 15 net-snmp, 16 pcre, 17 portaudio, 18 qt6, 19 sqlite, 20 21 withFireBird ? false, 22 withMySQL ? false, 23 withPostgreSQL ? false, 24 withSNMP ? false, 25 withSoundCard ? false, 26 withSiemens ? stdenv.hostPlatform.isLinux, 27 }: 28 29 stdenv.mkDerivation (finalAttrs: { 30 pname = "openscada"; 31 version = "0.9.8"; 32 33 main_src = fetchurl { 34 url = "http://oscada.org/oscadaArch/0.9/openscada-${finalAttrs.version}.tar.xz"; 35 hash = "sha256-UuDdURwu/hL/b3sykumLbHZXMzLh8/qmKqEsBRcaZew="; 36 }; 37 38 res_src = fetchurl { 39 url = "http://oscada.org/oscadaArch/0.9/openscada-res-${finalAttrs.version}.tar.xz"; 40 hash = "sha256-qVCmklGt9UKGFC1iiSy9+4kqfScfNIoiJeXX60bjJr0="; 41 }; 42 43 srcs = [ 44 finalAttrs.main_src 45 finalAttrs.res_src 46 ]; 47 48 sourceRoot = "openscada-${finalAttrs.version}"; 49 50 postPatch = '' 51 mv ../data ../doc . 52 ''; 53 54 nativeBuildInputs = [ 55 bison 56 gettext 57 pkg-config 58 qt6.wrapQtAppsHook 59 ]; 60 61 buildInputs = [ 62 gd 63 libz 64 pcre 65 qt6.qtbase 66 sqlite 67 ] 68 ++ lib.optional withFireBird firebird 69 ++ lib.optional withMySQL libmysqlclient 70 ++ lib.optional withPostgreSQL libpq 71 ++ lib.optional withSNMP net-snmp 72 ++ lib.optional withSoundCard portaudio; 73 74 configureFlags = [ 75 (lib.enableFeature withFireBird "FireBird") 76 (lib.withFeatureAs withFireBird "firebird" firebird) 77 (lib.enableFeature withMySQL "MySQL") 78 (lib.enableFeature withPostgreSQL "PostgreSQL") 79 (lib.enableFeature withSNMP "SNMP") 80 (lib.enableFeature withSoundCard "SoundCard") 81 (lib.enableFeature withSiemens "Siemens") 82 ]; 83 84 enableParallelBuilding = true; 85 86 env.NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration"; 87 88 meta = { 89 description = "Open SCADA system"; 90 homepage = "http://oscada.org"; 91 license = lib.licenses.gpl2Only; 92 maintainers = [ lib.maintainers.sikmir ]; 93 platforms = lib.platforms.unix; 94 mainProgram = "openscada"; 95 }; 96 })
